From 5e4dc1a2d736cfb2c1170dcedff2fa339fa5bd92 Mon Sep 17 00:00:00 2001 From: jackofallops Date: Tue, 27 Feb 2024 14:34:02 +0100 Subject: [PATCH 01/16] refactor static site to typedSDK and bump to go-azure-sdk --- internal/services/appservice/client/client.go | 9 + internal/services/appservice/registration.go | 2 + ...static_site_resource_custom_domain_test.go | 4 +- .../static_site_resource_test.go | 23 +- .../static_web_app_custom_domain.go | 187 +++ .../appservice/static_web_app_resource.go | 370 +++++ .../validate/static_site.go | 0 internal/services/web/parse/static_site.go | 72 - .../services/web/parse/static_site_test.go | 115 -- internal/services/web/registration.go | 2 - internal/services/web/resourceids.go | 2 - .../web/static_site_custom_domain_resource.go | 224 --- internal/services/web/static_site_resource.go | 330 ----- .../validate/static_site_custom_domain_id.go | 26 - .../static_site_custom_domain_id_test.go | 91 -- .../services/web/validate/static_site_id.go | 26 - .../web/validate/static_site_id_test.go | 79 - .../web/2023-01-01/staticsites/README.md | 1300 +++++++++++++++++ .../web/2023-01-01/staticsites/client.go | 26 + .../web/2023-01-01/staticsites/constants.go | 251 ++++ .../2023-01-01/staticsites/id_authprovider.go | 134 ++ .../web/2023-01-01/staticsites/id_build.go | 134 ++ .../staticsites/id_builddatabaseconnection.go | 143 ++ .../staticsites/id_buildlinkedbackend.go | 143 ++ .../id_builduserprovidedfunctionapp.go | 143 ++ .../2023-01-01/staticsites/id_customdomain.go | 134 ++ .../staticsites/id_databaseconnection.go | 134 ++ .../staticsites/id_linkedbackend.go | 134 ++ .../staticsites/id_providerlocation.go | 116 ++ .../2023-01-01/staticsites/id_staticsite.go | 125 ++ .../id_staticsiteprivateendpointconnection.go | 134 ++ .../web/2023-01-01/staticsites/id_user.go | 143 ++ .../staticsites/id_userprovidedfunctionapp.go | 134 ++ ...pproveorrejectprivateendpointconnection.go | 75 + .../method_createorupdatebasicauth.go | 56 + ...d_createorupdatebuilddatabaseconnection.go | 55 + ...method_createorupdatedatabaseconnection.go | 55 + .../method_createorupdatestaticsite.go | 75 + ...hod_createorupdatestaticsiteappsettings.go | 56 + ...reateorupdatestaticsitebuildappsettings.go | 56 + ...pdatestaticsitebuildfunctionappsettings.go | 56 + ...od_createorupdatestaticsitecustomdomain.go | 75 + ...teorupdatestaticsitefunctionappsettings.go | 56 + .../method_createuserrolesinvitationlink.go | 56 + ...method_createzipdeploymentforstaticsite.go | 74 + ...d_createzipdeploymentforstaticsitebuild.go | 74 + .../method_deletebuilddatabaseconnection.go | 47 + .../method_deletedatabaseconnection.go | 47 + .../method_deleteprivateendpointconnection.go | 72 + .../staticsites/method_deletestaticsite.go | 70 + .../method_deletestaticsitebuild.go | 71 + .../method_deletestaticsitecustomdomain.go | 70 + .../method_deletestaticsiteuser.go | 46 + .../staticsites/method_detachstaticsite.go | 70 + ...chuserprovidedfunctionappfromstaticsite.go | 47 + ...rprovidedfunctionappfromstaticsitebuild.go | 47 + .../staticsites/method_getbasicauth.go | 52 + .../method_getbuilddatabaseconnection.go | 51 + .../method_getbuilddatabaseconnections.go | 91 ++ ..._getbuilddatabaseconnectionswithdetails.go | 91 ++ ...d_getbuilddatabaseconnectionwithdetails.go | 52 + .../method_getdatabaseconnection.go | 51 + .../method_getdatabaseconnections.go | 91 ++ ...ethod_getdatabaseconnectionswithdetails.go | 91 ++ ...method_getdatabaseconnectionwithdetails.go | 52 + .../staticsites/method_getlinkedbackend.go | 51 + .../method_getlinkedbackendforbuild.go | 51 + .../staticsites/method_getlinkedbackends.go | 91 ++ .../method_getlinkedbackendsforbuild.go | 91 ++ .../method_getprivateendpointconnection.go | 51 + ...method_getprivateendpointconnectionlist.go | 91 ++ .../method_getprivatelinkresources.go | 52 + .../staticsites/method_getstaticsite.go | 51 + .../staticsites/method_getstaticsitebuild.go | 51 + .../staticsites/method_getstaticsitebuilds.go | 91 ++ .../method_getstaticsitecustomdomain.go | 51 + .../method_getstaticsitesbyresourcegroup.go | 92 ++ ...getuserprovidedfunctionappforstaticsite.go | 51 + ...erprovidedfunctionappforstaticsitebuild.go | 51 + ...etuserprovidedfunctionappsforstaticsite.go | 91 ++ ...rprovidedfunctionappsforstaticsitebuild.go | 91 ++ .../staticsites/method_linkbackend.go | 74 + .../staticsites/method_linkbackendtobuild.go | 74 + .../web/2023-01-01/staticsites/method_list.go | 92 ++ .../staticsites/method_listbasicauth.go | 91 ++ .../method_liststaticsiteappsettings.go | 52 + .../method_liststaticsitebuildappsettings.go | 52 + ..._liststaticsitebuildfunctionappsettings.go | 52 + .../method_liststaticsitebuildfunctions.go | 91 ++ .../method_liststaticsiteconfiguredroles.go | 52 + .../method_liststaticsitecustomdomains.go | 91 ++ ...ethod_liststaticsitefunctionappsettings.go | 52 + .../method_liststaticsitefunctions.go | 91 ++ .../method_liststaticsitesecrets.go | 52 + .../staticsites/method_liststaticsiteusers.go | 91 ++ .../staticsites/method_previewworkflow.go | 56 + ...eruserprovidedfunctionappwithstaticsite.go | 103 ++ ...rprovidedfunctionappwithstaticsitebuild.go | 103 ++ .../method_resetstaticsiteapikey.go | 51 + .../staticsites/method_unlinkbackend.go | 76 + .../method_unlinkbackendfrombuild.go | 76 + .../method_updatebuilddatabaseconnection.go | 55 + .../method_updatedatabaseconnection.go | 55 + .../staticsites/method_updatestaticsite.go | 56 + .../method_updatestaticsiteuser.go | 55 + .../staticsites/method_validatebackend.go | 74 + .../method_validatebackendforbuild.go | 74 + ...idatecustomdomaincanbeaddedtostaticsite.go | 74 + .../staticsites/model_armidwrapper.go | 8 + .../2023-01-01/staticsites/model_armplan.go | 12 + .../staticsites/model_capability.go | 10 + .../staticsites/model_databaseconnection.go | 12 + .../model_databaseconnectionoverview.go | 12 + .../model_databaseconnectionpatchrequest.go | 8 + ...atabaseconnectionpatchrequestproperties.go | 11 + .../model_databaseconnectionproperties.go | 12 + .../staticsites/model_errorentity.go | 15 + .../model_privatelinkconnectionstate.go | 10 + .../staticsites/model_privatelinkresource.go | 11 + .../model_privatelinkresourceproperties.go | 10 + .../model_privatelinkresourceswrapper.go | 8 + .../model_remoteprivateendpointconnection.go | 12 + ...oteprivateendpointconnectionarmresource.go | 12 + ...endpointconnectionarmresourceproperties.go | 11 + ...moteprivateendpointconnectionproperties.go | 11 + ...enveloperemoteprivateendpointconnection.go | 24 + .../staticsites/model_skucapacity.go | 12 + .../staticsites/model_skudescription.go | 15 + .../staticsites/model_staticsite.go | 25 + .../model_staticsitearmresource.go | 20 + ...taticsitebasicauthpropertiesarmresource.go | 12 + ...asicauthpropertiesarmresourceproperties.go | 12 + .../model_staticsitebuildarmresource.go | 12 + ...el_staticsitebuildarmresourceproperties.go | 47 + .../model_staticsitebuildproperties.go | 15 + ...aticsitecustomdomainoverviewarmresource.go | 12 + ...stomdomainoverviewarmresourceproperties.go | 30 + ...ustomdomainrequestpropertiesarmresource.go | 12 + ...nrequestpropertiesarmresourceproperties.go | 8 + ...baseconnectionconfigurationfileoverview.go | 10 + ...l_staticsitefunctionoverviewarmresource.go | 12 + ...tefunctionoverviewarmresourceproperties.go | 9 + .../model_staticsitelinkedbackend.go | 29 + ...odel_staticsitelinkedbackendarmresource.go | 12 + ...csitelinkedbackendarmresourceproperties.go | 29 + .../model_staticsitepatchresource.go | 12 + ...el_staticsiteresetpropertiesarmresource.go | 12 + ...iteresetpropertiesarmresourceproperties.go | 9 + .../model_staticsitesworkflowpreview.go | 12 + ...el_staticsitesworkflowpreviewproperties.go | 9 + ...model_staticsitesworkflowpreviewrequest.go | 12 + ...icsitesworkflowpreviewrequestproperties.go | 10 + .../model_staticsitetemplateoptions.go | 12 + .../model_staticsiteuserarmresource.go | 12 + ...del_staticsiteuserarmresourceproperties.go | 11 + ...staticsiteuserinvitationrequestresource.go | 12 + ...userinvitationrequestresourceproperties.go | 12 + ...taticsiteuserinvitationresponseresource.go | 12 + ...serinvitationresponseresourceproperties.go | 27 + ...model_staticsiteuserprovidedfunctionapp.go | 12 + ...csiteuserprovidedfunctionapparmresource.go | 12 + ...rovidedfunctionapparmresourceproperties.go | 28 + ...icsiteuserprovidedfunctionappproperties.go | 28 + .../model_staticsitezipdeployment.go | 12 + ...odel_staticsitezipdeploymentarmresource.go | 12 + .../staticsites/model_stringdictionary.go | 12 + .../staticsites/model_stringlist.go | 12 + .../web/2023-01-01/staticsites/predicates.go | 289 ++++ .../web/2023-01-01/staticsites/version.go | 12 + vendor/modules.txt | 1 + 170 files changed, 10101 insertions(+), 976 deletions(-) rename internal/services/{web => appservice}/static_site_resource_custom_domain_test.go (97%) rename internal/services/{web => appservice}/static_site_resource_test.go (94%) create mode 100644 internal/services/appservice/static_web_app_custom_domain.go create mode 100644 internal/services/appservice/static_web_app_resource.go rename internal/services/{web => appservice}/validate/static_site.go (100%) delete mode 100644 internal/services/web/parse/static_site.go delete mode 100644 internal/services/web/parse/static_site_test.go delete mode 100644 internal/services/web/static_site_custom_domain_resource.go delete mode 100644 internal/services/web/static_site_resource.go delete mode 100644 internal/services/web/validate/static_site_custom_domain_id.go delete mode 100644 internal/services/web/validate/static_site_custom_domain_id_test.go delete mode 100644 internal/services/web/validate/static_site_id.go delete mode 100644 internal/services/web/validate/static_site_id_test.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_authprovider.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_build.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_builddatabaseconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_buildlinkedbackend.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_builduserprovidedfunctionapp.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_customdomain.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_databaseconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_linkedbackend.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_providerlocation.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_staticsite.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_staticsiteprivateendpointconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_user.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_userprovidedfunctionapp.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_approveorrejectprivateendpointconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatebasicauth.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatebuilddatabaseconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatedatabaseconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsite.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsiteappsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitebuildappsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitebuildfunctionappsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitecustomdomain.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitefunctionappsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createuserrolesinvitationlink.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createzipdeploymentforstaticsite.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createzipdeploymentforstaticsitebuild.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletebuilddatabaseconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletedatabaseconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deleteprivateendpointconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsite.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsitebuild.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsitecustomdomain.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsiteuser.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_detachstaticsite.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_detachuserprovidedfunctionappfromstaticsite.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_detachuserprovidedfunctionappfromstaticsitebuild.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbasicauth.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnections.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnectionswithdetails.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnectionwithdetails.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnections.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnectionswithdetails.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnectionwithdetails.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackend.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackendforbuild.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackends.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackendsforbuild.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivateendpointconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivateendpointconnectionlist.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivatelinkresources.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsite.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitebuild.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitebuilds.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitecustomdomain.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitesbyresourcegroup.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappforstaticsite.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappforstaticsitebuild.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappsforstaticsite.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappsforstaticsitebuild.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_linkbackend.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_linkbackendtobuild.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_list.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_listbasicauth.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteappsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildappsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildfunctionappsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildfunctions.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteconfiguredroles.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitecustomdomains.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitefunctionappsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitefunctions.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitesecrets.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteusers.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_previewworkflow.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_registeruserprovidedfunctionappwithstaticsite.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_registeruserprovidedfunctionappwithstaticsitebuild.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_resetstaticsiteapikey.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_unlinkbackend.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_unlinkbackendfrombuild.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatebuilddatabaseconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatedatabaseconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatestaticsite.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatestaticsiteuser.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_validatebackend.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_validatebackendforbuild.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_validatecustomdomaincanbeaddedtostaticsite.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_armidwrapper.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_armplan.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_capability.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionoverview.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionpatchrequest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionpatchrequestproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_errorentity.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkconnectionstate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkresourceproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkresourceswrapper.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnectionarmresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnectionarmresourceproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnectionproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_responsemessageenveloperemoteprivateendpointconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_skucapacity.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_skudescription.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsite.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitearmresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebasicauthpropertiesarmresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebasicauthpropertiesarmresourceproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebuildarmresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebuildarmresourceproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebuildproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainoverviewarmresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainoverviewarmresourceproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainrequestpropertiesarmresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainrequestpropertiesarmresourceproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitedatabaseconnectionconfigurationfileoverview.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitefunctionoverviewarmresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitefunctionoverviewarmresourceproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitelinkedbackend.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitelinkedbackendarmresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitelinkedbackendarmresourceproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitepatchresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteresetpropertiesarmresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteresetpropertiesarmresourceproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreview.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewrequest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewrequestproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitetemplateoptions.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserarmresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserarmresourceproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationrequestresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationrequestresourceproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationresponseresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationresponseresourceproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionapp.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionapparmresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionapparmresourceproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionappproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitezipdeployment.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitezipdeploymentarmresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_stringdictionary.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_stringlist.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/version.go diff --git a/internal/services/appservice/client/client.go b/internal/services/appservice/client/client.go index 655d4a0da987..7ac94264cc21 100644 --- a/internal/services/appservice/client/client.go +++ b/internal/services/appservice/client/client.go @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/appserviceenvironments" "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/appserviceplans" "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/resourceproviders" + "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites" "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/webapps" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) @@ -17,6 +18,7 @@ type Client struct { AppServiceEnvironmentClient *appserviceenvironments.AppServiceEnvironmentsClient ResourceProvidersClient *resourceproviders.ResourceProvidersClient ServicePlanClient *appserviceplans.AppServicePlansClient + StaticSitesClient *staticsites.StaticSitesClient WebAppsClient *webapps.WebAppsClient } @@ -39,6 +41,12 @@ func NewClient(o *common.ClientOptions) (*Client, error) { } o.Configure(resourceProvidersClient.Client, o.Authorizers.ResourceManager) + staticSitesClient, err := staticsites.NewStaticSitesClientWithBaseURI(o.Environment.ResourceManager) + if err != nil { + return nil, fmt.Errorf("building ServicePlan client: %+v", err) + } + o.Configure(staticSitesClient.Client, o.Authorizers.ResourceManager) + servicePlanClient, err := appserviceplans.NewAppServicePlansClientWithBaseURI(o.Environment.ResourceManager) if err != nil { return nil, fmt.Errorf("building ServicePlan client: %+v", err) @@ -49,6 +57,7 @@ func NewClient(o *common.ClientOptions) (*Client, error) { AppServiceEnvironmentClient: appServiceEnvironmentClient, ResourceProvidersClient: resourceProvidersClient, ServicePlanClient: servicePlanClient, + StaticSitesClient: staticSitesClient, WebAppsClient: webAppServiceClient, }, nil } diff --git a/internal/services/appservice/registration.go b/internal/services/appservice/registration.go index 332f36462711..58cfaa2bd26c 100644 --- a/internal/services/appservice/registration.go +++ b/internal/services/appservice/registration.go @@ -49,6 +49,8 @@ func (r Registration) Resources() []sdk.Resource { ServicePlanResource{}, SourceControlResource{}, SourceControlSlotResource{}, + StaticWebAppResource{}, + StaticSiteCustomDomainResource{}, WebAppActiveSlotResource{}, WebAppHybridConnectionResource{}, WindowsFunctionAppResource{}, diff --git a/internal/services/web/static_site_resource_custom_domain_test.go b/internal/services/appservice/static_site_resource_custom_domain_test.go similarity index 97% rename from internal/services/web/static_site_resource_custom_domain_test.go rename to internal/services/appservice/static_site_resource_custom_domain_test.go index bc8eba336468..0a0004b95e06 100644 --- a/internal/services/web/static_site_resource_custom_domain_test.go +++ b/internal/services/appservice/static_site_resource_custom_domain_test.go @@ -1,7 +1,7 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -package web_test +package appservice_test import ( "context" @@ -81,6 +81,8 @@ resource "azurerm_static_site" "test" { name = "acctestSS-%d" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name + sku_size = "Standard" + sku_tier = "Standard" } resource "azurerm_static_site_custom_domain" "test" { diff --git a/internal/services/web/static_site_resource_test.go b/internal/services/appservice/static_site_resource_test.go similarity index 94% rename from internal/services/web/static_site_resource_test.go rename to internal/services/appservice/static_site_resource_test.go index 19b92aa4571f..837b7cbaf173 100644 --- a/internal/services/web/static_site_resource_test.go +++ b/internal/services/appservice/static_site_resource_test.go @@ -1,19 +1,20 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -package web_test +package appservice_test import ( "context" "fmt" "testing" + "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" - "github.com/hashicorp/terraform-provider-azurerm/utils" ) type StaticSiteResource struct{} @@ -201,20 +202,20 @@ func TestAccStaticSite_appSettings(t *testing.T) { } func (r StaticSiteResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := parse.StaticSiteID(state.ID) + id, err := staticsites.ParseStaticSiteID(state.ID) if err != nil { return nil, err } - resp, err := clients.Web.StaticSitesClient.GetStaticSite(ctx, id.ResourceGroup, id.Name) + resp, err := clients.AppService.StaticSitesClient.GetStaticSite(ctx, *id) if err != nil { - if utils.ResponseWasNotFound(resp.Response) { - return utils.Bool(false), nil + if response.WasNotFound(resp.HttpResponse) { + return pointer.To(false), nil } return nil, fmt.Errorf("retrieving Static Site %q: %+v", id, err) } - return utils.Bool(true), nil + return pointer.To(true), nil } func (r StaticSiteResource) basic(data acceptance.TestData) string { @@ -232,6 +233,8 @@ resource "azurerm_static_site" "test" { name = "acctestSS-%[1]d" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name + sku_size = "Standard" + sku_tier = "Standard" tags = { environment = "acceptance" @@ -366,6 +369,8 @@ resource "azurerm_static_site" "import" { name = azurerm_static_site.test.name location = azurerm_static_site.test.location resource_group_name = azurerm_static_site.test.resource_group_name + sku_size = azurerm_static_site.test.sku_size + sku_tier = azurerm_static_site.test.sku_tier } `, template) } @@ -385,6 +390,8 @@ resource "azurerm_static_site" "test" { name = "acctestSS-%d" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name + sku_size = "Standard" + sku_tier = "Standard" app_settings = { "foo" = "bar" diff --git a/internal/services/appservice/static_web_app_custom_domain.go b/internal/services/appservice/static_web_app_custom_domain.go new file mode 100644 index 000000000000..cc7ac9040641 --- /dev/null +++ b/internal/services/appservice/static_web_app_custom_domain.go @@ -0,0 +1,187 @@ +package appservice + +import ( + "context" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" +) + +type StaticSiteCustomDomainResource struct{} + +var _ sdk.Resource = StaticSiteCustomDomainResource{} + +const ( + txtValidationType = "dns-txt-token" + cnameValidationType = "cname-delegation" +) + +type StaticSiteCustomDomainResourceModel struct { + DomainName string `tfschema:"domain_name"` + StaticSiteId string `tfschema:"static_site_id"` + ValidationType string `tfschema:"validation_type"` + ValidationToken string `tfschema:"validation_token"` +} + +func (r StaticSiteCustomDomainResource) Arguments() map[string]*schema.Schema { + return map[string]*pluginsdk.Schema{ + "static_site_id": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: staticsites.ValidateStaticSiteID, + }, + + "domain_name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "validation_type": { + Type: pluginsdk.TypeString, + Optional: true, + Default: txtValidationType, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + txtValidationType, + cnameValidationType, + }, false), + }, + } +} + +func (r StaticSiteCustomDomainResource) Attributes() map[string]*schema.Schema { + return map[string]*pluginsdk.Schema{ + "validation_token": { + Type: pluginsdk.TypeString, + Sensitive: true, + Computed: true, + }, + } +} + +func (r StaticSiteCustomDomainResource) ModelObject() interface{} { + return &StaticSiteCustomDomainResource{} +} + +func (r StaticSiteCustomDomainResource) ResourceType() string { + return "azurerm_static_site_custom_domain" +} + +func (r StaticSiteCustomDomainResource) Create() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.AppService.StaticSitesClient + + model := StaticSiteCustomDomainResourceModel{} + + if err := metadata.Decode(&model); err != nil { + return err + } + + siteId, err := staticsites.ParseStaticSiteID(model.StaticSiteId) + if err != nil { + return err + } + + id := staticsites.NewCustomDomainID(siteId.SubscriptionId, siteId.ResourceGroupName, siteId.StaticSiteName, model.DomainName) + + existing, err := client.GetStaticSiteCustomDomain(ctx, id) + if err != nil { + if !response.WasNotFound(existing.HttpResponse) { + return fmt.Errorf("failed checking for presence of existing %s: %+v", id, err) + } + } + if !response.WasNotFound(existing.HttpResponse) { + return metadata.ResourceRequiresImport(r.ResourceType(), id) + } + + customDomain := staticsites.StaticSiteCustomDomainRequestPropertiesARMResource{ + Properties: &staticsites.StaticSiteCustomDomainRequestPropertiesARMResourceProperties{ + ValidationMethod: pointer.To(model.ValidationType), + }, + } + + if err = client.CreateOrUpdateStaticSiteCustomDomainThenPoll(ctx, id, customDomain); err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } + + metadata.SetID(id) + + return nil + }, + } +} + +func (r StaticSiteCustomDomainResource) Read() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 5 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.AppService.StaticSitesClient + + id, err := staticsites.ParseCustomDomainID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + // Some values are not retrievable from the API so we try and load the config. + state := StaticSiteCustomDomainResourceModel{} + if err := metadata.Decode(&state); err != nil { + return err + } + + existing, err := client.GetStaticSiteCustomDomain(ctx, *id) + if err != nil { + if response.WasNotFound(existing.HttpResponse) { + return metadata.MarkAsGone(*id) + } + return fmt.Errorf("retrieving %s: %+v", *id, err) + } + + state.DomainName = id.CustomDomainName + state.StaticSiteId = staticsites.NewStaticSiteID(id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName).ID() + + if model := existing.Model; model != nil { + if props := model.Properties; props != nil { + state.ValidationToken = pointer.From(props.ValidationToken) + } + } + + return metadata.Encode(&state) + }, + } +} + +func (r StaticSiteCustomDomainResource) Delete() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.AppService.StaticSitesClient + + id, err := staticsites.ParseCustomDomainID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + if err = client.DeleteStaticSiteCustomDomainThenPoll(ctx, *id); err != nil { + return fmt.Errorf("deleting %s: %+v", *id, err) + } + + return nil + }, + } +} + +func (r StaticSiteCustomDomainResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { + return staticsites.ValidateCustomDomainID +} diff --git a/internal/services/appservice/static_web_app_resource.go b/internal/services/appservice/static_web_app_resource.go new file mode 100644 index 000000000000..c2c9a6fc5c4d --- /dev/null +++ b/internal/services/appservice/static_web_app_resource.go @@ -0,0 +1,370 @@ +package appservice + +import ( + "context" + "fmt" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/resourceproviders" + "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tags" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" +) + +type StaticWebAppResource struct{} + +var _ sdk.ResourceWithUpdate = StaticWebAppResource{} + +var _ sdk.ResourceWithCustomizeDiff = StaticWebAppResource{} + +type StaticWebAppResourceModel struct { + Name string `tfschema:"name"` + ResourceGroupName string `tfschema:"resource_group_name"` + Location string `tfschema:"location"` + SkuTier string `tfschema:"sku_tier"` + SkuSize string `tfschema:"sku_size"` + AppSettings map[string]string `tfschema:"app_settings"` + Identity []identity.ModelSystemAssignedUserAssigned `tfschema:"identity"` + Tags map[string]string `tfschema:"tags"` + + ApiKey string `tfschema:"api_key"` + DefaultHostName string `tfschema:"default_host_name"` +} + +func (r StaticWebAppResource) Arguments() map[string]*schema.Schema { + return map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validate.StaticSiteName, + }, + + "resource_group_name": commonschema.ResourceGroupName(), + + "location": commonschema.Location(), + + "sku_tier": { + Type: pluginsdk.TypeString, + Optional: true, + Default: string(resourceproviders.SkuNameFree), + ValidateFunc: validation.StringInSlice([]string{ + string(resourceproviders.SkuNameStandard), + string(resourceproviders.SkuNameFree), + }, false), + }, + + "sku_size": { + Type: pluginsdk.TypeString, + Optional: true, + Default: string(resourceproviders.SkuNameFree), + ValidateFunc: validation.StringInSlice([]string{ + string(resourceproviders.SkuNameStandard), + string(resourceproviders.SkuNameFree), + }, false), + }, + + "app_settings": { + Type: pluginsdk.TypeMap, + Optional: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + }, + }, + + "identity": commonschema.SystemAssignedUserAssignedIdentityOptional(), + + "tags": tags.Schema(), + } +} + +func (r StaticWebAppResource) Attributes() map[string]*schema.Schema { + return map[string]*pluginsdk.Schema{ + "api_key": { + Type: pluginsdk.TypeString, + Computed: true, + Sensitive: true, + }, + + "default_host_name": { + Type: pluginsdk.TypeString, + Computed: true, + }, + } +} + +func (r StaticWebAppResource) ModelObject() interface{} { + return &StaticWebAppResourceModel{} +} + +func (r StaticWebAppResource) ResourceType() string { + return "azurerm_static_site" +} + +func (r StaticWebAppResource) Create() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.AppService.StaticSitesClient + subscriptionId := metadata.Client.Account.SubscriptionId + + model := StaticWebAppResourceModel{} + + if err := metadata.Decode(&model); err != nil { + return err + } + + id := staticsites.NewStaticSiteID(subscriptionId, model.ResourceGroupName, model.Name) + + existing, err := client.GetStaticSite(ctx, id) + if err != nil { + if !response.WasNotFound(existing.HttpResponse) { + return fmt.Errorf("failed checking for presence of existing %s: %+v", id, err) + } + } + if !response.WasNotFound(existing.HttpResponse) { + return metadata.ResourceRequiresImport(r.ResourceType(), id) + } + + ident, err := identity.ExpandSystemAndUserAssignedMapFromModel(model.Identity) + + envelope := staticsites.StaticSiteARMResource{ + Identity: ident, + Location: location.Normalize(model.Location), + Properties: nil, + Sku: &staticsites.SkuDescription{ + Name: pointer.To(model.SkuSize), + Tier: pointer.To(model.SkuTier), + }, + Tags: pointer.To(model.Tags), + } + + props := &staticsites.StaticSite{ // TODO - Can we support this now? + AllowConfigFileUpdates: nil, + Branch: nil, + BuildProperties: nil, + ContentDistributionEndpoint: nil, + CustomDomains: nil, + DatabaseConnections: nil, + DefaultHostname: nil, + EnterpriseGradeCdnStatus: nil, + KeyVaultReferenceIdentity: nil, + LinkedBackends: nil, + PrivateEndpointConnections: nil, + Provider: nil, + PublicNetworkAccess: nil, + RepositoryToken: nil, + RepositoryUrl: nil, + StagingEnvironmentPolicy: nil, + TemplateProperties: nil, + UserProvidedFunctionApps: nil, + } + + envelope.Properties = props + + if err := client.CreateOrUpdateStaticSiteThenPoll(ctx, id, envelope); err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } + + metadata.SetID(id) + + if len(model.AppSettings) > 0 { + appSettings := staticsites.StringDictionary{ + Properties: pointer.To(model.AppSettings), + } + + if _, err = client.CreateOrUpdateStaticSiteAppSettings(ctx, id, appSettings); err != nil { + return fmt.Errorf("updating app settings for %s: %+v", id, err) + } + } + + return nil + }, + } +} + +func (r StaticWebAppResource) Read() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 5 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.AppService.StaticSitesClient + + id, err := staticsites.ParseStaticSiteID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + staticSite, err := client.GetStaticSite(ctx, *id) + if err != nil { + if response.WasNotFound(staticSite.HttpResponse) { + return metadata.MarkAsGone(*id) + } + return fmt.Errorf("retrieving %s: %+v", *id, err) + } + + state := StaticWebAppResourceModel{ + Name: id.StaticSiteName, + ResourceGroupName: id.ResourceGroupName, + } + + if model := staticSite.Model; model != nil { + state.Location = location.Normalize(model.Location) + + ident, err := identity.FlattenSystemAndUserAssignedMapToModel(model.Identity) + if err != nil { + return fmt.Errorf("flattening identity for %s: %+v", *id, err) + } + state.Identity = pointer.From(ident) + + state.Tags = pointer.From(model.Tags) + if props := model.Properties; props != nil { + state.DefaultHostName = pointer.From(props.DefaultHostname) + } + + if sku := model.Sku; sku != nil { + state.SkuSize = pointer.From(sku.Name) + state.SkuTier = pointer.From(sku.Tier) + } + + sec, err := client.ListStaticSiteSecrets(ctx, *id) + if err != nil || sec.Model == nil { + return fmt.Errorf("retrieving secrets for %s: %+v", *id, err) + } + + if secProps := sec.Model.Properties; secProps != nil { + propsMap := pointer.From(secProps) + apiKey := "" + apiKey = propsMap["apiKey"] + state.ApiKey = apiKey + } + } + + return metadata.Encode(&state) + }, + } +} + +func (r StaticWebAppResource) Delete() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.AppService.StaticSitesClient + + id, err := staticsites.ParseStaticSiteID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + if err := client.DeleteStaticSiteThenPoll(ctx, *id); err != nil { + return fmt.Errorf("deleting %s: %+v", *id, err) + } + + return nil + }, + } +} + +func (r StaticWebAppResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { + return staticsites.ValidateStaticSiteID +} + +func (r StaticWebAppResource) Update() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.AppService.StaticSitesClient + + config := StaticWebAppResourceModel{} + + if err := metadata.Decode(&config); err != nil { + return err + } + + id, err := staticsites.ParseStaticSiteID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + existing, err := client.GetStaticSite(ctx, *id) + if err != nil || existing.Model == nil { + return fmt.Errorf("retrieving %s for update: %+v", *id, err) + } + + model := *existing.Model + + if metadata.ResourceData.HasChange("identity") { + ident, err := identity.ExpandSystemAndUserAssignedMapFromModel(config.Identity) + if err != nil { + return err + } + model.Identity = ident + } + + if metadata.ResourceData.HasChanges("sku_tier", "sku_size") { + model.Sku = &staticsites.SkuDescription{ + Name: pointer.To(config.SkuSize), + Tier: pointer.To(config.SkuTier), + } + } + + props := &staticsites.StaticSite{ // TODO - Can we support this now? + AllowConfigFileUpdates: nil, + Branch: nil, + BuildProperties: nil, + ContentDistributionEndpoint: nil, + CustomDomains: nil, + DatabaseConnections: nil, + DefaultHostname: nil, + EnterpriseGradeCdnStatus: nil, + KeyVaultReferenceIdentity: nil, + LinkedBackends: nil, + PrivateEndpointConnections: nil, + Provider: nil, + PublicNetworkAccess: nil, + RepositoryToken: nil, + RepositoryUrl: nil, + StagingEnvironmentPolicy: nil, + TemplateProperties: nil, + UserProvidedFunctionApps: nil, + } + + model.Properties = props + + if err := client.CreateOrUpdateStaticSiteThenPoll(ctx, *id, model); err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } + + if metadata.ResourceData.HasChange("app_settings") { + appSettings := staticsites.StringDictionary{ + Properties: pointer.To(config.AppSettings), + } + + if _, err = client.CreateOrUpdateStaticSiteAppSettings(ctx, *id, appSettings); err != nil { + return fmt.Errorf("updating app settings for %s: %+v", id, err) + } + } + + return nil + }, + } +} + +func (r StaticWebAppResource) CustomizeDiff() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + // TODO - Free SKU cannot be used with Identity + return nil + }, + + Timeout: 5 * time.Minute, + } +} diff --git a/internal/services/web/validate/static_site.go b/internal/services/appservice/validate/static_site.go similarity index 100% rename from internal/services/web/validate/static_site.go rename to internal/services/appservice/validate/static_site.go diff --git a/internal/services/web/parse/static_site.go b/internal/services/web/parse/static_site.go deleted file mode 100644 index ad9d5f56c251..000000000000 --- a/internal/services/web/parse/static_site.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package parse - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -type StaticSiteId struct { - SubscriptionId string - ResourceGroup string - Name string -} - -func NewStaticSiteID(subscriptionId, resourceGroup, name string) StaticSiteId { - return StaticSiteId{ - SubscriptionId: subscriptionId, - ResourceGroup: resourceGroup, - Name: name, - } -} - -func (id StaticSiteId) String() string { - segments := []string{ - fmt.Sprintf("Name %q", id.Name), - fmt.Sprintf("Resource Group %q", id.ResourceGroup), - } - segmentsStr := strings.Join(segments, " / ") - return fmt.Sprintf("%s: (%s)", "Static Site", segmentsStr) -} - -func (id StaticSiteId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.Name) -} - -// StaticSiteID parses a StaticSite ID into an StaticSiteId struct -func StaticSiteID(input string) (*StaticSiteId, error) { - id, err := resourceids.ParseAzureResourceID(input) - if err != nil { - return nil, fmt.Errorf("parsing %q as an StaticSite ID: %+v", input, err) - } - - resourceId := StaticSiteId{ - SubscriptionId: id.SubscriptionID, - ResourceGroup: id.ResourceGroup, - } - - if resourceId.SubscriptionId == "" { - return nil, fmt.Errorf("ID was missing the 'subscriptions' element") - } - - if resourceId.ResourceGroup == "" { - return nil, fmt.Errorf("ID was missing the 'resourceGroups' element") - } - - if resourceId.Name, err = id.PopSegment("staticSites"); err != nil { - return nil, err - } - - if err := id.ValidateNoEmptySegments(input); err != nil { - return nil, err - } - - return &resourceId, nil -} diff --git a/internal/services/web/parse/static_site_test.go b/internal/services/web/parse/static_site_test.go deleted file mode 100644 index dacc7d3433bd..000000000000 --- a/internal/services/web/parse/static_site_test.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package parse - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.Id = StaticSiteId{} - -func TestStaticSiteIDFormatter(t *testing.T) { - actual := NewStaticSiteID("12345678-1234-9876-4563-123456789012", "group1", "my-static-site1").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/my-static-site1" - if actual != expected { - t.Fatalf("Expected %q but got %q", expected, actual) - } -} - -func TestStaticSiteID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *StaticSiteId - }{ - - { - // empty - Input: "", - Error: true, - }, - - { - // missing SubscriptionId - Input: "/", - Error: true, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Error: true, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Error: true, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Error: true, - }, - - { - // missing Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/", - Error: true, - }, - - { - // missing value for Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/", - Error: true, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/my-static-site1", - Expected: &StaticSiteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroup: "group1", - Name: "my-static-site1", - }, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/GROUP1/PROVIDERS/MICROSOFT.WEB/STATICSITES/MY-STATIC-SITE1", - Error: true, - }, - } - - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := StaticSiteID(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %s", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - if actual.ResourceGroup != v.Expected.ResourceGroup { - t.Fatalf("Expected %q but got %q for ResourceGroup", v.Expected.ResourceGroup, actual.ResourceGroup) - } - if actual.Name != v.Expected.Name { - t.Fatalf("Expected %q but got %q for Name", v.Expected.Name, actual.Name) - } - } -} diff --git a/internal/services/web/registration.go b/internal/services/web/registration.go index 74cce64710eb..4d41aebde28b 100644 --- a/internal/services/web/registration.go +++ b/internal/services/web/registration.go @@ -56,8 +56,6 @@ func (r Registration) SupportedResources() map[string]*pluginsdk.Resource { "azurerm_app_service": resourceAppService(), "azurerm_function_app": resourceFunctionApp(), "azurerm_function_app_slot": resourceFunctionAppSlot(), - "azurerm_static_site": resourceStaticSite(), - "azurerm_static_site_custom_domain": resourceStaticSiteCustomDomain(), } } diff --git a/internal/services/web/resourceids.go b/internal/services/web/resourceids.go index 583675d96961..40056feb9e80 100644 --- a/internal/services/web/resourceids.go +++ b/internal/services/web/resourceids.go @@ -16,8 +16,6 @@ package web //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=ManagedCertificate -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Web/certificates/customhost.contoso.com //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=PublicCertificate -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Web/sites/site1/publicCertificates/publicCertificate1 //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=SlotVirtualNetworkSwiftConnection -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Web/sites/site1/slots/slot1/config/virtualNetwork -//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=StaticSite -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/my-static-site1 -//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=StaticSiteCustomDomain -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/my-static-site1/customDomains/name.contoso.com //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=VirtualNetworkSwiftConnection -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Web/sites/site1/config/virtualNetwork // @tombuildsstuff: this is going to require a State Migration to account for `serverfarms` -> `serverFarms` prior to migrating to `hashicorp/go-azure-sdk` diff --git a/internal/services/web/static_site_custom_domain_resource.go b/internal/services/web/static_site_custom_domain_resource.go deleted file mode 100644 index 289349d3ef91..000000000000 --- a/internal/services/web/static_site_custom_domain_resource.go +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package web - -import ( - "fmt" - "log" - "time" - - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck - "github.com/hashicorp/go-azure-helpers/lang/pointer" - "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" - "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/parse" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/validate" - "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" - "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" - "github.com/hashicorp/terraform-provider-azurerm/utils" -) - -const ( - txtValidationType = "dns-txt-token" - cnameValidationType = "cname-delegation" -) - -func resourceStaticSiteCustomDomain() *pluginsdk.Resource { - return &pluginsdk.Resource{ - Create: resourceStaticSiteCustomDomainCreate, - Read: resourceStaticSiteCustomDomainRead, - Delete: resourceStaticSiteCustomDomainDelete, - Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { - _, err := parse.StaticSiteCustomDomainID(id) - return err - }), - - Timeouts: &pluginsdk.ResourceTimeout{ - Create: pluginsdk.DefaultTimeout(30 * time.Minute), - Read: pluginsdk.DefaultTimeout(5 * time.Minute), - Delete: pluginsdk.DefaultTimeout(30 * time.Minute), - }, - - Schema: map[string]*pluginsdk.Schema{ - "static_site_id": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validate.StaticSiteID, - }, - - "domain_name": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.StringIsNotEmpty, - }, - - "validation_type": { - Type: pluginsdk.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{ - txtValidationType, - cnameValidationType, - }, false), - }, - - "validation_token": { - Type: pluginsdk.TypeString, - Sensitive: true, - Computed: true, - }, - }, - } -} - -func resourceStaticSiteCustomDomainCreate(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Web.StaticSitesClient - ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d) - defer cancel() - - log.Printf("[INFO] preparing arguments for AzureRM Static Site custom domain creation.") - - staticSiteId, err := parse.StaticSiteID(d.Get("static_site_id").(string)) - if err != nil { - return err - } - - id := parse.NewStaticSiteCustomDomainID(staticSiteId.SubscriptionId, staticSiteId.ResourceGroup, staticSiteId.Name, d.Get("domain_name").(string)) - _, err = client.GetStaticSite(ctx, id.ResourceGroup, id.StaticSiteName) - if err != nil { - return fmt.Errorf("retrieving %s: %+v", *staticSiteId, err) - } - - existing, err := client.GetStaticSiteCustomDomain(ctx, staticSiteId.ResourceGroup, id.StaticSiteName, id.CustomDomainName) - if err != nil { - if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("checking for presence of existing %s: %+v", id, err) - } - } - - if !utils.ResponseWasNotFound(existing.Response) { - return tf.ImportAsExistsError("azurerm_static_site_custom_domain", staticSiteId.ID()) - } - - validationMethod := d.Get("validation_type").(string) - if validationMethod == "" { - return fmt.Errorf("`validation_type` can't be empty string") - } - - siteEnvelope := web.StaticSiteCustomDomainRequestPropertiesARMResource{ - StaticSiteCustomDomainRequestPropertiesARMResourceProperties: &web.StaticSiteCustomDomainRequestPropertiesARMResourceProperties{ - ValidationMethod: &validationMethod, - }, - } - - future, err := client.CreateOrUpdateStaticSiteCustomDomain(ctx, staticSiteId.ResourceGroup, id.StaticSiteName, id.CustomDomainName, siteEnvelope) - if err != nil { - return fmt.Errorf("creating %s: %+v", id, err) - } - - // we can't wait for the future to be complete for txt validation as we need to give the user the validation token - if validationMethod == cnameValidationType { - err := future.WaitForCompletionRef(ctx, client.Client) - if err != nil { - return fmt.Errorf("waiting for creation of %s: %+v", id, err) - } - } - - // we need to poll till the validation token is ready - if validationMethod == txtValidationType { - deadline, ok := ctx.Deadline() - if !ok { - return fmt.Errorf("context was missing a deadline") - } - stateConf := &pluginsdk.StateChangeConf{ - Pending: []string{ - string(web.CustomDomainStatusRetrievingValidationToken), - }, - Target: []string{ - string(web.CustomDomainStatusValidating), - }, - MinTimeout: 20 * time.Second, - Timeout: time.Until(deadline), - Refresh: func() (interface{}, string, error) { - domain, err := client.GetStaticSiteCustomDomain(ctx, staticSiteId.ResourceGroup, id.StaticSiteName, id.CustomDomainName) - if err != nil { - return domain, "Error", fmt.Errorf("retrieving %s: %+v", id, err) - } - - if domain.StaticSiteCustomDomainOverviewARMResourceProperties == nil { - return nil, "Failed", fmt.Errorf("`properties` was missing from the response") - } - return domain, string(domain.StaticSiteCustomDomainOverviewARMResourceProperties.Status), nil - }, - } - - if _, err := stateConf.WaitForStateContext(ctx); err != nil { - return fmt.Errorf("waiting for DNS Validation after Creation of %s %+v", id, err) - } - } - - // we set `validation_token` into state here since it's removed from the API once it's been validated - // setting it in the read would overwrite the value with an empty string and cause a diff, since this - // is not a user specifiable field we don't need to be concerned with it at import time either - resp, err := client.GetStaticSiteCustomDomain(ctx, staticSiteId.ResourceGroup, id.StaticSiteName, id.CustomDomainName) - if err != nil { - return fmt.Errorf("retrieving %s: %+v", id, err) - } - d.Set("validation_token", pointer.From(resp.ValidationToken)) - - d.SetId(id.ID()) - - return resourceStaticSiteCustomDomainRead(d, meta) -} - -func resourceStaticSiteCustomDomainRead(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Web.StaticSitesClient - ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) - defer cancel() - - id, err := parse.StaticSiteCustomDomainID(d.Id()) - if err != nil { - return err - } - - resp, err := client.GetStaticSiteCustomDomain(ctx, id.ResourceGroup, id.StaticSiteName, id.CustomDomainName) - if err != nil { - if utils.ResponseWasNotFound(resp.Response) { - log.Printf("[DEBUG] %s was not found - removing from state", *id) - d.SetId("") - return nil - } - return fmt.Errorf("retrieving %s: %+v", *id, err) - } - d.Set("domain_name", id.CustomDomainName) - d.Set("static_site_id", parse.NewStaticSiteID(id.SubscriptionId, id.ResourceGroup, id.StaticSiteName).ID()) - - return nil -} - -func resourceStaticSiteCustomDomainDelete(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Web.StaticSitesClient - ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) - defer cancel() - - id, err := parse.StaticSiteCustomDomainID(d.Id()) - if err != nil { - return err - } - - log.Printf("[DEBUG] Deleting Static Site Custom Domain %q (resource group %q)", id.CustomDomainName, id.ResourceGroup) - - future, err := client.DeleteStaticSiteCustomDomain(ctx, id.ResourceGroup, id.StaticSiteName, id.CustomDomainName) - if err != nil { - return fmt.Errorf("deleting %s: %+v", id, err) - } - if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { - return fmt.Errorf("waiting for deletion of %s: %+v", id, err) - } - - return nil -} diff --git a/internal/services/web/static_site_resource.go b/internal/services/web/static_site_resource.go deleted file mode 100644 index 752fe3195337..000000000000 --- a/internal/services/web/static_site_resource.go +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package web - -import ( - "fmt" - "log" - "time" - - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck - "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" - "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" - "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/parse" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/validate" - "github.com/hashicorp/terraform-provider-azurerm/internal/tags" - "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" - "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" - "github.com/hashicorp/terraform-provider-azurerm/utils" -) - -func resourceStaticSite() *pluginsdk.Resource { - return &pluginsdk.Resource{ - Create: resourceStaticSiteCreateOrUpdate, - Read: resourceStaticSiteRead, - Update: resourceStaticSiteCreateOrUpdate, - Delete: resourceStaticSiteDelete, - Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { - _, err := parse.StaticSiteID(id) - return err - }), - - Timeouts: &pluginsdk.ResourceTimeout{ - Create: pluginsdk.DefaultTimeout(30 * time.Minute), - Read: pluginsdk.DefaultTimeout(5 * time.Minute), - Update: pluginsdk.DefaultTimeout(30 * time.Minute), - Delete: pluginsdk.DefaultTimeout(30 * time.Minute), - }, - - Schema: map[string]*pluginsdk.Schema{ - "name": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validate.StaticSiteName, - }, - - "resource_group_name": commonschema.ResourceGroupName(), - - "location": commonschema.Location(), - - "sku_tier": { - Type: pluginsdk.TypeString, - Optional: true, - Default: string(web.SkuNameFree), - ValidateFunc: validation.StringInSlice([]string{ - string(web.SkuNameStandard), - string(web.SkuNameFree), - }, false), - }, - - "sku_size": { - Type: pluginsdk.TypeString, - Optional: true, - Default: string(web.SkuNameFree), - ValidateFunc: validation.StringInSlice([]string{ - string(web.SkuNameStandard), - string(web.SkuNameFree), - }, false), - }, - - "app_settings": { - Type: pluginsdk.TypeMap, - Optional: true, - Elem: &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - }, - }, - - "default_host_name": { - Type: pluginsdk.TypeString, - Computed: true, - }, - - "identity": commonschema.SystemAssignedUserAssignedIdentityOptional(), - - "api_key": { - Type: pluginsdk.TypeString, - Computed: true, - Sensitive: true, - }, - - "tags": tags.Schema(), - }, - } -} - -func resourceStaticSiteCreateOrUpdate(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Web.StaticSitesClient - subscriptionId := meta.(*clients.Client).Account.SubscriptionId - ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d) - defer cancel() - - log.Printf("[INFO] preparing arguments for AzureRM Static Site creation.") - - id := parse.NewStaticSiteID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) - - if d.IsNewResource() { - existing, err := client.GetStaticSite(ctx, id.ResourceGroup, id.Name) - if err != nil { - if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("failed checking for presence of existing %s: %+v", id, err) - } - } - - if !utils.ResponseWasNotFound(existing.Response) { - return tf.ImportAsExistsError("azurerm_static_site", id.ID()) - } - } - - loc := location.Normalize(d.Get("location").(string)) - - skuName := d.Get("sku_size").(string) - - identity, err := expandStaticSiteIdentity(d.Get("identity").([]interface{})) - if err != nil { - return fmt.Errorf("expanding `identity`: %+v", err) - } - - // See: https://github.com/Azure/azure-rest-api-specs/issues/17525 - if skuName == string(web.SkuNameFree) && identity != nil { - return fmt.Errorf("a Managed Identity cannot be used when tier is set to `Free`") - } - - siteEnvelope := web.StaticSiteARMResource{ - Sku: &web.SkuDescription{ - Name: &skuName, - Tier: utils.String(d.Get("sku_tier").(string)), - }, - StaticSite: &web.StaticSite{}, - Location: &loc, - Identity: identity, - Tags: tags.Expand(d.Get("tags").(map[string]interface{})), - } - - future, err := client.CreateOrUpdateStaticSite(ctx, id.ResourceGroup, id.Name, siteEnvelope) - if err != nil { - return fmt.Errorf("failed creating %s: %+v", id, err) - } - if err := future.WaitForCompletionRef(ctx, client.Client); err != nil { - return fmt.Errorf("waiting for creation of %q: %+v", id, err) - } - - d.SetId(id.ID()) - - if d.HasChange("app_settings") { - settings := web.StringDictionary{ - Properties: expandStaticSiteAppSettings(d), - } - - if _, err := client.CreateOrUpdateStaticSiteAppSettings(ctx, id.ResourceGroup, id.Name, settings); err != nil { - return fmt.Errorf("updating Application Settings for %s: %+v", id, err) - } - } - - return resourceStaticSiteRead(d, meta) -} - -func resourceStaticSiteRead(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Web.StaticSitesClient - ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) - defer cancel() - - id, err := parse.StaticSiteID(d.Id()) - if err != nil { - return err - } - - resp, err := client.GetStaticSite(ctx, id.ResourceGroup, id.Name) - if err != nil { - if utils.ResponseWasNotFound(resp.Response) { - log.Printf("[DEBUG] Static Site %q (resource group %q) was not found - removing from state", id.Name, id.ResourceGroup) - d.SetId("") - return nil - } - return fmt.Errorf("failed making Read request on %s: %+v", id, err) - } - d.Set("name", id.Name) - d.Set("resource_group_name", id.ResourceGroup) - - identity, err := flattenStaticSiteIdentity(resp.Identity) - if err != nil { - return err - } - d.Set("identity", identity) - - d.Set("location", location.NormalizeNilable(resp.Location)) - - if prop := resp.StaticSite; prop != nil { - defaultHostname := "" - if prop.DefaultHostname != nil { - defaultHostname = *prop.DefaultHostname - } - d.Set("default_host_name", defaultHostname) - } - - skuName := "" - skuTier := "" - if sku := resp.Sku; sku != nil { - if v := sku.Name; v != nil { - skuName = *v - } - - if v := sku.Tier; v != nil { - skuTier = *v - } - } - d.Set("sku_size", skuName) - d.Set("sku_tier", skuTier) - - secretResp, err := client.ListStaticSiteSecrets(ctx, id.ResourceGroup, id.Name) - if err != nil { - return fmt.Errorf("listing secretes for %s: %v", id, err) - } - - apiKey := "" - if pkey := secretResp.Properties["apiKey"]; pkey != nil { - apiKey = *pkey - } - d.Set("api_key", apiKey) - - appSettingsResp, err := client.ListStaticSiteAppSettings(ctx, id.ResourceGroup, id.Name) - if err != nil { - return fmt.Errorf("making Read request for app settings on %s: %+v", id, err) - } - - if err := d.Set("app_settings", appSettingsResp.Properties); err != nil { - return fmt.Errorf("setting `app_settings`: %s", err) - } - - return tags.FlattenAndSet(d, resp.Tags) -} - -func resourceStaticSiteDelete(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Web.StaticSitesClient - ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) - defer cancel() - - id, err := parse.StaticSiteID(d.Id()) - if err != nil { - return err - } - - log.Printf("[DEBUG] Deleting Static Site %q (resource group %q)", id.Name, id.ResourceGroup) - - future, err := client.DeleteStaticSite(ctx, id.ResourceGroup, id.Name) - if err != nil { - if !response.WasNotFound(future.Response()) { - return err - } - } - - return nil -} - -func expandStaticSiteIdentity(input []interface{}) (*web.ManagedServiceIdentity, error) { - config, err := identity.ExpandSystemAndUserAssignedMap(input) - if err != nil { - return nil, err - } - - if config.Type == identity.TypeNone { - return nil, nil - } - - out := web.ManagedServiceIdentity{ - Type: web.ManagedServiceIdentityType(config.Type), - } - - if len(config.IdentityIds) != 0 { - out.UserAssignedIdentities = make(map[string]*web.UserAssignedIdentity) - for id := range config.IdentityIds { - out.UserAssignedIdentities[id] = &web.UserAssignedIdentity{} - } - } - - return &out, nil -} - -func flattenStaticSiteIdentity(input *web.ManagedServiceIdentity) (*[]interface{}, error) { - var transform *identity.SystemAndUserAssignedMap - - if input != nil { - transform = &identity.SystemAndUserAssignedMap{ - Type: identity.Type(string(input.Type)), - IdentityIds: make(map[string]identity.UserAssignedIdentityDetails), - } - - if input.PrincipalID != nil { - transform.PrincipalId = *input.PrincipalID - } - if input.TenantID != nil { - transform.TenantId = *input.TenantID - } - for k, v := range input.UserAssignedIdentities { - transform.IdentityIds[k] = identity.UserAssignedIdentityDetails{ - ClientId: v.ClientID, - PrincipalId: v.PrincipalID, - } - } - } - - return identity.FlattenSystemAndUserAssignedMap(transform) -} - -func expandStaticSiteAppSettings(d *pluginsdk.ResourceData) map[string]*string { - input := d.Get("app_settings").(map[string]interface{}) - output := make(map[string]*string, len(input)) - - for k, v := range input { - output[k] = utils.String(v.(string)) - } - - return output -} diff --git a/internal/services/web/validate/static_site_custom_domain_id.go b/internal/services/web/validate/static_site_custom_domain_id.go deleted file mode 100644 index fada9ea861dc..000000000000 --- a/internal/services/web/validate/static_site_custom_domain_id.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "fmt" - - "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/parse" -) - -func StaticSiteCustomDomainID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := parse.StaticSiteCustomDomainID(v); err != nil { - errors = append(errors, err) - } - - return -} diff --git a/internal/services/web/validate/static_site_custom_domain_id_test.go b/internal/services/web/validate/static_site_custom_domain_id_test.go deleted file mode 100644 index 7e3d0ceb0cd0..000000000000 --- a/internal/services/web/validate/static_site_custom_domain_id_test.go +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import "testing" - -func TestStaticSiteCustomDomainID(t *testing.T) { - cases := []struct { - Input string - Valid bool - }{ - - { - // empty - Input: "", - Valid: false, - }, - - { - // missing SubscriptionId - Input: "/", - Valid: false, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Valid: false, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Valid: false, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Valid: false, - }, - - { - // missing StaticSiteName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/", - Valid: false, - }, - - { - // missing value for StaticSiteName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/", - Valid: false, - }, - - { - // missing CustomDomainName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/my-static-site1/", - Valid: false, - }, - - { - // missing value for CustomDomainName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/my-static-site1/customDomains/", - Valid: false, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/my-static-site1/customDomains/name.contoso.com", - Valid: true, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/GROUP1/PROVIDERS/MICROSOFT.WEB/STATICSITES/MY-STATIC-SITE1/CUSTOMDOMAINS/NAME.CONTOSO.COM", - Valid: false, - }, - } - for _, tc := range cases { - t.Logf("[DEBUG] Testing Value %s", tc.Input) - _, errors := StaticSiteCustomDomainID(tc.Input, "test") - valid := len(errors) == 0 - - if tc.Valid != valid { - t.Fatalf("Expected %t but got %t", tc.Valid, valid) - } - } -} diff --git a/internal/services/web/validate/static_site_id.go b/internal/services/web/validate/static_site_id.go deleted file mode 100644 index 818e6d7028bf..000000000000 --- a/internal/services/web/validate/static_site_id.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "fmt" - - "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/parse" -) - -func StaticSiteID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := parse.StaticSiteID(v); err != nil { - errors = append(errors, err) - } - - return -} diff --git a/internal/services/web/validate/static_site_id_test.go b/internal/services/web/validate/static_site_id_test.go deleted file mode 100644 index 9abee6ec21d1..000000000000 --- a/internal/services/web/validate/static_site_id_test.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import "testing" - -func TestStaticSiteID(t *testing.T) { - cases := []struct { - Input string - Valid bool - }{ - - { - // empty - Input: "", - Valid: false, - }, - - { - // missing SubscriptionId - Input: "/", - Valid: false, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Valid: false, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Valid: false, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Valid: false, - }, - - { - // missing Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/", - Valid: false, - }, - - { - // missing value for Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/", - Valid: false, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/my-static-site1", - Valid: true, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/GROUP1/PROVIDERS/MICROSOFT.WEB/STATICSITES/MY-STATIC-SITE1", - Valid: false, - }, - } - for _, tc := range cases { - t.Logf("[DEBUG] Testing Value %s", tc.Input) - _, errors := StaticSiteID(tc.Input, "test") - valid := len(errors) == 0 - - if tc.Valid != valid { - t.Fatalf("Expected %t but got %t", tc.Valid, valid) - } - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/README.md new file mode 100644 index 000000000000..5b573d21e919 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/README.md @@ -0,0 +1,1300 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites` Documentation + +The `staticsites` SDK allows for interaction with the Azure Resource Manager Service `web` (API Version `2023-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/web/2023-01-01/staticsites" +``` + + +### Client Initialization + +```go +client := staticsites.NewStaticSitesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `StaticSitesClient.ApproveOrRejectPrivateEndpointConnection` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "privateEndpointConnectionValue") + +payload := staticsites.RemotePrivateEndpointConnectionARMResource{ + // ... +} + + +if err := client.ApproveOrRejectPrivateEndpointConnectionThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.CreateOrUpdateBasicAuth` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +payload := staticsites.StaticSiteBasicAuthPropertiesARMResource{ + // ... +} + + +read, err := client.CreateOrUpdateBasicAuth(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.CreateOrUpdateBuildDatabaseConnection` + +```go +ctx := context.TODO() +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "databaseConnectionValue") + +payload := staticsites.DatabaseConnection{ + // ... +} + + +read, err := client.CreateOrUpdateBuildDatabaseConnection(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.CreateOrUpdateDatabaseConnection` + +```go +ctx := context.TODO() +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "databaseConnectionValue") + +payload := staticsites.DatabaseConnection{ + // ... +} + + +read, err := client.CreateOrUpdateDatabaseConnection(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.CreateOrUpdateStaticSite` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +payload := staticsites.StaticSiteARMResource{ + // ... +} + + +if err := client.CreateOrUpdateStaticSiteThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.CreateOrUpdateStaticSiteAppSettings` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +payload := staticsites.StringDictionary{ + // ... +} + + +read, err := client.CreateOrUpdateStaticSiteAppSettings(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.CreateOrUpdateStaticSiteBuildAppSettings` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +payload := staticsites.StringDictionary{ + // ... +} + + +read, err := client.CreateOrUpdateStaticSiteBuildAppSettings(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.CreateOrUpdateStaticSiteBuildFunctionAppSettings` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +payload := staticsites.StringDictionary{ + // ... +} + + +read, err := client.CreateOrUpdateStaticSiteBuildFunctionAppSettings(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.CreateOrUpdateStaticSiteCustomDomain` + +```go +ctx := context.TODO() +id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "customDomainValue") + +payload := staticsites.StaticSiteCustomDomainRequestPropertiesARMResource{ + // ... +} + + +if err := client.CreateOrUpdateStaticSiteCustomDomainThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.CreateOrUpdateStaticSiteFunctionAppSettings` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +payload := staticsites.StringDictionary{ + // ... +} + + +read, err := client.CreateOrUpdateStaticSiteFunctionAppSettings(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.CreateUserRolesInvitationLink` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +payload := staticsites.StaticSiteUserInvitationRequestResource{ + // ... +} + + +read, err := client.CreateUserRolesInvitationLink(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.CreateZipDeploymentForStaticSite` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +payload := staticsites.StaticSiteZipDeploymentARMResource{ + // ... +} + + +if err := client.CreateZipDeploymentForStaticSiteThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.CreateZipDeploymentForStaticSiteBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +payload := staticsites.StaticSiteZipDeploymentARMResource{ + // ... +} + + +if err := client.CreateZipDeploymentForStaticSiteBuildThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.DeleteBuildDatabaseConnection` + +```go +ctx := context.TODO() +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "databaseConnectionValue") + +read, err := client.DeleteBuildDatabaseConnection(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.DeleteDatabaseConnection` + +```go +ctx := context.TODO() +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "databaseConnectionValue") + +read, err := client.DeleteDatabaseConnection(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.DeletePrivateEndpointConnection` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "privateEndpointConnectionValue") + +if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.DeleteStaticSite` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +if err := client.DeleteStaticSiteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.DeleteStaticSiteBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +if err := client.DeleteStaticSiteBuildThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.DeleteStaticSiteCustomDomain` + +```go +ctx := context.TODO() +id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "customDomainValue") + +if err := client.DeleteStaticSiteCustomDomainThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.DeleteStaticSiteUser` + +```go +ctx := context.TODO() +id := staticsites.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "authProviderValue", "userValue") + +read, err := client.DeleteStaticSiteUser(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.DetachStaticSite` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +if err := client.DetachStaticSiteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.DetachUserProvidedFunctionAppFromStaticSite` + +```go +ctx := context.TODO() +id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "userProvidedFunctionAppValue") + +read, err := client.DetachUserProvidedFunctionAppFromStaticSite(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.DetachUserProvidedFunctionAppFromStaticSiteBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "userProvidedFunctionAppValue") + +read, err := client.DetachUserProvidedFunctionAppFromStaticSiteBuild(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetBasicAuth` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +read, err := client.GetBasicAuth(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetBuildDatabaseConnection` + +```go +ctx := context.TODO() +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "databaseConnectionValue") + +read, err := client.GetBuildDatabaseConnection(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetBuildDatabaseConnectionWithDetails` + +```go +ctx := context.TODO() +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "databaseConnectionValue") + +read, err := client.GetBuildDatabaseConnectionWithDetails(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetBuildDatabaseConnections` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +// alternatively `client.GetBuildDatabaseConnections(ctx, id)` can be used to do batched pagination +items, err := client.GetBuildDatabaseConnectionsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.GetBuildDatabaseConnectionsWithDetails` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +// alternatively `client.GetBuildDatabaseConnectionsWithDetails(ctx, id)` can be used to do batched pagination +items, err := client.GetBuildDatabaseConnectionsWithDetailsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.GetDatabaseConnection` + +```go +ctx := context.TODO() +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "databaseConnectionValue") + +read, err := client.GetDatabaseConnection(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetDatabaseConnectionWithDetails` + +```go +ctx := context.TODO() +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "databaseConnectionValue") + +read, err := client.GetDatabaseConnectionWithDetails(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetDatabaseConnections` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +// alternatively `client.GetDatabaseConnections(ctx, id)` can be used to do batched pagination +items, err := client.GetDatabaseConnectionsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.GetDatabaseConnectionsWithDetails` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +// alternatively `client.GetDatabaseConnectionsWithDetails(ctx, id)` can be used to do batched pagination +items, err := client.GetDatabaseConnectionsWithDetailsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.GetLinkedBackend` + +```go +ctx := context.TODO() +id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "linkedBackendValue") + +read, err := client.GetLinkedBackend(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetLinkedBackendForBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "linkedBackendValue") + +read, err := client.GetLinkedBackendForBuild(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetLinkedBackends` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +// alternatively `client.GetLinkedBackends(ctx, id)` can be used to do batched pagination +items, err := client.GetLinkedBackendsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.GetLinkedBackendsForBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +// alternatively `client.GetLinkedBackendsForBuild(ctx, id)` can be used to do batched pagination +items, err := client.GetLinkedBackendsForBuildComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.GetPrivateEndpointConnection` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "privateEndpointConnectionValue") + +read, err := client.GetPrivateEndpointConnection(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetPrivateEndpointConnectionList` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +// alternatively `client.GetPrivateEndpointConnectionList(ctx, id)` can be used to do batched pagination +items, err := client.GetPrivateEndpointConnectionListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.GetPrivateLinkResources` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +read, err := client.GetPrivateLinkResources(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetStaticSite` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +read, err := client.GetStaticSite(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetStaticSiteBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +read, err := client.GetStaticSiteBuild(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetStaticSiteBuilds` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +// alternatively `client.GetStaticSiteBuilds(ctx, id)` can be used to do batched pagination +items, err := client.GetStaticSiteBuildsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.GetStaticSiteCustomDomain` + +```go +ctx := context.TODO() +id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "customDomainValue") + +read, err := client.GetStaticSiteCustomDomain(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetStaticSitesByResourceGroup` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.GetStaticSitesByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.GetStaticSitesByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.GetUserProvidedFunctionAppForStaticSite` + +```go +ctx := context.TODO() +id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "userProvidedFunctionAppValue") + +read, err := client.GetUserProvidedFunctionAppForStaticSite(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetUserProvidedFunctionAppForStaticSiteBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "userProvidedFunctionAppValue") + +read, err := client.GetUserProvidedFunctionAppForStaticSiteBuild(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetUserProvidedFunctionAppsForStaticSite` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +// alternatively `client.GetUserProvidedFunctionAppsForStaticSite(ctx, id)` can be used to do batched pagination +items, err := client.GetUserProvidedFunctionAppsForStaticSiteComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.GetUserProvidedFunctionAppsForStaticSiteBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +// alternatively `client.GetUserProvidedFunctionAppsForStaticSiteBuild(ctx, id)` can be used to do batched pagination +items, err := client.GetUserProvidedFunctionAppsForStaticSiteBuildComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.LinkBackend` + +```go +ctx := context.TODO() +id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "linkedBackendValue") + +payload := staticsites.StaticSiteLinkedBackendARMResource{ + // ... +} + + +if err := client.LinkBackendThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.LinkBackendToBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "linkedBackendValue") + +payload := staticsites.StaticSiteLinkedBackendARMResource{ + // ... +} + + +if err := client.LinkBackendToBuildThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.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: `StaticSitesClient.ListBasicAuth` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +// alternatively `client.ListBasicAuth(ctx, id)` can be used to do batched pagination +items, err := client.ListBasicAuthComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.ListStaticSiteAppSettings` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +read, err := client.ListStaticSiteAppSettings(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.ListStaticSiteBuildAppSettings` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +read, err := client.ListStaticSiteBuildAppSettings(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.ListStaticSiteBuildFunctionAppSettings` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +read, err := client.ListStaticSiteBuildFunctionAppSettings(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.ListStaticSiteBuildFunctions` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +// alternatively `client.ListStaticSiteBuildFunctions(ctx, id)` can be used to do batched pagination +items, err := client.ListStaticSiteBuildFunctionsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.ListStaticSiteConfiguredRoles` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +read, err := client.ListStaticSiteConfiguredRoles(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.ListStaticSiteCustomDomains` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +// alternatively `client.ListStaticSiteCustomDomains(ctx, id)` can be used to do batched pagination +items, err := client.ListStaticSiteCustomDomainsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.ListStaticSiteFunctionAppSettings` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +read, err := client.ListStaticSiteFunctionAppSettings(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.ListStaticSiteFunctions` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +// alternatively `client.ListStaticSiteFunctions(ctx, id)` can be used to do batched pagination +items, err := client.ListStaticSiteFunctionsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.ListStaticSiteSecrets` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +read, err := client.ListStaticSiteSecrets(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.ListStaticSiteUsers` + +```go +ctx := context.TODO() +id := staticsites.NewAuthProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "authProviderValue") + +// alternatively `client.ListStaticSiteUsers(ctx, id)` can be used to do batched pagination +items, err := client.ListStaticSiteUsersComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.PreviewWorkflow` + +```go +ctx := context.TODO() +id := staticsites.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +payload := staticsites.StaticSitesWorkflowPreviewRequest{ + // ... +} + + +read, err := client.PreviewWorkflow(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.RegisterUserProvidedFunctionAppWithStaticSite` + +```go +ctx := context.TODO() +id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "userProvidedFunctionAppValue") + +payload := staticsites.StaticSiteUserProvidedFunctionAppARMResource{ + // ... +} + + +if err := client.RegisterUserProvidedFunctionAppWithStaticSiteThenPoll(ctx, id, payload, staticsites.DefaultRegisterUserProvidedFunctionAppWithStaticSiteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.RegisterUserProvidedFunctionAppWithStaticSiteBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "userProvidedFunctionAppValue") + +payload := staticsites.StaticSiteUserProvidedFunctionAppARMResource{ + // ... +} + + +if err := client.RegisterUserProvidedFunctionAppWithStaticSiteBuildThenPoll(ctx, id, payload, staticsites.DefaultRegisterUserProvidedFunctionAppWithStaticSiteBuildOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.ResetStaticSiteApiKey` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +payload := staticsites.StaticSiteResetPropertiesARMResource{ + // ... +} + + +read, err := client.ResetStaticSiteApiKey(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.UnlinkBackend` + +```go +ctx := context.TODO() +id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "linkedBackendValue") + +read, err := client.UnlinkBackend(ctx, id, staticsites.DefaultUnlinkBackendOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.UnlinkBackendFromBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "linkedBackendValue") + +read, err := client.UnlinkBackendFromBuild(ctx, id, staticsites.DefaultUnlinkBackendFromBuildOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.UpdateBuildDatabaseConnection` + +```go +ctx := context.TODO() +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "databaseConnectionValue") + +payload := staticsites.DatabaseConnectionPatchRequest{ + // ... +} + + +read, err := client.UpdateBuildDatabaseConnection(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.UpdateDatabaseConnection` + +```go +ctx := context.TODO() +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "databaseConnectionValue") + +payload := staticsites.DatabaseConnectionPatchRequest{ + // ... +} + + +read, err := client.UpdateDatabaseConnection(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.UpdateStaticSite` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +payload := staticsites.StaticSitePatchResource{ + // ... +} + + +read, err := client.UpdateStaticSite(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.UpdateStaticSiteUser` + +```go +ctx := context.TODO() +id := staticsites.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "authProviderValue", "userValue") + +payload := staticsites.StaticSiteUserARMResource{ + // ... +} + + +read, err := client.UpdateStaticSiteUser(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.ValidateBackend` + +```go +ctx := context.TODO() +id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "linkedBackendValue") + +payload := staticsites.StaticSiteLinkedBackendARMResource{ + // ... +} + + +if err := client.ValidateBackendThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.ValidateBackendForBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "linkedBackendValue") + +payload := staticsites.StaticSiteLinkedBackendARMResource{ + // ... +} + + +if err := client.ValidateBackendForBuildThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.ValidateCustomDomainCanBeAddedToStaticSite` + +```go +ctx := context.TODO() +id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "customDomainValue") + +payload := staticsites.StaticSiteCustomDomainRequestPropertiesARMResource{ + // ... +} + + +if err := client.ValidateCustomDomainCanBeAddedToStaticSiteThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/client.go new file mode 100644 index 000000000000..d725455a2d77 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/client.go @@ -0,0 +1,26 @@ +package staticsites + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSitesClient struct { + Client *resourcemanager.Client +} + +func NewStaticSitesClientWithBaseURI(sdkApi sdkEnv.Api) (*StaticSitesClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "staticsites", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating StaticSitesClient: %+v", err) + } + + return &StaticSitesClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/constants.go new file mode 100644 index 000000000000..dfdde9730155 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/constants.go @@ -0,0 +1,251 @@ +package staticsites + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BuildStatus string + +const ( + BuildStatusDeleting BuildStatus = "Deleting" + BuildStatusDeploying BuildStatus = "Deploying" + BuildStatusDetached BuildStatus = "Detached" + BuildStatusFailed BuildStatus = "Failed" + BuildStatusReady BuildStatus = "Ready" + BuildStatusUploading BuildStatus = "Uploading" + BuildStatusWaitingForDeployment BuildStatus = "WaitingForDeployment" +) + +func PossibleValuesForBuildStatus() []string { + return []string{ + string(BuildStatusDeleting), + string(BuildStatusDeploying), + string(BuildStatusDetached), + string(BuildStatusFailed), + string(BuildStatusReady), + string(BuildStatusUploading), + string(BuildStatusWaitingForDeployment), + } +} + +func (s *BuildStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBuildStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBuildStatus(input string) (*BuildStatus, error) { + vals := map[string]BuildStatus{ + "deleting": BuildStatusDeleting, + "deploying": BuildStatusDeploying, + "detached": BuildStatusDetached, + "failed": BuildStatusFailed, + "ready": BuildStatusReady, + "uploading": BuildStatusUploading, + "waitingfordeployment": BuildStatusWaitingForDeployment, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BuildStatus(input) + return &out, nil +} + +type CustomDomainStatus string + +const ( + CustomDomainStatusAdding CustomDomainStatus = "Adding" + CustomDomainStatusDeleting CustomDomainStatus = "Deleting" + CustomDomainStatusFailed CustomDomainStatus = "Failed" + CustomDomainStatusReady CustomDomainStatus = "Ready" + CustomDomainStatusRetrievingValidationToken CustomDomainStatus = "RetrievingValidationToken" + CustomDomainStatusUnhealthy CustomDomainStatus = "Unhealthy" + CustomDomainStatusValidating CustomDomainStatus = "Validating" +) + +func PossibleValuesForCustomDomainStatus() []string { + return []string{ + string(CustomDomainStatusAdding), + string(CustomDomainStatusDeleting), + string(CustomDomainStatusFailed), + string(CustomDomainStatusReady), + string(CustomDomainStatusRetrievingValidationToken), + string(CustomDomainStatusUnhealthy), + string(CustomDomainStatusValidating), + } +} + +func (s *CustomDomainStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCustomDomainStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCustomDomainStatus(input string) (*CustomDomainStatus, error) { + vals := map[string]CustomDomainStatus{ + "adding": CustomDomainStatusAdding, + "deleting": CustomDomainStatusDeleting, + "failed": CustomDomainStatusFailed, + "ready": CustomDomainStatusReady, + "retrievingvalidationtoken": CustomDomainStatusRetrievingValidationToken, + "unhealthy": CustomDomainStatusUnhealthy, + "validating": CustomDomainStatusValidating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CustomDomainStatus(input) + return &out, nil +} + +type EnterpriseGradeCdnStatus string + +const ( + EnterpriseGradeCdnStatusDisabled EnterpriseGradeCdnStatus = "Disabled" + EnterpriseGradeCdnStatusDisabling EnterpriseGradeCdnStatus = "Disabling" + EnterpriseGradeCdnStatusEnabled EnterpriseGradeCdnStatus = "Enabled" + EnterpriseGradeCdnStatusEnabling EnterpriseGradeCdnStatus = "Enabling" +) + +func PossibleValuesForEnterpriseGradeCdnStatus() []string { + return []string{ + string(EnterpriseGradeCdnStatusDisabled), + string(EnterpriseGradeCdnStatusDisabling), + string(EnterpriseGradeCdnStatusEnabled), + string(EnterpriseGradeCdnStatusEnabling), + } +} + +func (s *EnterpriseGradeCdnStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseEnterpriseGradeCdnStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseEnterpriseGradeCdnStatus(input string) (*EnterpriseGradeCdnStatus, error) { + vals := map[string]EnterpriseGradeCdnStatus{ + "disabled": EnterpriseGradeCdnStatusDisabled, + "disabling": EnterpriseGradeCdnStatusDisabling, + "enabled": EnterpriseGradeCdnStatusEnabled, + "enabling": EnterpriseGradeCdnStatusEnabling, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EnterpriseGradeCdnStatus(input) + return &out, nil +} + +type StagingEnvironmentPolicy string + +const ( + StagingEnvironmentPolicyDisabled StagingEnvironmentPolicy = "Disabled" + StagingEnvironmentPolicyEnabled StagingEnvironmentPolicy = "Enabled" +) + +func PossibleValuesForStagingEnvironmentPolicy() []string { + return []string{ + string(StagingEnvironmentPolicyDisabled), + string(StagingEnvironmentPolicyEnabled), + } +} + +func (s *StagingEnvironmentPolicy) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseStagingEnvironmentPolicy(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseStagingEnvironmentPolicy(input string) (*StagingEnvironmentPolicy, error) { + vals := map[string]StagingEnvironmentPolicy{ + "disabled": StagingEnvironmentPolicyDisabled, + "enabled": StagingEnvironmentPolicyEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := StagingEnvironmentPolicy(input) + return &out, nil +} + +type TriggerTypes string + +const ( + TriggerTypesHTTPTrigger TriggerTypes = "HttpTrigger" + TriggerTypesUnknown TriggerTypes = "Unknown" +) + +func PossibleValuesForTriggerTypes() []string { + return []string{ + string(TriggerTypesHTTPTrigger), + string(TriggerTypesUnknown), + } +} + +func (s *TriggerTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTriggerTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTriggerTypes(input string) (*TriggerTypes, error) { + vals := map[string]TriggerTypes{ + "httptrigger": TriggerTypesHTTPTrigger, + "unknown": TriggerTypesUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TriggerTypes(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_authprovider.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_authprovider.go new file mode 100644 index 000000000000..c5f6e54f94ff --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_authprovider.go @@ -0,0 +1,134 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &AuthProviderId{} + +// AuthProviderId is a struct representing the Resource ID for a Auth Provider +type AuthProviderId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string + AuthProviderName string +} + +// NewAuthProviderID returns a new AuthProviderId struct +func NewAuthProviderID(subscriptionId string, resourceGroupName string, staticSiteName string, authProviderName string) AuthProviderId { + return AuthProviderId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + AuthProviderName: authProviderName, + } +} + +// ParseAuthProviderID parses 'input' into a AuthProviderId +func ParseAuthProviderID(input string) (*AuthProviderId, error) { + parser := resourceids.NewParserFromResourceIdType(&AuthProviderId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AuthProviderId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseAuthProviderIDInsensitively parses 'input' case-insensitively into a AuthProviderId +// note: this method should only be used for API response data and not user input +func ParseAuthProviderIDInsensitively(input string) (*AuthProviderId, error) { + parser := resourceids.NewParserFromResourceIdType(&AuthProviderId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AuthProviderId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *AuthProviderId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + if id.AuthProviderName, ok = input.Parsed["authProviderName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "authProviderName", input) + } + + return nil +} + +// ValidateAuthProviderID checks that 'input' can be parsed as a Auth Provider ID +func ValidateAuthProviderID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseAuthProviderID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Auth Provider ID +func (id AuthProviderId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s/authProviders/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName, id.AuthProviderName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Auth Provider ID +func (id AuthProviderId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + resourceids.StaticSegment("staticAuthProviders", "authProviders", "authProviders"), + resourceids.UserSpecifiedSegment("authProviderName", "authProviderValue"), + } +} + +// String returns a human-readable description of this Auth Provider ID +func (id AuthProviderId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Static Site Name: %q", id.StaticSiteName), + fmt.Sprintf("Auth Provider Name: %q", id.AuthProviderName), + } + return fmt.Sprintf("Auth Provider (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_build.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_build.go new file mode 100644 index 000000000000..38ae98cc414d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_build.go @@ -0,0 +1,134 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &BuildId{} + +// BuildId is a struct representing the Resource ID for a Build +type BuildId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string + BuildName string +} + +// NewBuildID returns a new BuildId struct +func NewBuildID(subscriptionId string, resourceGroupName string, staticSiteName string, buildName string) BuildId { + return BuildId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + BuildName: buildName, + } +} + +// ParseBuildID parses 'input' into a BuildId +func ParseBuildID(input string) (*BuildId, error) { + parser := resourceids.NewParserFromResourceIdType(&BuildId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BuildId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseBuildIDInsensitively parses 'input' case-insensitively into a BuildId +// note: this method should only be used for API response data and not user input +func ParseBuildIDInsensitively(input string) (*BuildId, error) { + parser := resourceids.NewParserFromResourceIdType(&BuildId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BuildId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *BuildId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + if id.BuildName, ok = input.Parsed["buildName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "buildName", input) + } + + return nil +} + +// ValidateBuildID checks that 'input' can be parsed as a Build ID +func ValidateBuildID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseBuildID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Build ID +func (id BuildId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s/builds/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName, id.BuildName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Build ID +func (id BuildId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + resourceids.StaticSegment("staticBuilds", "builds", "builds"), + resourceids.UserSpecifiedSegment("buildName", "buildValue"), + } +} + +// String returns a human-readable description of this Build ID +func (id BuildId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Static Site Name: %q", id.StaticSiteName), + fmt.Sprintf("Build Name: %q", id.BuildName), + } + return fmt.Sprintf("Build (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_builddatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_builddatabaseconnection.go new file mode 100644 index 000000000000..2aaa0fda2292 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_builddatabaseconnection.go @@ -0,0 +1,143 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &BuildDatabaseConnectionId{} + +// BuildDatabaseConnectionId is a struct representing the Resource ID for a Build Database Connection +type BuildDatabaseConnectionId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string + BuildName string + DatabaseConnectionName string +} + +// NewBuildDatabaseConnectionID returns a new BuildDatabaseConnectionId struct +func NewBuildDatabaseConnectionID(subscriptionId string, resourceGroupName string, staticSiteName string, buildName string, databaseConnectionName string) BuildDatabaseConnectionId { + return BuildDatabaseConnectionId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + BuildName: buildName, + DatabaseConnectionName: databaseConnectionName, + } +} + +// ParseBuildDatabaseConnectionID parses 'input' into a BuildDatabaseConnectionId +func ParseBuildDatabaseConnectionID(input string) (*BuildDatabaseConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(&BuildDatabaseConnectionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BuildDatabaseConnectionId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseBuildDatabaseConnectionIDInsensitively parses 'input' case-insensitively into a BuildDatabaseConnectionId +// note: this method should only be used for API response data and not user input +func ParseBuildDatabaseConnectionIDInsensitively(input string) (*BuildDatabaseConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(&BuildDatabaseConnectionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BuildDatabaseConnectionId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *BuildDatabaseConnectionId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + if id.BuildName, ok = input.Parsed["buildName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "buildName", input) + } + + if id.DatabaseConnectionName, ok = input.Parsed["databaseConnectionName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "databaseConnectionName", input) + } + + return nil +} + +// ValidateBuildDatabaseConnectionID checks that 'input' can be parsed as a Build Database Connection ID +func ValidateBuildDatabaseConnectionID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseBuildDatabaseConnectionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Build Database Connection ID +func (id BuildDatabaseConnectionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s/builds/%s/databaseConnections/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName, id.BuildName, id.DatabaseConnectionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Build Database Connection ID +func (id BuildDatabaseConnectionId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + resourceids.StaticSegment("staticBuilds", "builds", "builds"), + resourceids.UserSpecifiedSegment("buildName", "buildValue"), + resourceids.StaticSegment("staticDatabaseConnections", "databaseConnections", "databaseConnections"), + resourceids.UserSpecifiedSegment("databaseConnectionName", "databaseConnectionValue"), + } +} + +// String returns a human-readable description of this Build Database Connection ID +func (id BuildDatabaseConnectionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Static Site Name: %q", id.StaticSiteName), + fmt.Sprintf("Build Name: %q", id.BuildName), + fmt.Sprintf("Database Connection Name: %q", id.DatabaseConnectionName), + } + return fmt.Sprintf("Build Database Connection (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_buildlinkedbackend.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_buildlinkedbackend.go new file mode 100644 index 000000000000..ff9e6a809f87 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_buildlinkedbackend.go @@ -0,0 +1,143 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &BuildLinkedBackendId{} + +// BuildLinkedBackendId is a struct representing the Resource ID for a Build Linked Backend +type BuildLinkedBackendId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string + BuildName string + LinkedBackendName string +} + +// NewBuildLinkedBackendID returns a new BuildLinkedBackendId struct +func NewBuildLinkedBackendID(subscriptionId string, resourceGroupName string, staticSiteName string, buildName string, linkedBackendName string) BuildLinkedBackendId { + return BuildLinkedBackendId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + BuildName: buildName, + LinkedBackendName: linkedBackendName, + } +} + +// ParseBuildLinkedBackendID parses 'input' into a BuildLinkedBackendId +func ParseBuildLinkedBackendID(input string) (*BuildLinkedBackendId, error) { + parser := resourceids.NewParserFromResourceIdType(&BuildLinkedBackendId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BuildLinkedBackendId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseBuildLinkedBackendIDInsensitively parses 'input' case-insensitively into a BuildLinkedBackendId +// note: this method should only be used for API response data and not user input +func ParseBuildLinkedBackendIDInsensitively(input string) (*BuildLinkedBackendId, error) { + parser := resourceids.NewParserFromResourceIdType(&BuildLinkedBackendId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BuildLinkedBackendId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *BuildLinkedBackendId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + if id.BuildName, ok = input.Parsed["buildName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "buildName", input) + } + + if id.LinkedBackendName, ok = input.Parsed["linkedBackendName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "linkedBackendName", input) + } + + return nil +} + +// ValidateBuildLinkedBackendID checks that 'input' can be parsed as a Build Linked Backend ID +func ValidateBuildLinkedBackendID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseBuildLinkedBackendID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Build Linked Backend ID +func (id BuildLinkedBackendId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s/builds/%s/linkedBackends/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName, id.BuildName, id.LinkedBackendName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Build Linked Backend ID +func (id BuildLinkedBackendId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + resourceids.StaticSegment("staticBuilds", "builds", "builds"), + resourceids.UserSpecifiedSegment("buildName", "buildValue"), + resourceids.StaticSegment("staticLinkedBackends", "linkedBackends", "linkedBackends"), + resourceids.UserSpecifiedSegment("linkedBackendName", "linkedBackendValue"), + } +} + +// String returns a human-readable description of this Build Linked Backend ID +func (id BuildLinkedBackendId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Static Site Name: %q", id.StaticSiteName), + fmt.Sprintf("Build Name: %q", id.BuildName), + fmt.Sprintf("Linked Backend Name: %q", id.LinkedBackendName), + } + return fmt.Sprintf("Build Linked Backend (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_builduserprovidedfunctionapp.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_builduserprovidedfunctionapp.go new file mode 100644 index 000000000000..e2479f779dfc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_builduserprovidedfunctionapp.go @@ -0,0 +1,143 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &BuildUserProvidedFunctionAppId{} + +// BuildUserProvidedFunctionAppId is a struct representing the Resource ID for a Build User Provided Function App +type BuildUserProvidedFunctionAppId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string + BuildName string + UserProvidedFunctionAppName string +} + +// NewBuildUserProvidedFunctionAppID returns a new BuildUserProvidedFunctionAppId struct +func NewBuildUserProvidedFunctionAppID(subscriptionId string, resourceGroupName string, staticSiteName string, buildName string, userProvidedFunctionAppName string) BuildUserProvidedFunctionAppId { + return BuildUserProvidedFunctionAppId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + BuildName: buildName, + UserProvidedFunctionAppName: userProvidedFunctionAppName, + } +} + +// ParseBuildUserProvidedFunctionAppID parses 'input' into a BuildUserProvidedFunctionAppId +func ParseBuildUserProvidedFunctionAppID(input string) (*BuildUserProvidedFunctionAppId, error) { + parser := resourceids.NewParserFromResourceIdType(&BuildUserProvidedFunctionAppId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BuildUserProvidedFunctionAppId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseBuildUserProvidedFunctionAppIDInsensitively parses 'input' case-insensitively into a BuildUserProvidedFunctionAppId +// note: this method should only be used for API response data and not user input +func ParseBuildUserProvidedFunctionAppIDInsensitively(input string) (*BuildUserProvidedFunctionAppId, error) { + parser := resourceids.NewParserFromResourceIdType(&BuildUserProvidedFunctionAppId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BuildUserProvidedFunctionAppId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *BuildUserProvidedFunctionAppId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + if id.BuildName, ok = input.Parsed["buildName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "buildName", input) + } + + if id.UserProvidedFunctionAppName, ok = input.Parsed["userProvidedFunctionAppName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "userProvidedFunctionAppName", input) + } + + return nil +} + +// ValidateBuildUserProvidedFunctionAppID checks that 'input' can be parsed as a Build User Provided Function App ID +func ValidateBuildUserProvidedFunctionAppID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseBuildUserProvidedFunctionAppID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Build User Provided Function App ID +func (id BuildUserProvidedFunctionAppId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s/builds/%s/userProvidedFunctionApps/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName, id.BuildName, id.UserProvidedFunctionAppName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Build User Provided Function App ID +func (id BuildUserProvidedFunctionAppId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + resourceids.StaticSegment("staticBuilds", "builds", "builds"), + resourceids.UserSpecifiedSegment("buildName", "buildValue"), + resourceids.StaticSegment("staticUserProvidedFunctionApps", "userProvidedFunctionApps", "userProvidedFunctionApps"), + resourceids.UserSpecifiedSegment("userProvidedFunctionAppName", "userProvidedFunctionAppValue"), + } +} + +// String returns a human-readable description of this Build User Provided Function App ID +func (id BuildUserProvidedFunctionAppId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Static Site Name: %q", id.StaticSiteName), + fmt.Sprintf("Build Name: %q", id.BuildName), + fmt.Sprintf("User Provided Function App Name: %q", id.UserProvidedFunctionAppName), + } + return fmt.Sprintf("Build User Provided Function App (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_customdomain.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_customdomain.go new file mode 100644 index 000000000000..991e4b4c4b6d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_customdomain.go @@ -0,0 +1,134 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &CustomDomainId{} + +// CustomDomainId is a struct representing the Resource ID for a Custom Domain +type CustomDomainId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string + CustomDomainName string +} + +// NewCustomDomainID returns a new CustomDomainId struct +func NewCustomDomainID(subscriptionId string, resourceGroupName string, staticSiteName string, customDomainName string) CustomDomainId { + return CustomDomainId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + CustomDomainName: customDomainName, + } +} + +// ParseCustomDomainID parses 'input' into a CustomDomainId +func ParseCustomDomainID(input string) (*CustomDomainId, error) { + parser := resourceids.NewParserFromResourceIdType(&CustomDomainId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := CustomDomainId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseCustomDomainIDInsensitively parses 'input' case-insensitively into a CustomDomainId +// note: this method should only be used for API response data and not user input +func ParseCustomDomainIDInsensitively(input string) (*CustomDomainId, error) { + parser := resourceids.NewParserFromResourceIdType(&CustomDomainId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := CustomDomainId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *CustomDomainId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + if id.CustomDomainName, ok = input.Parsed["customDomainName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "customDomainName", input) + } + + return nil +} + +// ValidateCustomDomainID checks that 'input' can be parsed as a Custom Domain ID +func ValidateCustomDomainID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseCustomDomainID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Custom Domain ID +func (id CustomDomainId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s/customDomains/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName, id.CustomDomainName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Custom Domain ID +func (id CustomDomainId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + resourceids.StaticSegment("staticCustomDomains", "customDomains", "customDomains"), + resourceids.UserSpecifiedSegment("customDomainName", "customDomainValue"), + } +} + +// String returns a human-readable description of this Custom Domain ID +func (id CustomDomainId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Static Site Name: %q", id.StaticSiteName), + fmt.Sprintf("Custom Domain Name: %q", id.CustomDomainName), + } + return fmt.Sprintf("Custom Domain (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_databaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_databaseconnection.go new file mode 100644 index 000000000000..a78341eccda0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_databaseconnection.go @@ -0,0 +1,134 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &DatabaseConnectionId{} + +// DatabaseConnectionId is a struct representing the Resource ID for a Database Connection +type DatabaseConnectionId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string + DatabaseConnectionName string +} + +// NewDatabaseConnectionID returns a new DatabaseConnectionId struct +func NewDatabaseConnectionID(subscriptionId string, resourceGroupName string, staticSiteName string, databaseConnectionName string) DatabaseConnectionId { + return DatabaseConnectionId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + DatabaseConnectionName: databaseConnectionName, + } +} + +// ParseDatabaseConnectionID parses 'input' into a DatabaseConnectionId +func ParseDatabaseConnectionID(input string) (*DatabaseConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(&DatabaseConnectionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := DatabaseConnectionId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseDatabaseConnectionIDInsensitively parses 'input' case-insensitively into a DatabaseConnectionId +// note: this method should only be used for API response data and not user input +func ParseDatabaseConnectionIDInsensitively(input string) (*DatabaseConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(&DatabaseConnectionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := DatabaseConnectionId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *DatabaseConnectionId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + if id.DatabaseConnectionName, ok = input.Parsed["databaseConnectionName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "databaseConnectionName", input) + } + + return nil +} + +// ValidateDatabaseConnectionID checks that 'input' can be parsed as a Database Connection ID +func ValidateDatabaseConnectionID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseDatabaseConnectionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Database Connection ID +func (id DatabaseConnectionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s/databaseConnections/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName, id.DatabaseConnectionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Database Connection ID +func (id DatabaseConnectionId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + resourceids.StaticSegment("staticDatabaseConnections", "databaseConnections", "databaseConnections"), + resourceids.UserSpecifiedSegment("databaseConnectionName", "databaseConnectionValue"), + } +} + +// String returns a human-readable description of this Database Connection ID +func (id DatabaseConnectionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Static Site Name: %q", id.StaticSiteName), + fmt.Sprintf("Database Connection Name: %q", id.DatabaseConnectionName), + } + return fmt.Sprintf("Database Connection (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_linkedbackend.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_linkedbackend.go new file mode 100644 index 000000000000..9ac8eda7b29d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_linkedbackend.go @@ -0,0 +1,134 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &LinkedBackendId{} + +// LinkedBackendId is a struct representing the Resource ID for a Linked Backend +type LinkedBackendId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string + LinkedBackendName string +} + +// NewLinkedBackendID returns a new LinkedBackendId struct +func NewLinkedBackendID(subscriptionId string, resourceGroupName string, staticSiteName string, linkedBackendName string) LinkedBackendId { + return LinkedBackendId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + LinkedBackendName: linkedBackendName, + } +} + +// ParseLinkedBackendID parses 'input' into a LinkedBackendId +func ParseLinkedBackendID(input string) (*LinkedBackendId, error) { + parser := resourceids.NewParserFromResourceIdType(&LinkedBackendId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LinkedBackendId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseLinkedBackendIDInsensitively parses 'input' case-insensitively into a LinkedBackendId +// note: this method should only be used for API response data and not user input +func ParseLinkedBackendIDInsensitively(input string) (*LinkedBackendId, error) { + parser := resourceids.NewParserFromResourceIdType(&LinkedBackendId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LinkedBackendId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *LinkedBackendId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + if id.LinkedBackendName, ok = input.Parsed["linkedBackendName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "linkedBackendName", input) + } + + return nil +} + +// ValidateLinkedBackendID checks that 'input' can be parsed as a Linked Backend ID +func ValidateLinkedBackendID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseLinkedBackendID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Linked Backend ID +func (id LinkedBackendId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s/linkedBackends/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName, id.LinkedBackendName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Linked Backend ID +func (id LinkedBackendId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + resourceids.StaticSegment("staticLinkedBackends", "linkedBackends", "linkedBackends"), + resourceids.UserSpecifiedSegment("linkedBackendName", "linkedBackendValue"), + } +} + +// String returns a human-readable description of this Linked Backend ID +func (id LinkedBackendId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Static Site Name: %q", id.StaticSiteName), + fmt.Sprintf("Linked Backend Name: %q", id.LinkedBackendName), + } + return fmt.Sprintf("Linked Backend (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_providerlocation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_providerlocation.go new file mode 100644 index 000000000000..417225dc0b2d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_providerlocation.go @@ -0,0 +1,116 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (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{} + +// ProviderLocationId is a struct representing the Resource ID for a Provider Location +type ProviderLocationId struct { + SubscriptionId string + LocationName string +} + +// NewProviderLocationID returns a new ProviderLocationId struct +func NewProviderLocationID(subscriptionId string, locationName string) ProviderLocationId { + return ProviderLocationId{ + SubscriptionId: subscriptionId, + 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.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/providers/Microsoft.Web/locations/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, 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("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + 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("Location Name: %q", id.LocationName), + } + return fmt.Sprintf("Provider Location (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_staticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_staticsite.go new file mode 100644 index 000000000000..5b9ba4d32bef --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_staticsite.go @@ -0,0 +1,125 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &StaticSiteId{} + +// StaticSiteId is a struct representing the Resource ID for a Static Site +type StaticSiteId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string +} + +// NewStaticSiteID returns a new StaticSiteId struct +func NewStaticSiteID(subscriptionId string, resourceGroupName string, staticSiteName string) StaticSiteId { + return StaticSiteId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + } +} + +// ParseStaticSiteID parses 'input' into a StaticSiteId +func ParseStaticSiteID(input string) (*StaticSiteId, error) { + parser := resourceids.NewParserFromResourceIdType(&StaticSiteId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := StaticSiteId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseStaticSiteIDInsensitively parses 'input' case-insensitively into a StaticSiteId +// note: this method should only be used for API response data and not user input +func ParseStaticSiteIDInsensitively(input string) (*StaticSiteId, error) { + parser := resourceids.NewParserFromResourceIdType(&StaticSiteId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := StaticSiteId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *StaticSiteId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + return nil +} + +// ValidateStaticSiteID checks that 'input' can be parsed as a Static Site ID +func ValidateStaticSiteID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseStaticSiteID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Static Site ID +func (id StaticSiteId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Static Site ID +func (id StaticSiteId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + } +} + +// String returns a human-readable description of this Static Site ID +func (id StaticSiteId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Static Site Name: %q", id.StaticSiteName), + } + return fmt.Sprintf("Static Site (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_staticsiteprivateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_staticsiteprivateendpointconnection.go new file mode 100644 index 000000000000..eec1e309f1ef --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_staticsiteprivateendpointconnection.go @@ -0,0 +1,134 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &StaticSitePrivateEndpointConnectionId{} + +// StaticSitePrivateEndpointConnectionId is a struct representing the Resource ID for a Static Site Private Endpoint Connection +type StaticSitePrivateEndpointConnectionId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string + PrivateEndpointConnectionName string +} + +// NewStaticSitePrivateEndpointConnectionID returns a new StaticSitePrivateEndpointConnectionId struct +func NewStaticSitePrivateEndpointConnectionID(subscriptionId string, resourceGroupName string, staticSiteName string, privateEndpointConnectionName string) StaticSitePrivateEndpointConnectionId { + return StaticSitePrivateEndpointConnectionId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + PrivateEndpointConnectionName: privateEndpointConnectionName, + } +} + +// ParseStaticSitePrivateEndpointConnectionID parses 'input' into a StaticSitePrivateEndpointConnectionId +func ParseStaticSitePrivateEndpointConnectionID(input string) (*StaticSitePrivateEndpointConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(&StaticSitePrivateEndpointConnectionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := StaticSitePrivateEndpointConnectionId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseStaticSitePrivateEndpointConnectionIDInsensitively parses 'input' case-insensitively into a StaticSitePrivateEndpointConnectionId +// note: this method should only be used for API response data and not user input +func ParseStaticSitePrivateEndpointConnectionIDInsensitively(input string) (*StaticSitePrivateEndpointConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(&StaticSitePrivateEndpointConnectionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := StaticSitePrivateEndpointConnectionId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *StaticSitePrivateEndpointConnectionId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + if id.PrivateEndpointConnectionName, ok = input.Parsed["privateEndpointConnectionName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "privateEndpointConnectionName", input) + } + + return nil +} + +// ValidateStaticSitePrivateEndpointConnectionID checks that 'input' can be parsed as a Static Site Private Endpoint Connection ID +func ValidateStaticSitePrivateEndpointConnectionID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseStaticSitePrivateEndpointConnectionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Static Site Private Endpoint Connection ID +func (id StaticSitePrivateEndpointConnectionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s/privateEndpointConnections/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName, id.PrivateEndpointConnectionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Static Site Private Endpoint Connection ID +func (id StaticSitePrivateEndpointConnectionId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), + resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionValue"), + } +} + +// String returns a human-readable description of this Static Site Private Endpoint Connection ID +func (id StaticSitePrivateEndpointConnectionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Static Site Name: %q", id.StaticSiteName), + fmt.Sprintf("Private Endpoint Connection Name: %q", id.PrivateEndpointConnectionName), + } + return fmt.Sprintf("Static Site Private Endpoint Connection (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_user.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_user.go new file mode 100644 index 000000000000..255d5817128e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_user.go @@ -0,0 +1,143 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (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{} + +// UserId is a struct representing the Resource ID for a User +type UserId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string + AuthProviderName string + UserName string +} + +// NewUserID returns a new UserId struct +func NewUserID(subscriptionId string, resourceGroupName string, staticSiteName string, authProviderName string, userName string) UserId { + return UserId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + AuthProviderName: authProviderName, + 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.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + if id.AuthProviderName, ok = input.Parsed["authProviderName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "authProviderName", 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.Web/staticSites/%s/authProviders/%s/users/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName, id.AuthProviderName, 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("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + resourceids.StaticSegment("staticAuthProviders", "authProviders", "authProviders"), + resourceids.UserSpecifiedSegment("authProviderName", "authProviderValue"), + 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("Static Site Name: %q", id.StaticSiteName), + fmt.Sprintf("Auth Provider Name: %q", id.AuthProviderName), + fmt.Sprintf("User Name: %q", id.UserName), + } + return fmt.Sprintf("User (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_userprovidedfunctionapp.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_userprovidedfunctionapp.go new file mode 100644 index 000000000000..76926f756530 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_userprovidedfunctionapp.go @@ -0,0 +1,134 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &UserProvidedFunctionAppId{} + +// UserProvidedFunctionAppId is a struct representing the Resource ID for a User Provided Function App +type UserProvidedFunctionAppId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string + UserProvidedFunctionAppName string +} + +// NewUserProvidedFunctionAppID returns a new UserProvidedFunctionAppId struct +func NewUserProvidedFunctionAppID(subscriptionId string, resourceGroupName string, staticSiteName string, userProvidedFunctionAppName string) UserProvidedFunctionAppId { + return UserProvidedFunctionAppId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + UserProvidedFunctionAppName: userProvidedFunctionAppName, + } +} + +// ParseUserProvidedFunctionAppID parses 'input' into a UserProvidedFunctionAppId +func ParseUserProvidedFunctionAppID(input string) (*UserProvidedFunctionAppId, error) { + parser := resourceids.NewParserFromResourceIdType(&UserProvidedFunctionAppId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := UserProvidedFunctionAppId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseUserProvidedFunctionAppIDInsensitively parses 'input' case-insensitively into a UserProvidedFunctionAppId +// note: this method should only be used for API response data and not user input +func ParseUserProvidedFunctionAppIDInsensitively(input string) (*UserProvidedFunctionAppId, error) { + parser := resourceids.NewParserFromResourceIdType(&UserProvidedFunctionAppId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := UserProvidedFunctionAppId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *UserProvidedFunctionAppId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + if id.UserProvidedFunctionAppName, ok = input.Parsed["userProvidedFunctionAppName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "userProvidedFunctionAppName", input) + } + + return nil +} + +// ValidateUserProvidedFunctionAppID checks that 'input' can be parsed as a User Provided Function App ID +func ValidateUserProvidedFunctionAppID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseUserProvidedFunctionAppID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted User Provided Function App ID +func (id UserProvidedFunctionAppId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s/userProvidedFunctionApps/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName, id.UserProvidedFunctionAppName) +} + +// Segments returns a slice of Resource ID Segments which comprise this User Provided Function App ID +func (id UserProvidedFunctionAppId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + resourceids.StaticSegment("staticUserProvidedFunctionApps", "userProvidedFunctionApps", "userProvidedFunctionApps"), + resourceids.UserSpecifiedSegment("userProvidedFunctionAppName", "userProvidedFunctionAppValue"), + } +} + +// String returns a human-readable description of this User Provided Function App ID +func (id UserProvidedFunctionAppId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Static Site Name: %q", id.StaticSiteName), + fmt.Sprintf("User Provided Function App Name: %q", id.UserProvidedFunctionAppName), + } + return fmt.Sprintf("User Provided Function App (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_approveorrejectprivateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_approveorrejectprivateendpointconnection.go new file mode 100644 index 000000000000..b07e76844115 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_approveorrejectprivateendpointconnection.go @@ -0,0 +1,75 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApproveOrRejectPrivateEndpointConnectionOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *RemotePrivateEndpointConnectionARMResource +} + +// ApproveOrRejectPrivateEndpointConnection ... +func (c StaticSitesClient) ApproveOrRejectPrivateEndpointConnection(ctx context.Context, id StaticSitePrivateEndpointConnectionId, input RemotePrivateEndpointConnectionARMResource) (result ApproveOrRejectPrivateEndpointConnectionOperationResponse, 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 +} + +// ApproveOrRejectPrivateEndpointConnectionThenPoll performs ApproveOrRejectPrivateEndpointConnection then polls until it's completed +func (c StaticSitesClient) ApproveOrRejectPrivateEndpointConnectionThenPoll(ctx context.Context, id StaticSitePrivateEndpointConnectionId, input RemotePrivateEndpointConnectionARMResource) error { + result, err := c.ApproveOrRejectPrivateEndpointConnection(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ApproveOrRejectPrivateEndpointConnection: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ApproveOrRejectPrivateEndpointConnection: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatebasicauth.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatebasicauth.go new file mode 100644 index 000000000000..5250db7e942d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatebasicauth.go @@ -0,0 +1,56 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateBasicAuthOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteBasicAuthPropertiesARMResource +} + +// CreateOrUpdateBasicAuth ... +func (c StaticSitesClient) CreateOrUpdateBasicAuth(ctx context.Context, id StaticSiteId, input StaticSiteBasicAuthPropertiesARMResource) (result CreateOrUpdateBasicAuthOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/basicAuth/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 + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatebuilddatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatebuilddatabaseconnection.go new file mode 100644 index 000000000000..c58864f04823 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatebuilddatabaseconnection.go @@ -0,0 +1,55 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateBuildDatabaseConnectionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DatabaseConnection +} + +// CreateOrUpdateBuildDatabaseConnection ... +func (c StaticSitesClient) CreateOrUpdateBuildDatabaseConnection(ctx context.Context, id BuildDatabaseConnectionId, input DatabaseConnection) (result CreateOrUpdateBuildDatabaseConnectionOperationResponse, 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 + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatedatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatedatabaseconnection.go new file mode 100644 index 000000000000..062b82975e2b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatedatabaseconnection.go @@ -0,0 +1,55 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateDatabaseConnectionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DatabaseConnection +} + +// CreateOrUpdateDatabaseConnection ... +func (c StaticSitesClient) CreateOrUpdateDatabaseConnection(ctx context.Context, id DatabaseConnectionId, input DatabaseConnection) (result CreateOrUpdateDatabaseConnectionOperationResponse, 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 + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsite.go new file mode 100644 index 000000000000..15bec3068239 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsite.go @@ -0,0 +1,75 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateStaticSiteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteARMResource +} + +// CreateOrUpdateStaticSite ... +func (c StaticSitesClient) CreateOrUpdateStaticSite(ctx context.Context, id StaticSiteId, input StaticSiteARMResource) (result CreateOrUpdateStaticSiteOperationResponse, 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 +} + +// CreateOrUpdateStaticSiteThenPoll performs CreateOrUpdateStaticSite then polls until it's completed +func (c StaticSitesClient) CreateOrUpdateStaticSiteThenPoll(ctx context.Context, id StaticSiteId, input StaticSiteARMResource) error { + result, err := c.CreateOrUpdateStaticSite(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdateStaticSite: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdateStaticSite: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsiteappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsiteappsettings.go new file mode 100644 index 000000000000..c4158a404d32 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsiteappsettings.go @@ -0,0 +1,56 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateStaticSiteAppSettingsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StringDictionary +} + +// CreateOrUpdateStaticSiteAppSettings ... +func (c StaticSitesClient) CreateOrUpdateStaticSiteAppSettings(ctx context.Context, id StaticSiteId, input StringDictionary) (result CreateOrUpdateStaticSiteAppSettingsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/config/appSettings", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitebuildappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitebuildappsettings.go new file mode 100644 index 000000000000..12aec03f6717 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitebuildappsettings.go @@ -0,0 +1,56 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateStaticSiteBuildAppSettingsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StringDictionary +} + +// CreateOrUpdateStaticSiteBuildAppSettings ... +func (c StaticSitesClient) CreateOrUpdateStaticSiteBuildAppSettings(ctx context.Context, id BuildId, input StringDictionary) (result CreateOrUpdateStaticSiteBuildAppSettingsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/config/appSettings", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitebuildfunctionappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitebuildfunctionappsettings.go new file mode 100644 index 000000000000..171c8ebf756f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitebuildfunctionappsettings.go @@ -0,0 +1,56 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateStaticSiteBuildFunctionAppSettingsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StringDictionary +} + +// CreateOrUpdateStaticSiteBuildFunctionAppSettings ... +func (c StaticSitesClient) CreateOrUpdateStaticSiteBuildFunctionAppSettings(ctx context.Context, id BuildId, input StringDictionary) (result CreateOrUpdateStaticSiteBuildFunctionAppSettingsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/config/functionAppSettings", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitecustomdomain.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitecustomdomain.go new file mode 100644 index 000000000000..77c06560af1f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitecustomdomain.go @@ -0,0 +1,75 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateStaticSiteCustomDomainOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteCustomDomainOverviewARMResource +} + +// CreateOrUpdateStaticSiteCustomDomain ... +func (c StaticSitesClient) CreateOrUpdateStaticSiteCustomDomain(ctx context.Context, id CustomDomainId, input StaticSiteCustomDomainRequestPropertiesARMResource) (result CreateOrUpdateStaticSiteCustomDomainOperationResponse, 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 +} + +// CreateOrUpdateStaticSiteCustomDomainThenPoll performs CreateOrUpdateStaticSiteCustomDomain then polls until it's completed +func (c StaticSitesClient) CreateOrUpdateStaticSiteCustomDomainThenPoll(ctx context.Context, id CustomDomainId, input StaticSiteCustomDomainRequestPropertiesARMResource) error { + result, err := c.CreateOrUpdateStaticSiteCustomDomain(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdateStaticSiteCustomDomain: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdateStaticSiteCustomDomain: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitefunctionappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitefunctionappsettings.go new file mode 100644 index 000000000000..9db7d09fe068 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitefunctionappsettings.go @@ -0,0 +1,56 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateStaticSiteFunctionAppSettingsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StringDictionary +} + +// CreateOrUpdateStaticSiteFunctionAppSettings ... +func (c StaticSitesClient) CreateOrUpdateStaticSiteFunctionAppSettings(ctx context.Context, id StaticSiteId, input StringDictionary) (result CreateOrUpdateStaticSiteFunctionAppSettingsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/config/functionAppSettings", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createuserrolesinvitationlink.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createuserrolesinvitationlink.go new file mode 100644 index 000000000000..2bd65d0c1c23 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createuserrolesinvitationlink.go @@ -0,0 +1,56 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateUserRolesInvitationLinkOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteUserInvitationResponseResource +} + +// CreateUserRolesInvitationLink ... +func (c StaticSitesClient) CreateUserRolesInvitationLink(ctx context.Context, id StaticSiteId, input StaticSiteUserInvitationRequestResource) (result CreateUserRolesInvitationLinkOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/createUserInvitation", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createzipdeploymentforstaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createzipdeploymentforstaticsite.go new file mode 100644 index 000000000000..6dddfe32eadc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createzipdeploymentforstaticsite.go @@ -0,0 +1,74 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateZipDeploymentForStaticSiteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// CreateZipDeploymentForStaticSite ... +func (c StaticSitesClient) CreateZipDeploymentForStaticSite(ctx context.Context, id StaticSiteId, input StaticSiteZipDeploymentARMResource) (result CreateZipDeploymentForStaticSiteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/zipdeploy", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateZipDeploymentForStaticSiteThenPoll performs CreateZipDeploymentForStaticSite then polls until it's completed +func (c StaticSitesClient) CreateZipDeploymentForStaticSiteThenPoll(ctx context.Context, id StaticSiteId, input StaticSiteZipDeploymentARMResource) error { + result, err := c.CreateZipDeploymentForStaticSite(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateZipDeploymentForStaticSite: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateZipDeploymentForStaticSite: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createzipdeploymentforstaticsitebuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createzipdeploymentforstaticsitebuild.go new file mode 100644 index 000000000000..4b1ac38f9e91 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createzipdeploymentforstaticsitebuild.go @@ -0,0 +1,74 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateZipDeploymentForStaticSiteBuildOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// CreateZipDeploymentForStaticSiteBuild ... +func (c StaticSitesClient) CreateZipDeploymentForStaticSiteBuild(ctx context.Context, id BuildId, input StaticSiteZipDeploymentARMResource) (result CreateZipDeploymentForStaticSiteBuildOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/zipdeploy", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateZipDeploymentForStaticSiteBuildThenPoll performs CreateZipDeploymentForStaticSiteBuild then polls until it's completed +func (c StaticSitesClient) CreateZipDeploymentForStaticSiteBuildThenPoll(ctx context.Context, id BuildId, input StaticSiteZipDeploymentARMResource) error { + result, err := c.CreateZipDeploymentForStaticSiteBuild(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateZipDeploymentForStaticSiteBuild: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateZipDeploymentForStaticSiteBuild: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletebuilddatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletebuilddatabaseconnection.go new file mode 100644 index 000000000000..5a80028d137a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletebuilddatabaseconnection.go @@ -0,0 +1,47 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteBuildDatabaseConnectionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +// DeleteBuildDatabaseConnection ... +func (c StaticSitesClient) DeleteBuildDatabaseConnection(ctx context.Context, id BuildDatabaseConnectionId) (result DeleteBuildDatabaseConnectionOperationResponse, 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/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletedatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletedatabaseconnection.go new file mode 100644 index 000000000000..7f0d6cc94aa9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletedatabaseconnection.go @@ -0,0 +1,47 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteDatabaseConnectionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +// DeleteDatabaseConnection ... +func (c StaticSitesClient) DeleteDatabaseConnection(ctx context.Context, id DatabaseConnectionId) (result DeleteDatabaseConnectionOperationResponse, 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/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deleteprivateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deleteprivateendpointconnection.go new file mode 100644 index 000000000000..d632f3899b4b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deleteprivateendpointconnection.go @@ -0,0 +1,72 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/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 + Model *interface{} +} + +// DeletePrivateEndpointConnection ... +func (c StaticSitesClient) DeletePrivateEndpointConnection(ctx context.Context, id StaticSitePrivateEndpointConnectionId) (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 StaticSitesClient) DeletePrivateEndpointConnectionThenPoll(ctx context.Context, id StaticSitePrivateEndpointConnectionId) 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/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsite.go new file mode 100644 index 000000000000..78d3bd0abf4e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsite.go @@ -0,0 +1,70 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteStaticSiteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// DeleteStaticSite ... +func (c StaticSitesClient) DeleteStaticSite(ctx context.Context, id StaticSiteId) (result DeleteStaticSiteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteStaticSiteThenPoll performs DeleteStaticSite then polls until it's completed +func (c StaticSitesClient) DeleteStaticSiteThenPoll(ctx context.Context, id StaticSiteId) error { + result, err := c.DeleteStaticSite(ctx, id) + if err != nil { + return fmt.Errorf("performing DeleteStaticSite: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after DeleteStaticSite: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsitebuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsitebuild.go new file mode 100644 index 000000000000..a3fdbf849005 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsitebuild.go @@ -0,0 +1,71 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteStaticSiteBuildOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// DeleteStaticSiteBuild ... +func (c StaticSitesClient) DeleteStaticSiteBuild(ctx context.Context, id BuildId) (result DeleteStaticSiteBuildOperationResponse, 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 +} + +// DeleteStaticSiteBuildThenPoll performs DeleteStaticSiteBuild then polls until it's completed +func (c StaticSitesClient) DeleteStaticSiteBuildThenPoll(ctx context.Context, id BuildId) error { + result, err := c.DeleteStaticSiteBuild(ctx, id) + if err != nil { + return fmt.Errorf("performing DeleteStaticSiteBuild: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after DeleteStaticSiteBuild: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsitecustomdomain.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsitecustomdomain.go new file mode 100644 index 000000000000..471bf713f5df --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsitecustomdomain.go @@ -0,0 +1,70 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteStaticSiteCustomDomainOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// DeleteStaticSiteCustomDomain ... +func (c StaticSitesClient) DeleteStaticSiteCustomDomain(ctx context.Context, id CustomDomainId) (result DeleteStaticSiteCustomDomainOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteStaticSiteCustomDomainThenPoll performs DeleteStaticSiteCustomDomain then polls until it's completed +func (c StaticSitesClient) DeleteStaticSiteCustomDomainThenPoll(ctx context.Context, id CustomDomainId) error { + result, err := c.DeleteStaticSiteCustomDomain(ctx, id) + if err != nil { + return fmt.Errorf("performing DeleteStaticSiteCustomDomain: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after DeleteStaticSiteCustomDomain: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsiteuser.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsiteuser.go new file mode 100644 index 000000000000..e4799c87ddbe --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsiteuser.go @@ -0,0 +1,46 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteStaticSiteUserOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +// DeleteStaticSiteUser ... +func (c StaticSitesClient) DeleteStaticSiteUser(ctx context.Context, id UserId) (result DeleteStaticSiteUserOperationResponse, 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/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_detachstaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_detachstaticsite.go new file mode 100644 index 000000000000..00fa4ac9dd0c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_detachstaticsite.go @@ -0,0 +1,70 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DetachStaticSiteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// DetachStaticSite ... +func (c StaticSitesClient) DetachStaticSite(ctx context.Context, id StaticSiteId) (result DetachStaticSiteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/detach", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DetachStaticSiteThenPoll performs DetachStaticSite then polls until it's completed +func (c StaticSitesClient) DetachStaticSiteThenPoll(ctx context.Context, id StaticSiteId) error { + result, err := c.DetachStaticSite(ctx, id) + if err != nil { + return fmt.Errorf("performing DetachStaticSite: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after DetachStaticSite: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_detachuserprovidedfunctionappfromstaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_detachuserprovidedfunctionappfromstaticsite.go new file mode 100644 index 000000000000..b9a68ba826dc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_detachuserprovidedfunctionappfromstaticsite.go @@ -0,0 +1,47 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DetachUserProvidedFunctionAppFromStaticSiteOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +// DetachUserProvidedFunctionAppFromStaticSite ... +func (c StaticSitesClient) DetachUserProvidedFunctionAppFromStaticSite(ctx context.Context, id UserProvidedFunctionAppId) (result DetachUserProvidedFunctionAppFromStaticSiteOperationResponse, 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/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_detachuserprovidedfunctionappfromstaticsitebuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_detachuserprovidedfunctionappfromstaticsitebuild.go new file mode 100644 index 000000000000..305f4802b1d1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_detachuserprovidedfunctionappfromstaticsitebuild.go @@ -0,0 +1,47 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DetachUserProvidedFunctionAppFromStaticSiteBuildOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +// DetachUserProvidedFunctionAppFromStaticSiteBuild ... +func (c StaticSitesClient) DetachUserProvidedFunctionAppFromStaticSiteBuild(ctx context.Context, id BuildUserProvidedFunctionAppId) (result DetachUserProvidedFunctionAppFromStaticSiteBuildOperationResponse, 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/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbasicauth.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbasicauth.go new file mode 100644 index 000000000000..0aa227882779 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbasicauth.go @@ -0,0 +1,52 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetBasicAuthOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteBasicAuthPropertiesARMResource +} + +// GetBasicAuth ... +func (c StaticSitesClient) GetBasicAuth(ctx context.Context, id StaticSiteId) (result GetBasicAuthOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/basicAuth/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 + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnection.go new file mode 100644 index 000000000000..cbdb12bc4ed8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnection.go @@ -0,0 +1,51 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetBuildDatabaseConnectionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DatabaseConnection +} + +// GetBuildDatabaseConnection ... +func (c StaticSitesClient) GetBuildDatabaseConnection(ctx context.Context, id BuildDatabaseConnectionId) (result GetBuildDatabaseConnectionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnections.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnections.go new file mode 100644 index 000000000000..044bfd57fbcd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnections.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetBuildDatabaseConnectionsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]DatabaseConnection +} + +type GetBuildDatabaseConnectionsCompleteResult struct { + LatestHttpResponse *http.Response + Items []DatabaseConnection +} + +// GetBuildDatabaseConnections ... +func (c StaticSitesClient) GetBuildDatabaseConnections(ctx context.Context, id BuildId) (result GetBuildDatabaseConnectionsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/databaseConnections", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]DatabaseConnection `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// GetBuildDatabaseConnectionsComplete retrieves all the results into a single object +func (c StaticSitesClient) GetBuildDatabaseConnectionsComplete(ctx context.Context, id BuildId) (GetBuildDatabaseConnectionsCompleteResult, error) { + return c.GetBuildDatabaseConnectionsCompleteMatchingPredicate(ctx, id, DatabaseConnectionOperationPredicate{}) +} + +// GetBuildDatabaseConnectionsCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) GetBuildDatabaseConnectionsCompleteMatchingPredicate(ctx context.Context, id BuildId, predicate DatabaseConnectionOperationPredicate) (result GetBuildDatabaseConnectionsCompleteResult, err error) { + items := make([]DatabaseConnection, 0) + + resp, err := c.GetBuildDatabaseConnections(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = GetBuildDatabaseConnectionsCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnectionswithdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnectionswithdetails.go new file mode 100644 index 000000000000..a32b0d4ac41f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnectionswithdetails.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetBuildDatabaseConnectionsWithDetailsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]DatabaseConnection +} + +type GetBuildDatabaseConnectionsWithDetailsCompleteResult struct { + LatestHttpResponse *http.Response + Items []DatabaseConnection +} + +// GetBuildDatabaseConnectionsWithDetails ... +func (c StaticSitesClient) GetBuildDatabaseConnectionsWithDetails(ctx context.Context, id BuildId) (result GetBuildDatabaseConnectionsWithDetailsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/showDatabaseConnections", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]DatabaseConnection `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// GetBuildDatabaseConnectionsWithDetailsComplete retrieves all the results into a single object +func (c StaticSitesClient) GetBuildDatabaseConnectionsWithDetailsComplete(ctx context.Context, id BuildId) (GetBuildDatabaseConnectionsWithDetailsCompleteResult, error) { + return c.GetBuildDatabaseConnectionsWithDetailsCompleteMatchingPredicate(ctx, id, DatabaseConnectionOperationPredicate{}) +} + +// GetBuildDatabaseConnectionsWithDetailsCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) GetBuildDatabaseConnectionsWithDetailsCompleteMatchingPredicate(ctx context.Context, id BuildId, predicate DatabaseConnectionOperationPredicate) (result GetBuildDatabaseConnectionsWithDetailsCompleteResult, err error) { + items := make([]DatabaseConnection, 0) + + resp, err := c.GetBuildDatabaseConnectionsWithDetails(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = GetBuildDatabaseConnectionsWithDetailsCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnectionwithdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnectionwithdetails.go new file mode 100644 index 000000000000..1b44f14a1bf6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnectionwithdetails.go @@ -0,0 +1,52 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetBuildDatabaseConnectionWithDetailsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DatabaseConnection +} + +// GetBuildDatabaseConnectionWithDetails ... +func (c StaticSitesClient) GetBuildDatabaseConnectionWithDetails(ctx context.Context, id BuildDatabaseConnectionId) (result GetBuildDatabaseConnectionWithDetailsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/show", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnection.go new file mode 100644 index 000000000000..092b297bd106 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnection.go @@ -0,0 +1,51 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetDatabaseConnectionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DatabaseConnection +} + +// GetDatabaseConnection ... +func (c StaticSitesClient) GetDatabaseConnection(ctx context.Context, id DatabaseConnectionId) (result GetDatabaseConnectionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnections.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnections.go new file mode 100644 index 000000000000..3f413b9475b8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnections.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetDatabaseConnectionsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]DatabaseConnection +} + +type GetDatabaseConnectionsCompleteResult struct { + LatestHttpResponse *http.Response + Items []DatabaseConnection +} + +// GetDatabaseConnections ... +func (c StaticSitesClient) GetDatabaseConnections(ctx context.Context, id StaticSiteId) (result GetDatabaseConnectionsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/databaseConnections", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]DatabaseConnection `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// GetDatabaseConnectionsComplete retrieves all the results into a single object +func (c StaticSitesClient) GetDatabaseConnectionsComplete(ctx context.Context, id StaticSiteId) (GetDatabaseConnectionsCompleteResult, error) { + return c.GetDatabaseConnectionsCompleteMatchingPredicate(ctx, id, DatabaseConnectionOperationPredicate{}) +} + +// GetDatabaseConnectionsCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) GetDatabaseConnectionsCompleteMatchingPredicate(ctx context.Context, id StaticSiteId, predicate DatabaseConnectionOperationPredicate) (result GetDatabaseConnectionsCompleteResult, err error) { + items := make([]DatabaseConnection, 0) + + resp, err := c.GetDatabaseConnections(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = GetDatabaseConnectionsCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnectionswithdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnectionswithdetails.go new file mode 100644 index 000000000000..4c1fb498cae0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnectionswithdetails.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetDatabaseConnectionsWithDetailsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]DatabaseConnection +} + +type GetDatabaseConnectionsWithDetailsCompleteResult struct { + LatestHttpResponse *http.Response + Items []DatabaseConnection +} + +// GetDatabaseConnectionsWithDetails ... +func (c StaticSitesClient) GetDatabaseConnectionsWithDetails(ctx context.Context, id StaticSiteId) (result GetDatabaseConnectionsWithDetailsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/showDatabaseConnections", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]DatabaseConnection `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// GetDatabaseConnectionsWithDetailsComplete retrieves all the results into a single object +func (c StaticSitesClient) GetDatabaseConnectionsWithDetailsComplete(ctx context.Context, id StaticSiteId) (GetDatabaseConnectionsWithDetailsCompleteResult, error) { + return c.GetDatabaseConnectionsWithDetailsCompleteMatchingPredicate(ctx, id, DatabaseConnectionOperationPredicate{}) +} + +// GetDatabaseConnectionsWithDetailsCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) GetDatabaseConnectionsWithDetailsCompleteMatchingPredicate(ctx context.Context, id StaticSiteId, predicate DatabaseConnectionOperationPredicate) (result GetDatabaseConnectionsWithDetailsCompleteResult, err error) { + items := make([]DatabaseConnection, 0) + + resp, err := c.GetDatabaseConnectionsWithDetails(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = GetDatabaseConnectionsWithDetailsCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnectionwithdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnectionwithdetails.go new file mode 100644 index 000000000000..6a040448b47a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnectionwithdetails.go @@ -0,0 +1,52 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetDatabaseConnectionWithDetailsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DatabaseConnection +} + +// GetDatabaseConnectionWithDetails ... +func (c StaticSitesClient) GetDatabaseConnectionWithDetails(ctx context.Context, id DatabaseConnectionId) (result GetDatabaseConnectionWithDetailsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/show", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackend.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackend.go new file mode 100644 index 000000000000..efb97469398a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackend.go @@ -0,0 +1,51 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetLinkedBackendOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteLinkedBackendARMResource +} + +// GetLinkedBackend ... +func (c StaticSitesClient) GetLinkedBackend(ctx context.Context, id LinkedBackendId) (result GetLinkedBackendOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackendforbuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackendforbuild.go new file mode 100644 index 000000000000..1a8882ba8a0a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackendforbuild.go @@ -0,0 +1,51 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetLinkedBackendForBuildOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteLinkedBackendARMResource +} + +// GetLinkedBackendForBuild ... +func (c StaticSitesClient) GetLinkedBackendForBuild(ctx context.Context, id BuildLinkedBackendId) (result GetLinkedBackendForBuildOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackends.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackends.go new file mode 100644 index 000000000000..a9117d962ae8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackends.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetLinkedBackendsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteLinkedBackendARMResource +} + +type GetLinkedBackendsCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteLinkedBackendARMResource +} + +// GetLinkedBackends ... +func (c StaticSitesClient) GetLinkedBackends(ctx context.Context, id StaticSiteId) (result GetLinkedBackendsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/linkedBackends", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteLinkedBackendARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// GetLinkedBackendsComplete retrieves all the results into a single object +func (c StaticSitesClient) GetLinkedBackendsComplete(ctx context.Context, id StaticSiteId) (GetLinkedBackendsCompleteResult, error) { + return c.GetLinkedBackendsCompleteMatchingPredicate(ctx, id, StaticSiteLinkedBackendARMResourceOperationPredicate{}) +} + +// GetLinkedBackendsCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) GetLinkedBackendsCompleteMatchingPredicate(ctx context.Context, id StaticSiteId, predicate StaticSiteLinkedBackendARMResourceOperationPredicate) (result GetLinkedBackendsCompleteResult, err error) { + items := make([]StaticSiteLinkedBackendARMResource, 0) + + resp, err := c.GetLinkedBackends(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = GetLinkedBackendsCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackendsforbuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackendsforbuild.go new file mode 100644 index 000000000000..a9c90637d14a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackendsforbuild.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetLinkedBackendsForBuildOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteLinkedBackendARMResource +} + +type GetLinkedBackendsForBuildCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteLinkedBackendARMResource +} + +// GetLinkedBackendsForBuild ... +func (c StaticSitesClient) GetLinkedBackendsForBuild(ctx context.Context, id BuildId) (result GetLinkedBackendsForBuildOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/linkedBackends", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteLinkedBackendARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// GetLinkedBackendsForBuildComplete retrieves all the results into a single object +func (c StaticSitesClient) GetLinkedBackendsForBuildComplete(ctx context.Context, id BuildId) (GetLinkedBackendsForBuildCompleteResult, error) { + return c.GetLinkedBackendsForBuildCompleteMatchingPredicate(ctx, id, StaticSiteLinkedBackendARMResourceOperationPredicate{}) +} + +// GetLinkedBackendsForBuildCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) GetLinkedBackendsForBuildCompleteMatchingPredicate(ctx context.Context, id BuildId, predicate StaticSiteLinkedBackendARMResourceOperationPredicate) (result GetLinkedBackendsForBuildCompleteResult, err error) { + items := make([]StaticSiteLinkedBackendARMResource, 0) + + resp, err := c.GetLinkedBackendsForBuild(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = GetLinkedBackendsForBuildCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivateendpointconnection.go new file mode 100644 index 000000000000..d7113546236e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivateendpointconnection.go @@ -0,0 +1,51 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/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 *RemotePrivateEndpointConnectionARMResource +} + +// GetPrivateEndpointConnection ... +func (c StaticSitesClient) GetPrivateEndpointConnection(ctx context.Context, id StaticSitePrivateEndpointConnectionId) (result GetPrivateEndpointConnectionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivateendpointconnectionlist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivateendpointconnectionlist.go new file mode 100644 index 000000000000..b5a681796cd4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivateendpointconnectionlist.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetPrivateEndpointConnectionListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]RemotePrivateEndpointConnectionARMResource +} + +type GetPrivateEndpointConnectionListCompleteResult struct { + LatestHttpResponse *http.Response + Items []RemotePrivateEndpointConnectionARMResource +} + +// GetPrivateEndpointConnectionList ... +func (c StaticSitesClient) GetPrivateEndpointConnectionList(ctx context.Context, id StaticSiteId) (result GetPrivateEndpointConnectionListOperationResponse, 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 *[]RemotePrivateEndpointConnectionARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// GetPrivateEndpointConnectionListComplete retrieves all the results into a single object +func (c StaticSitesClient) GetPrivateEndpointConnectionListComplete(ctx context.Context, id StaticSiteId) (GetPrivateEndpointConnectionListCompleteResult, error) { + return c.GetPrivateEndpointConnectionListCompleteMatchingPredicate(ctx, id, RemotePrivateEndpointConnectionARMResourceOperationPredicate{}) +} + +// GetPrivateEndpointConnectionListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) GetPrivateEndpointConnectionListCompleteMatchingPredicate(ctx context.Context, id StaticSiteId, predicate RemotePrivateEndpointConnectionARMResourceOperationPredicate) (result GetPrivateEndpointConnectionListCompleteResult, err error) { + items := make([]RemotePrivateEndpointConnectionARMResource, 0) + + resp, err := c.GetPrivateEndpointConnectionList(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = GetPrivateEndpointConnectionListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivatelinkresources.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivatelinkresources.go new file mode 100644 index 000000000000..f522c045d496 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivatelinkresources.go @@ -0,0 +1,52 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetPrivateLinkResourcesOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *PrivateLinkResourcesWrapper +} + +// GetPrivateLinkResources ... +func (c StaticSitesClient) GetPrivateLinkResources(ctx context.Context, id StaticSiteId) (result GetPrivateLinkResourcesOperationResponse, 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 + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsite.go new file mode 100644 index 000000000000..d2ace41c4540 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsite.go @@ -0,0 +1,51 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetStaticSiteOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteARMResource +} + +// GetStaticSite ... +func (c StaticSitesClient) GetStaticSite(ctx context.Context, id StaticSiteId) (result GetStaticSiteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitebuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitebuild.go new file mode 100644 index 000000000000..01ad9e56fc5e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitebuild.go @@ -0,0 +1,51 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetStaticSiteBuildOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteBuildARMResource +} + +// GetStaticSiteBuild ... +func (c StaticSitesClient) GetStaticSiteBuild(ctx context.Context, id BuildId) (result GetStaticSiteBuildOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitebuilds.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitebuilds.go new file mode 100644 index 000000000000..35a0a1c37e05 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitebuilds.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetStaticSiteBuildsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteBuildARMResource +} + +type GetStaticSiteBuildsCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteBuildARMResource +} + +// GetStaticSiteBuilds ... +func (c StaticSitesClient) GetStaticSiteBuilds(ctx context.Context, id StaticSiteId) (result GetStaticSiteBuildsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/builds", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteBuildARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// GetStaticSiteBuildsComplete retrieves all the results into a single object +func (c StaticSitesClient) GetStaticSiteBuildsComplete(ctx context.Context, id StaticSiteId) (GetStaticSiteBuildsCompleteResult, error) { + return c.GetStaticSiteBuildsCompleteMatchingPredicate(ctx, id, StaticSiteBuildARMResourceOperationPredicate{}) +} + +// GetStaticSiteBuildsCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) GetStaticSiteBuildsCompleteMatchingPredicate(ctx context.Context, id StaticSiteId, predicate StaticSiteBuildARMResourceOperationPredicate) (result GetStaticSiteBuildsCompleteResult, err error) { + items := make([]StaticSiteBuildARMResource, 0) + + resp, err := c.GetStaticSiteBuilds(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = GetStaticSiteBuildsCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitecustomdomain.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitecustomdomain.go new file mode 100644 index 000000000000..f57e327a864c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitecustomdomain.go @@ -0,0 +1,51 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetStaticSiteCustomDomainOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteCustomDomainOverviewARMResource +} + +// GetStaticSiteCustomDomain ... +func (c StaticSitesClient) GetStaticSiteCustomDomain(ctx context.Context, id CustomDomainId) (result GetStaticSiteCustomDomainOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitesbyresourcegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitesbyresourcegroup.go new file mode 100644 index 000000000000..f5a6e73a93a2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitesbyresourcegroup.go @@ -0,0 +1,92 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetStaticSitesByResourceGroupOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteARMResource +} + +type GetStaticSitesByResourceGroupCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteARMResource +} + +// GetStaticSitesByResourceGroup ... +func (c StaticSitesClient) GetStaticSitesByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result GetStaticSitesByResourceGroupOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.Web/staticSites", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// GetStaticSitesByResourceGroupComplete retrieves all the results into a single object +func (c StaticSitesClient) GetStaticSitesByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (GetStaticSitesByResourceGroupCompleteResult, error) { + return c.GetStaticSitesByResourceGroupCompleteMatchingPredicate(ctx, id, StaticSiteARMResourceOperationPredicate{}) +} + +// GetStaticSitesByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) GetStaticSitesByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate StaticSiteARMResourceOperationPredicate) (result GetStaticSitesByResourceGroupCompleteResult, err error) { + items := make([]StaticSiteARMResource, 0) + + resp, err := c.GetStaticSitesByResourceGroup(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = GetStaticSitesByResourceGroupCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappforstaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappforstaticsite.go new file mode 100644 index 000000000000..34c7b10edcec --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappforstaticsite.go @@ -0,0 +1,51 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserProvidedFunctionAppForStaticSiteOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteUserProvidedFunctionAppARMResource +} + +// GetUserProvidedFunctionAppForStaticSite ... +func (c StaticSitesClient) GetUserProvidedFunctionAppForStaticSite(ctx context.Context, id UserProvidedFunctionAppId) (result GetUserProvidedFunctionAppForStaticSiteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappforstaticsitebuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappforstaticsitebuild.go new file mode 100644 index 000000000000..fe3ce92b2acb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappforstaticsitebuild.go @@ -0,0 +1,51 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserProvidedFunctionAppForStaticSiteBuildOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteUserProvidedFunctionAppARMResource +} + +// GetUserProvidedFunctionAppForStaticSiteBuild ... +func (c StaticSitesClient) GetUserProvidedFunctionAppForStaticSiteBuild(ctx context.Context, id BuildUserProvidedFunctionAppId) (result GetUserProvidedFunctionAppForStaticSiteBuildOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappsforstaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappsforstaticsite.go new file mode 100644 index 000000000000..23d1ee2ba485 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappsforstaticsite.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserProvidedFunctionAppsForStaticSiteOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteUserProvidedFunctionAppARMResource +} + +type GetUserProvidedFunctionAppsForStaticSiteCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteUserProvidedFunctionAppARMResource +} + +// GetUserProvidedFunctionAppsForStaticSite ... +func (c StaticSitesClient) GetUserProvidedFunctionAppsForStaticSite(ctx context.Context, id StaticSiteId) (result GetUserProvidedFunctionAppsForStaticSiteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/userProvidedFunctionApps", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteUserProvidedFunctionAppARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// GetUserProvidedFunctionAppsForStaticSiteComplete retrieves all the results into a single object +func (c StaticSitesClient) GetUserProvidedFunctionAppsForStaticSiteComplete(ctx context.Context, id StaticSiteId) (GetUserProvidedFunctionAppsForStaticSiteCompleteResult, error) { + return c.GetUserProvidedFunctionAppsForStaticSiteCompleteMatchingPredicate(ctx, id, StaticSiteUserProvidedFunctionAppARMResourceOperationPredicate{}) +} + +// GetUserProvidedFunctionAppsForStaticSiteCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) GetUserProvidedFunctionAppsForStaticSiteCompleteMatchingPredicate(ctx context.Context, id StaticSiteId, predicate StaticSiteUserProvidedFunctionAppARMResourceOperationPredicate) (result GetUserProvidedFunctionAppsForStaticSiteCompleteResult, err error) { + items := make([]StaticSiteUserProvidedFunctionAppARMResource, 0) + + resp, err := c.GetUserProvidedFunctionAppsForStaticSite(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = GetUserProvidedFunctionAppsForStaticSiteCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappsforstaticsitebuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappsforstaticsitebuild.go new file mode 100644 index 000000000000..2e45fd82f95b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappsforstaticsitebuild.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserProvidedFunctionAppsForStaticSiteBuildOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteUserProvidedFunctionAppARMResource +} + +type GetUserProvidedFunctionAppsForStaticSiteBuildCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteUserProvidedFunctionAppARMResource +} + +// GetUserProvidedFunctionAppsForStaticSiteBuild ... +func (c StaticSitesClient) GetUserProvidedFunctionAppsForStaticSiteBuild(ctx context.Context, id BuildId) (result GetUserProvidedFunctionAppsForStaticSiteBuildOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/userProvidedFunctionApps", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteUserProvidedFunctionAppARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// GetUserProvidedFunctionAppsForStaticSiteBuildComplete retrieves all the results into a single object +func (c StaticSitesClient) GetUserProvidedFunctionAppsForStaticSiteBuildComplete(ctx context.Context, id BuildId) (GetUserProvidedFunctionAppsForStaticSiteBuildCompleteResult, error) { + return c.GetUserProvidedFunctionAppsForStaticSiteBuildCompleteMatchingPredicate(ctx, id, StaticSiteUserProvidedFunctionAppARMResourceOperationPredicate{}) +} + +// GetUserProvidedFunctionAppsForStaticSiteBuildCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) GetUserProvidedFunctionAppsForStaticSiteBuildCompleteMatchingPredicate(ctx context.Context, id BuildId, predicate StaticSiteUserProvidedFunctionAppARMResourceOperationPredicate) (result GetUserProvidedFunctionAppsForStaticSiteBuildCompleteResult, err error) { + items := make([]StaticSiteUserProvidedFunctionAppARMResource, 0) + + resp, err := c.GetUserProvidedFunctionAppsForStaticSiteBuild(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = GetUserProvidedFunctionAppsForStaticSiteBuildCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_linkbackend.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_linkbackend.go new file mode 100644 index 000000000000..a36f96d86fad --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_linkbackend.go @@ -0,0 +1,74 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LinkBackendOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteLinkedBackendARMResource +} + +// LinkBackend ... +func (c StaticSitesClient) LinkBackend(ctx context.Context, id LinkedBackendId, input StaticSiteLinkedBackendARMResource) (result LinkBackendOperationResponse, 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 +} + +// LinkBackendThenPoll performs LinkBackend then polls until it's completed +func (c StaticSitesClient) LinkBackendThenPoll(ctx context.Context, id LinkedBackendId, input StaticSiteLinkedBackendARMResource) error { + result, err := c.LinkBackend(ctx, id, input) + if err != nil { + return fmt.Errorf("performing LinkBackend: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after LinkBackend: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_linkbackendtobuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_linkbackendtobuild.go new file mode 100644 index 000000000000..5e1875714932 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_linkbackendtobuild.go @@ -0,0 +1,74 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LinkBackendToBuildOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteLinkedBackendARMResource +} + +// LinkBackendToBuild ... +func (c StaticSitesClient) LinkBackendToBuild(ctx context.Context, id BuildLinkedBackendId, input StaticSiteLinkedBackendARMResource) (result LinkBackendToBuildOperationResponse, 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 +} + +// LinkBackendToBuildThenPoll performs LinkBackendToBuild then polls until it's completed +func (c StaticSitesClient) LinkBackendToBuildThenPoll(ctx context.Context, id BuildLinkedBackendId, input StaticSiteLinkedBackendARMResource) error { + result, err := c.LinkBackendToBuild(ctx, id, input) + if err != nil { + return fmt.Errorf("performing LinkBackendToBuild: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after LinkBackendToBuild: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_list.go new file mode 100644 index 000000000000..827e0cf38556 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_list.go @@ -0,0 +1,92 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteARMResource +} + +type ListCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteARMResource +} + +// List ... +func (c StaticSitesClient) 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.Web/staticSites", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteARMResource `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 StaticSitesClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, StaticSiteARMResourceOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate StaticSiteARMResourceOperationPredicate) (result ListCompleteResult, err error) { + items := make([]StaticSiteARMResource, 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/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_listbasicauth.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_listbasicauth.go new file mode 100644 index 000000000000..5a3da7684ede --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_listbasicauth.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListBasicAuthOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteBasicAuthPropertiesARMResource +} + +type ListBasicAuthCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteBasicAuthPropertiesARMResource +} + +// ListBasicAuth ... +func (c StaticSitesClient) ListBasicAuth(ctx context.Context, id StaticSiteId) (result ListBasicAuthOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/basicAuth", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteBasicAuthPropertiesARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListBasicAuthComplete retrieves all the results into a single object +func (c StaticSitesClient) ListBasicAuthComplete(ctx context.Context, id StaticSiteId) (ListBasicAuthCompleteResult, error) { + return c.ListBasicAuthCompleteMatchingPredicate(ctx, id, StaticSiteBasicAuthPropertiesARMResourceOperationPredicate{}) +} + +// ListBasicAuthCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) ListBasicAuthCompleteMatchingPredicate(ctx context.Context, id StaticSiteId, predicate StaticSiteBasicAuthPropertiesARMResourceOperationPredicate) (result ListBasicAuthCompleteResult, err error) { + items := make([]StaticSiteBasicAuthPropertiesARMResource, 0) + + resp, err := c.ListBasicAuth(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListBasicAuthCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteappsettings.go new file mode 100644 index 000000000000..a22360cad1db --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteappsettings.go @@ -0,0 +1,52 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListStaticSiteAppSettingsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StringDictionary +} + +// ListStaticSiteAppSettings ... +func (c StaticSitesClient) ListStaticSiteAppSettings(ctx context.Context, id StaticSiteId) (result ListStaticSiteAppSettingsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/listAppSettings", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildappsettings.go new file mode 100644 index 000000000000..db2be7bfaa01 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildappsettings.go @@ -0,0 +1,52 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListStaticSiteBuildAppSettingsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StringDictionary +} + +// ListStaticSiteBuildAppSettings ... +func (c StaticSitesClient) ListStaticSiteBuildAppSettings(ctx context.Context, id BuildId) (result ListStaticSiteBuildAppSettingsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/listAppSettings", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildfunctionappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildfunctionappsettings.go new file mode 100644 index 000000000000..48d5b5bbb1d3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildfunctionappsettings.go @@ -0,0 +1,52 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListStaticSiteBuildFunctionAppSettingsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StringDictionary +} + +// ListStaticSiteBuildFunctionAppSettings ... +func (c StaticSitesClient) ListStaticSiteBuildFunctionAppSettings(ctx context.Context, id BuildId) (result ListStaticSiteBuildFunctionAppSettingsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/listFunctionAppSettings", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildfunctions.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildfunctions.go new file mode 100644 index 000000000000..ac7570b97c57 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildfunctions.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListStaticSiteBuildFunctionsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteFunctionOverviewARMResource +} + +type ListStaticSiteBuildFunctionsCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteFunctionOverviewARMResource +} + +// ListStaticSiteBuildFunctions ... +func (c StaticSitesClient) ListStaticSiteBuildFunctions(ctx context.Context, id BuildId) (result ListStaticSiteBuildFunctionsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/functions", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteFunctionOverviewARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListStaticSiteBuildFunctionsComplete retrieves all the results into a single object +func (c StaticSitesClient) ListStaticSiteBuildFunctionsComplete(ctx context.Context, id BuildId) (ListStaticSiteBuildFunctionsCompleteResult, error) { + return c.ListStaticSiteBuildFunctionsCompleteMatchingPredicate(ctx, id, StaticSiteFunctionOverviewARMResourceOperationPredicate{}) +} + +// ListStaticSiteBuildFunctionsCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) ListStaticSiteBuildFunctionsCompleteMatchingPredicate(ctx context.Context, id BuildId, predicate StaticSiteFunctionOverviewARMResourceOperationPredicate) (result ListStaticSiteBuildFunctionsCompleteResult, err error) { + items := make([]StaticSiteFunctionOverviewARMResource, 0) + + resp, err := c.ListStaticSiteBuildFunctions(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListStaticSiteBuildFunctionsCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteconfiguredroles.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteconfiguredroles.go new file mode 100644 index 000000000000..21d2ac8f0283 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteconfiguredroles.go @@ -0,0 +1,52 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListStaticSiteConfiguredRolesOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StringList +} + +// ListStaticSiteConfiguredRoles ... +func (c StaticSitesClient) ListStaticSiteConfiguredRoles(ctx context.Context, id StaticSiteId) (result ListStaticSiteConfiguredRolesOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/listConfiguredRoles", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitecustomdomains.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitecustomdomains.go new file mode 100644 index 000000000000..570facccce53 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitecustomdomains.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListStaticSiteCustomDomainsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteCustomDomainOverviewARMResource +} + +type ListStaticSiteCustomDomainsCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteCustomDomainOverviewARMResource +} + +// ListStaticSiteCustomDomains ... +func (c StaticSitesClient) ListStaticSiteCustomDomains(ctx context.Context, id StaticSiteId) (result ListStaticSiteCustomDomainsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/customDomains", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteCustomDomainOverviewARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListStaticSiteCustomDomainsComplete retrieves all the results into a single object +func (c StaticSitesClient) ListStaticSiteCustomDomainsComplete(ctx context.Context, id StaticSiteId) (ListStaticSiteCustomDomainsCompleteResult, error) { + return c.ListStaticSiteCustomDomainsCompleteMatchingPredicate(ctx, id, StaticSiteCustomDomainOverviewARMResourceOperationPredicate{}) +} + +// ListStaticSiteCustomDomainsCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) ListStaticSiteCustomDomainsCompleteMatchingPredicate(ctx context.Context, id StaticSiteId, predicate StaticSiteCustomDomainOverviewARMResourceOperationPredicate) (result ListStaticSiteCustomDomainsCompleteResult, err error) { + items := make([]StaticSiteCustomDomainOverviewARMResource, 0) + + resp, err := c.ListStaticSiteCustomDomains(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListStaticSiteCustomDomainsCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitefunctionappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitefunctionappsettings.go new file mode 100644 index 000000000000..0c17498be8ad --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitefunctionappsettings.go @@ -0,0 +1,52 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListStaticSiteFunctionAppSettingsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StringDictionary +} + +// ListStaticSiteFunctionAppSettings ... +func (c StaticSitesClient) ListStaticSiteFunctionAppSettings(ctx context.Context, id StaticSiteId) (result ListStaticSiteFunctionAppSettingsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/listFunctionAppSettings", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitefunctions.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitefunctions.go new file mode 100644 index 000000000000..374b80280e2c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitefunctions.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListStaticSiteFunctionsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteFunctionOverviewARMResource +} + +type ListStaticSiteFunctionsCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteFunctionOverviewARMResource +} + +// ListStaticSiteFunctions ... +func (c StaticSitesClient) ListStaticSiteFunctions(ctx context.Context, id StaticSiteId) (result ListStaticSiteFunctionsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/functions", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteFunctionOverviewARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListStaticSiteFunctionsComplete retrieves all the results into a single object +func (c StaticSitesClient) ListStaticSiteFunctionsComplete(ctx context.Context, id StaticSiteId) (ListStaticSiteFunctionsCompleteResult, error) { + return c.ListStaticSiteFunctionsCompleteMatchingPredicate(ctx, id, StaticSiteFunctionOverviewARMResourceOperationPredicate{}) +} + +// ListStaticSiteFunctionsCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) ListStaticSiteFunctionsCompleteMatchingPredicate(ctx context.Context, id StaticSiteId, predicate StaticSiteFunctionOverviewARMResourceOperationPredicate) (result ListStaticSiteFunctionsCompleteResult, err error) { + items := make([]StaticSiteFunctionOverviewARMResource, 0) + + resp, err := c.ListStaticSiteFunctions(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListStaticSiteFunctionsCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitesecrets.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitesecrets.go new file mode 100644 index 000000000000..f58b2aece144 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitesecrets.go @@ -0,0 +1,52 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListStaticSiteSecretsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StringDictionary +} + +// ListStaticSiteSecrets ... +func (c StaticSitesClient) ListStaticSiteSecrets(ctx context.Context, id StaticSiteId) (result ListStaticSiteSecretsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/listSecrets", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteusers.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteusers.go new file mode 100644 index 000000000000..1c6904d7ecc2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteusers.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListStaticSiteUsersOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteUserARMResource +} + +type ListStaticSiteUsersCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteUserARMResource +} + +// ListStaticSiteUsers ... +func (c StaticSitesClient) ListStaticSiteUsers(ctx context.Context, id AuthProviderId) (result ListStaticSiteUsersOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/listUsers", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteUserARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListStaticSiteUsersComplete retrieves all the results into a single object +func (c StaticSitesClient) ListStaticSiteUsersComplete(ctx context.Context, id AuthProviderId) (ListStaticSiteUsersCompleteResult, error) { + return c.ListStaticSiteUsersCompleteMatchingPredicate(ctx, id, StaticSiteUserARMResourceOperationPredicate{}) +} + +// ListStaticSiteUsersCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) ListStaticSiteUsersCompleteMatchingPredicate(ctx context.Context, id AuthProviderId, predicate StaticSiteUserARMResourceOperationPredicate) (result ListStaticSiteUsersCompleteResult, err error) { + items := make([]StaticSiteUserARMResource, 0) + + resp, err := c.ListStaticSiteUsers(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListStaticSiteUsersCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_previewworkflow.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_previewworkflow.go new file mode 100644 index 000000000000..61a0502d27a8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_previewworkflow.go @@ -0,0 +1,56 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PreviewWorkflowOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSitesWorkflowPreview +} + +// PreviewWorkflow ... +func (c StaticSitesClient) PreviewWorkflow(ctx context.Context, id ProviderLocationId, input StaticSitesWorkflowPreviewRequest) (result PreviewWorkflowOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/previewStaticSiteWorkflowFile", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_registeruserprovidedfunctionappwithstaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_registeruserprovidedfunctionappwithstaticsite.go new file mode 100644 index 000000000000..cda8ba615de2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_registeruserprovidedfunctionappwithstaticsite.go @@ -0,0 +1,103 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegisterUserProvidedFunctionAppWithStaticSiteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteUserProvidedFunctionAppARMResource +} + +type RegisterUserProvidedFunctionAppWithStaticSiteOperationOptions struct { + IsForced *bool +} + +func DefaultRegisterUserProvidedFunctionAppWithStaticSiteOperationOptions() RegisterUserProvidedFunctionAppWithStaticSiteOperationOptions { + return RegisterUserProvidedFunctionAppWithStaticSiteOperationOptions{} +} + +func (o RegisterUserProvidedFunctionAppWithStaticSiteOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o RegisterUserProvidedFunctionAppWithStaticSiteOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o RegisterUserProvidedFunctionAppWithStaticSiteOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.IsForced != nil { + out.Append("isForced", fmt.Sprintf("%v", *o.IsForced)) + } + return &out +} + +// RegisterUserProvidedFunctionAppWithStaticSite ... +func (c StaticSitesClient) RegisterUserProvidedFunctionAppWithStaticSite(ctx context.Context, id UserProvidedFunctionAppId, input StaticSiteUserProvidedFunctionAppARMResource, options RegisterUserProvidedFunctionAppWithStaticSiteOperationOptions) (result RegisterUserProvidedFunctionAppWithStaticSiteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 +} + +// RegisterUserProvidedFunctionAppWithStaticSiteThenPoll performs RegisterUserProvidedFunctionAppWithStaticSite then polls until it's completed +func (c StaticSitesClient) RegisterUserProvidedFunctionAppWithStaticSiteThenPoll(ctx context.Context, id UserProvidedFunctionAppId, input StaticSiteUserProvidedFunctionAppARMResource, options RegisterUserProvidedFunctionAppWithStaticSiteOperationOptions) error { + result, err := c.RegisterUserProvidedFunctionAppWithStaticSite(ctx, id, input, options) + if err != nil { + return fmt.Errorf("performing RegisterUserProvidedFunctionAppWithStaticSite: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after RegisterUserProvidedFunctionAppWithStaticSite: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_registeruserprovidedfunctionappwithstaticsitebuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_registeruserprovidedfunctionappwithstaticsitebuild.go new file mode 100644 index 000000000000..a3f67cbfd6e9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_registeruserprovidedfunctionappwithstaticsitebuild.go @@ -0,0 +1,103 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegisterUserProvidedFunctionAppWithStaticSiteBuildOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteUserProvidedFunctionAppARMResource +} + +type RegisterUserProvidedFunctionAppWithStaticSiteBuildOperationOptions struct { + IsForced *bool +} + +func DefaultRegisterUserProvidedFunctionAppWithStaticSiteBuildOperationOptions() RegisterUserProvidedFunctionAppWithStaticSiteBuildOperationOptions { + return RegisterUserProvidedFunctionAppWithStaticSiteBuildOperationOptions{} +} + +func (o RegisterUserProvidedFunctionAppWithStaticSiteBuildOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o RegisterUserProvidedFunctionAppWithStaticSiteBuildOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o RegisterUserProvidedFunctionAppWithStaticSiteBuildOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.IsForced != nil { + out.Append("isForced", fmt.Sprintf("%v", *o.IsForced)) + } + return &out +} + +// RegisterUserProvidedFunctionAppWithStaticSiteBuild ... +func (c StaticSitesClient) RegisterUserProvidedFunctionAppWithStaticSiteBuild(ctx context.Context, id BuildUserProvidedFunctionAppId, input StaticSiteUserProvidedFunctionAppARMResource, options RegisterUserProvidedFunctionAppWithStaticSiteBuildOperationOptions) (result RegisterUserProvidedFunctionAppWithStaticSiteBuildOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 +} + +// RegisterUserProvidedFunctionAppWithStaticSiteBuildThenPoll performs RegisterUserProvidedFunctionAppWithStaticSiteBuild then polls until it's completed +func (c StaticSitesClient) RegisterUserProvidedFunctionAppWithStaticSiteBuildThenPoll(ctx context.Context, id BuildUserProvidedFunctionAppId, input StaticSiteUserProvidedFunctionAppARMResource, options RegisterUserProvidedFunctionAppWithStaticSiteBuildOperationOptions) error { + result, err := c.RegisterUserProvidedFunctionAppWithStaticSiteBuild(ctx, id, input, options) + if err != nil { + return fmt.Errorf("performing RegisterUserProvidedFunctionAppWithStaticSiteBuild: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after RegisterUserProvidedFunctionAppWithStaticSiteBuild: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_resetstaticsiteapikey.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_resetstaticsiteapikey.go new file mode 100644 index 000000000000..722e36f78c67 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_resetstaticsiteapikey.go @@ -0,0 +1,51 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResetStaticSiteApiKeyOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +// ResetStaticSiteApiKey ... +func (c StaticSitesClient) ResetStaticSiteApiKey(ctx context.Context, id StaticSiteId, input StaticSiteResetPropertiesARMResource) (result ResetStaticSiteApiKeyOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/resetapikey", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + 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/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_unlinkbackend.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_unlinkbackend.go new file mode 100644 index 000000000000..980662409691 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_unlinkbackend.go @@ -0,0 +1,76 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UnlinkBackendOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +type UnlinkBackendOperationOptions struct { + IsCleaningAuthConfig *bool +} + +func DefaultUnlinkBackendOperationOptions() UnlinkBackendOperationOptions { + return UnlinkBackendOperationOptions{} +} + +func (o UnlinkBackendOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o UnlinkBackendOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o UnlinkBackendOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.IsCleaningAuthConfig != nil { + out.Append("isCleaningAuthConfig", fmt.Sprintf("%v", *o.IsCleaningAuthConfig)) + } + return &out +} + +// UnlinkBackend ... +func (c StaticSitesClient) UnlinkBackend(ctx context.Context, id LinkedBackendId, options UnlinkBackendOperationOptions) (result UnlinkBackendOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + 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 + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_unlinkbackendfrombuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_unlinkbackendfrombuild.go new file mode 100644 index 000000000000..9ef02435e54b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_unlinkbackendfrombuild.go @@ -0,0 +1,76 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UnlinkBackendFromBuildOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +type UnlinkBackendFromBuildOperationOptions struct { + IsCleaningAuthConfig *bool +} + +func DefaultUnlinkBackendFromBuildOperationOptions() UnlinkBackendFromBuildOperationOptions { + return UnlinkBackendFromBuildOperationOptions{} +} + +func (o UnlinkBackendFromBuildOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o UnlinkBackendFromBuildOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o UnlinkBackendFromBuildOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.IsCleaningAuthConfig != nil { + out.Append("isCleaningAuthConfig", fmt.Sprintf("%v", *o.IsCleaningAuthConfig)) + } + return &out +} + +// UnlinkBackendFromBuild ... +func (c StaticSitesClient) UnlinkBackendFromBuild(ctx context.Context, id BuildLinkedBackendId, options UnlinkBackendFromBuildOperationOptions) (result UnlinkBackendFromBuildOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + 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 + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatebuilddatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatebuilddatabaseconnection.go new file mode 100644 index 000000000000..4252bf110274 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatebuilddatabaseconnection.go @@ -0,0 +1,55 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateBuildDatabaseConnectionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DatabaseConnection +} + +// UpdateBuildDatabaseConnection ... +func (c StaticSitesClient) UpdateBuildDatabaseConnection(ctx context.Context, id BuildDatabaseConnectionId, input DatabaseConnectionPatchRequest) (result UpdateBuildDatabaseConnectionOperationResponse, 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 + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatedatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatedatabaseconnection.go new file mode 100644 index 000000000000..2f754354195a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatedatabaseconnection.go @@ -0,0 +1,55 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateDatabaseConnectionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DatabaseConnection +} + +// UpdateDatabaseConnection ... +func (c StaticSitesClient) UpdateDatabaseConnection(ctx context.Context, id DatabaseConnectionId, input DatabaseConnectionPatchRequest) (result UpdateDatabaseConnectionOperationResponse, 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 + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatestaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatestaticsite.go new file mode 100644 index 000000000000..4f1c235fa6cf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatestaticsite.go @@ -0,0 +1,56 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateStaticSiteOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteARMResource +} + +// UpdateStaticSite ... +func (c StaticSitesClient) UpdateStaticSite(ctx context.Context, id StaticSiteId, input StaticSitePatchResource) (result UpdateStaticSiteOperationResponse, 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 + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatestaticsiteuser.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatestaticsiteuser.go new file mode 100644 index 000000000000..6a8baec8c075 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatestaticsiteuser.go @@ -0,0 +1,55 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateStaticSiteUserOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteUserARMResource +} + +// UpdateStaticSiteUser ... +func (c StaticSitesClient) UpdateStaticSiteUser(ctx context.Context, id UserId, input StaticSiteUserARMResource) (result UpdateStaticSiteUserOperationResponse, 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 + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_validatebackend.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_validatebackend.go new file mode 100644 index 000000000000..12aa25c2202f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_validatebackend.go @@ -0,0 +1,74 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateBackendOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// ValidateBackend ... +func (c StaticSitesClient) ValidateBackend(ctx context.Context, id LinkedBackendId, input StaticSiteLinkedBackendARMResource) (result ValidateBackendOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + 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 +} + +// ValidateBackendThenPoll performs ValidateBackend then polls until it's completed +func (c StaticSitesClient) ValidateBackendThenPoll(ctx context.Context, id LinkedBackendId, input StaticSiteLinkedBackendARMResource) error { + result, err := c.ValidateBackend(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ValidateBackend: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ValidateBackend: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_validatebackendforbuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_validatebackendforbuild.go new file mode 100644 index 000000000000..d703ff84c0bc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_validatebackendforbuild.go @@ -0,0 +1,74 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateBackendForBuildOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// ValidateBackendForBuild ... +func (c StaticSitesClient) ValidateBackendForBuild(ctx context.Context, id BuildLinkedBackendId, input StaticSiteLinkedBackendARMResource) (result ValidateBackendForBuildOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + 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 +} + +// ValidateBackendForBuildThenPoll performs ValidateBackendForBuild then polls until it's completed +func (c StaticSitesClient) ValidateBackendForBuildThenPoll(ctx context.Context, id BuildLinkedBackendId, input StaticSiteLinkedBackendARMResource) error { + result, err := c.ValidateBackendForBuild(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ValidateBackendForBuild: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ValidateBackendForBuild: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_validatecustomdomaincanbeaddedtostaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_validatecustomdomaincanbeaddedtostaticsite.go new file mode 100644 index 000000000000..deda3155c42b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_validatecustomdomaincanbeaddedtostaticsite.go @@ -0,0 +1,74 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateCustomDomainCanBeAddedToStaticSiteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// ValidateCustomDomainCanBeAddedToStaticSite ... +func (c StaticSitesClient) ValidateCustomDomainCanBeAddedToStaticSite(ctx context.Context, id CustomDomainId, input StaticSiteCustomDomainRequestPropertiesARMResource) (result ValidateCustomDomainCanBeAddedToStaticSiteOperationResponse, 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 +} + +// ValidateCustomDomainCanBeAddedToStaticSiteThenPoll performs ValidateCustomDomainCanBeAddedToStaticSite then polls until it's completed +func (c StaticSitesClient) ValidateCustomDomainCanBeAddedToStaticSiteThenPoll(ctx context.Context, id CustomDomainId, input StaticSiteCustomDomainRequestPropertiesARMResource) error { + result, err := c.ValidateCustomDomainCanBeAddedToStaticSite(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ValidateCustomDomainCanBeAddedToStaticSite: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ValidateCustomDomainCanBeAddedToStaticSite: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_armidwrapper.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_armidwrapper.go new file mode 100644 index 000000000000..c9987651a5f2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_armidwrapper.go @@ -0,0 +1,8 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ArmIdWrapper struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_armplan.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_armplan.go new file mode 100644 index 000000000000..2cb5352de6eb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_armplan.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ArmPlan struct { + Name *string `json:"name,omitempty"` + Product *string `json:"product,omitempty"` + PromotionCode *string `json:"promotionCode,omitempty"` + Publisher *string `json:"publisher,omitempty"` + Version *string `json:"version,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_capability.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_capability.go new file mode 100644 index 000000000000..300bf980489f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_capability.go @@ -0,0 +1,10 @@ +package staticsites + +// 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 { + Name *string `json:"name,omitempty"` + Reason *string `json:"reason,omitempty"` + Value *string `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnection.go new file mode 100644 index 000000000000..cd069f365d42 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnection.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseConnection struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *DatabaseConnectionProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionoverview.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionoverview.go new file mode 100644 index 000000000000..8597c4ff8b48 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionoverview.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseConnectionOverview struct { + ConfigurationFiles *[]StaticSiteDatabaseConnectionConfigurationFileOverview `json:"configurationFiles,omitempty"` + ConnectionIdentity *string `json:"connectionIdentity,omitempty"` + Name *string `json:"name,omitempty"` + Region *string `json:"region,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionpatchrequest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionpatchrequest.go new file mode 100644 index 000000000000..493e3509268c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionpatchrequest.go @@ -0,0 +1,8 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseConnectionPatchRequest struct { + Properties *DatabaseConnectionPatchRequestProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionpatchrequestproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionpatchrequestproperties.go new file mode 100644 index 000000000000..2b5eb824c264 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionpatchrequestproperties.go @@ -0,0 +1,11 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseConnectionPatchRequestProperties struct { + ConnectionIdentity *string `json:"connectionIdentity,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + Region *string `json:"region,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionproperties.go new file mode 100644 index 000000000000..81aee01e533a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionproperties.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseConnectionProperties struct { + ConfigurationFiles *[]StaticSiteDatabaseConnectionConfigurationFileOverview `json:"configurationFiles,omitempty"` + ConnectionIdentity *string `json:"connectionIdentity,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + Region string `json:"region"` + ResourceId string `json:"resourceId"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_errorentity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_errorentity.go new file mode 100644 index 000000000000..6b726cb5492f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_errorentity.go @@ -0,0 +1,15 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ErrorEntity struct { + Code *string `json:"code,omitempty"` + Details *[]ErrorEntity `json:"details,omitempty"` + ExtendedCode *string `json:"extendedCode,omitempty"` + InnerErrors *[]ErrorEntity `json:"innerErrors,omitempty"` + Message *string `json:"message,omitempty"` + MessageTemplate *string `json:"messageTemplate,omitempty"` + Parameters *[]string `json:"parameters,omitempty"` + Target *string `json:"target,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkconnectionstate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkconnectionstate.go new file mode 100644 index 000000000000..bdfe81e8a98f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkconnectionstate.go @@ -0,0 +1,10 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateLinkConnectionState struct { + ActionsRequired *string `json:"actionsRequired,omitempty"` + Description *string `json:"description,omitempty"` + Status *string `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkresource.go new file mode 100644 index 000000000000..975df70d5c79 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkresource.go @@ -0,0 +1,11 @@ +package staticsites + +// 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"` + Name string `json:"name"` + Properties PrivateLinkResourceProperties `json:"properties"` + Type string `json:"type"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkresourceproperties.go new file mode 100644 index 000000000000..8dacfc8b182a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkresourceproperties.go @@ -0,0 +1,10 @@ +package staticsites + +// 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/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkresourceswrapper.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkresourceswrapper.go new file mode 100644 index 000000000000..2890dfe9e4ad --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkresourceswrapper.go @@ -0,0 +1,8 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateLinkResourcesWrapper struct { + Value []PrivateLinkResource `json:"value"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnection.go new file mode 100644 index 000000000000..2456e6e1d5b8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnection.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RemotePrivateEndpointConnection struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *RemotePrivateEndpointConnectionProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnectionarmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnectionarmresource.go new file mode 100644 index 000000000000..708bf563a7fa --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnectionarmresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RemotePrivateEndpointConnectionARMResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *RemotePrivateEndpointConnectionARMResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnectionarmresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnectionarmresourceproperties.go new file mode 100644 index 000000000000..75f3ef6233dd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnectionarmresourceproperties.go @@ -0,0 +1,11 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RemotePrivateEndpointConnectionARMResourceProperties struct { + IPAddresses *[]string `json:"ipAddresses,omitempty"` + PrivateEndpoint *ArmIdWrapper `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnectionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnectionproperties.go new file mode 100644 index 000000000000..23d098fcaa6b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RemotePrivateEndpointConnectionProperties struct { + IPAddresses *[]string `json:"ipAddresses,omitempty"` + PrivateEndpoint *ArmIdWrapper `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_responsemessageenveloperemoteprivateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_responsemessageenveloperemoteprivateendpointconnection.go new file mode 100644 index 000000000000..54a231b34602 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_responsemessageenveloperemoteprivateendpointconnection.go @@ -0,0 +1,24 @@ +package staticsites + +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 ResponseMessageEnvelopeRemotePrivateEndpointConnection struct { + Error *ErrorEntity `json:"error,omitempty"` + Id *string `json:"id,omitempty"` + Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Plan *ArmPlan `json:"plan,omitempty"` + Properties *RemotePrivateEndpointConnection `json:"properties,omitempty"` + Sku *SkuDescription `json:"sku,omitempty"` + Status *string `json:"status,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` + Zones *zones.Schema `json:"zones,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_skucapacity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_skucapacity.go new file mode 100644 index 000000000000..d8cd9de7ec4e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_skucapacity.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SkuCapacity struct { + Default *int64 `json:"default,omitempty"` + ElasticMaximum *int64 `json:"elasticMaximum,omitempty"` + Maximum *int64 `json:"maximum,omitempty"` + Minimum *int64 `json:"minimum,omitempty"` + ScaleType *string `json:"scaleType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_skudescription.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_skudescription.go new file mode 100644 index 000000000000..2e1e0cde311e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_skudescription.go @@ -0,0 +1,15 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SkuDescription struct { + Capabilities *[]Capability `json:"capabilities,omitempty"` + Capacity *int64 `json:"capacity,omitempty"` + Family *string `json:"family,omitempty"` + Locations *[]string `json:"locations,omitempty"` + Name *string `json:"name,omitempty"` + Size *string `json:"size,omitempty"` + SkuCapacity *SkuCapacity `json:"skuCapacity,omitempty"` + Tier *string `json:"tier,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsite.go new file mode 100644 index 000000000000..9fad6989e545 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsite.go @@ -0,0 +1,25 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSite struct { + AllowConfigFileUpdates *bool `json:"allowConfigFileUpdates,omitempty"` + Branch *string `json:"branch,omitempty"` + BuildProperties *StaticSiteBuildProperties `json:"buildProperties,omitempty"` + ContentDistributionEndpoint *string `json:"contentDistributionEndpoint,omitempty"` + CustomDomains *[]string `json:"customDomains,omitempty"` + DatabaseConnections *[]DatabaseConnectionOverview `json:"databaseConnections,omitempty"` + DefaultHostname *string `json:"defaultHostname,omitempty"` + EnterpriseGradeCdnStatus *EnterpriseGradeCdnStatus `json:"enterpriseGradeCdnStatus,omitempty"` + KeyVaultReferenceIdentity *string `json:"keyVaultReferenceIdentity,omitempty"` + LinkedBackends *[]StaticSiteLinkedBackend `json:"linkedBackends,omitempty"` + PrivateEndpointConnections *[]ResponseMessageEnvelopeRemotePrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + Provider *string `json:"provider,omitempty"` + PublicNetworkAccess *string `json:"publicNetworkAccess,omitempty"` + RepositoryToken *string `json:"repositoryToken,omitempty"` + RepositoryUrl *string `json:"repositoryUrl,omitempty"` + StagingEnvironmentPolicy *StagingEnvironmentPolicy `json:"stagingEnvironmentPolicy,omitempty"` + TemplateProperties *StaticSiteTemplateOptions `json:"templateProperties,omitempty"` + UserProvidedFunctionApps *[]StaticSiteUserProvidedFunctionApp `json:"userProvidedFunctionApps,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitearmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitearmresource.go new file mode 100644 index 000000000000..a54aa2362bbb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitearmresource.go @@ -0,0 +1,20 @@ +package staticsites + +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 StaticSiteARMResource struct { + Id *string `json:"id,omitempty"` + Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` + Kind *string `json:"kind,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *StaticSite `json:"properties,omitempty"` + Sku *SkuDescription `json:"sku,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebasicauthpropertiesarmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebasicauthpropertiesarmresource.go new file mode 100644 index 000000000000..bf58faf53d3c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebasicauthpropertiesarmresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteBasicAuthPropertiesARMResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteBasicAuthPropertiesARMResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebasicauthpropertiesarmresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebasicauthpropertiesarmresourceproperties.go new file mode 100644 index 000000000000..80795463497f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebasicauthpropertiesarmresourceproperties.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteBasicAuthPropertiesARMResourceProperties struct { + ApplicableEnvironmentsMode string `json:"applicableEnvironmentsMode"` + Environments *[]string `json:"environments,omitempty"` + Password *string `json:"password,omitempty"` + SecretState *string `json:"secretState,omitempty"` + SecretUrl *string `json:"secretUrl,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebuildarmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebuildarmresource.go new file mode 100644 index 000000000000..332e5334386d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebuildarmresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteBuildARMResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteBuildARMResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebuildarmresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebuildarmresourceproperties.go new file mode 100644 index 000000000000..50bbe9e5443b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebuildarmresourceproperties.go @@ -0,0 +1,47 @@ +package staticsites + +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 StaticSiteBuildARMResourceProperties struct { + BuildId *string `json:"buildId,omitempty"` + CreatedTimeUtc *string `json:"createdTimeUtc,omitempty"` + DatabaseConnections *[]DatabaseConnectionOverview `json:"databaseConnections,omitempty"` + Hostname *string `json:"hostname,omitempty"` + LastUpdatedOn *string `json:"lastUpdatedOn,omitempty"` + LinkedBackends *[]StaticSiteLinkedBackend `json:"linkedBackends,omitempty"` + PullRequestTitle *string `json:"pullRequestTitle,omitempty"` + SourceBranch *string `json:"sourceBranch,omitempty"` + Status *BuildStatus `json:"status,omitempty"` + UserProvidedFunctionApps *[]StaticSiteUserProvidedFunctionApp `json:"userProvidedFunctionApps,omitempty"` +} + +func (o *StaticSiteBuildARMResourceProperties) GetCreatedTimeUtcAsTime() (*time.Time, error) { + if o.CreatedTimeUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedTimeUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *StaticSiteBuildARMResourceProperties) SetCreatedTimeUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedTimeUtc = &formatted +} + +func (o *StaticSiteBuildARMResourceProperties) GetLastUpdatedOnAsTime() (*time.Time, error) { + if o.LastUpdatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastUpdatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *StaticSiteBuildARMResourceProperties) SetLastUpdatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastUpdatedOn = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebuildproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebuildproperties.go new file mode 100644 index 000000000000..9dbe72ed06c8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebuildproperties.go @@ -0,0 +1,15 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteBuildProperties struct { + ApiBuildCommand *string `json:"apiBuildCommand,omitempty"` + ApiLocation *string `json:"apiLocation,omitempty"` + AppArtifactLocation *string `json:"appArtifactLocation,omitempty"` + AppBuildCommand *string `json:"appBuildCommand,omitempty"` + AppLocation *string `json:"appLocation,omitempty"` + GitHubActionSecretNameOverride *string `json:"githubActionSecretNameOverride,omitempty"` + OutputLocation *string `json:"outputLocation,omitempty"` + SkipGithubActionWorkflowGeneration *bool `json:"skipGithubActionWorkflowGeneration,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainoverviewarmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainoverviewarmresource.go new file mode 100644 index 000000000000..95f00a987622 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainoverviewarmresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteCustomDomainOverviewARMResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteCustomDomainOverviewARMResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainoverviewarmresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainoverviewarmresourceproperties.go new file mode 100644 index 000000000000..cc0b5c992745 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainoverviewarmresourceproperties.go @@ -0,0 +1,30 @@ +package staticsites + +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 StaticSiteCustomDomainOverviewARMResourceProperties struct { + CreatedOn *string `json:"createdOn,omitempty"` + DomainName *string `json:"domainName,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + Status *CustomDomainStatus `json:"status,omitempty"` + ValidationToken *string `json:"validationToken,omitempty"` +} + +func (o *StaticSiteCustomDomainOverviewARMResourceProperties) GetCreatedOnAsTime() (*time.Time, error) { + if o.CreatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *StaticSiteCustomDomainOverviewARMResourceProperties) SetCreatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedOn = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainrequestpropertiesarmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainrequestpropertiesarmresource.go new file mode 100644 index 000000000000..b790fc90f5d6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainrequestpropertiesarmresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteCustomDomainRequestPropertiesARMResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteCustomDomainRequestPropertiesARMResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainrequestpropertiesarmresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainrequestpropertiesarmresourceproperties.go new file mode 100644 index 000000000000..e4510ee88550 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainrequestpropertiesarmresourceproperties.go @@ -0,0 +1,8 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteCustomDomainRequestPropertiesARMResourceProperties struct { + ValidationMethod *string `json:"validationMethod,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitedatabaseconnectionconfigurationfileoverview.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitedatabaseconnectionconfigurationfileoverview.go new file mode 100644 index 000000000000..0389a6f704cf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitedatabaseconnectionconfigurationfileoverview.go @@ -0,0 +1,10 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteDatabaseConnectionConfigurationFileOverview struct { + Contents *string `json:"contents,omitempty"` + FileName *string `json:"fileName,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitefunctionoverviewarmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitefunctionoverviewarmresource.go new file mode 100644 index 000000000000..fa8ca3288d9c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitefunctionoverviewarmresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteFunctionOverviewARMResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteFunctionOverviewARMResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitefunctionoverviewarmresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitefunctionoverviewarmresourceproperties.go new file mode 100644 index 000000000000..46eeb3307745 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitefunctionoverviewarmresourceproperties.go @@ -0,0 +1,9 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteFunctionOverviewARMResourceProperties struct { + FunctionName *string `json:"functionName,omitempty"` + TriggerType *TriggerTypes `json:"triggerType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitelinkedbackend.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitelinkedbackend.go new file mode 100644 index 000000000000..52b103d13bc3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitelinkedbackend.go @@ -0,0 +1,29 @@ +package staticsites + +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 StaticSiteLinkedBackend struct { + BackendResourceId *string `json:"backendResourceId,omitempty"` + CreatedOn *string `json:"createdOn,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + Region *string `json:"region,omitempty"` +} + +func (o *StaticSiteLinkedBackend) GetCreatedOnAsTime() (*time.Time, error) { + if o.CreatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *StaticSiteLinkedBackend) SetCreatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedOn = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitelinkedbackendarmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitelinkedbackendarmresource.go new file mode 100644 index 000000000000..97ddc7ab2ac5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitelinkedbackendarmresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteLinkedBackendARMResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteLinkedBackendARMResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitelinkedbackendarmresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitelinkedbackendarmresourceproperties.go new file mode 100644 index 000000000000..5ec2c55c3933 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitelinkedbackendarmresourceproperties.go @@ -0,0 +1,29 @@ +package staticsites + +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 StaticSiteLinkedBackendARMResourceProperties struct { + BackendResourceId *string `json:"backendResourceId,omitempty"` + CreatedOn *string `json:"createdOn,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + Region *string `json:"region,omitempty"` +} + +func (o *StaticSiteLinkedBackendARMResourceProperties) GetCreatedOnAsTime() (*time.Time, error) { + if o.CreatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *StaticSiteLinkedBackendARMResourceProperties) SetCreatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedOn = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitepatchresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitepatchresource.go new file mode 100644 index 000000000000..6969a6ebae49 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitepatchresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSitePatchResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSite `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteresetpropertiesarmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteresetpropertiesarmresource.go new file mode 100644 index 000000000000..53a0c64632ad --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteresetpropertiesarmresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteResetPropertiesARMResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteResetPropertiesARMResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteresetpropertiesarmresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteresetpropertiesarmresourceproperties.go new file mode 100644 index 000000000000..87a927d39523 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteresetpropertiesarmresourceproperties.go @@ -0,0 +1,9 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteResetPropertiesARMResourceProperties struct { + RepositoryToken *string `json:"repositoryToken,omitempty"` + ShouldUpdateRepository *bool `json:"shouldUpdateRepository,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreview.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreview.go new file mode 100644 index 000000000000..01cca8f1d477 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreview.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSitesWorkflowPreview struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSitesWorkflowPreviewProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewproperties.go new file mode 100644 index 000000000000..4e0aa482c925 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewproperties.go @@ -0,0 +1,9 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSitesWorkflowPreviewProperties struct { + Contents *string `json:"contents,omitempty"` + Path *string `json:"path,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewrequest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewrequest.go new file mode 100644 index 000000000000..c255ba006977 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewrequest.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSitesWorkflowPreviewRequest struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSitesWorkflowPreviewRequestProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewrequestproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewrequestproperties.go new file mode 100644 index 000000000000..bca5c553bc44 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewrequestproperties.go @@ -0,0 +1,10 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSitesWorkflowPreviewRequestProperties struct { + Branch *string `json:"branch,omitempty"` + BuildProperties *StaticSiteBuildProperties `json:"buildProperties,omitempty"` + RepositoryUrl *string `json:"repositoryUrl,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitetemplateoptions.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitetemplateoptions.go new file mode 100644 index 000000000000..5afb0421afc4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitetemplateoptions.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteTemplateOptions struct { + Description *string `json:"description,omitempty"` + IsPrivate *bool `json:"isPrivate,omitempty"` + Owner *string `json:"owner,omitempty"` + RepositoryName *string `json:"repositoryName,omitempty"` + TemplateRepositoryUrl *string `json:"templateRepositoryUrl,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserarmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserarmresource.go new file mode 100644 index 000000000000..296cf30c6f8f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserarmresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteUserARMResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteUserARMResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserarmresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserarmresourceproperties.go new file mode 100644 index 000000000000..1ee310fa7734 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserarmresourceproperties.go @@ -0,0 +1,11 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteUserARMResourceProperties struct { + DisplayName *string `json:"displayName,omitempty"` + Provider *string `json:"provider,omitempty"` + Roles *string `json:"roles,omitempty"` + UserId *string `json:"userId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationrequestresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationrequestresource.go new file mode 100644 index 000000000000..d9d5ae47bdcb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationrequestresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteUserInvitationRequestResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteUserInvitationRequestResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationrequestresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationrequestresourceproperties.go new file mode 100644 index 000000000000..744a01b8f56f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationrequestresourceproperties.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteUserInvitationRequestResourceProperties struct { + Domain *string `json:"domain,omitempty"` + NumHoursToExpiration *int64 `json:"numHoursToExpiration,omitempty"` + Provider *string `json:"provider,omitempty"` + Roles *string `json:"roles,omitempty"` + UserDetails *string `json:"userDetails,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationresponseresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationresponseresource.go new file mode 100644 index 000000000000..1c89e5056c0c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationresponseresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteUserInvitationResponseResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteUserInvitationResponseResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationresponseresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationresponseresourceproperties.go new file mode 100644 index 000000000000..674c99a3b509 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationresponseresourceproperties.go @@ -0,0 +1,27 @@ +package staticsites + +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 StaticSiteUserInvitationResponseResourceProperties struct { + ExpiresOn *string `json:"expiresOn,omitempty"` + InvitationUrl *string `json:"invitationUrl,omitempty"` +} + +func (o *StaticSiteUserInvitationResponseResourceProperties) GetExpiresOnAsTime() (*time.Time, error) { + if o.ExpiresOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ExpiresOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *StaticSiteUserInvitationResponseResourceProperties) SetExpiresOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ExpiresOn = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionapp.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionapp.go new file mode 100644 index 000000000000..08c7d23a344b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionapp.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteUserProvidedFunctionApp struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteUserProvidedFunctionAppProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionapparmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionapparmresource.go new file mode 100644 index 000000000000..c3a983f8eeaf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionapparmresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteUserProvidedFunctionAppARMResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteUserProvidedFunctionAppARMResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionapparmresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionapparmresourceproperties.go new file mode 100644 index 000000000000..5c3f5f4b6290 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionapparmresourceproperties.go @@ -0,0 +1,28 @@ +package staticsites + +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 StaticSiteUserProvidedFunctionAppARMResourceProperties struct { + CreatedOn *string `json:"createdOn,omitempty"` + FunctionAppRegion *string `json:"functionAppRegion,omitempty"` + FunctionAppResourceId *string `json:"functionAppResourceId,omitempty"` +} + +func (o *StaticSiteUserProvidedFunctionAppARMResourceProperties) GetCreatedOnAsTime() (*time.Time, error) { + if o.CreatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *StaticSiteUserProvidedFunctionAppARMResourceProperties) SetCreatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedOn = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionappproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionappproperties.go new file mode 100644 index 000000000000..d1aa33d93e10 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionappproperties.go @@ -0,0 +1,28 @@ +package staticsites + +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 StaticSiteUserProvidedFunctionAppProperties struct { + CreatedOn *string `json:"createdOn,omitempty"` + FunctionAppRegion *string `json:"functionAppRegion,omitempty"` + FunctionAppResourceId *string `json:"functionAppResourceId,omitempty"` +} + +func (o *StaticSiteUserProvidedFunctionAppProperties) GetCreatedOnAsTime() (*time.Time, error) { + if o.CreatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *StaticSiteUserProvidedFunctionAppProperties) SetCreatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedOn = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitezipdeployment.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitezipdeployment.go new file mode 100644 index 000000000000..29435dc00a6d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitezipdeployment.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteZipDeployment struct { + ApiZipUrl *string `json:"apiZipUrl,omitempty"` + AppZipUrl *string `json:"appZipUrl,omitempty"` + DeploymentTitle *string `json:"deploymentTitle,omitempty"` + FunctionLanguage *string `json:"functionLanguage,omitempty"` + Provider *string `json:"provider,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitezipdeploymentarmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitezipdeploymentarmresource.go new file mode 100644 index 000000000000..f842a2730dc0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitezipdeploymentarmresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteZipDeploymentARMResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteZipDeployment `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_stringdictionary.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_stringdictionary.go new file mode 100644 index 000000000000..719659036142 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_stringdictionary.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StringDictionary struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *map[string]string `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_stringlist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_stringlist.go new file mode 100644 index 000000000000..79987b1ea842 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_stringlist.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StringList struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *[]string `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/predicates.go new file mode 100644 index 000000000000..b27ed7b5388c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/predicates.go @@ -0,0 +1,289 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseConnectionOperationPredicate struct { + Id *string + Kind *string + Name *string + Type *string +} + +func (p DatabaseConnectionOperationPredicate) Matches(input DatabaseConnection) 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 +} + +type RemotePrivateEndpointConnectionARMResourceOperationPredicate struct { + Id *string + Kind *string + Name *string + Type *string +} + +func (p RemotePrivateEndpointConnectionARMResourceOperationPredicate) Matches(input RemotePrivateEndpointConnectionARMResource) 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 +} + +type StaticSiteARMResourceOperationPredicate struct { + Id *string + Kind *string + Location *string + Name *string + Type *string +} + +func (p StaticSiteARMResourceOperationPredicate) Matches(input StaticSiteARMResource) 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 +} + +type StaticSiteBasicAuthPropertiesARMResourceOperationPredicate struct { + Id *string + Kind *string + Name *string + Type *string +} + +func (p StaticSiteBasicAuthPropertiesARMResourceOperationPredicate) Matches(input StaticSiteBasicAuthPropertiesARMResource) 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 +} + +type StaticSiteBuildARMResourceOperationPredicate struct { + Id *string + Kind *string + Name *string + Type *string +} + +func (p StaticSiteBuildARMResourceOperationPredicate) Matches(input StaticSiteBuildARMResource) 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 +} + +type StaticSiteCustomDomainOverviewARMResourceOperationPredicate struct { + Id *string + Kind *string + Name *string + Type *string +} + +func (p StaticSiteCustomDomainOverviewARMResourceOperationPredicate) Matches(input StaticSiteCustomDomainOverviewARMResource) 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 +} + +type StaticSiteFunctionOverviewARMResourceOperationPredicate struct { + Id *string + Kind *string + Name *string + Type *string +} + +func (p StaticSiteFunctionOverviewARMResourceOperationPredicate) Matches(input StaticSiteFunctionOverviewARMResource) 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 +} + +type StaticSiteLinkedBackendARMResourceOperationPredicate struct { + Id *string + Kind *string + Name *string + Type *string +} + +func (p StaticSiteLinkedBackendARMResourceOperationPredicate) Matches(input StaticSiteLinkedBackendARMResource) 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 +} + +type StaticSiteUserARMResourceOperationPredicate struct { + Id *string + Kind *string + Name *string + Type *string +} + +func (p StaticSiteUserARMResourceOperationPredicate) Matches(input StaticSiteUserARMResource) 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 +} + +type StaticSiteUserProvidedFunctionAppARMResourceOperationPredicate struct { + Id *string + Kind *string + Name *string + Type *string +} + +func (p StaticSiteUserProvidedFunctionAppARMResourceOperationPredicate) Matches(input StaticSiteUserProvidedFunctionAppARMResource) 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/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/version.go new file mode 100644 index 000000000000..dbb89d0c49bd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/version.go @@ -0,0 +1,12 @@ +package staticsites + +import "fmt" + +// Copyright (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-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/staticsites/%s", defaultApiVersion) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 44a266596926..b5846fa0f0de 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1053,6 +1053,7 @@ github.com/hashicorp/go-azure-sdk/resource-manager/web/2016-06-01/managedapis github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/appserviceenvironments github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/appserviceplans github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/resourceproviders +github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/webapps github.com/hashicorp/go-azure-sdk/resource-manager/webpubsub/2023-02-01 github.com/hashicorp/go-azure-sdk/resource-manager/webpubsub/2023-02-01/webpubsub From fd65f52c532d7ba3a20df840136bc72a430a86ba Mon Sep 17 00:00:00 2001 From: jackofallops Date: Wed, 28 Feb 2024 14:22:13 +0100 Subject: [PATCH 02/16] switch to deprecate and replace rather than refactor --- internal/services/appservice/helpers/enums.go | 5 + internal/services/appservice/registration.go | 2 +- .../static_web_app_custom_domain.go | 42 +- .../appservice/static_web_app_resource.go | 4 +- ...ic_web_app_resource_custom_domain_test.go} | 0 ...est.go => static_web_app_resource_test.go} | 0 .../appservice/validate/static_web_app.go | 19 + internal/services/web/parse/static_site.go | 72 +++ .../services/web/parse/static_site_test.go | 115 +++++ internal/services/web/registration.go | 2 + internal/services/web/resourceids.go | 2 + .../web/static_site_custom_domain_resource.go | 224 ++++++++++ internal/services/web/static_site_resource.go | 331 ++++++++++++++ ...static_site_resource_custom_domain_test.go | 105 +++++ .../services/web/static_site_resource_test.go | 418 ++++++++++++++++++ .../validate/static_site.go | 0 .../validate/static_site_custom_domain_id.go | 26 ++ .../static_site_custom_domain_id_test.go | 91 ++++ .../services/web/validate/static_site_id.go | 26 ++ .../web/validate/static_site_id_test.go | 79 ++++ 20 files changed, 1537 insertions(+), 26 deletions(-) rename internal/services/appservice/{static_site_resource_custom_domain_test.go => static_web_app_resource_custom_domain_test.go} (100%) rename internal/services/appservice/{static_site_resource_test.go => static_web_app_resource_test.go} (100%) create mode 100644 internal/services/appservice/validate/static_web_app.go create mode 100644 internal/services/web/parse/static_site.go create mode 100644 internal/services/web/parse/static_site_test.go create mode 100644 internal/services/web/static_site_custom_domain_resource.go create mode 100644 internal/services/web/static_site_resource.go create mode 100644 internal/services/web/static_site_resource_custom_domain_test.go create mode 100644 internal/services/web/static_site_resource_test.go rename internal/services/{appservice => web}/validate/static_site.go (100%) create mode 100644 internal/services/web/validate/static_site_custom_domain_id.go create mode 100644 internal/services/web/validate/static_site_custom_domain_id_test.go create mode 100644 internal/services/web/validate/static_site_id.go create mode 100644 internal/services/web/validate/static_site_id_test.go diff --git a/internal/services/appservice/helpers/enums.go b/internal/services/appservice/helpers/enums.go index 9dc4282f967d..3ed42b881c69 100644 --- a/internal/services/appservice/helpers/enums.go +++ b/internal/services/appservice/helpers/enums.go @@ -10,3 +10,8 @@ const ( PublicNetworkAccessEnabled string = "Enabled" PublicNetworkAccessDisabled string = "Disabled" ) + +const ( + ValidationTypeTXT = "dns-txt-token" + ValidationTypeCName = "cname-delegation" +) diff --git a/internal/services/appservice/registration.go b/internal/services/appservice/registration.go index 58cfaa2bd26c..ee2a1223d3fc 100644 --- a/internal/services/appservice/registration.go +++ b/internal/services/appservice/registration.go @@ -50,7 +50,7 @@ func (r Registration) Resources() []sdk.Resource { SourceControlResource{}, SourceControlSlotResource{}, StaticWebAppResource{}, - StaticSiteCustomDomainResource{}, + StaticWebAppCustomDomainResource{}, WebAppActiveSlotResource{}, WebAppHybridConnectionResource{}, WindowsFunctionAppResource{}, diff --git a/internal/services/appservice/static_web_app_custom_domain.go b/internal/services/appservice/static_web_app_custom_domain.go index cc7ac9040641..882a3b70f712 100644 --- a/internal/services/appservice/static_web_app_custom_domain.go +++ b/internal/services/appservice/static_web_app_custom_domain.go @@ -3,6 +3,7 @@ package appservice import ( "context" "fmt" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers" "time" "github.com/hashicorp/go-azure-helpers/lang/pointer" @@ -14,23 +15,18 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" ) -type StaticSiteCustomDomainResource struct{} +type StaticWebAppCustomDomainResource struct{} -var _ sdk.Resource = StaticSiteCustomDomainResource{} +var _ sdk.Resource = StaticWebAppCustomDomainResource{} -const ( - txtValidationType = "dns-txt-token" - cnameValidationType = "cname-delegation" -) - -type StaticSiteCustomDomainResourceModel struct { +type StaticWebAppCustomDomainResourceModel struct { DomainName string `tfschema:"domain_name"` StaticSiteId string `tfschema:"static_site_id"` ValidationType string `tfschema:"validation_type"` ValidationToken string `tfschema:"validation_token"` } -func (r StaticSiteCustomDomainResource) Arguments() map[string]*schema.Schema { +func (r StaticWebAppCustomDomainResource) Arguments() map[string]*schema.Schema { return map[string]*pluginsdk.Schema{ "static_site_id": { Type: pluginsdk.TypeString, @@ -49,17 +45,17 @@ func (r StaticSiteCustomDomainResource) Arguments() map[string]*schema.Schema { "validation_type": { Type: pluginsdk.TypeString, Optional: true, - Default: txtValidationType, + Default: helpers.ValidationTypeTXT, ForceNew: true, ValidateFunc: validation.StringInSlice([]string{ - txtValidationType, - cnameValidationType, + helpers.ValidationTypeTXT, + helpers.ValidationTypeCName, }, false), }, } } -func (r StaticSiteCustomDomainResource) Attributes() map[string]*schema.Schema { +func (r StaticWebAppCustomDomainResource) Attributes() map[string]*schema.Schema { return map[string]*pluginsdk.Schema{ "validation_token": { Type: pluginsdk.TypeString, @@ -69,21 +65,21 @@ func (r StaticSiteCustomDomainResource) Attributes() map[string]*schema.Schema { } } -func (r StaticSiteCustomDomainResource) ModelObject() interface{} { - return &StaticSiteCustomDomainResource{} +func (r StaticWebAppCustomDomainResource) ModelObject() interface{} { + return &StaticWebAppCustomDomainResource{} } -func (r StaticSiteCustomDomainResource) ResourceType() string { - return "azurerm_static_site_custom_domain" +func (r StaticWebAppCustomDomainResource) ResourceType() string { + return "azurerm_static_web_app_custom_domain" } -func (r StaticSiteCustomDomainResource) Create() sdk.ResourceFunc { +func (r StaticWebAppCustomDomainResource) Create() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 30 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.AppService.StaticSitesClient - model := StaticSiteCustomDomainResourceModel{} + model := StaticWebAppCustomDomainResourceModel{} if err := metadata.Decode(&model); err != nil { return err @@ -123,7 +119,7 @@ func (r StaticSiteCustomDomainResource) Create() sdk.ResourceFunc { } } -func (r StaticSiteCustomDomainResource) Read() sdk.ResourceFunc { +func (r StaticWebAppCustomDomainResource) Read() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 5 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { @@ -135,7 +131,7 @@ func (r StaticSiteCustomDomainResource) Read() sdk.ResourceFunc { } // Some values are not retrievable from the API so we try and load the config. - state := StaticSiteCustomDomainResourceModel{} + state := StaticWebAppCustomDomainResourceModel{} if err := metadata.Decode(&state); err != nil { return err } @@ -162,7 +158,7 @@ func (r StaticSiteCustomDomainResource) Read() sdk.ResourceFunc { } } -func (r StaticSiteCustomDomainResource) Delete() sdk.ResourceFunc { +func (r StaticWebAppCustomDomainResource) Delete() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 30 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { @@ -182,6 +178,6 @@ func (r StaticSiteCustomDomainResource) Delete() sdk.ResourceFunc { } } -func (r StaticSiteCustomDomainResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { +func (r StaticWebAppCustomDomainResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { return staticsites.ValidateCustomDomainID } diff --git a/internal/services/appservice/static_web_app_resource.go b/internal/services/appservice/static_web_app_resource.go index c2c9a6fc5c4d..cef0640b2ad4 100644 --- a/internal/services/appservice/static_web_app_resource.go +++ b/internal/services/appservice/static_web_app_resource.go @@ -46,7 +46,7 @@ func (r StaticWebAppResource) Arguments() map[string]*schema.Schema { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: validate.StaticSiteName, + ValidateFunc: validate.StaticWebAppName, }, "resource_group_name": commonschema.ResourceGroupName(), @@ -107,7 +107,7 @@ func (r StaticWebAppResource) ModelObject() interface{} { } func (r StaticWebAppResource) ResourceType() string { - return "azurerm_static_site" + return "azurerm_static_web_app" } func (r StaticWebAppResource) Create() sdk.ResourceFunc { diff --git a/internal/services/appservice/static_site_resource_custom_domain_test.go b/internal/services/appservice/static_web_app_resource_custom_domain_test.go similarity index 100% rename from internal/services/appservice/static_site_resource_custom_domain_test.go rename to internal/services/appservice/static_web_app_resource_custom_domain_test.go diff --git a/internal/services/appservice/static_site_resource_test.go b/internal/services/appservice/static_web_app_resource_test.go similarity index 100% rename from internal/services/appservice/static_site_resource_test.go rename to internal/services/appservice/static_web_app_resource_test.go diff --git a/internal/services/appservice/validate/static_web_app.go b/internal/services/appservice/validate/static_web_app.go new file mode 100644 index 000000000000..d4f4033b8644 --- /dev/null +++ b/internal/services/appservice/validate/static_web_app.go @@ -0,0 +1,19 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package validate + +import ( + "fmt" + "regexp" +) + +func StaticWebAppName(v interface{}, k string) (warnings []string, errors []error) { + value := v.(string) + + if matched := regexp.MustCompile(`^[0-9a-zA-Z-]{1,60}$`).Match([]byte(value)); !matched { + errors = append(errors, fmt.Errorf("%q may only contain alphanumeric characters and dashes and up to 60 characters in length", k)) + } + + return warnings, errors +} diff --git a/internal/services/web/parse/static_site.go b/internal/services/web/parse/static_site.go new file mode 100644 index 000000000000..ad9d5f56c251 --- /dev/null +++ b/internal/services/web/parse/static_site.go @@ -0,0 +1,72 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package parse + +// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +type StaticSiteId struct { + SubscriptionId string + ResourceGroup string + Name string +} + +func NewStaticSiteID(subscriptionId, resourceGroup, name string) StaticSiteId { + return StaticSiteId{ + SubscriptionId: subscriptionId, + ResourceGroup: resourceGroup, + Name: name, + } +} + +func (id StaticSiteId) String() string { + segments := []string{ + fmt.Sprintf("Name %q", id.Name), + fmt.Sprintf("Resource Group %q", id.ResourceGroup), + } + segmentsStr := strings.Join(segments, " / ") + return fmt.Sprintf("%s: (%s)", "Static Site", segmentsStr) +} + +func (id StaticSiteId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.Name) +} + +// StaticSiteID parses a StaticSite ID into an StaticSiteId struct +func StaticSiteID(input string) (*StaticSiteId, error) { + id, err := resourceids.ParseAzureResourceID(input) + if err != nil { + return nil, fmt.Errorf("parsing %q as an StaticSite ID: %+v", input, err) + } + + resourceId := StaticSiteId{ + SubscriptionId: id.SubscriptionID, + ResourceGroup: id.ResourceGroup, + } + + if resourceId.SubscriptionId == "" { + return nil, fmt.Errorf("ID was missing the 'subscriptions' element") + } + + if resourceId.ResourceGroup == "" { + return nil, fmt.Errorf("ID was missing the 'resourceGroups' element") + } + + if resourceId.Name, err = id.PopSegment("staticSites"); err != nil { + return nil, err + } + + if err := id.ValidateNoEmptySegments(input); err != nil { + return nil, err + } + + return &resourceId, nil +} diff --git a/internal/services/web/parse/static_site_test.go b/internal/services/web/parse/static_site_test.go new file mode 100644 index 000000000000..dacc7d3433bd --- /dev/null +++ b/internal/services/web/parse/static_site_test.go @@ -0,0 +1,115 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package parse + +// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten + +import ( + "testing" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.Id = StaticSiteId{} + +func TestStaticSiteIDFormatter(t *testing.T) { + actual := NewStaticSiteID("12345678-1234-9876-4563-123456789012", "group1", "my-static-site1").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/my-static-site1" + if actual != expected { + t.Fatalf("Expected %q but got %q", expected, actual) + } +} + +func TestStaticSiteID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *StaticSiteId + }{ + + { + // empty + Input: "", + Error: true, + }, + + { + // missing SubscriptionId + Input: "/", + Error: true, + }, + + { + // missing value for SubscriptionId + Input: "/subscriptions/", + Error: true, + }, + + { + // missing ResourceGroup + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", + Error: true, + }, + + { + // missing value for ResourceGroup + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", + Error: true, + }, + + { + // missing Name + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/", + Error: true, + }, + + { + // missing value for Name + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/", + Error: true, + }, + + { + // valid + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/my-static-site1", + Expected: &StaticSiteId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroup: "group1", + Name: "my-static-site1", + }, + }, + + { + // upper-cased + Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/GROUP1/PROVIDERS/MICROSOFT.WEB/STATICSITES/MY-STATIC-SITE1", + Error: true, + }, + } + + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := StaticSiteID(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %s", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + if actual.ResourceGroup != v.Expected.ResourceGroup { + t.Fatalf("Expected %q but got %q for ResourceGroup", v.Expected.ResourceGroup, actual.ResourceGroup) + } + if actual.Name != v.Expected.Name { + t.Fatalf("Expected %q but got %q for Name", v.Expected.Name, actual.Name) + } + } +} diff --git a/internal/services/web/registration.go b/internal/services/web/registration.go index 4d41aebde28b..74cce64710eb 100644 --- a/internal/services/web/registration.go +++ b/internal/services/web/registration.go @@ -56,6 +56,8 @@ func (r Registration) SupportedResources() map[string]*pluginsdk.Resource { "azurerm_app_service": resourceAppService(), "azurerm_function_app": resourceFunctionApp(), "azurerm_function_app_slot": resourceFunctionAppSlot(), + "azurerm_static_site": resourceStaticSite(), + "azurerm_static_site_custom_domain": resourceStaticSiteCustomDomain(), } } diff --git a/internal/services/web/resourceids.go b/internal/services/web/resourceids.go index 40056feb9e80..583675d96961 100644 --- a/internal/services/web/resourceids.go +++ b/internal/services/web/resourceids.go @@ -16,6 +16,8 @@ package web //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=ManagedCertificate -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Web/certificates/customhost.contoso.com //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=PublicCertificate -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Web/sites/site1/publicCertificates/publicCertificate1 //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=SlotVirtualNetworkSwiftConnection -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Web/sites/site1/slots/slot1/config/virtualNetwork +//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=StaticSite -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/my-static-site1 +//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=StaticSiteCustomDomain -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/my-static-site1/customDomains/name.contoso.com //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=VirtualNetworkSwiftConnection -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Web/sites/site1/config/virtualNetwork // @tombuildsstuff: this is going to require a State Migration to account for `serverfarms` -> `serverFarms` prior to migrating to `hashicorp/go-azure-sdk` diff --git a/internal/services/web/static_site_custom_domain_resource.go b/internal/services/web/static_site_custom_domain_resource.go new file mode 100644 index 000000000000..289349d3ef91 --- /dev/null +++ b/internal/services/web/static_site_custom_domain_resource.go @@ -0,0 +1,224 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package web + +import ( + "fmt" + "log" + "time" + + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck + "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/parse" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/validate" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" + "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +const ( + txtValidationType = "dns-txt-token" + cnameValidationType = "cname-delegation" +) + +func resourceStaticSiteCustomDomain() *pluginsdk.Resource { + return &pluginsdk.Resource{ + Create: resourceStaticSiteCustomDomainCreate, + Read: resourceStaticSiteCustomDomainRead, + Delete: resourceStaticSiteCustomDomainDelete, + Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { + _, err := parse.StaticSiteCustomDomainID(id) + return err + }), + + Timeouts: &pluginsdk.ResourceTimeout{ + Create: pluginsdk.DefaultTimeout(30 * time.Minute), + Read: pluginsdk.DefaultTimeout(5 * time.Minute), + Delete: pluginsdk.DefaultTimeout(30 * time.Minute), + }, + + Schema: map[string]*pluginsdk.Schema{ + "static_site_id": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validate.StaticSiteID, + }, + + "domain_name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "validation_type": { + Type: pluginsdk.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + txtValidationType, + cnameValidationType, + }, false), + }, + + "validation_token": { + Type: pluginsdk.TypeString, + Sensitive: true, + Computed: true, + }, + }, + } +} + +func resourceStaticSiteCustomDomainCreate(d *pluginsdk.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).Web.StaticSitesClient + ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d) + defer cancel() + + log.Printf("[INFO] preparing arguments for AzureRM Static Site custom domain creation.") + + staticSiteId, err := parse.StaticSiteID(d.Get("static_site_id").(string)) + if err != nil { + return err + } + + id := parse.NewStaticSiteCustomDomainID(staticSiteId.SubscriptionId, staticSiteId.ResourceGroup, staticSiteId.Name, d.Get("domain_name").(string)) + _, err = client.GetStaticSite(ctx, id.ResourceGroup, id.StaticSiteName) + if err != nil { + return fmt.Errorf("retrieving %s: %+v", *staticSiteId, err) + } + + existing, err := client.GetStaticSiteCustomDomain(ctx, staticSiteId.ResourceGroup, id.StaticSiteName, id.CustomDomainName) + if err != nil { + if !utils.ResponseWasNotFound(existing.Response) { + return fmt.Errorf("checking for presence of existing %s: %+v", id, err) + } + } + + if !utils.ResponseWasNotFound(existing.Response) { + return tf.ImportAsExistsError("azurerm_static_site_custom_domain", staticSiteId.ID()) + } + + validationMethod := d.Get("validation_type").(string) + if validationMethod == "" { + return fmt.Errorf("`validation_type` can't be empty string") + } + + siteEnvelope := web.StaticSiteCustomDomainRequestPropertiesARMResource{ + StaticSiteCustomDomainRequestPropertiesARMResourceProperties: &web.StaticSiteCustomDomainRequestPropertiesARMResourceProperties{ + ValidationMethod: &validationMethod, + }, + } + + future, err := client.CreateOrUpdateStaticSiteCustomDomain(ctx, staticSiteId.ResourceGroup, id.StaticSiteName, id.CustomDomainName, siteEnvelope) + if err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } + + // we can't wait for the future to be complete for txt validation as we need to give the user the validation token + if validationMethod == cnameValidationType { + err := future.WaitForCompletionRef(ctx, client.Client) + if err != nil { + return fmt.Errorf("waiting for creation of %s: %+v", id, err) + } + } + + // we need to poll till the validation token is ready + if validationMethod == txtValidationType { + deadline, ok := ctx.Deadline() + if !ok { + return fmt.Errorf("context was missing a deadline") + } + stateConf := &pluginsdk.StateChangeConf{ + Pending: []string{ + string(web.CustomDomainStatusRetrievingValidationToken), + }, + Target: []string{ + string(web.CustomDomainStatusValidating), + }, + MinTimeout: 20 * time.Second, + Timeout: time.Until(deadline), + Refresh: func() (interface{}, string, error) { + domain, err := client.GetStaticSiteCustomDomain(ctx, staticSiteId.ResourceGroup, id.StaticSiteName, id.CustomDomainName) + if err != nil { + return domain, "Error", fmt.Errorf("retrieving %s: %+v", id, err) + } + + if domain.StaticSiteCustomDomainOverviewARMResourceProperties == nil { + return nil, "Failed", fmt.Errorf("`properties` was missing from the response") + } + return domain, string(domain.StaticSiteCustomDomainOverviewARMResourceProperties.Status), nil + }, + } + + if _, err := stateConf.WaitForStateContext(ctx); err != nil { + return fmt.Errorf("waiting for DNS Validation after Creation of %s %+v", id, err) + } + } + + // we set `validation_token` into state here since it's removed from the API once it's been validated + // setting it in the read would overwrite the value with an empty string and cause a diff, since this + // is not a user specifiable field we don't need to be concerned with it at import time either + resp, err := client.GetStaticSiteCustomDomain(ctx, staticSiteId.ResourceGroup, id.StaticSiteName, id.CustomDomainName) + if err != nil { + return fmt.Errorf("retrieving %s: %+v", id, err) + } + d.Set("validation_token", pointer.From(resp.ValidationToken)) + + d.SetId(id.ID()) + + return resourceStaticSiteCustomDomainRead(d, meta) +} + +func resourceStaticSiteCustomDomainRead(d *pluginsdk.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).Web.StaticSitesClient + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := parse.StaticSiteCustomDomainID(d.Id()) + if err != nil { + return err + } + + resp, err := client.GetStaticSiteCustomDomain(ctx, id.ResourceGroup, id.StaticSiteName, id.CustomDomainName) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + log.Printf("[DEBUG] %s was not found - removing from state", *id) + d.SetId("") + return nil + } + return fmt.Errorf("retrieving %s: %+v", *id, err) + } + d.Set("domain_name", id.CustomDomainName) + d.Set("static_site_id", parse.NewStaticSiteID(id.SubscriptionId, id.ResourceGroup, id.StaticSiteName).ID()) + + return nil +} + +func resourceStaticSiteCustomDomainDelete(d *pluginsdk.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).Web.StaticSitesClient + ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := parse.StaticSiteCustomDomainID(d.Id()) + if err != nil { + return err + } + + log.Printf("[DEBUG] Deleting Static Site Custom Domain %q (resource group %q)", id.CustomDomainName, id.ResourceGroup) + + future, err := client.DeleteStaticSiteCustomDomain(ctx, id.ResourceGroup, id.StaticSiteName, id.CustomDomainName) + if err != nil { + return fmt.Errorf("deleting %s: %+v", id, err) + } + if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { + return fmt.Errorf("waiting for deletion of %s: %+v", id, err) + } + + return nil +} diff --git a/internal/services/web/static_site_resource.go b/internal/services/web/static_site_resource.go new file mode 100644 index 000000000000..16ebba0a08e5 --- /dev/null +++ b/internal/services/web/static_site_resource.go @@ -0,0 +1,331 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package web + +import ( + "fmt" + "log" + "time" + + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/parse" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/validate" + "github.com/hashicorp/terraform-provider-azurerm/internal/tags" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" + "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +func resourceStaticSite() *pluginsdk.Resource { + return &pluginsdk.Resource{ + DeprecationMessage: "This resource has been deprecated in favour of `azurerm_static_web_app` and will be removed in a future release.", + Create: resourceStaticSiteCreateOrUpdate, + Read: resourceStaticSiteRead, + Update: resourceStaticSiteCreateOrUpdate, + Delete: resourceStaticSiteDelete, + Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { + _, err := parse.StaticSiteID(id) + return err + }), + + Timeouts: &pluginsdk.ResourceTimeout{ + Create: pluginsdk.DefaultTimeout(30 * time.Minute), + Read: pluginsdk.DefaultTimeout(5 * time.Minute), + Update: pluginsdk.DefaultTimeout(30 * time.Minute), + Delete: pluginsdk.DefaultTimeout(30 * time.Minute), + }, + + Schema: map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validate.StaticSiteName, + }, + + "resource_group_name": commonschema.ResourceGroupName(), + + "location": commonschema.Location(), + + "sku_tier": { + Type: pluginsdk.TypeString, + Optional: true, + Default: string(web.SkuNameFree), + ValidateFunc: validation.StringInSlice([]string{ + string(web.SkuNameStandard), + string(web.SkuNameFree), + }, false), + }, + + "sku_size": { + Type: pluginsdk.TypeString, + Optional: true, + Default: string(web.SkuNameFree), + ValidateFunc: validation.StringInSlice([]string{ + string(web.SkuNameStandard), + string(web.SkuNameFree), + }, false), + }, + + "app_settings": { + Type: pluginsdk.TypeMap, + Optional: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + }, + }, + + "default_host_name": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "identity": commonschema.SystemAssignedUserAssignedIdentityOptional(), + + "api_key": { + Type: pluginsdk.TypeString, + Computed: true, + Sensitive: true, + }, + + "tags": tags.Schema(), + }, + } +} + +func resourceStaticSiteCreateOrUpdate(d *pluginsdk.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).Web.StaticSitesClient + subscriptionId := meta.(*clients.Client).Account.SubscriptionId + ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d) + defer cancel() + + log.Printf("[INFO] preparing arguments for AzureRM Static Site creation.") + + id := parse.NewStaticSiteID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) + + if d.IsNewResource() { + existing, err := client.GetStaticSite(ctx, id.ResourceGroup, id.Name) + if err != nil { + if !utils.ResponseWasNotFound(existing.Response) { + return fmt.Errorf("failed checking for presence of existing %s: %+v", id, err) + } + } + + if !utils.ResponseWasNotFound(existing.Response) { + return tf.ImportAsExistsError("azurerm_static_site", id.ID()) + } + } + + loc := location.Normalize(d.Get("location").(string)) + + skuName := d.Get("sku_size").(string) + + identity, err := expandStaticSiteIdentity(d.Get("identity").([]interface{})) + if err != nil { + return fmt.Errorf("expanding `identity`: %+v", err) + } + + // See: https://github.com/Azure/azure-rest-api-specs/issues/17525 + if skuName == string(web.SkuNameFree) && identity != nil { + return fmt.Errorf("a Managed Identity cannot be used when tier is set to `Free`") + } + + siteEnvelope := web.StaticSiteARMResource{ + Sku: &web.SkuDescription{ + Name: &skuName, + Tier: utils.String(d.Get("sku_tier").(string)), + }, + StaticSite: &web.StaticSite{}, + Location: &loc, + Identity: identity, + Tags: tags.Expand(d.Get("tags").(map[string]interface{})), + } + + future, err := client.CreateOrUpdateStaticSite(ctx, id.ResourceGroup, id.Name, siteEnvelope) + if err != nil { + return fmt.Errorf("failed creating %s: %+v", id, err) + } + if err := future.WaitForCompletionRef(ctx, client.Client); err != nil { + return fmt.Errorf("waiting for creation of %q: %+v", id, err) + } + + d.SetId(id.ID()) + + if d.HasChange("app_settings") { + settings := web.StringDictionary{ + Properties: expandStaticSiteAppSettings(d), + } + + if _, err := client.CreateOrUpdateStaticSiteAppSettings(ctx, id.ResourceGroup, id.Name, settings); err != nil { + return fmt.Errorf("updating Application Settings for %s: %+v", id, err) + } + } + + return resourceStaticSiteRead(d, meta) +} + +func resourceStaticSiteRead(d *pluginsdk.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).Web.StaticSitesClient + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := parse.StaticSiteID(d.Id()) + if err != nil { + return err + } + + resp, err := client.GetStaticSite(ctx, id.ResourceGroup, id.Name) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + log.Printf("[DEBUG] Static Site %q (resource group %q) was not found - removing from state", id.Name, id.ResourceGroup) + d.SetId("") + return nil + } + return fmt.Errorf("failed making Read request on %s: %+v", id, err) + } + d.Set("name", id.Name) + d.Set("resource_group_name", id.ResourceGroup) + + identity, err := flattenStaticSiteIdentity(resp.Identity) + if err != nil { + return err + } + d.Set("identity", identity) + + d.Set("location", location.NormalizeNilable(resp.Location)) + + if prop := resp.StaticSite; prop != nil { + defaultHostname := "" + if prop.DefaultHostname != nil { + defaultHostname = *prop.DefaultHostname + } + d.Set("default_host_name", defaultHostname) + } + + skuName := "" + skuTier := "" + if sku := resp.Sku; sku != nil { + if v := sku.Name; v != nil { + skuName = *v + } + + if v := sku.Tier; v != nil { + skuTier = *v + } + } + d.Set("sku_size", skuName) + d.Set("sku_tier", skuTier) + + secretResp, err := client.ListStaticSiteSecrets(ctx, id.ResourceGroup, id.Name) + if err != nil { + return fmt.Errorf("listing secretes for %s: %v", id, err) + } + + apiKey := "" + if pkey := secretResp.Properties["apiKey"]; pkey != nil { + apiKey = *pkey + } + d.Set("api_key", apiKey) + + appSettingsResp, err := client.ListStaticSiteAppSettings(ctx, id.ResourceGroup, id.Name) + if err != nil { + return fmt.Errorf("making Read request for app settings on %s: %+v", id, err) + } + + if err := d.Set("app_settings", appSettingsResp.Properties); err != nil { + return fmt.Errorf("setting `app_settings`: %s", err) + } + + return tags.FlattenAndSet(d, resp.Tags) +} + +func resourceStaticSiteDelete(d *pluginsdk.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).Web.StaticSitesClient + ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := parse.StaticSiteID(d.Id()) + if err != nil { + return err + } + + log.Printf("[DEBUG] Deleting Static Site %q (resource group %q)", id.Name, id.ResourceGroup) + + future, err := client.DeleteStaticSite(ctx, id.ResourceGroup, id.Name) + if err != nil { + if !response.WasNotFound(future.Response()) { + return err + } + } + + return nil +} + +func expandStaticSiteIdentity(input []interface{}) (*web.ManagedServiceIdentity, error) { + config, err := identity.ExpandSystemAndUserAssignedMap(input) + if err != nil { + return nil, err + } + + if config.Type == identity.TypeNone { + return nil, nil + } + + out := web.ManagedServiceIdentity{ + Type: web.ManagedServiceIdentityType(config.Type), + } + + if len(config.IdentityIds) != 0 { + out.UserAssignedIdentities = make(map[string]*web.UserAssignedIdentity) + for id := range config.IdentityIds { + out.UserAssignedIdentities[id] = &web.UserAssignedIdentity{} + } + } + + return &out, nil +} + +func flattenStaticSiteIdentity(input *web.ManagedServiceIdentity) (*[]interface{}, error) { + var transform *identity.SystemAndUserAssignedMap + + if input != nil { + transform = &identity.SystemAndUserAssignedMap{ + Type: identity.Type(string(input.Type)), + IdentityIds: make(map[string]identity.UserAssignedIdentityDetails), + } + + if input.PrincipalID != nil { + transform.PrincipalId = *input.PrincipalID + } + if input.TenantID != nil { + transform.TenantId = *input.TenantID + } + for k, v := range input.UserAssignedIdentities { + transform.IdentityIds[k] = identity.UserAssignedIdentityDetails{ + ClientId: v.ClientID, + PrincipalId: v.PrincipalID, + } + } + } + + return identity.FlattenSystemAndUserAssignedMap(transform) +} + +func expandStaticSiteAppSettings(d *pluginsdk.ResourceData) map[string]*string { + input := d.Get("app_settings").(map[string]interface{}) + output := make(map[string]*string, len(input)) + + for k, v := range input { + output[k] = utils.String(v.(string)) + } + + return output +} diff --git a/internal/services/web/static_site_resource_custom_domain_test.go b/internal/services/web/static_site_resource_custom_domain_test.go new file mode 100644 index 000000000000..bc8eba336468 --- /dev/null +++ b/internal/services/web/static_site_resource_custom_domain_test.go @@ -0,0 +1,105 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package web_test + +import ( + "context" + "fmt" + "testing" + + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/parse" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +type StaticSiteCustomDomainResource struct{} + +func TestAccAzureStaticSiteCustomDomain_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_site_custom_domain", "test") + r := StaticSiteCustomDomainResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("validation_token").Exists(), + ), + }, + data.ImportStep("validation_type", "validation_token"), + }) +} + +func TestAccAzureStaticSiteCustomDomain_requiresImport(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_site_custom_domain", "test") + r := StaticSiteCustomDomainResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.RequiresImportErrorStep(r.requiresImport), + }) +} + +func (r StaticSiteCustomDomainResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { + id, err := parse.StaticSiteCustomDomainID(state.ID) + if err != nil { + return nil, err + } + + resp, err := clients.Web.StaticSitesClient.GetStaticSiteCustomDomain(ctx, id.ResourceGroup, id.StaticSiteName, id.CustomDomainName) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + return utils.Bool(false), nil + } + return nil, fmt.Errorf("retrieving Static Site %q: %+v", id, err) + } + + return utils.Bool(true), nil +} + +func (r StaticSiteCustomDomainResource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_static_site" "test" { + name = "acctestSS-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name +} + +resource "azurerm_static_site_custom_domain" "test" { + static_site_id = azurerm_static_site.test.id + domain_name = "acctestSS-%d.contoso.com" + validation_type = "dns-txt-token" +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) +} + +func (r StaticSiteCustomDomainResource) requiresImport(data acceptance.TestData) string { + template := r.basic(data) + return fmt.Sprintf(` +%s + +resource "azurerm_static_site_custom_domain" "import" { + static_site_id = azurerm_static_site.test.id + domain_name = "acctestSS-%d.contoso.com" + validation_type = "dns-txt-token" +} +`, template, data.RandomInteger) +} diff --git a/internal/services/web/static_site_resource_test.go b/internal/services/web/static_site_resource_test.go new file mode 100644 index 000000000000..19b92aa4571f --- /dev/null +++ b/internal/services/web/static_site_resource_test.go @@ -0,0 +1,418 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package web_test + +import ( + "context" + "fmt" + "testing" + + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/parse" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +type StaticSiteResource struct{} + +func TestAccAzureStaticSite_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_site", "test") + r := StaticSiteResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("default_host_name").Exists(), + check.That(data.ResourceName).Key("api_key").Exists(), + check.That(data.ResourceName).Key("tags.environment").HasValue("acceptance"), + ), + }, + data.ImportStep(), + }) +} + +func TestAccAzureStaticSite_withSystemAssignedIdentity(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_site", "test") + r := StaticSiteResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.withSystemAssignedIdentity(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("identity.#").HasValue("1"), + check.That(data.ResourceName).Key("identity.0.type").HasValue("SystemAssigned"), + check.That(data.ResourceName).Key("identity.0.principal_id").Exists(), + ), + }, + data.ImportStep(), + }) +} + +func TestAccAzureStaticSite_identity(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_site", "test") + r := StaticSiteResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.withSystemAssignedIdentity(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + { + Config: r.withSystemAssignedUserAssignedIdentity(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + { + Config: r.withUserAssignedIdentity(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + // TODO: re-enable this once the API issue is resolved: https://github.com/Azure/azure-rest-api-specs/issues/18253 + // { + // Config: r.basic(data), + // Check: acceptance.ComposeTestCheckFunc( + // check.That(data.ResourceName).ExistsInAzure(r), + // ), + // }, + // data.ImportStep(), + }) +} + +func TestAccAzureStaticSite_withSystemAssignedUserAssignedIdentity(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_site", "test") + r := StaticSiteResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.withSystemAssignedUserAssignedIdentity(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("identity.#").HasValue("1"), + check.That(data.ResourceName).Key("identity.0.type").HasValue("SystemAssigned, UserAssigned"), + check.That(data.ResourceName).Key("identity.0.principal_id").Exists(), + ), + }, + data.ImportStep(), + }) +} + +func TestAccAzureStaticSite_withUserAssignedIdentity(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_site", "test") + r := StaticSiteResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.withUserAssignedIdentity(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("identity.#").HasValue("1"), + check.That(data.ResourceName).Key("identity.0.type").HasValue("UserAssigned"), + ), + }, + data.ImportStep(), + }) +} + +func TestAccAzureStaticSite_basicUpdate(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_site", "test") + r := StaticSiteResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("default_host_name").Exists(), + check.That(data.ResourceName).Key("api_key").Exists(), + check.That(data.ResourceName).Key("tags.environment").HasValue("acceptance"), + ), + }, + data.ImportStep(), + { + Config: r.basicUpdate(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("default_host_name").Exists(), + check.That(data.ResourceName).Key("api_key").Exists(), + check.That(data.ResourceName).Key("tags.environment").HasValue("acceptance"), + check.That(data.ResourceName).Key("tags.updated").HasValue("true"), + ), + }, + }) +} + +func TestAccAzureStaticSite_requiresImport(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_site", "test") + r := StaticSiteResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.RequiresImportErrorStep(r.requiresImport), + }) +} + +func TestAccStaticSite_appSettings(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_site", "test") + r := StaticSiteResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.appSettings(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("app_settings.foo").HasValue("bar"), + ), + }, + data.ImportStep(), + { + Config: r.appSettingsUpdate(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("app_settings.foo").HasValue("bar"), + ), + }, + data.ImportStep(), + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func (r StaticSiteResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { + id, err := parse.StaticSiteID(state.ID) + if err != nil { + return nil, err + } + + resp, err := clients.Web.StaticSitesClient.GetStaticSite(ctx, id.ResourceGroup, id.Name) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + return utils.Bool(false), nil + } + return nil, fmt.Errorf("retrieving Static Site %q: %+v", id, err) + } + + return utils.Bool(true), nil +} + +func (r StaticSiteResource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%[1]d" + location = "%[2]s" +} + +resource "azurerm_static_site" "test" { + name = "acctestSS-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + tags = { + environment = "acceptance" + } +} +`, data.RandomInteger, data.Locations.Secondary) // TODO - Put back to primary when support ticket is resolved +} + +func (r StaticSiteResource) withSystemAssignedIdentity(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%[1]d" + location = "%[2]s" +} + +resource "azurerm_static_site" "test" { + name = "acctestSS-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_size = "Standard" + sku_tier = "Standard" + + identity { + type = "SystemAssigned" + } +} +`, data.RandomInteger, data.Locations.Secondary) // TODO - Put back to primary when support ticket is resolved +} + +func (r StaticSiteResource) withSystemAssignedUserAssignedIdentity(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%[1]d" + location = "%[2]s" +} + +resource "azurerm_user_assigned_identity" "test" { + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + + name = "acctest-%[1]d" +} + +resource "azurerm_static_site" "test" { + name = "acctestSS-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_size = "Standard" + sku_tier = "Standard" + + identity { + type = "SystemAssigned, UserAssigned" + identity_ids = [azurerm_user_assigned_identity.test.id] + } +} +`, data.RandomInteger, data.Locations.Secondary) // TODO - Put back to primary when support ticket is resolved +} + +func (r StaticSiteResource) withUserAssignedIdentity(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%[1]d" + location = "%[2]s" +} + +resource "azurerm_user_assigned_identity" "test" { + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + + name = "acctest-%[1]d" +} + +resource "azurerm_static_site" "test" { + name = "acctestSS-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_size = "Standard" + sku_tier = "Standard" + + identity { + type = "UserAssigned" + identity_ids = [azurerm_user_assigned_identity.test.id] + } +} +`, data.RandomInteger, data.Locations.Secondary) // TODO - Put back to primary when support ticket is resolved +} + +func (r StaticSiteResource) basicUpdate(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%[1]d" + location = "%[2]s" +} + +resource "azurerm_static_site" "test" { + name = "acctestSS-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_size = "Standard" + sku_tier = "Standard" + + tags = { + environment = "acceptance" + updated = "true" + } +} +`, data.RandomInteger, data.Locations.Secondary) // TODO - Put back to primary when support ticket is resolved +} + +func (r StaticSiteResource) requiresImport(data acceptance.TestData) string { + template := r.basic(data) + return fmt.Sprintf(` +%s + +resource "azurerm_static_site" "import" { + name = azurerm_static_site.test.name + location = azurerm_static_site.test.location + resource_group_name = azurerm_static_site.test.resource_group_name +} +`, template) +} + +func (r StaticSiteResource) appSettings(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_static_site" "test" { + name = "acctestSS-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + app_settings = { + "foo" = "bar" + } +} +`, data.RandomInteger, data.Locations.Secondary, data.RandomInteger) +} + +func (r StaticSiteResource) appSettingsUpdate(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_static_site" "test" { + name = "acctestSS-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + app_settings = { + "foo" = "bar" + "baz" = "foo" + } +} +`, data.RandomInteger, data.Locations.Secondary, data.RandomInteger) +} diff --git a/internal/services/appservice/validate/static_site.go b/internal/services/web/validate/static_site.go similarity index 100% rename from internal/services/appservice/validate/static_site.go rename to internal/services/web/validate/static_site.go diff --git a/internal/services/web/validate/static_site_custom_domain_id.go b/internal/services/web/validate/static_site_custom_domain_id.go new file mode 100644 index 000000000000..fada9ea861dc --- /dev/null +++ b/internal/services/web/validate/static_site_custom_domain_id.go @@ -0,0 +1,26 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package validate + +// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten + +import ( + "fmt" + + "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/parse" +) + +func StaticSiteCustomDomainID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := parse.StaticSiteCustomDomainID(v); err != nil { + errors = append(errors, err) + } + + return +} diff --git a/internal/services/web/validate/static_site_custom_domain_id_test.go b/internal/services/web/validate/static_site_custom_domain_id_test.go new file mode 100644 index 000000000000..7e3d0ceb0cd0 --- /dev/null +++ b/internal/services/web/validate/static_site_custom_domain_id_test.go @@ -0,0 +1,91 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package validate + +// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten + +import "testing" + +func TestStaticSiteCustomDomainID(t *testing.T) { + cases := []struct { + Input string + Valid bool + }{ + + { + // empty + Input: "", + Valid: false, + }, + + { + // missing SubscriptionId + Input: "/", + Valid: false, + }, + + { + // missing value for SubscriptionId + Input: "/subscriptions/", + Valid: false, + }, + + { + // missing ResourceGroup + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", + Valid: false, + }, + + { + // missing value for ResourceGroup + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", + Valid: false, + }, + + { + // missing StaticSiteName + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/", + Valid: false, + }, + + { + // missing value for StaticSiteName + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/", + Valid: false, + }, + + { + // missing CustomDomainName + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/my-static-site1/", + Valid: false, + }, + + { + // missing value for CustomDomainName + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/my-static-site1/customDomains/", + Valid: false, + }, + + { + // valid + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/my-static-site1/customDomains/name.contoso.com", + Valid: true, + }, + + { + // upper-cased + Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/GROUP1/PROVIDERS/MICROSOFT.WEB/STATICSITES/MY-STATIC-SITE1/CUSTOMDOMAINS/NAME.CONTOSO.COM", + Valid: false, + }, + } + for _, tc := range cases { + t.Logf("[DEBUG] Testing Value %s", tc.Input) + _, errors := StaticSiteCustomDomainID(tc.Input, "test") + valid := len(errors) == 0 + + if tc.Valid != valid { + t.Fatalf("Expected %t but got %t", tc.Valid, valid) + } + } +} diff --git a/internal/services/web/validate/static_site_id.go b/internal/services/web/validate/static_site_id.go new file mode 100644 index 000000000000..818e6d7028bf --- /dev/null +++ b/internal/services/web/validate/static_site_id.go @@ -0,0 +1,26 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package validate + +// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten + +import ( + "fmt" + + "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/parse" +) + +func StaticSiteID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := parse.StaticSiteID(v); err != nil { + errors = append(errors, err) + } + + return +} diff --git a/internal/services/web/validate/static_site_id_test.go b/internal/services/web/validate/static_site_id_test.go new file mode 100644 index 000000000000..9abee6ec21d1 --- /dev/null +++ b/internal/services/web/validate/static_site_id_test.go @@ -0,0 +1,79 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package validate + +// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten + +import "testing" + +func TestStaticSiteID(t *testing.T) { + cases := []struct { + Input string + Valid bool + }{ + + { + // empty + Input: "", + Valid: false, + }, + + { + // missing SubscriptionId + Input: "/", + Valid: false, + }, + + { + // missing value for SubscriptionId + Input: "/subscriptions/", + Valid: false, + }, + + { + // missing ResourceGroup + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", + Valid: false, + }, + + { + // missing value for ResourceGroup + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", + Valid: false, + }, + + { + // missing Name + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/", + Valid: false, + }, + + { + // missing value for Name + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/", + Valid: false, + }, + + { + // valid + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/my-static-site1", + Valid: true, + }, + + { + // upper-cased + Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/GROUP1/PROVIDERS/MICROSOFT.WEB/STATICSITES/MY-STATIC-SITE1", + Valid: false, + }, + } + for _, tc := range cases { + t.Logf("[DEBUG] Testing Value %s", tc.Input) + _, errors := StaticSiteID(tc.Input, "test") + valid := len(errors) == 0 + + if tc.Valid != valid { + t.Fatalf("Expected %t but got %t", tc.Valid, valid) + } + } +} From 5a59b663a06a05b0a5d9fdd50f18d2be388049c6 Mon Sep 17 00:00:00 2001 From: jackofallops Date: Thu, 29 Feb 2024 14:30:12 +0100 Subject: [PATCH 03/16] add new props, add datasource --- .../appservice/helpers/static_web_app.go | 68 ++++ internal/services/appservice/registration.go | 1 + .../sdkhacks/static_web_app_basic_auth.go | 92 +++++ .../static_web_app_custom_domain.go | 59 ++- .../appservice/static_web_app_data_source.go | 206 +++++++++++ .../static_web_app_data_source_test.go | 44 +++ .../appservice/static_web_app_resource.go | 219 +++++++---- ...tic_web_app_resource_custom_domain_test.go | 34 +- .../static_web_app_resource_test.go | 344 ++++++++++++++---- .../appservice/validate/static_web_app.go | 39 +- .../validate/static_web_app_test.go | 46 +++ 11 files changed, 1002 insertions(+), 150 deletions(-) create mode 100644 internal/services/appservice/helpers/static_web_app.go create mode 100644 internal/services/appservice/sdkhacks/static_web_app_basic_auth.go create mode 100644 internal/services/appservice/static_web_app_data_source.go create mode 100644 internal/services/appservice/static_web_app_data_source_test.go create mode 100644 internal/services/appservice/validate/static_web_app_test.go diff --git a/internal/services/appservice/helpers/static_web_app.go b/internal/services/appservice/helpers/static_web_app.go new file mode 100644 index 000000000000..deb26be7ebf3 --- /dev/null +++ b/internal/services/appservice/helpers/static_web_app.go @@ -0,0 +1,68 @@ +package helpers + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" +) + +type BasicAuth struct { + Password string `tfschema:"password"` + Environments string `tfschema:"environments"` // AllEnvironments, StagingEnvironments +} + +const ( + EnvironmentsTypeAllEnvironments string = "AllEnvironments" + EnvironmentsTypeStagingEnvironments string = "StagingEnvironments" + EnvironmentsTypeSpecifiedEnvironments string = "SpecifiedEnvironments" +) + +func BasicAuthSchema() *pluginsdk.Schema { + return &pluginsdk.Schema{ + Type: pluginsdk.TypeList, + MaxItems: 1, + Optional: true, + Sensitive: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*schema.Schema{ + "password": { + Type: pluginsdk.TypeString, + Required: true, + Sensitive: true, + ValidateFunc: validate.StaticWebAppPassword, + }, + + "environments": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice([]string{ + EnvironmentsTypeAllEnvironments, + EnvironmentsTypeStagingEnvironments, + }, false), + }, + }, + }, + } +} + +func BasicAuthSchemaComputed() *pluginsdk.Schema { + return &pluginsdk.Schema{ + Type: pluginsdk.TypeList, + Computed: true, + Sensitive: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*schema.Schema{ + "password": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "environments": { + Type: pluginsdk.TypeString, + Computed: true, + }, + }, + }, + } +} diff --git a/internal/services/appservice/registration.go b/internal/services/appservice/registration.go index ee2a1223d3fc..27ea650960cf 100644 --- a/internal/services/appservice/registration.go +++ b/internal/services/appservice/registration.go @@ -30,6 +30,7 @@ func (r Registration) DataSources() []sdk.DataSource { LinuxFunctionAppDataSource{}, LinuxWebAppDataSource{}, ServicePlanDataSource{}, + StaticWebAppDataSource{}, WindowsFunctionAppDataSource{}, WindowsWebAppDataSource{}, } diff --git a/internal/services/appservice/sdkhacks/static_web_app_basic_auth.go b/internal/services/appservice/sdkhacks/static_web_app_basic_auth.go new file mode 100644 index 000000000000..5c426c7b8380 --- /dev/null +++ b/internal/services/appservice/sdkhacks/static_web_app_basic_auth.go @@ -0,0 +1,92 @@ +package sdkhacks + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites" + "github.com/hashicorp/go-azure-sdk/sdk/client" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSitesClient struct { + client *staticsites.StaticSitesClient +} + +func NewStaticWebAppClient(client *staticsites.StaticSitesClient) StaticSitesClient { + return StaticSitesClient{ + client: client, + } +} + +// CreateOrUpdateBasicAuth ... +func (c StaticSitesClient) CreateOrUpdateBasicAuth(ctx context.Context, id staticsites.StaticSiteId, input staticsites.StaticSiteBasicAuthPropertiesARMResource) (result staticsites.CreateOrUpdateBasicAuthOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/config/basicAuth", id.ID()), + } + + req, err := c.client.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} + +func (c StaticSitesClient) GetBasicAuth(ctx context.Context, id staticsites.StaticSiteId) (result staticsites.GetBasicAuthOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/basicAuth/default", id.ID()), + } + + req, err := c.client.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/internal/services/appservice/static_web_app_custom_domain.go b/internal/services/appservice/static_web_app_custom_domain.go index 882a3b70f712..81949a0a0715 100644 --- a/internal/services/appservice/static_web_app_custom_domain.go +++ b/internal/services/appservice/static_web_app_custom_domain.go @@ -3,7 +3,7 @@ package appservice import ( "context" "fmt" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers" + "strings" "time" "github.com/hashicorp/go-azure-helpers/lang/pointer" @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" ) @@ -21,14 +22,14 @@ var _ sdk.Resource = StaticWebAppCustomDomainResource{} type StaticWebAppCustomDomainResourceModel struct { DomainName string `tfschema:"domain_name"` - StaticSiteId string `tfschema:"static_site_id"` + StaticSiteId string `tfschema:"static_web_app_id"` ValidationType string `tfschema:"validation_type"` ValidationToken string `tfschema:"validation_token"` } func (r StaticWebAppCustomDomainResource) Arguments() map[string]*schema.Schema { return map[string]*pluginsdk.Schema{ - "static_site_id": { + "static_web_app_id": { Type: pluginsdk.TypeString, Required: true, ForceNew: true, @@ -108,8 +109,56 @@ func (r StaticWebAppCustomDomainResource) Create() sdk.ResourceFunc { }, } - if err = client.CreateOrUpdateStaticSiteCustomDomainThenPoll(ctx, id, customDomain); err != nil { - return fmt.Errorf("creating %s: %+v", id, err) + if strings.EqualFold(model.ValidationType, helpers.ValidationTypeCName) { + if err = client.CreateOrUpdateStaticSiteCustomDomainThenPoll(ctx, id, customDomain); err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } + } else { + if _, err := client.CreateOrUpdateStaticSiteCustomDomain(ctx, id, customDomain); err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } + deadline, ok := ctx.Deadline() + if !ok { + return fmt.Errorf("context was missing a deadline") + } + stateConf := &pluginsdk.StateChangeConf{ + Pending: []string{ + string(staticsites.CustomDomainStatusRetrievingValidationToken), + }, + Target: []string{ + string(staticsites.CustomDomainStatusValidating), + }, + MinTimeout: 20 * time.Second, + Timeout: time.Until(deadline), + Refresh: func() (interface{}, string, error) { + domain, err := client.GetStaticSiteCustomDomain(ctx, id) + if err != nil { + return domain, "Error", fmt.Errorf("retrieving %s: %+v", id, err) + } + + if domain.Model == nil || domain.Model.Properties == nil { + return nil, "Failed", fmt.Errorf("`properties` was missing from the response") + } + return domain, string(pointer.From(domain.Model.Properties.Status)), nil + }, + } + + if _, err := stateConf.WaitForStateContext(ctx); err != nil { + return fmt.Errorf("waiting for DNS Validation after Creation of %s %+v", id, err) + } + } + + // Once validated the token value is zeroed, + domain, err := client.GetStaticSiteCustomDomain(ctx, id) + if err != nil { + return fmt.Errorf("reading validation token for %s: %+v", id, err) + } + if m := domain.Model; m != nil { + if m.Properties != nil { + if err = metadata.ResourceData.Set("validation_token", m.Properties.ValidationToken); err != nil { + return fmt.Errorf("setting validation_toekn value for %s: %+v", id, err) + } + } } metadata.SetID(id) diff --git a/internal/services/appservice/static_web_app_data_source.go b/internal/services/appservice/static_web_app_data_source.go new file mode 100644 index 000000000000..c1887ebde452 --- /dev/null +++ b/internal/services/appservice/static_web_app_data_source.go @@ -0,0 +1,206 @@ +package appservice + +import ( + "context" + "fmt" + "strings" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites" + "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/sdkhacks" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate" + "github.com/hashicorp/terraform-provider-azurerm/internal/tags" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" +) + +type StaticWebAppDataSource struct{} + +var _ sdk.DataSource = StaticWebAppDataSource{} + +type StaticWebAppDataSourceModel struct { + Name string `tfschema:"name"` + ResourceGroupName string `tfschema:"resource_group_name"` + Location string `tfschema:"location"` + AppSettings map[string]string `tfschema:"app_settings"` + BasicAuth []helpers.BasicAuth `tfschema:"basic_auth"` + ConfigFileChanges bool `tfschema:"configuration_file_changes_enabled"` + Identity []identity.ModelSystemAssignedUserAssigned `tfschema:"identity"` + PreviewEnvironments bool `tfschema:"preview_environments_enabled"` + SkuTier string `tfschema:"sku_tier"` + SkuSize string `tfschema:"sku_size"` + Tags map[string]string `tfschema:"tags"` + + // TODO + // CustomDomains []string `tfschema:"custom_domains"` + // DatabaseConnections ?? + // + + ApiKey string `tfschema:"api_key"` + DefaultHostName string `tfschema:"default_host_name"` +} + +func (s StaticWebAppDataSource) Arguments() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validate.StaticWebAppName, + }, + + "resource_group_name": commonschema.ResourceGroupNameForDataSource(), + } +} + +func (s StaticWebAppDataSource) Attributes() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + "location": commonschema.LocationComputed(), + + "configuration_file_changes_enabled": { + Type: pluginsdk.TypeBool, + Computed: true, + }, + + "preview_environments_enabled": { + Type: pluginsdk.TypeBool, + Computed: true, + }, + + "sku_tier": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "sku_size": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "app_settings": { + Type: pluginsdk.TypeMap, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + }, + }, + + "basic_auth": helpers.BasicAuthSchemaComputed(), + + "identity": commonschema.SystemAssignedUserAssignedIdentityComputed(), + + "api_key": { + Type: pluginsdk.TypeString, + Computed: true, + Sensitive: true, + }, + + "default_host_name": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "tags": tags.SchemaDataSource(), + } +} + +func (s StaticWebAppDataSource) ModelObject() interface{} { + return &StaticWebAppDataSourceModel{} +} + +func (s StaticWebAppDataSource) ResourceType() string { + return "azurerm_static_web_app" +} + +func (s StaticWebAppDataSource) Read() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 5 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.AppService.StaticSitesClient + subscriptionId := metadata.Client.Account.SubscriptionId + + var state StaticWebAppDataSourceModel + if err := metadata.Decode(&state); err != nil { + return err + } + + id := staticsites.NewStaticSiteID(subscriptionId, state.ResourceGroupName, state.Name) + + staticSite, err := client.GetStaticSite(ctx, id) + if err != nil { + if response.WasNotFound(staticSite.HttpResponse) { + return fmt.Errorf("%s not found", id) + } + return fmt.Errorf("retrieving %s: %+v", id, err) + } + + if model := staticSite.Model; model != nil { + state.Location = location.Normalize(model.Location) + + ident, err := identity.FlattenSystemAndUserAssignedMapToModel(model.Identity) + if err != nil { + return fmt.Errorf("flattening identity for %s: %+v", id, err) + } + state.Identity = pointer.From(ident) + + state.Tags = pointer.From(model.Tags) + if props := model.Properties; props != nil { + state.ConfigFileChanges = pointer.From(props.AllowConfigFileUpdates) + state.DefaultHostName = pointer.From(props.DefaultHostname) + state.PreviewEnvironments = pointer.From(props.StagingEnvironmentPolicy) == staticsites.StagingEnvironmentPolicyEnabled + } + + if sku := model.Sku; sku != nil { + state.SkuSize = pointer.From(sku.Name) + state.SkuTier = pointer.From(sku.Tier) + } + + sec, err := client.ListStaticSiteSecrets(ctx, id) + if err != nil || sec.Model == nil { + return fmt.Errorf("retrieving secrets for %s: %+v", id, err) + } + + if secProps := sec.Model.Properties; secProps != nil { + propsMap := pointer.From(secProps) + apiKey := "" + apiKey = propsMap["apiKey"] + state.ApiKey = apiKey + } + } + + appSettings, err := client.ListStaticSiteAppSettings(ctx, id) + if err != nil { + return fmt.Errorf("retrieving app_settings for %s: %+v", id, err) + } + if appSettingsModel := appSettings.Model; appSettingsModel != nil { + state.AppSettings = pointer.From(appSettingsModel.Properties) + } + + sdkHackClient := sdkhacks.NewStaticWebAppClient(client) + auth, err := sdkHackClient.GetBasicAuth(ctx, id) + if err != nil && !response.WasNotFound(auth.HttpResponse) { // If basic auth is not configured then this 404's + return fmt.Errorf("retrieving auth config for %s: %+v", id, err) + } + if !response.WasNotFound(auth.HttpResponse) { + if authModel := auth.Model; authModel != nil && authModel.Properties != nil && !strings.EqualFold(authModel.Properties.ApplicableEnvironmentsMode, helpers.EnvironmentsTypeSpecifiedEnvironments) { + state.BasicAuth = []helpers.BasicAuth{ + { + Password: metadata.ResourceData.Get("basic_auth.0.password").(string), // Grab this from the config, if we can. + Environments: authModel.Properties.ApplicableEnvironmentsMode, + }, + } + } + } + + metadata.SetID(id) + + return metadata.Encode(&state) + }, + } +} diff --git a/internal/services/appservice/static_web_app_data_source_test.go b/internal/services/appservice/static_web_app_data_source_test.go new file mode 100644 index 000000000000..1558e0becadc --- /dev/null +++ b/internal/services/appservice/static_web_app_data_source_test.go @@ -0,0 +1,44 @@ +package appservice_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" +) + +type StaticWebAppDataSource struct{} + +func TestAccAzureStaticWebAppDataSource_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_static_web_app", "test") + r := StaticWebAppDataSource{} + + data.DataSourceTest(t, []acceptance.TestStep{ + { + Config: r.complete(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).Key("default_host_name").Exists(), + check.That(data.ResourceName).Key("api_key").Exists(), + check.That(data.ResourceName).Key("tags.environment").HasValue("acceptance"), + check.That(data.ResourceName).Key("basic_auth.#").HasValue("1"), + check.That(data.ResourceName).Key("basic_auth.0.environments").HasValue("AllEnvironments"), + check.That(data.ResourceName).Key("identity.#").Exists(), + check.That(data.ResourceName).Key("identity.0.type").HasValue("SystemAssigned, UserAssigned"), + ), + }, + }) +} + +func (StaticWebAppDataSource) complete(data acceptance.TestData) string { + return fmt.Sprintf(` + + +%s + +data "azurerm_static_web_app" "test" { + name = azurerm_static_web_app.test.name + resource_group_name = azurerm_static_web_app.test.resource_group_name +} +`, StaticWebAppResource{}.complete(data)) +} diff --git a/internal/services/appservice/static_web_app_resource.go b/internal/services/appservice/static_web_app_resource.go index cef0640b2ad4..d4fc1f6a1386 100644 --- a/internal/services/appservice/static_web_app_resource.go +++ b/internal/services/appservice/static_web_app_resource.go @@ -3,7 +3,7 @@ package appservice import ( "context" "fmt" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate" + "strings" "time" "github.com/hashicorp/go-azure-helpers/lang/pointer" @@ -13,8 +13,10 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/resourceproviders" "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/sdkhacks" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -27,20 +29,23 @@ var _ sdk.ResourceWithUpdate = StaticWebAppResource{} var _ sdk.ResourceWithCustomizeDiff = StaticWebAppResource{} type StaticWebAppResourceModel struct { - Name string `tfschema:"name"` - ResourceGroupName string `tfschema:"resource_group_name"` - Location string `tfschema:"location"` - SkuTier string `tfschema:"sku_tier"` - SkuSize string `tfschema:"sku_size"` - AppSettings map[string]string `tfschema:"app_settings"` - Identity []identity.ModelSystemAssignedUserAssigned `tfschema:"identity"` - Tags map[string]string `tfschema:"tags"` + Name string `tfschema:"name"` + ResourceGroupName string `tfschema:"resource_group_name"` + Location string `tfschema:"location"` + AppSettings map[string]string `tfschema:"app_settings"` + BasicAuth []helpers.BasicAuth `tfschema:"basic_auth"` + ConfigFileChanges bool `tfschema:"configuration_file_changes_enabled"` + Identity []identity.ModelSystemAssignedUserAssigned `tfschema:"identity"` + PreviewEnvironments bool `tfschema:"preview_environments_enabled"` + SkuTier string `tfschema:"sku_tier"` + SkuSize string `tfschema:"sku_size"` + Tags map[string]string `tfschema:"tags"` ApiKey string `tfschema:"api_key"` DefaultHostName string `tfschema:"default_host_name"` } -func (r StaticWebAppResource) Arguments() map[string]*schema.Schema { +func (r StaticWebAppResource) Arguments() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{ "name": { Type: pluginsdk.TypeString, @@ -53,6 +58,18 @@ func (r StaticWebAppResource) Arguments() map[string]*schema.Schema { "location": commonschema.Location(), + "configuration_file_changes_enabled": { + Type: pluginsdk.TypeBool, + Optional: true, + Default: true, + }, + + "preview_environments_enabled": { + Type: pluginsdk.TypeBool, + Optional: true, + Default: true, + }, + "sku_tier": { Type: pluginsdk.TypeString, Optional: true, @@ -81,13 +98,15 @@ func (r StaticWebAppResource) Arguments() map[string]*schema.Schema { }, }, + "basic_auth": helpers.BasicAuthSchema(), + "identity": commonschema.SystemAssignedUserAssignedIdentityOptional(), "tags": tags.Schema(), } } -func (r StaticWebAppResource) Attributes() map[string]*schema.Schema { +func (r StaticWebAppResource) Attributes() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{ "api_key": { Type: pluginsdk.TypeString, @@ -106,6 +125,10 @@ func (r StaticWebAppResource) ModelObject() interface{} { return &StaticWebAppResourceModel{} } +func (r StaticWebAppResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { + return staticsites.ValidateStaticSiteID +} + func (r StaticWebAppResource) ResourceType() string { return "azurerm_static_web_app" } @@ -135,10 +158,7 @@ func (r StaticWebAppResource) Create() sdk.ResourceFunc { return metadata.ResourceRequiresImport(r.ResourceType(), id) } - ident, err := identity.ExpandSystemAndUserAssignedMapFromModel(model.Identity) - envelope := staticsites.StaticSiteARMResource{ - Identity: ident, Location: location.Normalize(model.Location), Properties: nil, Sku: &staticsites.SkuDescription{ @@ -148,25 +168,21 @@ func (r StaticWebAppResource) Create() sdk.ResourceFunc { Tags: pointer.To(model.Tags), } - props := &staticsites.StaticSite{ // TODO - Can we support this now? - AllowConfigFileUpdates: nil, - Branch: nil, - BuildProperties: nil, - ContentDistributionEndpoint: nil, - CustomDomains: nil, - DatabaseConnections: nil, - DefaultHostname: nil, - EnterpriseGradeCdnStatus: nil, - KeyVaultReferenceIdentity: nil, - LinkedBackends: nil, - PrivateEndpointConnections: nil, - Provider: nil, - PublicNetworkAccess: nil, - RepositoryToken: nil, - RepositoryUrl: nil, - StagingEnvironmentPolicy: nil, - TemplateProperties: nil, - UserProvidedFunctionApps: nil, + ident, err := identity.ExpandSystemAndUserAssignedMapFromModel(model.Identity) + if err != nil { + return fmt.Errorf("expanding identity for %s: %+v", id, err) + } + if ident.Type != identity.TypeNone { + envelope.Identity = ident + } + + props := &staticsites.StaticSite{ + AllowConfigFileUpdates: pointer.To(model.ConfigFileChanges), + StagingEnvironmentPolicy: pointer.To(staticsites.StagingEnvironmentPolicyEnabled), + } + + if !model.PreviewEnvironments { + props.StagingEnvironmentPolicy = pointer.To(staticsites.StagingEnvironmentPolicyDisabled) } envelope.Properties = props @@ -187,6 +203,24 @@ func (r StaticWebAppResource) Create() sdk.ResourceFunc { } } + if len(model.BasicAuth) > 0 { + sdkHackClient := sdkhacks.NewStaticWebAppClient(client) + + auth := model.BasicAuth[0] + + authProps := staticsites.StaticSiteBasicAuthPropertiesARMResource{ + Properties: &staticsites.StaticSiteBasicAuthPropertiesARMResourceProperties{ + ApplicableEnvironmentsMode: auth.Environments, + Password: pointer.To(auth.Password), + SecretState: pointer.To("Password"), + }, + } + + if _, err := sdkHackClient.CreateOrUpdateBasicAuth(ctx, id, authProps); err != nil { + return fmt.Errorf("setting basic auth on %s: %+v", id, err) + } + } + return nil }, } @@ -227,7 +261,9 @@ func (r StaticWebAppResource) Read() sdk.ResourceFunc { state.Tags = pointer.From(model.Tags) if props := model.Properties; props != nil { + state.ConfigFileChanges = pointer.From(props.AllowConfigFileUpdates) state.DefaultHostName = pointer.From(props.DefaultHostname) + state.PreviewEnvironments = pointer.From(props.StagingEnvironmentPolicy) == staticsites.StagingEnvironmentPolicyEnabled } if sku := model.Sku; sku != nil { @@ -248,6 +284,30 @@ func (r StaticWebAppResource) Read() sdk.ResourceFunc { } } + appSettings, err := client.ListStaticSiteAppSettings(ctx, *id) + if err != nil { + return fmt.Errorf("retrieving app_settings for %s: %+v", *id, err) + } + if appSettingsModel := appSettings.Model; appSettingsModel != nil { + state.AppSettings = pointer.From(appSettingsModel.Properties) + } + + sdkHackClient := sdkhacks.NewStaticWebAppClient(client) + auth, err := sdkHackClient.GetBasicAuth(ctx, *id) + if err != nil && !response.WasNotFound(auth.HttpResponse) { // If basic auth is not configured then this 404's + return fmt.Errorf("retrieving auth config for %s: %+v", *id, err) + } + if !response.WasNotFound(auth.HttpResponse) { + if authModel := auth.Model; authModel != nil && authModel.Properties != nil && !strings.EqualFold(authModel.Properties.ApplicableEnvironmentsMode, helpers.EnvironmentsTypeSpecifiedEnvironments) { + state.BasicAuth = []helpers.BasicAuth{ + { + Password: metadata.ResourceData.Get("basic_auth.0.password").(string), // Grab this from the config, if we can. + Environments: authModel.Properties.ApplicableEnvironmentsMode, + }, + } + } + } + return metadata.Encode(&state) }, } @@ -273,10 +333,6 @@ func (r StaticWebAppResource) Delete() sdk.ResourceFunc { } } -func (r StaticWebAppResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { - return staticsites.ValidateStaticSiteID -} - func (r StaticWebAppResource) Update() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 30 * time.Minute, @@ -306,7 +362,12 @@ func (r StaticWebAppResource) Update() sdk.ResourceFunc { if err != nil { return err } - model.Identity = ident + if ident.Type != identity.TypeNone { + model.Identity = ident + } else { + model.Identity = &identity.SystemAndUserAssignedMap{} + } + } if metadata.ResourceData.HasChanges("sku_tier", "sku_size") { @@ -316,28 +377,21 @@ func (r StaticWebAppResource) Update() sdk.ResourceFunc { } } - props := &staticsites.StaticSite{ // TODO - Can we support this now? - AllowConfigFileUpdates: nil, - Branch: nil, - BuildProperties: nil, - ContentDistributionEndpoint: nil, - CustomDomains: nil, - DatabaseConnections: nil, - DefaultHostname: nil, - EnterpriseGradeCdnStatus: nil, - KeyVaultReferenceIdentity: nil, - LinkedBackends: nil, - PrivateEndpointConnections: nil, - Provider: nil, - PublicNetworkAccess: nil, - RepositoryToken: nil, - RepositoryUrl: nil, - StagingEnvironmentPolicy: nil, - TemplateProperties: nil, - UserProvidedFunctionApps: nil, - } - - model.Properties = props + if metadata.ResourceData.HasChange("configuration_file_changes_enabled") { + model.Properties.AllowConfigFileUpdates = pointer.To(config.ConfigFileChanges) + } + + if metadata.ResourceData.HasChange("preview_environments_enabled") { + if config.PreviewEnvironments { + model.Properties.StagingEnvironmentPolicy = pointer.To(staticsites.StagingEnvironmentPolicyDisabled) + } else { + model.Properties.StagingEnvironmentPolicy = pointer.To(staticsites.StagingEnvironmentPolicyEnabled) + } + } + + if metadata.ResourceData.HasChange("tags") { + model.Tags = pointer.To(config.Tags) + } if err := client.CreateOrUpdateStaticSiteThenPoll(ctx, *id, model); err != nil { return fmt.Errorf("creating %s: %+v", id, err) @@ -353,6 +407,29 @@ func (r StaticWebAppResource) Update() sdk.ResourceFunc { } } + if metadata.ResourceData.HasChange("basic_auth") { + sdkHackClient := sdkhacks.NewStaticWebAppClient(client) + authProps := staticsites.StaticSiteBasicAuthPropertiesARMResource{} + if len(config.BasicAuth) > 0 { + auth := config.BasicAuth[0] + authProps.Properties = &staticsites.StaticSiteBasicAuthPropertiesARMResourceProperties{ + ApplicableEnvironmentsMode: auth.Environments, + Password: pointer.To(auth.Password), + SecretState: pointer.To("Password"), + } + } else { + authProps.Properties = &staticsites.StaticSiteBasicAuthPropertiesARMResourceProperties{ + ApplicableEnvironmentsMode: "SpecifiedEnvironments", + Password: nil, + SecretState: nil, + } + } + + if _, err := sdkHackClient.CreateOrUpdateBasicAuth(ctx, *id, authProps); err != nil { + return fmt.Errorf("setting basic auth on %s: %+v", *id, err) + } + } + return nil }, } @@ -360,11 +437,25 @@ func (r StaticWebAppResource) Update() sdk.ResourceFunc { func (r StaticWebAppResource) CustomizeDiff() sdk.ResourceFunc { return sdk.ResourceFunc{ + Timeout: 5 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - // TODO - Free SKU cannot be used with Identity + rd := metadata.ResourceDiff + + skuTier := rd.Get("sku_tier").(string) + skuSize := rd.Get("sku_size").(string) + + if strings.EqualFold(skuTier, string(resourceproviders.SkuNameFree)) && strings.EqualFold(skuSize, string(resourceproviders.SkuNameFree)) { + basicAuth, authOk := rd.GetOk("basic_auth") + if authOk && len(basicAuth.([]interface{})) > 0 { + return fmt.Errorf("basic_auth cannot be used with the Free tier of Static Web Apps") + } + ident, identOk := rd.GetOk("identity") + if identOk && len(ident.([]interface{})) > 0 { + return fmt.Errorf("identities cannot be used with the Free tier of Static Web Apps") + } + } + return nil }, - - Timeout: 5 * time.Minute, } } diff --git a/internal/services/appservice/static_web_app_resource_custom_domain_test.go b/internal/services/appservice/static_web_app_resource_custom_domain_test.go index 0a0004b95e06..e35749b0081f 100644 --- a/internal/services/appservice/static_web_app_resource_custom_domain_test.go +++ b/internal/services/appservice/static_web_app_resource_custom_domain_test.go @@ -16,11 +16,11 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/utils" ) -type StaticSiteCustomDomainResource struct{} +type StaticWebAppCustomDomainResource struct{} func TestAccAzureStaticSiteCustomDomain_basic(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_static_site_custom_domain", "test") - r := StaticSiteCustomDomainResource{} + data := acceptance.BuildTestData(t, "azurerm_static_web_app_custom_domain", "test") + r := StaticWebAppCustomDomainResource{} data.ResourceTest(t, r, []acceptance.TestStep{ { @@ -35,8 +35,8 @@ func TestAccAzureStaticSiteCustomDomain_basic(t *testing.T) { } func TestAccAzureStaticSiteCustomDomain_requiresImport(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_static_site_custom_domain", "test") - r := StaticSiteCustomDomainResource{} + data := acceptance.BuildTestData(t, "azurerm_static_web_app_custom_domain", "test") + r := StaticWebAppCustomDomainResource{} data.ResourceTest(t, r, []acceptance.TestStep{ { @@ -49,7 +49,7 @@ func TestAccAzureStaticSiteCustomDomain_requiresImport(t *testing.T) { }) } -func (r StaticSiteCustomDomainResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { +func (r StaticWebAppCustomDomainResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { id, err := parse.StaticSiteCustomDomainID(state.ID) if err != nil { return nil, err @@ -66,7 +66,7 @@ func (r StaticSiteCustomDomainResource) Exists(ctx context.Context, clients *cli return utils.Bool(true), nil } -func (r StaticSiteCustomDomainResource) basic(data acceptance.TestData) string { +func (r StaticWebAppCustomDomainResource) basic(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { features {} @@ -77,7 +77,7 @@ resource "azurerm_resource_group" "test" { location = "%s" } -resource "azurerm_static_site" "test" { +resource "azurerm_static_web_app" "test" { name = "acctestSS-%d" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name @@ -85,23 +85,23 @@ resource "azurerm_static_site" "test" { sku_tier = "Standard" } -resource "azurerm_static_site_custom_domain" "test" { - static_site_id = azurerm_static_site.test.id - domain_name = "acctestSS-%d.contoso.com" - validation_type = "dns-txt-token" +resource "azurerm_static_web_app_custom_domain" "test" { + static_web_app_id = azurerm_static_web_app.test.id + domain_name = "acctestSS-%d.contoso.com" + validation_type = "dns-txt-token" } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) } -func (r StaticSiteCustomDomainResource) requiresImport(data acceptance.TestData) string { +func (r StaticWebAppCustomDomainResource) requiresImport(data acceptance.TestData) string { template := r.basic(data) return fmt.Sprintf(` %s -resource "azurerm_static_site_custom_domain" "import" { - static_site_id = azurerm_static_site.test.id - domain_name = "acctestSS-%d.contoso.com" - validation_type = "dns-txt-token" +resource "azurerm_static_web_app_custom_domain" "import" { + static_web_app_id = azurerm_static_web_app.test.id + domain_name = "acctestSS-%d.contoso.com" + validation_type = "dns-txt-token" } `, template, data.RandomInteger) } diff --git a/internal/services/appservice/static_web_app_resource_test.go b/internal/services/appservice/static_web_app_resource_test.go index 837b7cbaf173..5ac899c33c17 100644 --- a/internal/services/appservice/static_web_app_resource_test.go +++ b/internal/services/appservice/static_web_app_resource_test.go @@ -6,6 +6,7 @@ package appservice_test import ( "context" "fmt" + "regexp" "testing" "github.com/hashicorp/go-azure-helpers/lang/pointer" @@ -17,11 +18,11 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" ) -type StaticSiteResource struct{} +type StaticWebAppResource struct{} -func TestAccAzureStaticSite_basic(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_static_site", "test") - r := StaticSiteResource{} +func TestAccAzureStaticWebApp_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} data.ResourceTest(t, r, []acceptance.TestStep{ { @@ -37,9 +38,61 @@ func TestAccAzureStaticSite_basic(t *testing.T) { }) } -func TestAccAzureStaticSite_withSystemAssignedIdentity(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_static_site", "test") - r := StaticSiteResource{} +func TestAccAzureStaticWebApp_complete(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.complete(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("default_host_name").Exists(), + check.That(data.ResourceName).Key("api_key").Exists(), + ), + }, + data.ImportStep(), + }) +} + +func TestAccAzureStaticWebApp_completeUpdate(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("default_host_name").Exists(), + check.That(data.ResourceName).Key("api_key").Exists(), + ), + }, + data.ImportStep(), + { + Config: r.complete(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("default_host_name").Exists(), + check.That(data.ResourceName).Key("api_key").Exists(), + ), + }, + data.ImportStep(), + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("default_host_name").Exists(), + check.That(data.ResourceName).Key("api_key").Exists(), + ), + }, + data.ImportStep(), + }) +} + +func TestAccAzureStaticWebApp_withSystemAssignedIdentity(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} data.ResourceTest(t, r, []acceptance.TestStep{ { @@ -55,9 +108,9 @@ func TestAccAzureStaticSite_withSystemAssignedIdentity(t *testing.T) { }) } -func TestAccAzureStaticSite_identity(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_static_site", "test") - r := StaticSiteResource{} +func TestAccAzureStaticWebApp_identity(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} data.ResourceTest(t, r, []acceptance.TestStep{ { @@ -82,19 +135,19 @@ func TestAccAzureStaticSite_identity(t *testing.T) { }, data.ImportStep(), // TODO: re-enable this once the API issue is resolved: https://github.com/Azure/azure-rest-api-specs/issues/18253 - // { - // Config: r.basic(data), - // Check: acceptance.ComposeTestCheckFunc( - // check.That(data.ResourceName).ExistsInAzure(r), - // ), - // }, - // data.ImportStep(), + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), }) } -func TestAccAzureStaticSite_withSystemAssignedUserAssignedIdentity(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_static_site", "test") - r := StaticSiteResource{} +func TestAccAzureStaticWebApp_withSystemAssignedUserAssignedIdentity(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} data.ResourceTest(t, r, []acceptance.TestStep{ { @@ -110,9 +163,9 @@ func TestAccAzureStaticSite_withSystemAssignedUserAssignedIdentity(t *testing.T) }) } -func TestAccAzureStaticSite_withUserAssignedIdentity(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_static_site", "test") - r := StaticSiteResource{} +func TestAccAzureStaticWebApp_withUserAssignedIdentity(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} data.ResourceTest(t, r, []acceptance.TestStep{ { @@ -127,9 +180,9 @@ func TestAccAzureStaticSite_withUserAssignedIdentity(t *testing.T) { }) } -func TestAccAzureStaticSite_basicUpdate(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_static_site", "test") - r := StaticSiteResource{} +func TestAccAzureStaticWebApp_basicUpdate(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} data.ResourceTest(t, r, []acceptance.TestStep{ { @@ -155,9 +208,9 @@ func TestAccAzureStaticSite_basicUpdate(t *testing.T) { }) } -func TestAccAzureStaticSite_requiresImport(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_static_site", "test") - r := StaticSiteResource{} +func TestAccAzureStaticWebApp_requiresImport(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} data.ResourceTest(t, r, []acceptance.TestStep{ { @@ -170,9 +223,9 @@ func TestAccAzureStaticSite_requiresImport(t *testing.T) { }) } -func TestAccStaticSite_appSettings(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_static_site", "test") - r := StaticSiteResource{} +func TestAccStaticWebApp_appSettings(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} data.ResourceTest(t, r, []acceptance.TestStep{ { @@ -201,7 +254,52 @@ func TestAccStaticSite_appSettings(t *testing.T) { }) } -func (r StaticSiteResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { +func TestAccStaticWebApp_basicAuth(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + { + Config: r.withBasicAuth(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("basic_auth.0.password"), + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func TestAccAzureStaticWebApp_basicWithConfigShouldFail(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.freeWithAuth(data), + ExpectError: regexp.MustCompile("basic_auth cannot be used with the Free tier of Static Web Apps"), + }, + { + Config: r.freeWithIdentity(data), + ExpectError: regexp.MustCompile("identities cannot be used with the Free tier of Static Web Apps"), + }, + }) +} + +func (r StaticWebAppResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { id, err := staticsites.ParseStaticSiteID(state.ID) if err != nil { return nil, err @@ -218,7 +316,7 @@ func (r StaticSiteResource) Exists(ctx context.Context, clients *clients.Client, return pointer.To(true), nil } -func (r StaticSiteResource) basic(data acceptance.TestData) string { +func (r StaticWebAppResource) basic(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { features {} @@ -229,21 +327,19 @@ resource "azurerm_resource_group" "test" { location = "%[2]s" } -resource "azurerm_static_site" "test" { +resource "azurerm_static_web_app" "test" { name = "acctestSS-%[1]d" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name - sku_size = "Standard" - sku_tier = "Standard" tags = { environment = "acceptance" } } -`, data.RandomInteger, data.Locations.Secondary) // TODO - Put back to primary when support ticket is resolved +`, data.RandomInteger, data.Locations.Primary) // TODO - Put back to primary when support ticket is resolved } -func (r StaticSiteResource) withSystemAssignedIdentity(data acceptance.TestData) string { +func (r StaticWebAppResource) withSystemAssignedIdentity(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { features {} @@ -254,7 +350,7 @@ resource "azurerm_resource_group" "test" { location = "%[2]s" } -resource "azurerm_static_site" "test" { +resource "azurerm_static_web_app" "test" { name = "acctestSS-%[1]d" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name @@ -265,10 +361,35 @@ resource "azurerm_static_site" "test" { type = "SystemAssigned" } } -`, data.RandomInteger, data.Locations.Secondary) // TODO - Put back to primary when support ticket is resolved +`, data.RandomInteger, data.Locations.Primary) +} + +func (r StaticWebAppResource) freeWithIdentity(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%[1]d" + location = "%[2]s" +} + +resource "azurerm_static_web_app" "test" { + name = "acctestSS-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_size = "Free" + sku_tier = "Free" + + identity { + type = "SystemAssigned" + } +} +`, data.RandomInteger, data.Locations.Primary) } -func (r StaticSiteResource) withSystemAssignedUserAssignedIdentity(data acceptance.TestData) string { +func (r StaticWebAppResource) withSystemAssignedUserAssignedIdentity(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { features {} @@ -286,7 +407,7 @@ resource "azurerm_user_assigned_identity" "test" { name = "acctest-%[1]d" } -resource "azurerm_static_site" "test" { +resource "azurerm_static_web_app" "test" { name = "acctestSS-%[1]d" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name @@ -298,10 +419,10 @@ resource "azurerm_static_site" "test" { identity_ids = [azurerm_user_assigned_identity.test.id] } } -`, data.RandomInteger, data.Locations.Secondary) // TODO - Put back to primary when support ticket is resolved +`, data.RandomInteger, data.Locations.Primary) // TODO - Put back to primary when support ticket is resolved } -func (r StaticSiteResource) withUserAssignedIdentity(data acceptance.TestData) string { +func (r StaticWebAppResource) withUserAssignedIdentity(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { features {} @@ -319,7 +440,7 @@ resource "azurerm_user_assigned_identity" "test" { name = "acctest-%[1]d" } -resource "azurerm_static_site" "test" { +resource "azurerm_static_web_app" "test" { name = "acctestSS-%[1]d" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name @@ -331,10 +452,10 @@ resource "azurerm_static_site" "test" { identity_ids = [azurerm_user_assigned_identity.test.id] } } -`, data.RandomInteger, data.Locations.Secondary) // TODO - Put back to primary when support ticket is resolved +`, data.RandomInteger, data.Locations.Primary) // TODO - Put back to primary when support ticket is resolved } -func (r StaticSiteResource) basicUpdate(data acceptance.TestData) string { +func (r StaticWebAppResource) basicUpdate(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { features {} @@ -345,7 +466,7 @@ resource "azurerm_resource_group" "test" { location = "%[2]s" } -resource "azurerm_static_site" "test" { +resource "azurerm_static_web_app" "test" { name = "acctestSS-%[1]d" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name @@ -357,25 +478,25 @@ resource "azurerm_static_site" "test" { updated = "true" } } -`, data.RandomInteger, data.Locations.Secondary) // TODO - Put back to primary when support ticket is resolved +`, data.RandomInteger, data.Locations.Primary) // TODO - Put back to primary when support ticket is resolved } -func (r StaticSiteResource) requiresImport(data acceptance.TestData) string { +func (r StaticWebAppResource) requiresImport(data acceptance.TestData) string { template := r.basic(data) return fmt.Sprintf(` %s -resource "azurerm_static_site" "import" { - name = azurerm_static_site.test.name - location = azurerm_static_site.test.location - resource_group_name = azurerm_static_site.test.resource_group_name - sku_size = azurerm_static_site.test.sku_size - sku_tier = azurerm_static_site.test.sku_tier +resource "azurerm_static_web_app" "import" { + name = azurerm_static_web_app.test.name + location = azurerm_static_web_app.test.location + resource_group_name = azurerm_static_web_app.test.resource_group_name + sku_size = azurerm_static_web_app.test.sku_size + sku_tier = azurerm_static_web_app.test.sku_tier } `, template) } -func (r StaticSiteResource) appSettings(data acceptance.TestData) string { +func (r StaticWebAppResource) appSettings(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { features {} @@ -386,7 +507,7 @@ resource "azurerm_resource_group" "test" { location = "%s" } -resource "azurerm_static_site" "test" { +resource "azurerm_static_web_app" "test" { name = "acctestSS-%d" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name @@ -397,10 +518,10 @@ resource "azurerm_static_site" "test" { "foo" = "bar" } } -`, data.RandomInteger, data.Locations.Secondary, data.RandomInteger) +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) } -func (r StaticSiteResource) appSettingsUpdate(data acceptance.TestData) string { +func (r StaticWebAppResource) appSettingsUpdate(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { features {} @@ -411,7 +532,7 @@ resource "azurerm_resource_group" "test" { location = "%s" } -resource "azurerm_static_site" "test" { +resource "azurerm_static_web_app" "test" { name = "acctestSS-%d" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name @@ -421,5 +542,102 @@ resource "azurerm_static_site" "test" { "baz" = "foo" } } -`, data.RandomInteger, data.Locations.Secondary, data.RandomInteger) +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) +} + +func (r StaticWebAppResource) withBasicAuth(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_static_web_app" "test" { + name = "acctestSS-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_size = "Standard" + sku_tier = "Standard" + + basic_auth { + password = "Super$3cretPassW0rd" + environments = "AllEnvironments" + } +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) +} + +func (r StaticWebAppResource) freeWithAuth(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_static_web_app" "test" { + name = "acctestSS-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_size = "Free" + sku_tier = "Free" + + basic_auth { + password = "Super$3cretPassW0rd" + environments = "AllEnvironments" + } +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) +} + +func (r StaticWebAppResource) complete(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%[1]d" + location = "%[2]s" +} + +resource "azurerm_user_assigned_identity" "test" { + name = "acctest-%[1]d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location +} + +resource "azurerm_static_web_app" "test" { + name = "acctestSS-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_size = "Standard" + sku_tier = "Standard" + + identity { + type = "SystemAssigned, UserAssigned" + identity_ids = [azurerm_user_assigned_identity.test.id] + } + + app_settings = { + "foo" = "bar" + } + + basic_auth { + password = "Super$3cretPassW0rd" + environments = "AllEnvironments" + } + + tags = { + environment = "acceptance" + } +} +`, data.RandomInteger, data.Locations.Primary) } diff --git a/internal/services/appservice/validate/static_web_app.go b/internal/services/appservice/validate/static_web_app.go index d4f4033b8644..9b1b831f8ef0 100644 --- a/internal/services/appservice/validate/static_web_app.go +++ b/internal/services/appservice/validate/static_web_app.go @@ -9,7 +9,10 @@ import ( ) func StaticWebAppName(v interface{}, k string) (warnings []string, errors []error) { - value := v.(string) + value, ok := v.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %s to be a string", k)) + } if matched := regexp.MustCompile(`^[0-9a-zA-Z-]{1,60}$`).Match([]byte(value)); !matched { errors = append(errors, fmt.Errorf("%q may only contain alphanumeric characters and dashes and up to 60 characters in length", k)) @@ -17,3 +20,37 @@ func StaticWebAppName(v interface{}, k string) (warnings []string, errors []erro return warnings, errors } + +func StaticWebAppPassword(v interface{}, k string) (warnings []string, errors []error) { + value, ok := v.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %s to be a string", k)) + return + } + + if len(value) < 8 { + errors = append(errors, fmt.Errorf("the password should be at least eight characters long.")) + } + + if matched := regexp.MustCompile(`[!@#$%^&*(),.?":{}|<>]`).Match([]byte(value)); !matched { + errors = append(errors, fmt.Errorf("the password must contain at least one symbol")) + } + + if matched := regexp.MustCompile(`[a-z]`).Match([]byte(value)); !matched { + errors = append(errors, fmt.Errorf("the password must contain at least one lower case letter")) + } + + if matched := regexp.MustCompile(`[A-Z]`).Match([]byte(value)); !matched { + errors = append(errors, fmt.Errorf("the password must contain at least one upper case letter")) + } + + if matched := regexp.MustCompile(`[0-9]`).Match([]byte(value)); !matched { + errors = append(errors, fmt.Errorf("the password must contain at least one number")) + } + + if matched := regexp.MustCompile(`[!@#$%^&*(),.?":{}|<>]`).Match([]byte(value)); !matched { + errors = append(errors, fmt.Errorf("the password must contain at least one symbol")) + } + + return +} diff --git a/internal/services/appservice/validate/static_web_app_test.go b/internal/services/appservice/validate/static_web_app_test.go new file mode 100644 index 000000000000..937bad8033ef --- /dev/null +++ b/internal/services/appservice/validate/static_web_app_test.go @@ -0,0 +1,46 @@ +package validate + +import "testing" + +func TestStaticWebAppPassword(t *testing.T) { + cases := []struct { + Input string + Valid bool + }{ + { + Input: "", + }, + { + Input: "short", + }, + { + Input: "nocapitallettersornumbers", + }, + { + Input: "NOLOWERCASELETTERSNUMBERSORSYMBOLS", + }, + { + Input: "CapitalLettersButNoNumbersOrSymbols", + }, + { + Input: "CapitalLettersWith0123ButNoSymbols", + }, + { + Input: "SECUREPASSWORD&1", + }, + { + Input: "SecUrePa$$Word1", + Valid: true, + }, + } + + for _, tc := range cases { + t.Logf("[DEBUG] Testing Value %s", tc.Input) + _, errors := StaticWebAppPassword(tc.Input, "test") + valid := len(errors) == 0 + + if tc.Valid != valid { + t.Fatalf("Expected %t but got %t", tc.Valid, valid) + } + } +} From 0c58f8c6bbd7345834b009282e7bb07b13bc1420 Mon Sep 17 00:00:00 2001 From: jackofallops Date: Thu, 29 Feb 2024 14:47:57 +0100 Subject: [PATCH 04/16] remove comment as no longer relevant --- internal/services/appservice/static_web_app_resource_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/services/appservice/static_web_app_resource_test.go b/internal/services/appservice/static_web_app_resource_test.go index 5ac899c33c17..14a953d1599e 100644 --- a/internal/services/appservice/static_web_app_resource_test.go +++ b/internal/services/appservice/static_web_app_resource_test.go @@ -134,7 +134,6 @@ func TestAccAzureStaticWebApp_identity(t *testing.T) { ), }, data.ImportStep(), - // TODO: re-enable this once the API issue is resolved: https://github.com/Azure/azure-rest-api-specs/issues/18253 { Config: r.basic(data), Check: acceptance.ComposeTestCheckFunc( From e859cfd31210409ab466145aa0172b1de96b1ae0 Mon Sep 17 00:00:00 2001 From: jackofallops Date: Thu, 29 Feb 2024 16:50:30 +0100 Subject: [PATCH 05/16] fixup update to remove identity correctly, fixup ignores on tests --- .../appservice/static_web_app_resource.go | 15 +++++++++------ .../appservice/static_web_app_resource_test.go | 7 +++++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/internal/services/appservice/static_web_app_resource.go b/internal/services/appservice/static_web_app_resource.go index d4fc1f6a1386..31e1dbc913b9 100644 --- a/internal/services/appservice/static_web_app_resource.go +++ b/internal/services/appservice/static_web_app_resource.go @@ -362,12 +362,15 @@ func (r StaticWebAppResource) Update() sdk.ResourceFunc { if err != nil { return err } - if ident.Type != identity.TypeNone { - model.Identity = ident - } else { - model.Identity = &identity.SystemAndUserAssignedMap{} + model.Identity = ident + // If we're changing to `Free` we must remove the Identity first + if strings.EqualFold(string(resourceproviders.SkuNameFree), config.SkuTier) { + if err := client.CreateOrUpdateStaticSiteThenPoll(ctx, *id, model); err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } + // Once removed, the identity payload needs to be nilled or the API validation for `Free` will reject the request + model.Identity = nil } - } if metadata.ResourceData.HasChanges("sku_tier", "sku_size") { @@ -382,7 +385,7 @@ func (r StaticWebAppResource) Update() sdk.ResourceFunc { } if metadata.ResourceData.HasChange("preview_environments_enabled") { - if config.PreviewEnvironments { + if !config.PreviewEnvironments { model.Properties.StagingEnvironmentPolicy = pointer.To(staticsites.StagingEnvironmentPolicyDisabled) } else { model.Properties.StagingEnvironmentPolicy = pointer.To(staticsites.StagingEnvironmentPolicyEnabled) diff --git a/internal/services/appservice/static_web_app_resource_test.go b/internal/services/appservice/static_web_app_resource_test.go index 14a953d1599e..ca60fdce2d80 100644 --- a/internal/services/appservice/static_web_app_resource_test.go +++ b/internal/services/appservice/static_web_app_resource_test.go @@ -51,7 +51,7 @@ func TestAccAzureStaticWebApp_complete(t *testing.T) { check.That(data.ResourceName).Key("api_key").Exists(), ), }, - data.ImportStep(), + data.ImportStep("basic_auth.0.password"), }) } @@ -77,7 +77,7 @@ func TestAccAzureStaticWebApp_completeUpdate(t *testing.T) { check.That(data.ResourceName).Key("api_key").Exists(), ), }, - data.ImportStep(), + data.ImportStep("basic_auth.0.password"), { Config: r.basic(data), Check: acceptance.ComposeTestCheckFunc( @@ -620,6 +620,9 @@ resource "azurerm_static_web_app" "test" { sku_size = "Standard" sku_tier = "Standard" + configuration_file_changes_enabled = false + preview_environments_enabled = false + identity { type = "SystemAssigned, UserAssigned" identity_ids = [azurerm_user_assigned_identity.test.id] From 27442da3c198b24a6c7aa3493172b4a66d15ceea Mon Sep 17 00:00:00 2001 From: jackofallops Date: Fri, 1 Mar 2024 10:33:07 +0100 Subject: [PATCH 06/16] add docs deprecate docs for old resources --- website/docs/r/static_site.html.markdown | 2 + .../r/static_site_custom_domain.html.markdown | 2 + website/docs/r/static_web_app.html.markdown | 105 ++++++++++++++++ ...static_web_app_custom_domain.html.markdown | 115 ++++++++++++++++++ 4 files changed, 224 insertions(+) create mode 100644 website/docs/r/static_web_app.html.markdown create mode 100644 website/docs/r/static_web_app_custom_domain.html.markdown diff --git a/website/docs/r/static_site.html.markdown b/website/docs/r/static_site.html.markdown index 660f3c93ba28..e5e567decf14 100644 --- a/website/docs/r/static_site.html.markdown +++ b/website/docs/r/static_site.html.markdown @@ -10,6 +10,8 @@ description: |- Manages an App Service Static Site. +-> **NOTE:** The `azurerm_static_site` resource is deprecated in favour of `azurerm_static_web_app` and will be removed in a future major release. + ->**NOTE:** After the Static Site is provisioned, you'll need to associate your target repository, which contains your web app, to the Static Site, by following the [Azure Static Site document](https://docs.microsoft.com/azure/static-web-apps/github-actions-workflow). ## Example Usage diff --git a/website/docs/r/static_site_custom_domain.html.markdown b/website/docs/r/static_site_custom_domain.html.markdown index 5e7cc7dba3d5..060e61a4f1d7 100644 --- a/website/docs/r/static_site_custom_domain.html.markdown +++ b/website/docs/r/static_site_custom_domain.html.markdown @@ -12,6 +12,8 @@ Manages a Static Site Custom Domain. !> DNS validation polling is only done for CNAME records, terraform will not validate TXT validation records are complete. +-> **NOTE:** The `azurerm_static_site_custom_domain` resource is deprecated in favour of `azurerm_static_web_app_custom_domain` and will be removed in a future major release. + ## Example Usage ### CNAME validation diff --git a/website/docs/r/static_web_app.html.markdown b/website/docs/r/static_web_app.html.markdown new file mode 100644 index 000000000000..3195647ef3b1 --- /dev/null +++ b/website/docs/r/static_web_app.html.markdown @@ -0,0 +1,105 @@ +--- +subcategory: "App Service (Web Apps)" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_static_web_app" +description: |- + Manages a Static Web App. +--- + +# azurerm_static_web_app + +Manages an App Service Static Web App. + +## Example Usage + +```hcl +resource "azurerm_resource_group" "example" { + name = "example-resources" + location = "West Europe" +} + +resource "azurerm_static_web_app" "example" { + name = "example" + resource_group_name = azurerm_resource_group.example.name + location = azurerm_resource_group.example.location +} +``` + +## Arguments Reference + +The following arguments are supported: + +* `name` - (Required) The name which should be used for this Static Web App. Changing this forces a new Static Web App to be created. + +* `location` - (Required) The Azure Region where the Static Web App should exist. Changing this forces a new Static Web App to be created. + +* `resource_group_name` - (Required) The name of the Resource Group where the Static Web App should exist. Changing this forces a new Static Web App to be created. + +* `basic_auth` - (Optional) A `basic_auth` block as defined below. + +* `configuration_file_changes_enabled` - (Optional) Should changes to the configuration file be permitted. Defaults to `true`. + +* `preview_environments_enabled` - (Optional) Are Preview (Staging) environments enabled. Defaults to `true`. + +* `sku_tier` - (Optional) Specifies the SKU tier of the Static Web App. Possible values are `Free` or `Standard`. Defaults to `Free`. + +* `sku_size` - (Optional) Specifies the SKU size of the Static Web App. Possible values are `Free` or `Standard`. Defaults to `Free`. + +* `identity` - (Optional) An `identity` block as defined below. + +* `app_settings` - (Optional) A key-value pair of App Settings. + +* `tags` - (Optional) A mapping of tags to assign to the resource. + +--- + +An `identity` block supports the following: + +* `type` - (Required) The Type of Managed Identity assigned to this Static Site resource. Possible values are `SystemAssigned`, `UserAssigned` and `SystemAssigned, UserAssigned`. + +* `identity_ids` - (Optional) A list of Managed Identity IDs which should be assigned to this Static Site resource. + +--- + +A `basic_auth` block supports the following: + +* `password` - (Required) The password for the basic authentication access. + +* `environments` - (Required) The Environment types to use the Basic Auth for access. Possible values include `AllEnvironments` and `StagingEnvironments`. + +## Attributes Reference + +In addition to the Arguments listed above - the following Attributes are exported: + +* `id` - The ID of the Static Web App. + +* `api_key` - The API key of this Static Web App, which is used for later interacting with this Static Web App from other clients, e.g. GitHub Action. + +* `default_host_name` - The default host name of the Static Web App. + +* `identity` - (Optional) An `identity` block as defined below which contains the Managed Service Identity information for this resource. + +--- + +An `identity` block exports the following: + +* `type` - (Required) The Type of Managed Identity assigned to this resource. Possible values are `SystemAssigned`, `UserAssigned` and `SystemAssigned, UserAssigned`. + +* `principal_id` - (Optional) The Principal ID associated with this Managed Service Identity. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `create` - (Defaults to 30 minutes) Used when creating the Static Web App. +* `read` - (Defaults to 5 minutes) Used when retrieving the Static Web App. +* `update` - (Defaults to 30 minutes) Used when updating the Static Web App. +* `delete` - (Defaults to 30 minutes) Used when deleting the Static Web App. + +## Import + +Static Web Apps can be imported using the `resource id`, e.g. + +```shell +terraform import azurerm_static_web_app.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Web/staticSites/my-static-site1 +``` diff --git a/website/docs/r/static_web_app_custom_domain.html.markdown b/website/docs/r/static_web_app_custom_domain.html.markdown new file mode 100644 index 000000000000..557b81f031a7 --- /dev/null +++ b/website/docs/r/static_web_app_custom_domain.html.markdown @@ -0,0 +1,115 @@ +--- +subcategory: "App Service (Web Apps)" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_static_web_app_custom_domain" +description: |- + Manages a Static Web App Custom Domain. +--- + +# azurerm_static_web_app_custom_domain + +Manages a Static Web App Custom Domain. + +!> DNS validation polling is only done for CNAME records, terraform will not validate TXT validation records are complete. + +## Example Usage + +### CNAME validation + +```hcl +resource "azurerm_resource_group" "example" { + name = "example-resources" + location = "West Europe" +} + +resource "azurerm_static_web_app" "example" { + name = "example" + resource_group_name = azurerm_resource_group.example.name + location = azurerm_resource_group.example.location +} + +resource "azurerm_dns_cname_record" "example" { + name = "my-domain" + zone_name = "contoso.com" + resource_group_name = azurerm_resource_group.example.name + ttl = 300 + record = azurerm_static_web_app.example.default_host_name +} + +resource "azurerm_static_web_app_custom_domain" "example" { + static_web_app_id = azurerm_static_web_app.example.id + domain_name = "${azurerm_dns_cname_record.example.name}.${azurerm_dns_cname_record.example.zone_name}" + validation_type = "cname-delegation" +} +``` + +### TXT validation + +```hcl +resource "azurerm_resource_group" "example" { + name = "example-resources" + location = "West Europe" +} + +resource "azurerm_static_web_app" "example" { + name = "example" + resource_group_name = azurerm_resource_group.example.name + location = azurerm_resource_group.example.location +} + +resource "azurerm_static_web_app_custom_domain" "example" { + static_web_app_id = azurerm_static_web_app.example.id + domain_name = "my-domain.contoso.com" + validation_type = "dns-txt-token" +} + +resource "azurerm_dns_txt_record" "example" { + name = "_dnsauth.my-domain" + zone_name = "contoso.com" + resource_group_name = azurerm_resource_group.example.name + ttl = 300 + record { + value = azurerm_static_web_app_custom_domain.example.validation_token + } +} +``` + +## Arguments Reference + +The following arguments are supported: + +* `domain_name` - (Required) The Domain Name which should be associated with this Static Site. Changing this forces a new Static Site Custom Domain to be created. + +* `static_web_app_id` - (Required) The ID of the Static Site. Changing this forces a new Static Site Custom Domain to be created. + +* `validation_type` - (Required) One of `cname-delegation` or `dns-txt-token`. Changing this forces a new Static Site Custom Domain to be created. + +-> **NOTE:** Apex domains must use `dns-txt-token` validation. + +-> **NOTE:** Validation using `dns-txt-token` is performed asynchronously and Terraform does wait for the validation process to be successful. Please ensure that the appropriate TXT record is created using the `validation_token` value for this to complete. + +## Attributes Reference + +In addition to the Arguments listed above - the following Attributes are exported: + +* `id` - The ID of the Static Site Custom Domain. + +* `validation_token` - Token to be used with `dns-txt-token` validation. + +-> **NOTE:** For `cname-delegation` this will be empty. For `dns-txt-token` validation, this value exists until the domain has been validated and is then cleared. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `create` - (Defaults to 30 minutes) Used when creating the Static Site Custom Domain. +* `read` - (Defaults to 5 minutes) Used when retrieving the Static Site Custom Domain. +* `delete` - (Defaults to 30 minutes) Used when deleting the Static Site Custom Domain. + +## Import + +Static Site Custom Domains can be imported using the `resource id`, e.g. + +```shell +terraform import azurerm_static_web_app_custom_domain.example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/my-static-site1/customDomains/name.contoso.com +``` From 02e11162c889798c2890a07bc6f3de7a81cb9e6f Mon Sep 17 00:00:00 2001 From: jackofallops Date: Fri, 1 Mar 2024 10:34:47 +0100 Subject: [PATCH 07/16] add deprecation --- .../services/web/static_site_custom_domain_resource.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/services/web/static_site_custom_domain_resource.go b/internal/services/web/static_site_custom_domain_resource.go index 289349d3ef91..0fa9ec211618 100644 --- a/internal/services/web/static_site_custom_domain_resource.go +++ b/internal/services/web/static_site_custom_domain_resource.go @@ -27,9 +27,10 @@ const ( func resourceStaticSiteCustomDomain() *pluginsdk.Resource { return &pluginsdk.Resource{ - Create: resourceStaticSiteCustomDomainCreate, - Read: resourceStaticSiteCustomDomainRead, - Delete: resourceStaticSiteCustomDomainDelete, + DeprecationMessage: "This resource has been deprecated in favour of `azurerm_static_web_app_custom_domain` and will be removed in a future release.", + Create: resourceStaticSiteCustomDomainCreate, + Read: resourceStaticSiteCustomDomainRead, + Delete: resourceStaticSiteCustomDomainDelete, Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { _, err := parse.StaticSiteCustomDomainID(id) return err From 0655e48b902dbe092f4cd630b4a0319f85c6751a Mon Sep 17 00:00:00 2001 From: jackofallops Date: Fri, 1 Mar 2024 10:35:24 +0100 Subject: [PATCH 08/16] make validation_type required, add tests --- .../static_web_app_custom_domain.go | 3 +- ...tic_web_app_resource_custom_domain_test.go | 70 +++++++++++++++++-- 2 files changed, 66 insertions(+), 7 deletions(-) diff --git a/internal/services/appservice/static_web_app_custom_domain.go b/internal/services/appservice/static_web_app_custom_domain.go index 81949a0a0715..d3ebf0849162 100644 --- a/internal/services/appservice/static_web_app_custom_domain.go +++ b/internal/services/appservice/static_web_app_custom_domain.go @@ -45,8 +45,7 @@ func (r StaticWebAppCustomDomainResource) Arguments() map[string]*schema.Schema "validation_type": { Type: pluginsdk.TypeString, - Optional: true, - Default: helpers.ValidationTypeTXT, + Required: true, ForceNew: true, ValidateFunc: validation.StringInSlice([]string{ helpers.ValidationTypeTXT, diff --git a/internal/services/appservice/static_web_app_resource_custom_domain_test.go b/internal/services/appservice/static_web_app_resource_custom_domain_test.go index e35749b0081f..5d7d15fb65ec 100644 --- a/internal/services/appservice/static_web_app_resource_custom_domain_test.go +++ b/internal/services/appservice/static_web_app_resource_custom_domain_test.go @@ -6,6 +6,7 @@ package appservice_test import ( "context" "fmt" + "os" "testing" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" @@ -34,6 +35,24 @@ func TestAccAzureStaticSiteCustomDomain_basic(t *testing.T) { }) } +func TestAccAzureStaticSiteCustomDomain_cnameValidation(t *testing.T) { + if os.Getenv("ARM_TEST_DNS_ZONE") == "" { + t.Skipf("Skipping Static Web App Test CNAME test as ARM_TEST_DNS_ZONE is not set.") + } + data := acceptance.BuildTestData(t, "azurerm_static_web_app_custom_domain", "test") + r := StaticWebAppCustomDomainResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.cnameValidation(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("validation_type", "validation_token"), + }) +} + func TestAccAzureStaticSiteCustomDomain_requiresImport(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_static_web_app_custom_domain", "test") r := StaticWebAppCustomDomainResource{} @@ -93,15 +112,56 @@ resource "azurerm_static_web_app_custom_domain" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) } +func (r StaticWebAppCustomDomainResource) cnameValidation(data acceptance.TestData) string { + dnsZone := os.Getenv("ARM_TEST_DNS_ZONE") + dnsZoneRG := os.Getenv("ARM_TEST_DATA_RESOURCE_GROUP") + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%[1]d" + location = "%[2]s" +} + +data "azurerm_dns_zone" "test" { + name = "%[3]s" + resource_group_name = "%[4]s" +} + +resource "azurerm_dns_cname_record" "test" { + name = "swa%[1]d" + resource_group_name = data.azurerm_dns_zone.test.resource_group_name + zone_name = data.azurerm_dns_zone.test.name + ttl = 300 + record = azurerm_static_web_app.test.default_host_name +} + +resource "azurerm_static_web_app" "test" { + name = "acctestSS-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_size = "Standard" + sku_tier = "Standard" +} + +resource "azurerm_static_web_app_custom_domain" "test" { + static_web_app_id = azurerm_static_web_app.test.id + domain_name = trimsuffix(azurerm_dns_cname_record.test.fqdn, ".") + validation_type = "cname-delegation" +} +`, data.RandomInteger, data.Locations.Primary, dnsZone, dnsZoneRG) +} + func (r StaticWebAppCustomDomainResource) requiresImport(data acceptance.TestData) string { - template := r.basic(data) return fmt.Sprintf(` %s resource "azurerm_static_web_app_custom_domain" "import" { - static_web_app_id = azurerm_static_web_app.test.id - domain_name = "acctestSS-%d.contoso.com" - validation_type = "dns-txt-token" + static_web_app_id = azurerm_static_web_app_custom_domain.test.static_web_app_id + domain_name = azurerm_static_web_app_custom_domain.test.domain_name + validation_type = azurerm_static_web_app_custom_domain.test.validation_type } -`, template, data.RandomInteger) +`, r.basic(data)) } From 6d1185a684ade05422980dfec728b0eccb81b5b2 Mon Sep 17 00:00:00 2001 From: jackofallops Date: Fri, 1 Mar 2024 12:44:17 +0100 Subject: [PATCH 09/16] update computed struct and add datasource doc --- .../appservice/helpers/static_web_app.go | 9 ++- .../appservice/static_web_app_data_source.go | 15 ++-- website/docs/d/static_web_app.html.markdown | 72 +++++++++++++++++++ website/docs/r/static_web_app.html.markdown | 13 +--- 4 files changed, 82 insertions(+), 27 deletions(-) create mode 100644 website/docs/d/static_web_app.html.markdown diff --git a/internal/services/appservice/helpers/static_web_app.go b/internal/services/appservice/helpers/static_web_app.go index deb26be7ebf3..3b68f555db59 100644 --- a/internal/services/appservice/helpers/static_web_app.go +++ b/internal/services/appservice/helpers/static_web_app.go @@ -12,6 +12,10 @@ type BasicAuth struct { Environments string `tfschema:"environments"` // AllEnvironments, StagingEnvironments } +type BasicAuthComputed struct { + Environments string `tfschema:"environments"` // AllEnvironments, StagingEnvironments +} + const ( EnvironmentsTypeAllEnvironments string = "AllEnvironments" EnvironmentsTypeStagingEnvironments string = "StagingEnvironments" @@ -53,11 +57,6 @@ func BasicAuthSchemaComputed() *pluginsdk.Schema { Sensitive: true, Elem: &pluginsdk.Resource{ Schema: map[string]*schema.Schema{ - "password": { - Type: pluginsdk.TypeString, - Computed: true, - }, - "environments": { Type: pluginsdk.TypeString, Computed: true, diff --git a/internal/services/appservice/static_web_app_data_source.go b/internal/services/appservice/static_web_app_data_source.go index c1887ebde452..d7c7f29142b0 100644 --- a/internal/services/appservice/static_web_app_data_source.go +++ b/internal/services/appservice/static_web_app_data_source.go @@ -28,22 +28,16 @@ type StaticWebAppDataSourceModel struct { Name string `tfschema:"name"` ResourceGroupName string `tfschema:"resource_group_name"` Location string `tfschema:"location"` + ApiKey string `tfschema:"api_key"` AppSettings map[string]string `tfschema:"app_settings"` - BasicAuth []helpers.BasicAuth `tfschema:"basic_auth"` + BasicAuth []helpers.BasicAuthComputed `tfschema:"basic_auth"` ConfigFileChanges bool `tfschema:"configuration_file_changes_enabled"` + DefaultHostName string `tfschema:"default_host_name"` Identity []identity.ModelSystemAssignedUserAssigned `tfschema:"identity"` PreviewEnvironments bool `tfschema:"preview_environments_enabled"` SkuTier string `tfschema:"sku_tier"` SkuSize string `tfschema:"sku_size"` Tags map[string]string `tfschema:"tags"` - - // TODO - // CustomDomains []string `tfschema:"custom_domains"` - // DatabaseConnections ?? - // - - ApiKey string `tfschema:"api_key"` - DefaultHostName string `tfschema:"default_host_name"` } func (s StaticWebAppDataSource) Arguments() map[string]*pluginsdk.Schema { @@ -189,9 +183,8 @@ func (s StaticWebAppDataSource) Read() sdk.ResourceFunc { } if !response.WasNotFound(auth.HttpResponse) { if authModel := auth.Model; authModel != nil && authModel.Properties != nil && !strings.EqualFold(authModel.Properties.ApplicableEnvironmentsMode, helpers.EnvironmentsTypeSpecifiedEnvironments) { - state.BasicAuth = []helpers.BasicAuth{ + state.BasicAuth = []helpers.BasicAuthComputed{ { - Password: metadata.ResourceData.Get("basic_auth.0.password").(string), // Grab this from the config, if we can. Environments: authModel.Properties.ApplicableEnvironmentsMode, }, } diff --git a/website/docs/d/static_web_app.html.markdown b/website/docs/d/static_web_app.html.markdown new file mode 100644 index 000000000000..4e2cc829afc7 --- /dev/null +++ b/website/docs/d/static_web_app.html.markdown @@ -0,0 +1,72 @@ +--- +subcategory: "App Service (Web Apps)" +layout: "azurerm" +page_title: "Azure Resource Manager: Data Source: azurerm_static_web_app" +description: |- + Gets information about an existing Static Web App. +--- + +# Data Source: azurerm_static_web_app + +Use this data source to access information about an existing Static Web App. + +## Example Usage + +```hcl +data "azurerm_static_web_app" "example" { + name = "existing" + resource_group_name = "existing" +} + + +``` + +## Arguments Reference + +The following arguments are supported: + +* `name` - (Required) The name of this Static Web App. + +* `resource_group_name` - (Required) The name of the Resource Group where the Static Web App exists. + +* `location` - The Azure region in which this Static Web App exists. + +* `api_key` - The API key of this Static Web App, which is used for later interacting with this Static Web App from other clients, e.g. GitHub Action. + +* `app_settings` - The map of key-value pairs of App Settings for the Static Web App. + +* `basic_auth` - A `basic_auth` block as defined below. + +* `configuration_file_changes_enabled` - Are changes to the configuration file be permitted. + +* `default_host_name` - The default host name of the Static Web App. + +* `preview_environments_enabled` - Are Preview (Staging) environments enabled. + +* `sku_tier` - The SKU tier of the Static Web App. + +* `sku_size` - The SKU size of the Static Web App. + +* `identity` - An `identity` block as defined below. + +* `tags` - The mapping of tags assigned to the resource. + +--- + +An `identity` block exports the following: + +* `type` - The Type of Managed Identity assigned to this Static Web App resource. + +* `identity_ids` -The list of Managed Identity IDs which are assigned to this Static Web App resource. + +--- + +A `basic_auth` block exports the following: + +* `environments` - The Environment types which are configured to use Basic Auth access. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `read` - (Defaults to 5 minutes) Used when retrieving the Static Web App \ No newline at end of file diff --git a/website/docs/r/static_web_app.html.markdown b/website/docs/r/static_web_app.html.markdown index 3195647ef3b1..e05753100c95 100644 --- a/website/docs/r/static_web_app.html.markdown +++ b/website/docs/r/static_web_app.html.markdown @@ -55,9 +55,9 @@ The following arguments are supported: An `identity` block supports the following: -* `type` - (Required) The Type of Managed Identity assigned to this Static Site resource. Possible values are `SystemAssigned`, `UserAssigned` and `SystemAssigned, UserAssigned`. +* `type` - (Required) The Type of Managed Identity assigned to this Static Web App resource. Possible values are `SystemAssigned`, `UserAssigned` and `SystemAssigned, UserAssigned`. -* `identity_ids` - (Optional) A list of Managed Identity IDs which should be assigned to this Static Site resource. +* `identity_ids` - (Optional) A list of Managed Identity IDs which should be assigned to this Static Web App resource. --- @@ -77,15 +77,6 @@ In addition to the Arguments listed above - the following Attributes are exporte * `default_host_name` - The default host name of the Static Web App. -* `identity` - (Optional) An `identity` block as defined below which contains the Managed Service Identity information for this resource. - ---- - -An `identity` block exports the following: - -* `type` - (Required) The Type of Managed Identity assigned to this resource. Possible values are `SystemAssigned`, `UserAssigned` and `SystemAssigned, UserAssigned`. - -* `principal_id` - (Optional) The Principal ID associated with this Managed Service Identity. ## Timeouts From 182a9e8d3eec1a669c3ef3139f79fa606916d500 Mon Sep 17 00:00:00 2001 From: jackofallops Date: Fri, 1 Mar 2024 12:47:05 +0100 Subject: [PATCH 10/16] remove comments --- .../services/appservice/sdkhacks/static_web_app_basic_auth.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/internal/services/appservice/sdkhacks/static_web_app_basic_auth.go b/internal/services/appservice/sdkhacks/static_web_app_basic_auth.go index 5c426c7b8380..dedd32d7caba 100644 --- a/internal/services/appservice/sdkhacks/static_web_app_basic_auth.go +++ b/internal/services/appservice/sdkhacks/static_web_app_basic_auth.go @@ -9,9 +9,6 @@ import ( "github.com/hashicorp/go-azure-sdk/sdk/client" ) -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - type StaticSitesClient struct { client *staticsites.StaticSitesClient } From f6623d8822620c3e1be3704eb2c542fce681909d Mon Sep 17 00:00:00 2001 From: jackofallops Date: Mon, 4 Mar 2024 10:20:04 +0100 Subject: [PATCH 11/16] make generate --- .github/labeler-issue-triage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/labeler-issue-triage.yml b/.github/labeler-issue-triage.yml index 93aa7ae0a448..f76df833c317 100644 --- a/.github/labeler-issue-triage.yml +++ b/.github/labeler-issue-triage.yml @@ -25,7 +25,7 @@ service/app-configuration: - '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_app_configuration((.|\n)*)###' service/app-service: - - '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_(app_service_environment_v3\W+|app_service_environment_v3\W+|app_service_source_control\W+|app_service_source_control_slot\W+|function_app_active_slot\W+|function_app_function\W+|function_app_hybrid_connection\W+|linux_function_app\W+|linux_function_app\W+|linux_function_app_slot\W+|linux_web_app\W+|linux_web_app\W+|linux_web_app_slot\W+|service_plan|source_control_token|web_app_|windows_function_app\W+|windows_function_app\W+|windows_function_app_slot\W+|windows_web_app\W+|windows_web_app\W+|windows_web_app_slot\W+)((.|\n)*)###' + - '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_(app_service_environment_v3\W+|app_service_environment_v3\W+|app_service_source_control\W+|app_service_source_control_slot\W+|function_app_active_slot\W+|function_app_function\W+|function_app_hybrid_connection\W+|linux_function_app\W+|linux_function_app\W+|linux_function_app_slot\W+|linux_web_app\W+|linux_web_app\W+|linux_web_app_slot\W+|service_plan|source_control_token|static_web_app|web_app_|windows_function_app\W+|windows_function_app\W+|windows_function_app_slot\W+|windows_web_app\W+|windows_web_app\W+|windows_web_app_slot\W+)((.|\n)*)###' service/application-insights: - '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_application_insights((.|\n)*)###' From 618c3d19133ebd6181b83aafb2c053abde2b9dde Mon Sep 17 00:00:00 2001 From: jackofallops Date: Mon, 4 Mar 2024 10:25:51 +0100 Subject: [PATCH 12/16] rebase, go mod tidy --- .../2023-01-01/staticsites/method_createorupdatebasicauth.go | 5 ++++- .../method_createorupdatebuilddatabaseconnection.go | 5 ++++- .../staticsites/method_createorupdatedatabaseconnection.go | 5 ++++- .../method_createorupdatestaticsiteappsettings.go | 5 ++++- .../method_createorupdatestaticsitebuildappsettings.go | 5 ++++- ...ethod_createorupdatestaticsitebuildfunctionappsettings.go | 5 ++++- .../method_createorupdatestaticsitefunctionappsettings.go | 5 ++++- .../staticsites/method_createuserrolesinvitationlink.go | 5 ++++- .../web/2023-01-01/staticsites/method_getbasicauth.go | 5 ++++- .../staticsites/method_getbuilddatabaseconnection.go | 5 ++++- .../method_getbuilddatabaseconnectionwithdetails.go | 5 ++++- .../2023-01-01/staticsites/method_getdatabaseconnection.go | 5 ++++- .../staticsites/method_getdatabaseconnectionwithdetails.go | 5 ++++- .../web/2023-01-01/staticsites/method_getlinkedbackend.go | 5 ++++- .../staticsites/method_getlinkedbackendforbuild.go | 5 ++++- .../staticsites/method_getprivateendpointconnection.go | 5 ++++- .../2023-01-01/staticsites/method_getprivatelinkresources.go | 5 ++++- .../web/2023-01-01/staticsites/method_getstaticsite.go | 5 ++++- .../web/2023-01-01/staticsites/method_getstaticsitebuild.go | 5 ++++- .../staticsites/method_getstaticsitecustomdomain.go | 5 ++++- .../method_getuserprovidedfunctionappforstaticsite.go | 5 ++++- .../method_getuserprovidedfunctionappforstaticsitebuild.go | 5 ++++- .../staticsites/method_liststaticsiteappsettings.go | 5 ++++- .../staticsites/method_liststaticsitebuildappsettings.go | 5 ++++- .../method_liststaticsitebuildfunctionappsettings.go | 5 ++++- .../staticsites/method_liststaticsiteconfiguredroles.go | 5 ++++- .../staticsites/method_liststaticsitefunctionappsettings.go | 5 ++++- .../2023-01-01/staticsites/method_liststaticsitesecrets.go | 5 ++++- .../web/2023-01-01/staticsites/method_previewworkflow.go | 5 ++++- .../staticsites/method_updatebuilddatabaseconnection.go | 5 ++++- .../staticsites/method_updatedatabaseconnection.go | 5 ++++- .../web/2023-01-01/staticsites/method_updatestaticsite.go | 5 ++++- .../2023-01-01/staticsites/method_updatestaticsiteuser.go | 5 ++++- 33 files changed, 132 insertions(+), 33 deletions(-) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatebasicauth.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatebasicauth.go index 5250db7e942d..34051d7923f9 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatebasicauth.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatebasicauth.go @@ -48,7 +48,10 @@ func (c StaticSitesClient) CreateOrUpdateBasicAuth(ctx context.Context, id Stati return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model StaticSiteBasicAuthPropertiesARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatebuilddatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatebuilddatabaseconnection.go index c58864f04823..9fa486417cb6 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatebuilddatabaseconnection.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatebuilddatabaseconnection.go @@ -47,7 +47,10 @@ func (c StaticSitesClient) CreateOrUpdateBuildDatabaseConnection(ctx context.Con return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model DatabaseConnection + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatedatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatedatabaseconnection.go index 062b82975e2b..718dd346c56a 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatedatabaseconnection.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatedatabaseconnection.go @@ -47,7 +47,10 @@ func (c StaticSitesClient) CreateOrUpdateDatabaseConnection(ctx context.Context, return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model DatabaseConnection + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsiteappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsiteappsettings.go index c4158a404d32..19e3b9c2d9d6 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsiteappsettings.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsiteappsettings.go @@ -48,7 +48,10 @@ func (c StaticSitesClient) CreateOrUpdateStaticSiteAppSettings(ctx context.Conte return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model StringDictionary + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitebuildappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitebuildappsettings.go index 12aec03f6717..bcded5df29e4 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitebuildappsettings.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitebuildappsettings.go @@ -48,7 +48,10 @@ func (c StaticSitesClient) CreateOrUpdateStaticSiteBuildAppSettings(ctx context. return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model StringDictionary + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitebuildfunctionappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitebuildfunctionappsettings.go index 171c8ebf756f..4a99a9e6b1da 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitebuildfunctionappsettings.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitebuildfunctionappsettings.go @@ -48,7 +48,10 @@ func (c StaticSitesClient) CreateOrUpdateStaticSiteBuildFunctionAppSettings(ctx return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model StringDictionary + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitefunctionappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitefunctionappsettings.go index 9db7d09fe068..b4181e79c23c 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitefunctionappsettings.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitefunctionappsettings.go @@ -48,7 +48,10 @@ func (c StaticSitesClient) CreateOrUpdateStaticSiteFunctionAppSettings(ctx conte return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model StringDictionary + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createuserrolesinvitationlink.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createuserrolesinvitationlink.go index 2bd65d0c1c23..2c3ce3709a23 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createuserrolesinvitationlink.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createuserrolesinvitationlink.go @@ -48,7 +48,10 @@ func (c StaticSitesClient) CreateUserRolesInvitationLink(ctx context.Context, id return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model StaticSiteUserInvitationResponseResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbasicauth.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbasicauth.go index 0aa227882779..93aca3f09be0 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbasicauth.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbasicauth.go @@ -44,7 +44,10 @@ func (c StaticSitesClient) GetBasicAuth(ctx context.Context, id StaticSiteId) (r return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model StaticSiteBasicAuthPropertiesARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnection.go index cbdb12bc4ed8..64d51db24b6f 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnection.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnection.go @@ -43,7 +43,10 @@ func (c StaticSitesClient) GetBuildDatabaseConnection(ctx context.Context, id Bu return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model DatabaseConnection + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnectionwithdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnectionwithdetails.go index 1b44f14a1bf6..39323af4c15a 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnectionwithdetails.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnectionwithdetails.go @@ -44,7 +44,10 @@ func (c StaticSitesClient) GetBuildDatabaseConnectionWithDetails(ctx context.Con return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model DatabaseConnection + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnection.go index 092b297bd106..118dabea2507 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnection.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnection.go @@ -43,7 +43,10 @@ func (c StaticSitesClient) GetDatabaseConnection(ctx context.Context, id Databas return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model DatabaseConnection + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnectionwithdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnectionwithdetails.go index 6a040448b47a..7ff319615bd5 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnectionwithdetails.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnectionwithdetails.go @@ -44,7 +44,10 @@ func (c StaticSitesClient) GetDatabaseConnectionWithDetails(ctx context.Context, return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model DatabaseConnection + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackend.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackend.go index efb97469398a..b572c2a28567 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackend.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackend.go @@ -43,7 +43,10 @@ func (c StaticSitesClient) GetLinkedBackend(ctx context.Context, id LinkedBacken return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model StaticSiteLinkedBackendARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackendforbuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackendforbuild.go index 1a8882ba8a0a..9bc02ed8de7f 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackendforbuild.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackendforbuild.go @@ -43,7 +43,10 @@ func (c StaticSitesClient) GetLinkedBackendForBuild(ctx context.Context, id Buil return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model StaticSiteLinkedBackendARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivateendpointconnection.go index d7113546236e..7342343fa2a3 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivateendpointconnection.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivateendpointconnection.go @@ -43,7 +43,10 @@ func (c StaticSitesClient) GetPrivateEndpointConnection(ctx context.Context, id return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model RemotePrivateEndpointConnectionARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivatelinkresources.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivatelinkresources.go index f522c045d496..d95909433957 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivatelinkresources.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivatelinkresources.go @@ -44,7 +44,10 @@ func (c StaticSitesClient) GetPrivateLinkResources(ctx context.Context, id Stati return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model PrivateLinkResourcesWrapper + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsite.go index d2ace41c4540..6096f2cb35e8 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsite.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsite.go @@ -43,7 +43,10 @@ func (c StaticSitesClient) GetStaticSite(ctx context.Context, id StaticSiteId) ( return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model StaticSiteARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitebuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitebuild.go index 01ad9e56fc5e..0794f8c9a408 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitebuild.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitebuild.go @@ -43,7 +43,10 @@ func (c StaticSitesClient) GetStaticSiteBuild(ctx context.Context, id BuildId) ( return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model StaticSiteBuildARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitecustomdomain.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitecustomdomain.go index f57e327a864c..482be40cd047 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitecustomdomain.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitecustomdomain.go @@ -43,7 +43,10 @@ func (c StaticSitesClient) GetStaticSiteCustomDomain(ctx context.Context, id Cus return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model StaticSiteCustomDomainOverviewARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappforstaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappforstaticsite.go index 34c7b10edcec..8b09371d9c2c 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappforstaticsite.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappforstaticsite.go @@ -43,7 +43,10 @@ func (c StaticSitesClient) GetUserProvidedFunctionAppForStaticSite(ctx context.C return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model StaticSiteUserProvidedFunctionAppARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappforstaticsitebuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappforstaticsitebuild.go index fe3ce92b2acb..9419b0ecc937 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappforstaticsitebuild.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappforstaticsitebuild.go @@ -43,7 +43,10 @@ func (c StaticSitesClient) GetUserProvidedFunctionAppForStaticSiteBuild(ctx cont return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model StaticSiteUserProvidedFunctionAppARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteappsettings.go index a22360cad1db..5ecb3eee84b1 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteappsettings.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteappsettings.go @@ -44,7 +44,10 @@ func (c StaticSitesClient) ListStaticSiteAppSettings(ctx context.Context, id Sta return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model StringDictionary + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildappsettings.go index db2be7bfaa01..deb7ce043eca 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildappsettings.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildappsettings.go @@ -44,7 +44,10 @@ func (c StaticSitesClient) ListStaticSiteBuildAppSettings(ctx context.Context, i return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model StringDictionary + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildfunctionappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildfunctionappsettings.go index 48d5b5bbb1d3..14b452b8d2ad 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildfunctionappsettings.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildfunctionappsettings.go @@ -44,7 +44,10 @@ func (c StaticSitesClient) ListStaticSiteBuildFunctionAppSettings(ctx context.Co return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model StringDictionary + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteconfiguredroles.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteconfiguredroles.go index 21d2ac8f0283..1a015925a7f8 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteconfiguredroles.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteconfiguredroles.go @@ -44,7 +44,10 @@ func (c StaticSitesClient) ListStaticSiteConfiguredRoles(ctx context.Context, id return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model StringList + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitefunctionappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitefunctionappsettings.go index 0c17498be8ad..32f56586d7e8 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitefunctionappsettings.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitefunctionappsettings.go @@ -44,7 +44,10 @@ func (c StaticSitesClient) ListStaticSiteFunctionAppSettings(ctx context.Context return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model StringDictionary + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitesecrets.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitesecrets.go index f58b2aece144..cc35a7c06546 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitesecrets.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitesecrets.go @@ -44,7 +44,10 @@ func (c StaticSitesClient) ListStaticSiteSecrets(ctx context.Context, id StaticS return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model StringDictionary + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_previewworkflow.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_previewworkflow.go index 61a0502d27a8..f867a88a25e0 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_previewworkflow.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_previewworkflow.go @@ -48,7 +48,10 @@ func (c StaticSitesClient) PreviewWorkflow(ctx context.Context, id ProviderLocat return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model StaticSitesWorkflowPreview + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatebuilddatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatebuilddatabaseconnection.go index 4252bf110274..c9611ae5cb38 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatebuilddatabaseconnection.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatebuilddatabaseconnection.go @@ -47,7 +47,10 @@ func (c StaticSitesClient) UpdateBuildDatabaseConnection(ctx context.Context, id return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model DatabaseConnection + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatedatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatedatabaseconnection.go index 2f754354195a..6e37673f34d2 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatedatabaseconnection.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatedatabaseconnection.go @@ -47,7 +47,10 @@ func (c StaticSitesClient) UpdateDatabaseConnection(ctx context.Context, id Data return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model DatabaseConnection + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatestaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatestaticsite.go index 4f1c235fa6cf..2db8a28235ae 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatestaticsite.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatestaticsite.go @@ -48,7 +48,10 @@ func (c StaticSitesClient) UpdateStaticSite(ctx context.Context, id StaticSiteId return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model StaticSiteARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatestaticsiteuser.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatestaticsiteuser.go index 6a8baec8c075..ddcb14fbcc65 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatestaticsiteuser.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatestaticsiteuser.go @@ -47,7 +47,10 @@ func (c StaticSitesClient) UpdateStaticSiteUser(ctx context.Context, id UserId, return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model StaticSiteUserARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } From 450f7e770493de038ab220c8e995dd06bc73092e Mon Sep 17 00:00:00 2001 From: jackofallops Date: Mon, 4 Mar 2024 10:31:37 +0100 Subject: [PATCH 13/16] terrafmt --- .../r/static_web_app_custom_domain.html.markdown | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/website/docs/r/static_web_app_custom_domain.html.markdown b/website/docs/r/static_web_app_custom_domain.html.markdown index 557b81f031a7..a15b4d0a6753 100644 --- a/website/docs/r/static_web_app_custom_domain.html.markdown +++ b/website/docs/r/static_web_app_custom_domain.html.markdown @@ -37,9 +37,9 @@ resource "azurerm_dns_cname_record" "example" { } resource "azurerm_static_web_app_custom_domain" "example" { - static_web_app_id = azurerm_static_web_app.example.id - domain_name = "${azurerm_dns_cname_record.example.name}.${azurerm_dns_cname_record.example.zone_name}" - validation_type = "cname-delegation" + static_web_app_id = azurerm_static_web_app.example.id + domain_name = "${azurerm_dns_cname_record.example.name}.${azurerm_dns_cname_record.example.zone_name}" + validation_type = "cname-delegation" } ``` @@ -58,9 +58,9 @@ resource "azurerm_static_web_app" "example" { } resource "azurerm_static_web_app_custom_domain" "example" { - static_web_app_id = azurerm_static_web_app.example.id - domain_name = "my-domain.contoso.com" - validation_type = "dns-txt-token" + static_web_app_id = azurerm_static_web_app.example.id + domain_name = "my-domain.contoso.com" + validation_type = "dns-txt-token" } resource "azurerm_dns_txt_record" "example" { From 020954cc1e5ca13088357947179416b860ba5c31 Mon Sep 17 00:00:00 2001 From: jackofallops Date: Mon, 4 Mar 2024 10:45:23 +0100 Subject: [PATCH 14/16] fix filename fixup test names --- ...ic_web_app_custom_domain_resource_test.go} | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) rename internal/services/appservice/{static_web_app_resource_custom_domain_test.go => static_web_app_custom_domain_resource_test.go} (87%) diff --git a/internal/services/appservice/static_web_app_resource_custom_domain_test.go b/internal/services/appservice/static_web_app_custom_domain_resource_test.go similarity index 87% rename from internal/services/appservice/static_web_app_resource_custom_domain_test.go rename to internal/services/appservice/static_web_app_custom_domain_resource_test.go index 5d7d15fb65ec..1e1fe6458b8e 100644 --- a/internal/services/appservice/static_web_app_resource_custom_domain_test.go +++ b/internal/services/appservice/static_web_app_custom_domain_resource_test.go @@ -9,17 +9,18 @@ import ( "os" "testing" + "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" - "github.com/hashicorp/terraform-provider-azurerm/utils" ) type StaticWebAppCustomDomainResource struct{} -func TestAccAzureStaticSiteCustomDomain_basic(t *testing.T) { +func TestAccAzureStaticWebAppCustomDomain_basic(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_static_web_app_custom_domain", "test") r := StaticWebAppCustomDomainResource{} @@ -35,7 +36,7 @@ func TestAccAzureStaticSiteCustomDomain_basic(t *testing.T) { }) } -func TestAccAzureStaticSiteCustomDomain_cnameValidation(t *testing.T) { +func TestAccAzureStaticWebAppCustomDomain_cnameValidation(t *testing.T) { if os.Getenv("ARM_TEST_DNS_ZONE") == "" { t.Skipf("Skipping Static Web App Test CNAME test as ARM_TEST_DNS_ZONE is not set.") } @@ -53,7 +54,7 @@ func TestAccAzureStaticSiteCustomDomain_cnameValidation(t *testing.T) { }) } -func TestAccAzureStaticSiteCustomDomain_requiresImport(t *testing.T) { +func TestAccAzureStaticWebAppCustomDomain_requiresImport(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_static_web_app_custom_domain", "test") r := StaticWebAppCustomDomainResource{} @@ -69,20 +70,20 @@ func TestAccAzureStaticSiteCustomDomain_requiresImport(t *testing.T) { } func (r StaticWebAppCustomDomainResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := parse.StaticSiteCustomDomainID(state.ID) + id, err := staticsites.ParseCustomDomainID(state.ID) if err != nil { return nil, err } - resp, err := clients.Web.StaticSitesClient.GetStaticSiteCustomDomain(ctx, id.ResourceGroup, id.StaticSiteName, id.CustomDomainName) + resp, err := clients.AppService.StaticSitesClient.GetStaticSiteCustomDomain(ctx, *id) if err != nil { - if utils.ResponseWasNotFound(resp.Response) { - return utils.Bool(false), nil + if response.WasNotFound(resp.HttpResponse) { + return pointer.To(false), nil } return nil, fmt.Errorf("retrieving Static Site %q: %+v", id, err) } - return utils.Bool(true), nil + return pointer.To(true), nil } func (r StaticWebAppCustomDomainResource) basic(data acceptance.TestData) string { From f41d0f491934f991fb31f79caa3e484b907d1d28 Mon Sep 17 00:00:00 2001 From: jackofallops Date: Mon, 4 Mar 2024 15:20:49 +0100 Subject: [PATCH 15/16] update for review comments --- internal/services/appservice/client/client.go | 2 +- internal/services/appservice/helpers/static_web_app.go | 4 ++-- internal/services/appservice/static_web_app_custom_domain.go | 4 ++-- .../appservice/static_web_app_custom_domain_resource_test.go | 4 ++-- internal/services/appservice/static_web_app_resource.go | 2 +- internal/services/appservice/static_web_app_resource_test.go | 4 ++-- website/docs/d/static_web_app.html.markdown | 4 ++-- website/docs/r/static_web_app_custom_domain.html.markdown | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/internal/services/appservice/client/client.go b/internal/services/appservice/client/client.go index 7ac94264cc21..1063269f2138 100644 --- a/internal/services/appservice/client/client.go +++ b/internal/services/appservice/client/client.go @@ -43,7 +43,7 @@ func NewClient(o *common.ClientOptions) (*Client, error) { staticSitesClient, err := staticsites.NewStaticSitesClientWithBaseURI(o.Environment.ResourceManager) if err != nil { - return nil, fmt.Errorf("building ServicePlan client: %+v", err) + return nil, fmt.Errorf("building StaticSites client: %+v", err) } o.Configure(staticSitesClient.Client, o.Authorizers.ResourceManager) diff --git a/internal/services/appservice/helpers/static_web_app.go b/internal/services/appservice/helpers/static_web_app.go index 3b68f555db59..783a3c9cb369 100644 --- a/internal/services/appservice/helpers/static_web_app.go +++ b/internal/services/appservice/helpers/static_web_app.go @@ -9,11 +9,11 @@ import ( type BasicAuth struct { Password string `tfschema:"password"` - Environments string `tfschema:"environments"` // AllEnvironments, StagingEnvironments + Environments string `tfschema:"environments"` } type BasicAuthComputed struct { - Environments string `tfschema:"environments"` // AllEnvironments, StagingEnvironments + Environments string `tfschema:"environments"` } const ( diff --git a/internal/services/appservice/static_web_app_custom_domain.go b/internal/services/appservice/static_web_app_custom_domain.go index d3ebf0849162..69cd5a4af125 100644 --- a/internal/services/appservice/static_web_app_custom_domain.go +++ b/internal/services/appservice/static_web_app_custom_domain.go @@ -95,7 +95,7 @@ func (r StaticWebAppCustomDomainResource) Create() sdk.ResourceFunc { existing, err := client.GetStaticSiteCustomDomain(ctx, id) if err != nil { if !response.WasNotFound(existing.HttpResponse) { - return fmt.Errorf("failed checking for presence of existing %s: %+v", id, err) + return fmt.Errorf("checking for presence of existing %s: %+v", id, err) } } if !response.WasNotFound(existing.HttpResponse) { @@ -118,7 +118,7 @@ func (r StaticWebAppCustomDomainResource) Create() sdk.ResourceFunc { } deadline, ok := ctx.Deadline() if !ok { - return fmt.Errorf("context was missing a deadline") + return fmt.Errorf("internal-error: context was missing a deadline") } stateConf := &pluginsdk.StateChangeConf{ Pending: []string{ diff --git a/internal/services/appservice/static_web_app_custom_domain_resource_test.go b/internal/services/appservice/static_web_app_custom_domain_resource_test.go index 1e1fe6458b8e..5402f7532637 100644 --- a/internal/services/appservice/static_web_app_custom_domain_resource_test.go +++ b/internal/services/appservice/static_web_app_custom_domain_resource_test.go @@ -80,10 +80,10 @@ func (r StaticWebAppCustomDomainResource) Exists(ctx context.Context, clients *c if response.WasNotFound(resp.HttpResponse) { return pointer.To(false), nil } - return nil, fmt.Errorf("retrieving Static Site %q: %+v", id, err) + return nil, fmt.Errorf("retrieving %q: %+v", id, err) } - return pointer.To(true), nil + return pointer.To(resp.Model != nil), nil } func (r StaticWebAppCustomDomainResource) basic(data acceptance.TestData) string { diff --git a/internal/services/appservice/static_web_app_resource.go b/internal/services/appservice/static_web_app_resource.go index 31e1dbc913b9..f3272efb290e 100644 --- a/internal/services/appservice/static_web_app_resource.go +++ b/internal/services/appservice/static_web_app_resource.go @@ -151,7 +151,7 @@ func (r StaticWebAppResource) Create() sdk.ResourceFunc { existing, err := client.GetStaticSite(ctx, id) if err != nil { if !response.WasNotFound(existing.HttpResponse) { - return fmt.Errorf("failed checking for presence of existing %s: %+v", id, err) + return fmt.Errorf("checking for presence of existing %s: %+v", id, err) } } if !response.WasNotFound(existing.HttpResponse) { diff --git a/internal/services/appservice/static_web_app_resource_test.go b/internal/services/appservice/static_web_app_resource_test.go index ca60fdce2d80..479c4575ce51 100644 --- a/internal/services/appservice/static_web_app_resource_test.go +++ b/internal/services/appservice/static_web_app_resource_test.go @@ -309,10 +309,10 @@ func (r StaticWebAppResource) Exists(ctx context.Context, clients *clients.Clien if response.WasNotFound(resp.HttpResponse) { return pointer.To(false), nil } - return nil, fmt.Errorf("retrieving Static Site %q: %+v", id, err) + return nil, fmt.Errorf("retrieving %q: %+v", id, err) } - return pointer.To(true), nil + return pointer.To(resp.Model != nil), nil } func (r StaticWebAppResource) basic(data acceptance.TestData) string { diff --git a/website/docs/d/static_web_app.html.markdown b/website/docs/d/static_web_app.html.markdown index 4e2cc829afc7..78b1995ecda1 100644 --- a/website/docs/d/static_web_app.html.markdown +++ b/website/docs/d/static_web_app.html.markdown @@ -37,7 +37,7 @@ The following arguments are supported: * `basic_auth` - A `basic_auth` block as defined below. -* `configuration_file_changes_enabled` - Are changes to the configuration file be permitted. +* `configuration_file_changes_enabled` - Are changes to the configuration file permitted. * `default_host_name` - The default host name of the Static Web App. @@ -57,7 +57,7 @@ An `identity` block exports the following: * `type` - The Type of Managed Identity assigned to this Static Web App resource. -* `identity_ids` -The list of Managed Identity IDs which are assigned to this Static Web App resource. +* `identity_ids` - The list of Managed Identity IDs which are assigned to this Static Web App resource. --- diff --git a/website/docs/r/static_web_app_custom_domain.html.markdown b/website/docs/r/static_web_app_custom_domain.html.markdown index a15b4d0a6753..5ed0844a9f7b 100644 --- a/website/docs/r/static_web_app_custom_domain.html.markdown +++ b/website/docs/r/static_web_app_custom_domain.html.markdown @@ -86,7 +86,7 @@ The following arguments are supported: -> **NOTE:** Apex domains must use `dns-txt-token` validation. --> **NOTE:** Validation using `dns-txt-token` is performed asynchronously and Terraform does wait for the validation process to be successful. Please ensure that the appropriate TXT record is created using the `validation_token` value for this to complete. +-> **NOTE:** Validation using `dns-txt-token` is performed asynchronously and Terraform does wait for the validation process to be successful before marking the resource as created successfully. Please ensure that the appropriate TXT record is created using the `validation_token` value for this to complete out of band. ## Attributes Reference From 5c65a8f8c762c355ea0810c17884b6b5436738e5 Mon Sep 17 00:00:00 2001 From: jackofallops Date: Mon, 4 Mar 2024 15:22:22 +0100 Subject: [PATCH 16/16] typo --- website/docs/r/static_web_app_custom_domain.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/static_web_app_custom_domain.html.markdown b/website/docs/r/static_web_app_custom_domain.html.markdown index 5ed0844a9f7b..55afffffbac7 100644 --- a/website/docs/r/static_web_app_custom_domain.html.markdown +++ b/website/docs/r/static_web_app_custom_domain.html.markdown @@ -86,7 +86,7 @@ The following arguments are supported: -> **NOTE:** Apex domains must use `dns-txt-token` validation. --> **NOTE:** Validation using `dns-txt-token` is performed asynchronously and Terraform does wait for the validation process to be successful before marking the resource as created successfully. Please ensure that the appropriate TXT record is created using the `validation_token` value for this to complete out of band. +-> **NOTE:** Validation using `dns-txt-token` is performed asynchronously and Terraform does not wait for the validation process to be successful before marking the resource as created successfully. Please ensure that the appropriate TXT record is created using the `validation_token` value for this to complete out of band. ## Attributes Reference