From 376185b5815b7cae7e5db9b3deaf8825ee98eefa Mon Sep 17 00:00:00 2001 From: kt Date: Thu, 25 May 2023 21:55:16 -0700 Subject: [PATCH 1/4] security.watchitems: switch to go-azure-sdk --- internal/services/sentinel/client/client.go | 12 +- internal/services/sentinel/parse/watchlist.go | 75 ---- .../services/sentinel/parse/watchlist_item.go | 81 ---- .../sentinel/parse/watchlist_item_test.go | 144 ------- .../services/sentinel/parse/watchlist_test.go | 128 ------- internal/services/sentinel/resourceids.go | 2 - .../sentinel_watchlist_item_resource.go | 122 +++--- .../sentinel_watchlist_item_resource_test.go | 12 +- .../sentinel/sentinel_watchlist_resource.go | 78 ++-- .../sentinel_watchlist_resource_test.go | 12 +- .../sentinel/validate/watchlist_id.go | 23 -- .../sentinel/validate/watchlist_id_test.go | 88 ----- .../sentinel/validate/watchlist_item_id.go | 23 -- .../validate/watchlist_item_id_test.go | 100 ----- ...ervice_custom_certificate_resource_test.go | 2 + .../alertruletemplates/README.md | 53 +++ .../alertruletemplates/client.go | 18 + .../alertruletemplates/constants.go | 353 ++++++++++++++++++ .../id_alertruletemplate.go | 142 +++++++ .../alertruletemplates/id_workspace.go | 127 +++++++ .../method_alertruletemplatesget_autorest.go | 77 ++++ .../method_alertruletemplateslist_autorest.go | 196 ++++++++++ .../model_alertdetailsoverride.go | 11 + .../model_alertruletemplate.go | 88 +++++ .../model_alertruletemplatedatasource.go | 9 + .../alertruletemplates/model_entitymapping.go | 9 + .../model_eventgroupingsettings.go | 8 + .../alertruletemplates/model_fieldmapping.go | 9 + .../model_fusionalertruletemplate.go | 47 +++ ...model_fusionalertruletemplateproperties.go | 46 +++ ...curityincidentcreationalertruletemplate.go | 47 +++ ...dentcreationalertruletemplateproperties.go | 45 +++ ...el_mlbehavioranalyticsalertruletemplate.go | 47 +++ ...ioranalyticsalertruletemplateproperties.go | 46 +++ .../model_nrtalertruletemplate.go | 47 +++ .../model_nrtalertruletemplateproperties.go | 51 +++ .../model_scheduledalertruletemplate.go | 47 +++ ...el_scheduledalertruletemplateproperties.go | 56 +++ ...del_threatintelligencealertruletemplate.go | 47 +++ ...intelligencealertruletemplateproperties.go | 46 +++ .../alertruletemplates/predicates.go | 12 + .../alertruletemplates/version.go | 12 + .../2022-11-01/dataconnectors/README.md | 90 +++++ .../2022-11-01/dataconnectors/client.go | 18 + .../2022-11-01/dataconnectors/constants.go | 80 ++++ .../dataconnectors/id_dataconnector.go | 142 +++++++ .../2022-11-01/dataconnectors/id_workspace.go | 127 +++++++ ...d_dataconnectorscreateorupdate_autorest.go | 78 ++++ .../method_dataconnectorsdelete_autorest.go | 66 ++++ .../method_dataconnectorsget_autorest.go | 77 ++++ .../method_dataconnectorslist_autorest.go | 196 ++++++++++ .../dataconnectors/model_aaddataconnector.go | 48 +++ .../model_aaddataconnectorproperties.go | 9 + .../dataconnectors/model_aatpdataconnector.go | 48 +++ .../model_aatpdataconnectorproperties.go | 9 + .../model_alertsdatatypeofdataconnector.go | 8 + .../dataconnectors/model_ascdataconnector.go | 48 +++ .../model_ascdataconnectorproperties.go | 9 + .../model_awscloudtraildataconnector.go | 48 +++ ...del_awscloudtraildataconnectordatatypes.go | 8 + ...el_awscloudtraildataconnectorproperties.go | 9 + .../dataconnectors/model_dataconnector.go | 104 ++++++ .../model_dataconnectordatatypecommon.go | 8 + .../dataconnectors/model_mcasdataconnector.go | 48 +++ .../model_mcasdataconnectordatatypes.go | 9 + .../model_mcasdataconnectorproperties.go | 9 + .../model_mdatpdataconnector.go | 48 +++ .../model_mdatpdataconnectorproperties.go | 9 + .../model_officedataconnector.go | 48 +++ .../model_officedataconnectordatatypes.go | 10 + .../model_officedataconnectorproperties.go | 9 + .../dataconnectors/model_tidataconnector.go | 48 +++ .../model_tidataconnectordatatypes.go | 8 + .../model_tidataconnectorproperties.go | 28 ++ .../2022-11-01/dataconnectors/predicates.go | 12 + .../2022-11-01/dataconnectors/version.go | 12 + .../securitymlanalyticssettings/README.md | 90 +++++ .../securitymlanalyticssettings/client.go | 18 + .../securitymlanalyticssettings/constants.go | 132 +++++++ .../id_securitymlanalyticssetting.go | 142 +++++++ .../id_workspace.go | 127 +++++++ ...nalyticssettingscreateorupdate_autorest.go | 78 ++++ ...uritymlanalyticssettingsdelete_autorest.go | 66 ++++ ...securitymlanalyticssettingsget_autorest.go | 77 ++++ ...ecuritymlanalyticssettingslist_autorest.go | 196 ++++++++++ ...odel_anomalysecuritymlanalyticssettings.go | 48 +++ ...lysecuritymlanalyticssettingsproperties.go | 39 ++ .../model_securitymlanalyticssetting.go | 48 +++ ...l_securitymlanalyticssettingsdatasource.go | 9 + .../securitymlanalyticssettings/predicates.go | 12 + .../securitymlanalyticssettings/version.go | 12 + .../2022-11-01/threatintelligence/README.md | 191 ++++++++++ .../2022-11-01/threatintelligence/client.go | 18 + .../threatintelligence/constants.go | 62 +++ .../threatintelligence/id_indicator.go | 144 +++++++ .../threatintelligence/id_workspace.go | 127 +++++++ .../method_indicatorappendtags_autorest.go | 68 ++++ .../method_indicatorcreate_autorest.go | 78 ++++ ...ethod_indicatorcreateindicator_autorest.go | 79 ++++ .../method_indicatordelete_autorest.go | 66 ++++ .../method_indicatorget_autorest.go | 77 ++++ .../method_indicatormetricslist_autorest.go | 69 ++++ ...ethod_indicatorqueryindicators_autorest.go | 197 ++++++++++ .../method_indicatorreplacetags_autorest.go | 79 ++++ .../method_indicatorslist_autorest.go | 235 ++++++++++++ .../model_threatintelligenceappendtags.go | 8 + ...del_threatintelligenceexternalreference.go | 12 + ...del_threatintelligencefilteringcriteria.go | 20 + ..._threatintelligencegranularmarkingmodel.go | 10 + .../model_threatintelligenceindicatormodel.go | 48 +++ ...l_threatintelligenceindicatorproperties.go | 37 ++ .../model_threatintelligenceinformation.go | 48 +++ .../model_threatintelligencekillchainphase.go | 9 + .../model_threatintelligencemetric.go | 11 + .../model_threatintelligencemetricentity.go | 9 + .../model_threatintelligencemetrics.go | 8 + .../model_threatintelligencemetricslist.go | 8 + .../model_threatintelligenceparsedpattern.go | 9 + ...hreatintelligenceparsedpatterntypevalue.go | 9 + ...model_threatintelligencesortingcriteria.go | 9 + .../threatintelligence/predicates.go | 12 + .../2022-11-01/threatintelligence/version.go | 12 + .../2022-11-01/watchlistitems/README.md | 90 +++++ .../2022-11-01/watchlistitems/client.go | 18 + .../2022-11-01/watchlistitems/id_watchlist.go | 142 +++++++ .../watchlistitems/id_watchlistitem.go | 155 ++++++++ .../method_createorupdate_autorest.go | 69 ++++ .../watchlistitems/method_delete_autorest.go | 66 ++++ .../watchlistitems/method_get_autorest.go | 68 ++++ .../watchlistitems/method_list_autorest.go | 186 +++++++++ .../watchlistitems/model_userinfo.go | 10 + .../watchlistitems/model_watchlistitem.go | 17 + .../model_watchlistitemproperties.go | 47 +++ .../2022-11-01/watchlistitems/predicates.go | 32 ++ .../2022-11-01/watchlistitems/version.go | 12 + .../2022-11-01/watchlists/README.md | 90 +++++ .../2022-11-01/watchlists/client.go | 18 + .../2022-11-01/watchlists/constants.go | 34 ++ .../2022-11-01/watchlists/id_watchlist.go | 142 +++++++ .../2022-11-01/watchlists/id_workspace.go | 127 +++++++ .../method_createorupdate_autorest.go | 69 ++++ .../watchlists/method_delete_autorest.go | 66 ++++ .../watchlists/method_get_autorest.go | 68 ++++ .../watchlists/method_list_autorest.go | 186 +++++++++ .../2022-11-01/watchlists/model_userinfo.go | 10 + .../2022-11-01/watchlists/model_watchlist.go | 17 + .../watchlists/model_watchlistproperties.go | 57 +++ .../2022-11-01/watchlists/predicates.go | 32 ++ .../2022-11-01/watchlists/version.go | 12 + vendor/modules.txt | 6 + 150 files changed, 8052 insertions(+), 783 deletions(-) delete mode 100644 internal/services/sentinel/parse/watchlist.go delete mode 100644 internal/services/sentinel/parse/watchlist_item.go delete mode 100644 internal/services/sentinel/parse/watchlist_item_test.go delete mode 100644 internal/services/sentinel/parse/watchlist_test.go delete mode 100644 internal/services/sentinel/validate/watchlist_id.go delete mode 100644 internal/services/sentinel/validate/watchlist_id_test.go delete mode 100644 internal/services/sentinel/validate/watchlist_item_id.go delete mode 100644 internal/services/sentinel/validate/watchlist_item_id_test.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_alertruletemplate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_workspace.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/method_alertruletemplatesget_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/method_alertruletemplateslist_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertdetailsoverride.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplatedatasource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_entitymapping.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_eventgroupingsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fieldmapping.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/id_dataconnector.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/id_workspace.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorscreateorupdate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorsdelete_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorsget_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorslist_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aaddataconnector.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aaddataconnectorproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aatpdataconnector.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aatpdataconnectorproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_alertsdatatypeofdataconnector.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_ascdataconnector.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_ascdataconnectorproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnector.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnectordatatypes.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnectorproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_dataconnector.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_dataconnectordatatypecommon.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnector.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnectordatatypes.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnectorproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mdatpdataconnector.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mdatpdataconnectorproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnector.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnectordatatypes.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnectorproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnector.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnectordatatypes.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnectorproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_workspace.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingscreateorupdate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingsdelete_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingsget_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingslist_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettingsproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_securitymlanalyticssetting.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_securitymlanalyticssettingsdatasource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/id_indicator.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/id_workspace.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorappendtags_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorcreate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorcreateindicator_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatordelete_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorget_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatormetricslist_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorqueryindicators_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorreplacetags_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorslist_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceappendtags.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceexternalreference.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencefilteringcriteria.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencegranularmarkingmodel.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceindicatormodel.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceindicatorproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceinformation.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencekillchainphase.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetric.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetricentity.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetrics.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetricslist.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceparsedpattern.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceparsedpatterntypevalue.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencesortingcriteria.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/id_watchlist.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/id_watchlistitem.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/method_createorupdate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/method_delete_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/method_get_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/method_list_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/model_userinfo.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/model_watchlistitem.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/model_watchlistitemproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/id_watchlist.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/id_workspace.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/method_createorupdate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/method_delete_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/method_get_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/method_list_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/model_userinfo.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/model_watchlist.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/model_watchlistproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/version.go diff --git a/internal/services/sentinel/client/client.go b/internal/services/sentinel/client/client.go index cf55c87ce48c..afd8030c1338 100644 --- a/internal/services/sentinel/client/client.go +++ b/internal/services/sentinel/client/client.go @@ -6,6 +6,8 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-10-01-preview/automationrules" "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-10-01-preview/metadata" "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/sentinelonboardingstates" + "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems" + "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists" "github.com/hashicorp/terraform-provider-azurerm/internal/common" securityinsight "github.com/tombuildsstuff/kermit/sdk/securityinsights/2022-10-01-preview/securityinsights" ) @@ -15,8 +17,8 @@ type Client struct { AlertRuleTemplatesClient *alertruletemplates.AlertRuleTemplatesClient AutomationRulesClient *automationrules.AutomationRulesClient DataConnectorsClient *securityinsight.DataConnectorsClient - WatchlistsClient *securityinsight.WatchlistsClient - WatchlistItemsClient *securityinsight.WatchlistItemsClient + WatchlistsClient *watchlists.WatchlistsClient + WatchlistItemsClient *watchlistitems.WatchlistItemsClient OnboardingStatesClient *sentinelonboardingstates.SentinelOnboardingStatesClient AnalyticsSettingsClient *securityinsight.SecurityMLAnalyticsSettingsClient ThreatIntelligenceClient *securityinsight.ThreatIntelligenceIndicatorClient @@ -36,10 +38,10 @@ func NewClient(o *common.ClientOptions) *Client { dataConnectorsClient := securityinsight.NewDataConnectorsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&dataConnectorsClient.Client, o.ResourceManagerAuthorizer) - watchListsClient := securityinsight.NewWatchlistsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + watchListsClient := watchlists.NewWatchlistsClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&watchListsClient.Client, o.ResourceManagerAuthorizer) - watchListItemsClient := securityinsight.NewWatchlistItemsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + watchListItemsClient := watchlistitems.NewWatchlistItemsClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&watchListItemsClient.Client, o.ResourceManagerAuthorizer) onboardingStatesClient := sentinelonboardingstates.NewSentinelOnboardingStatesClientWithBaseURI(o.ResourceManagerEndpoint) @@ -48,7 +50,7 @@ func NewClient(o *common.ClientOptions) *Client { analyticsSettingsClient := securityinsight.NewSecurityMLAnalyticsSettingsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&analyticsSettingsClient.Client, o.ResourceManagerAuthorizer) - threatIntelligenceClient := securityinsight.NewThreatIntelligenceIndicatorClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + threatIntelligenceClient := securityinsight.NewThreatIntelligenceIndicatorClient(o.ResourceManagerEndpoint) o.ConfigureClient(&threatIntelligenceClient.Client, o.ResourceManagerAuthorizer) metadataClient := metadata.NewMetadataClientWithBaseURI(o.ResourceManagerEndpoint) diff --git a/internal/services/sentinel/parse/watchlist.go b/internal/services/sentinel/parse/watchlist.go deleted file mode 100644 index 33c333ff93ed..000000000000 --- a/internal/services/sentinel/parse/watchlist.go +++ /dev/null @@ -1,75 +0,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 WatchlistId struct { - SubscriptionId string - ResourceGroup string - WorkspaceName string - Name string -} - -func NewWatchlistID(subscriptionId, resourceGroup, workspaceName, name string) WatchlistId { - return WatchlistId{ - SubscriptionId: subscriptionId, - ResourceGroup: resourceGroup, - WorkspaceName: workspaceName, - Name: name, - } -} - -func (id WatchlistId) String() string { - segments := []string{ - fmt.Sprintf("Name %q", id.Name), - fmt.Sprintf("Workspace Name %q", id.WorkspaceName), - fmt.Sprintf("Resource Group %q", id.ResourceGroup), - } - segmentsStr := strings.Join(segments, " / ") - return fmt.Sprintf("%s: (%s)", "Watchlist", segmentsStr) -} - -func (id WatchlistId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/watchlists/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.WorkspaceName, id.Name) -} - -// WatchlistID parses a Watchlist ID into an WatchlistId struct -func WatchlistID(input string) (*WatchlistId, error) { - id, err := resourceids.ParseAzureResourceID(input) - if err != nil { - return nil, fmt.Errorf("parsing %q as an Watchlist ID: %+v", input, err) - } - - resourceId := WatchlistId{ - 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.WorkspaceName, err = id.PopSegment("workspaces"); err != nil { - return nil, err - } - if resourceId.Name, err = id.PopSegment("watchlists"); err != nil { - return nil, err - } - - if err := id.ValidateNoEmptySegments(input); err != nil { - return nil, err - } - - return &resourceId, nil -} diff --git a/internal/services/sentinel/parse/watchlist_item.go b/internal/services/sentinel/parse/watchlist_item.go deleted file mode 100644 index fb4b5d19280e..000000000000 --- a/internal/services/sentinel/parse/watchlist_item.go +++ /dev/null @@ -1,81 +0,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 WatchlistItemId struct { - SubscriptionId string - ResourceGroup string - WorkspaceName string - WatchlistName string - Name string -} - -func NewWatchlistItemID(subscriptionId, resourceGroup, workspaceName, watchlistName, name string) WatchlistItemId { - return WatchlistItemId{ - SubscriptionId: subscriptionId, - ResourceGroup: resourceGroup, - WorkspaceName: workspaceName, - WatchlistName: watchlistName, - Name: name, - } -} - -func (id WatchlistItemId) String() string { - segments := []string{ - fmt.Sprintf("Name %q", id.Name), - fmt.Sprintf("Watchlist Name %q", id.WatchlistName), - fmt.Sprintf("Workspace Name %q", id.WorkspaceName), - fmt.Sprintf("Resource Group %q", id.ResourceGroup), - } - segmentsStr := strings.Join(segments, " / ") - return fmt.Sprintf("%s: (%s)", "Watchlist Item", segmentsStr) -} - -func (id WatchlistItemId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/watchlists/%s/watchlistItems/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.WorkspaceName, id.WatchlistName, id.Name) -} - -// WatchlistItemID parses a WatchlistItem ID into an WatchlistItemId struct -func WatchlistItemID(input string) (*WatchlistItemId, error) { - id, err := resourceids.ParseAzureResourceID(input) - if err != nil { - return nil, fmt.Errorf("parsing %q as an WatchlistItem ID: %+v", input, err) - } - - resourceId := WatchlistItemId{ - 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.WorkspaceName, err = id.PopSegment("workspaces"); err != nil { - return nil, err - } - if resourceId.WatchlistName, err = id.PopSegment("watchlists"); err != nil { - return nil, err - } - if resourceId.Name, err = id.PopSegment("watchlistItems"); err != nil { - return nil, err - } - - if err := id.ValidateNoEmptySegments(input); err != nil { - return nil, err - } - - return &resourceId, nil -} diff --git a/internal/services/sentinel/parse/watchlist_item_test.go b/internal/services/sentinel/parse/watchlist_item_test.go deleted file mode 100644 index 69227d5158ad..000000000000 --- a/internal/services/sentinel/parse/watchlist_item_test.go +++ /dev/null @@ -1,144 +0,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 = WatchlistItemId{} - -func TestWatchlistItemIDFormatter(t *testing.T) { - actual := NewWatchlistItemID("12345678-1234-9876-4563-123456789012", "resGroup1", "workspace1", "list1", "item1").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/watchlists/list1/watchlistItems/item1" - if actual != expected { - t.Fatalf("Expected %q but got %q", expected, actual) - } -} - -func TestWatchlistItemID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WatchlistItemId - }{ - - { - // 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 WorkspaceName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/", - Error: true, - }, - - { - // missing value for WorkspaceName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/", - Error: true, - }, - - { - // missing WatchlistName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/", - Error: true, - }, - - { - // missing value for WatchlistName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/watchlists/", - Error: true, - }, - - { - // missing Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/watchlists/list1/", - Error: true, - }, - - { - // missing value for Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/watchlists/list1/watchlistItems/", - Error: true, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/watchlists/list1/watchlistItems/item1", - Expected: &WatchlistItemId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroup: "resGroup1", - WorkspaceName: "workspace1", - WatchlistName: "list1", - Name: "item1", - }, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.OPERATIONALINSIGHTS/WORKSPACES/WORKSPACE1/PROVIDERS/MICROSOFT.SECURITYINSIGHTS/WATCHLISTS/LIST1/WATCHLISTITEMS/ITEM1", - Error: true, - }, - } - - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := WatchlistItemID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - if actual.WatchlistName != v.Expected.WatchlistName { - t.Fatalf("Expected %q but got %q for WatchlistName", v.Expected.WatchlistName, actual.WatchlistName) - } - 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/sentinel/parse/watchlist_test.go b/internal/services/sentinel/parse/watchlist_test.go deleted file mode 100644 index 594d9a19ca91..000000000000 --- a/internal/services/sentinel/parse/watchlist_test.go +++ /dev/null @@ -1,128 +0,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 = WatchlistId{} - -func TestWatchlistIDFormatter(t *testing.T) { - actual := NewWatchlistID("12345678-1234-9876-4563-123456789012", "resGroup1", "workspace1", "list1").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/watchlists/list1" - if actual != expected { - t.Fatalf("Expected %q but got %q", expected, actual) - } -} - -func TestWatchlistID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WatchlistId - }{ - - { - // 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 WorkspaceName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/", - Error: true, - }, - - { - // missing value for WorkspaceName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/", - Error: true, - }, - - { - // missing Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/", - Error: true, - }, - - { - // missing value for Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/watchlists/", - Error: true, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/watchlists/list1", - Expected: &WatchlistId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroup: "resGroup1", - WorkspaceName: "workspace1", - Name: "list1", - }, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.OPERATIONALINSIGHTS/WORKSPACES/WORKSPACE1/PROVIDERS/MICROSOFT.SECURITYINSIGHTS/WATCHLISTS/LIST1", - Error: true, - }, - } - - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := WatchlistID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - 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/sentinel/resourceids.go b/internal/services/sentinel/resourceids.go index dc69ff0b82a6..92af812aa167 100644 --- a/internal/services/sentinel/resourceids.go +++ b/internal/services/sentinel/resourceids.go @@ -3,7 +3,5 @@ package sentinel //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=SentinelAlertRuleTemplate -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/alertRuleTemplates/template1 -rewrite=true //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=DataConnector -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/dataConnectors/dc1 //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=AutomationRule -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/automationRules/rule1 -rewrite=true -//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=Watchlist -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/watchlists/list1 -//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=WatchlistItem -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/watchlists/list1/watchlistItems/item1 //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=MLAnalyticsSettings -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/setting1 //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=ThreatIntelligenceIndicator -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicator1 diff --git a/internal/services/sentinel/sentinel_watchlist_item_resource.go b/internal/services/sentinel/sentinel_watchlist_item_resource.go index b62bc26b2f50..9af4179196e0 100644 --- a/internal/services/sentinel/sentinel_watchlist_item_resource.go +++ b/internal/services/sentinel/sentinel_watchlist_item_resource.go @@ -6,13 +6,12 @@ import ( "time" "github.com/google/uuid" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems" + "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/sentinel/parse" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/sentinel/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/utils" - securityinsight "github.com/tombuildsstuff/kermit/sdk/securityinsights/2022-10-01-preview/securityinsights" ) type WatchlistItemResource struct{} @@ -38,7 +37,7 @@ func (r WatchlistItemResource) Arguments() map[string]*pluginsdk.Schema { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: validate.WatchlistID, + ValidateFunc: watchlists.ValidateWatchlistID, }, "properties": { Type: pluginsdk.TypeMap, @@ -63,7 +62,7 @@ func (r WatchlistItemResource) ModelObject() interface{} { } func (r WatchlistItemResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { - return validate.WatchlistItemID + return watchlistitems.ValidateWatchlistItemID } func (r WatchlistItemResource) Create() sdk.ResourceFunc { @@ -72,40 +71,40 @@ func (r WatchlistItemResource) Create() sdk.ResourceFunc { Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.Sentinel.WatchlistItemsClient - var model WatchlistItemModel - if err := metadata.Decode(&model); err != nil { + var watchListItem WatchlistItemModel + if err := metadata.Decode(&watchListItem); err != nil { return fmt.Errorf("decoding %+v", err) } // Generate a random UUID as the resource name if the user doesn't specify it. - if model.Name == "" { - model.Name = uuid.New().String() + if watchListItem.Name == "" { + watchListItem.Name = uuid.New().String() } - watchlistId, err := parse.WatchlistID(model.WatchlistID) + watchlistId, err := watchlists.ParseWatchlistID(watchListItem.WatchlistID) if err != nil { return err } - id := parse.NewWatchlistItemID(watchlistId.SubscriptionId, watchlistId.ResourceGroup, watchlistId.WorkspaceName, watchlistId.Name, model.Name) + id := watchlistitems.NewWatchlistItemID(watchlistId.SubscriptionId, watchlistId.ResourceGroupName, watchlistId.WorkspaceName, watchlistId.WatchlistAlias, watchListItem.Name) - existing, err := client.Get(ctx, id.ResourceGroup, id.WorkspaceName, id.WatchlistName, id.Name) + existing, err := client.Get(ctx, id) if err != nil { - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return fmt.Errorf("checking for presence of existing %s: %+v", id, err) } } - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return metadata.ResourceRequiresImport(r.ResourceType(), id) } - params := securityinsight.WatchlistItem{ - WatchlistItemProperties: &securityinsight.WatchlistItemProperties{ - ItemsKeyValue: model.Properties, + params := watchlistitems.WatchlistItem{ + Properties: &watchlistitems.WatchlistItemProperties{ + ItemsKeyValue: watchListItem.Properties, }, } - if _, err = client.CreateOrUpdate(ctx, id.ResourceGroup, id.WorkspaceName, id.WatchlistName, id.Name, params); err != nil { + if _, err = client.CreateOrUpdate(ctx, id, params); err != nil { return fmt.Errorf("creating %s: %+v", id, err) } @@ -121,54 +120,36 @@ func (r WatchlistItemResource) Read() sdk.ResourceFunc { Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.Sentinel.WatchlistItemsClient - id, err := parse.WatchlistItemID(metadata.ResourceData.Id()) + id, err := watchlistitems.ParseWatchlistItemID(metadata.ResourceData.Id()) if err != nil { return err } - resp, err := client.Get(ctx, id.ResourceGroup, id.WorkspaceName, id.WatchlistName, id.Name) + resp, err := client.Get(ctx, *id) if err != nil { - if utils.ResponseWasNotFound(resp.Response) { + if response.WasNotFound(resp.HttpResponse) { return metadata.MarkAsGone(id) } return fmt.Errorf("retrieving %s: %+v", id, err) } - watchlistId := parse.NewWatchlistID(id.SubscriptionId, id.ResourceGroup, id.WorkspaceName, id.WatchlistName) + watchlistId := watchlists.NewWatchlistID(id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.WatchlistAlias) var properties map[string]interface{} - if props := resp.WatchlistItemProperties; props != nil { - if itemsKV := props.ItemsKeyValue; itemsKV != nil { - properties = itemsKV + if model := resp.Model; model != nil { + if props := model.Properties; props != nil { + if itemsKV := props.ItemsKeyValue; itemsKV != nil { + properties = itemsKV.(map[string]interface{}) + } } } - model := WatchlistItemModel{ + + watchListItem := WatchlistItemModel{ WatchlistID: watchlistId.ID(), - Name: id.Name, + Name: id.WatchlistItemId, Properties: properties, } - - return metadata.Encode(&model) - }, - } -} - -func (r WatchlistItemResource) Delete() sdk.ResourceFunc { - return sdk.ResourceFunc{ - Timeout: 30 * time.Minute, - Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - client := metadata.Client.Sentinel.WatchlistItemsClient - - id, err := parse.WatchlistItemID(metadata.ResourceData.Id()) - if err != nil { - return err - } - - if _, err := client.Delete(ctx, id.ResourceGroup, id.WorkspaceName, id.WatchlistName, id.Name); err != nil { - return fmt.Errorf("deleting %s: %+v", id, err) - } - - return nil + return metadata.Encode(&watchListItem) }, } } @@ -184,29 +165,30 @@ func (r WatchlistItemResource) Update() sdk.ResourceFunc { return fmt.Errorf("decoding %+v", err) } - watchlistId, err := parse.WatchlistID(model.WatchlistID) + watchlistId, err := watchlistitems.ParseWatchlistItemID(model.WatchlistID) if err != nil { return err } - id := parse.NewWatchlistItemID(watchlistId.SubscriptionId, watchlistId.ResourceGroup, watchlistId.WorkspaceName, watchlistId.Name, model.Name) + id := watchlistitems.NewWatchlistItemID(watchlistId.SubscriptionId, watchlistId.ResourceGroupName, watchlistId.WorkspaceName, watchlistId.WatchlistAlias, model.Name) - existing, err := client.Get(ctx, id.ResourceGroup, id.WorkspaceName, id.WatchlistName, id.Name) + existing, err := client.Get(ctx, id) if err != nil { return fmt.Errorf("checking for presence of existing %s: %+v", id, err) } - update := securityinsight.WatchlistItem{ - WatchlistItemProperties: existing.WatchlistItemProperties, - } + update := watchlistitems.WatchlistItem{} + if model := existing.Model; model != nil { + update.Properties = model.Properties + } if metadata.ResourceData.HasChange("properties") { - if update.WatchlistItemProperties == nil { - update.WatchlistItemProperties = &securityinsight.WatchlistItemProperties{} + if update.Properties == nil { + update.Properties = &watchlistitems.WatchlistItemProperties{} } - update.WatchlistItemProperties.ItemsKeyValue = model.Properties + update.Properties.ItemsKeyValue = model.Properties } - if _, err = client.CreateOrUpdate(ctx, id.ResourceGroup, id.WorkspaceName, id.WatchlistName, id.Name, update); err != nil { + if _, err = client.CreateOrUpdate(ctx, *watchlistId, update); err != nil { return fmt.Errorf("creating %s: %+v", id, err) } @@ -215,3 +197,23 @@ func (r WatchlistItemResource) Update() sdk.ResourceFunc { }, } } + +func (r WatchlistItemResource) Delete() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.Sentinel.WatchlistItemsClient + + id, err := watchlistitems.ParseWatchlistItemID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + if _, err := client.Delete(ctx, *id); err != nil { + return fmt.Errorf("deleting %s: %+v", id, err) + } + + return nil + }, + } +} diff --git a/internal/services/sentinel/sentinel_watchlist_item_resource_test.go b/internal/services/sentinel/sentinel_watchlist_item_resource_test.go index 42499996f8d8..c5939e99e8dd 100644 --- a/internal/services/sentinel/sentinel_watchlist_item_resource_test.go +++ b/internal/services/sentinel/sentinel_watchlist_item_resource_test.go @@ -5,10 +5,11 @@ import ( "fmt" "testing" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems" "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/sentinel/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -77,16 +78,17 @@ func TestAccWatchlistItem_requiresImport(t *testing.T) { func (r WatchlistItemResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { client := clients.Sentinel.WatchlistItemsClient - id, err := parse.WatchlistItemID(state.ID) + id, err := watchlistitems.ParseWatchlistItemID(state.ID) if err != nil { return nil, err } - if resp, err := client.Get(ctx, id.ResourceGroup, id.WorkspaceName, id.WatchlistName, id.Name); err != nil { - if utils.ResponseWasNotFound(resp.Response) { + resp, err := client.Get(ctx, *id) + if err != nil { + if response.WasNotFound(resp.HttpResponse) { return utils.Bool(false), nil } - return nil, fmt.Errorf("retrieving %s: %+v", id, err) + return nil, fmt.Errorf("retrieving %s: %+v", *id, err) } return utils.Bool(true), nil diff --git a/internal/services/sentinel/sentinel_watchlist_resource.go b/internal/services/sentinel/sentinel_watchlist_resource.go index b715e6402fda..823a2712d4d9 100644 --- a/internal/services/sentinel/sentinel_watchlist_resource.go +++ b/internal/services/sentinel/sentinel_watchlist_resource.go @@ -5,15 +5,14 @@ import ( "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/operationalinsights/2020-08-01/workspaces" + "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists" commonValidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/sentinel/parse" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/sentinel/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/utils" - securityinsight "github.com/tombuildsstuff/kermit/sdk/securityinsights/2022-10-01-preview/securityinsights" ) type WatchlistResource struct{} @@ -93,7 +92,7 @@ func (r WatchlistResource) ModelObject() interface{} { } func (r WatchlistResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { - return validate.WatchlistID + return watchlists.ValidateWatchlistID } func (r WatchlistResource) Create() sdk.ResourceFunc { @@ -112,40 +111,39 @@ func (r WatchlistResource) Create() sdk.ResourceFunc { return fmt.Errorf("parsing Log Analytics Workspace ID: %w", err) } - id := parse.NewWatchlistID(workspaceId.SubscriptionId, workspaceId.ResourceGroupName, workspaceId.WorkspaceName, model.Name) + id := watchlists.NewWatchlistID(workspaceId.SubscriptionId, workspaceId.ResourceGroupName, workspaceId.WorkspaceName, model.Name) - existing, err := client.Get(ctx, id.ResourceGroup, id.WorkspaceName, id.Name) + existing, err := client.Get(ctx, id) if err != nil { - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return fmt.Errorf("checking for presence of existing %s: %+v", id, err) } } - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return metadata.ResourceRequiresImport(r.ResourceType(), id) } - param := securityinsight.Watchlist{ - WatchlistProperties: &securityinsight.WatchlistProperties{ - DisplayName: &model.DisplayName, + param := watchlists.Watchlist{ + Properties: &watchlists.WatchlistProperties{ + DisplayName: model.DisplayName, // The only supported provider for now is "Microsoft" - Provider: utils.String("Microsoft"), + Provider: "Microsoft", - ItemsSearchKey: utils.String(model.ItemSearchKey), + ItemsSearchKey: model.ItemSearchKey, }, } if model.Description != "" { - param.WatchlistProperties.Description = &model.Description + param.Properties.Description = &model.Description } if len(model.Labels) != 0 { - param.WatchlistProperties.Labels = &model.Labels + param.Properties.Labels = &model.Labels } if model.DefaultDuration != "" { - param.WatchlistProperties.DefaultDuration = &model.DefaultDuration + param.Properties.DefaultDuration = &model.DefaultDuration } - _, err = client.CreateOrUpdate(ctx, id.ResourceGroup, id.WorkspaceName, id.Name, param) - if err != nil { + if _, err = client.CreateOrUpdate(ctx, id, param); err != nil { return fmt.Errorf("creating %s: %+v", id, err) } @@ -161,43 +159,35 @@ func (r WatchlistResource) Read() sdk.ResourceFunc { Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.Sentinel.WatchlistsClient - id, err := parse.WatchlistID(metadata.ResourceData.Id()) + id, err := watchlists.ParseWatchlistID(metadata.ResourceData.Id()) if err != nil { return err } - resp, err := client.Get(ctx, id.ResourceGroup, id.WorkspaceName, id.Name) + resp, err := client.Get(ctx, *id) if err != nil { - if utils.ResponseWasNotFound(resp.Response) { + if response.WasNotFound(resp.HttpResponse) { return metadata.MarkAsGone(id) } return fmt.Errorf("retrieving %s: %+v", id, err) } - model := WatchlistModel{ - Name: id.Name, - LogAnalyticsWorkspaceId: workspaces.NewWorkspaceID(id.SubscriptionId, id.ResourceGroup, id.WorkspaceName).ID(), + watchList := WatchlistModel{ + Name: id.WatchlistAlias, + LogAnalyticsWorkspaceId: workspaces.NewWorkspaceID(id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName).ID(), } - if props := resp.WatchlistProperties; props != nil { - if props.DisplayName != nil { - model.DisplayName = *props.DisplayName - } - if props.Description != nil { - model.Description = *props.Description - } - if props.Labels != nil { - model.Labels = *props.Labels - } - if props.DefaultDuration != nil { - model.DefaultDuration = *props.DefaultDuration - } - if props.ItemsSearchKey != nil { - model.ItemSearchKey = *props.ItemsSearchKey + if model := resp.Model; model != nil { + if props := model.Properties; props != nil { + + watchList.DisplayName = props.DisplayName + watchList.ItemSearchKey = props.ItemsSearchKey + watchList.Description = pointer.From(props.Description) + watchList.Labels = pointer.From(props.Labels) + watchList.DefaultDuration = pointer.From(props.DefaultDuration) } } - - return metadata.Encode(&model) + return metadata.Encode(&watchList) }, } } @@ -208,12 +198,12 @@ func (r WatchlistResource) Delete() sdk.ResourceFunc { Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.Sentinel.WatchlistsClient - id, err := parse.WatchlistID(metadata.ResourceData.Id()) + id, err := watchlists.ParseWatchlistID(metadata.ResourceData.Id()) if err != nil { return err } - if _, err := client.Delete(ctx, id.ResourceGroup, id.WorkspaceName, id.Name); err != nil { + if _, err := client.Delete(ctx, *id); err != nil { return fmt.Errorf("deleting %s: %+v", id, err) } diff --git a/internal/services/sentinel/sentinel_watchlist_resource_test.go b/internal/services/sentinel/sentinel_watchlist_resource_test.go index fe5df8149212..a8ef9762e917 100644 --- a/internal/services/sentinel/sentinel_watchlist_resource_test.go +++ b/internal/services/sentinel/sentinel_watchlist_resource_test.go @@ -5,10 +5,11 @@ import ( "fmt" "testing" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists" "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/sentinel/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -63,16 +64,17 @@ func TestAccWatchlist_requiresImport(t *testing.T) { func (r WatchlistResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { client := clients.Sentinel.WatchlistsClient - id, err := parse.WatchlistID(state.ID) + id, err := watchlists.ParseWatchlistID(state.ID) if err != nil { return nil, err } - if resp, err := client.Get(ctx, id.ResourceGroup, id.WorkspaceName, id.Name); err != nil { - if utils.ResponseWasNotFound(resp.Response) { + resp, err := client.Get(ctx, *id) + if err != nil { + if response.WasNotFound(resp.HttpResponse) { return utils.Bool(false), nil } - return nil, fmt.Errorf("retrieving %s: %+v", id, err) + return nil, fmt.Errorf("retrieving %s: %+v", *id, err) } return utils.Bool(true), nil diff --git a/internal/services/sentinel/validate/watchlist_id.go b/internal/services/sentinel/validate/watchlist_id.go deleted file mode 100644 index 768304cb6726..000000000000 --- a/internal/services/sentinel/validate/watchlist_id.go +++ /dev/null @@ -1,23 +0,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/sentinel/parse" -) - -func WatchlistID(input interface{}, key string) (warnings []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.WatchlistID(v); err != nil { - errors = append(errors, err) - } - - return -} diff --git a/internal/services/sentinel/validate/watchlist_id_test.go b/internal/services/sentinel/validate/watchlist_id_test.go deleted file mode 100644 index bd94b7d94f27..000000000000 --- a/internal/services/sentinel/validate/watchlist_id_test.go +++ /dev/null @@ -1,88 +0,0 @@ -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import "testing" - -func TestWatchlistID(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 WorkspaceName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/", - Valid: false, - }, - - { - // missing value for WorkspaceName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/", - Valid: false, - }, - - { - // missing Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/", - Valid: false, - }, - - { - // missing value for Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/watchlists/", - Valid: false, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/watchlists/list1", - Valid: true, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.OPERATIONALINSIGHTS/WORKSPACES/WORKSPACE1/PROVIDERS/MICROSOFT.SECURITYINSIGHTS/WATCHLISTS/LIST1", - Valid: false, - }, - } - for _, tc := range cases { - t.Logf("[DEBUG] Testing Value %s", tc.Input) - _, errors := WatchlistID(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/sentinel/validate/watchlist_item_id.go b/internal/services/sentinel/validate/watchlist_item_id.go deleted file mode 100644 index 980e404b5873..000000000000 --- a/internal/services/sentinel/validate/watchlist_item_id.go +++ /dev/null @@ -1,23 +0,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/sentinel/parse" -) - -func WatchlistItemID(input interface{}, key string) (warnings []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.WatchlistItemID(v); err != nil { - errors = append(errors, err) - } - - return -} diff --git a/internal/services/sentinel/validate/watchlist_item_id_test.go b/internal/services/sentinel/validate/watchlist_item_id_test.go deleted file mode 100644 index 0325bf29c1f7..000000000000 --- a/internal/services/sentinel/validate/watchlist_item_id_test.go +++ /dev/null @@ -1,100 +0,0 @@ -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import "testing" - -func TestWatchlistItemID(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 WorkspaceName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/", - Valid: false, - }, - - { - // missing value for WorkspaceName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/", - Valid: false, - }, - - { - // missing WatchlistName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/", - Valid: false, - }, - - { - // missing value for WatchlistName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/watchlists/", - Valid: false, - }, - - { - // missing Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/watchlists/list1/", - Valid: false, - }, - - { - // missing value for Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/watchlists/list1/watchlistItems/", - Valid: false, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/watchlists/list1/watchlistItems/item1", - Valid: true, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.OPERATIONALINSIGHTS/WORKSPACES/WORKSPACE1/PROVIDERS/MICROSOFT.SECURITYINSIGHTS/WATCHLISTS/LIST1/WATCHLISTITEMS/ITEM1", - Valid: false, - }, - } - for _, tc := range cases { - t.Logf("[DEBUG] Testing Value %s", tc.Input) - _, errors := WatchlistItemID(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/signalr/signalr_service_custom_certificate_resource_test.go b/internal/services/signalr/signalr_service_custom_certificate_resource_test.go index 0df546e3ad7c..a416f1ec6163 100644 --- a/internal/services/signalr/signalr_service_custom_certificate_resource_test.go +++ b/internal/services/signalr/signalr_service_custom_certificate_resource_test.go @@ -162,6 +162,7 @@ func (r CustomCertSignalrServiceResource) Exists(ctx context.Context, client *cl if err != nil { return nil, err } + resp, err := client.SignalR.SignalRClient.CustomCertificatesGet(ctx, *id) if err != nil { if response.WasNotFound(resp.HttpResponse) { @@ -169,5 +170,6 @@ func (r CustomCertSignalrServiceResource) Exists(ctx context.Context, client *cl } return nil, fmt.Errorf("retrieving %s: %+v", *id, err) } + return utils.Bool(true), nil } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/README.md new file mode 100644 index 000000000000..70edfc2f92f0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/README.md @@ -0,0 +1,53 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates` Documentation + +The `alertruletemplates` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-preview`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates" +``` + + +### Client Initialization + +```go +client := alertruletemplates.NewAlertRuleTemplatesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `AlertRuleTemplatesClient.AlertRuleTemplatesGet` + +```go +ctx := context.TODO() +id := alertruletemplates.NewAlertRuleTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "alertRuleTemplateIdValue") + +read, err := client.AlertRuleTemplatesGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AlertRuleTemplatesClient.AlertRuleTemplatesList` + +```go +ctx := context.TODO() +id := alertruletemplates.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") + +// alternatively `client.AlertRuleTemplatesList(ctx, id)` can be used to do batched pagination +items, err := client.AlertRuleTemplatesListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/client.go new file mode 100644 index 000000000000..c439e5a41c7c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/client.go @@ -0,0 +1,18 @@ +package alertruletemplates + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AlertRuleTemplatesClient struct { + Client autorest.Client + baseUri string +} + +func NewAlertRuleTemplatesClientWithBaseURI(endpoint string) AlertRuleTemplatesClient { + return AlertRuleTemplatesClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/constants.go new file mode 100644 index 000000000000..bf41995ac98f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/constants.go @@ -0,0 +1,353 @@ +package alertruletemplates + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AlertRuleKind string + +const ( + AlertRuleKindFusion AlertRuleKind = "Fusion" + AlertRuleKindMLBehaviorAnalytics AlertRuleKind = "MLBehaviorAnalytics" + AlertRuleKindMicrosoftSecurityIncidentCreation AlertRuleKind = "MicrosoftSecurityIncidentCreation" + AlertRuleKindNRT AlertRuleKind = "NRT" + AlertRuleKindScheduled AlertRuleKind = "Scheduled" + AlertRuleKindThreatIntelligence AlertRuleKind = "ThreatIntelligence" +) + +func PossibleValuesForAlertRuleKind() []string { + return []string{ + string(AlertRuleKindFusion), + string(AlertRuleKindMLBehaviorAnalytics), + string(AlertRuleKindMicrosoftSecurityIncidentCreation), + string(AlertRuleKindNRT), + string(AlertRuleKindScheduled), + string(AlertRuleKindThreatIntelligence), + } +} + +func parseAlertRuleKind(input string) (*AlertRuleKind, error) { + vals := map[string]AlertRuleKind{ + "fusion": AlertRuleKindFusion, + "mlbehavioranalytics": AlertRuleKindMLBehaviorAnalytics, + "microsoftsecurityincidentcreation": AlertRuleKindMicrosoftSecurityIncidentCreation, + "nrt": AlertRuleKindNRT, + "scheduled": AlertRuleKindScheduled, + "threatintelligence": AlertRuleKindThreatIntelligence, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AlertRuleKind(input) + return &out, nil +} + +type AlertSeverity string + +const ( + AlertSeverityHigh AlertSeverity = "High" + AlertSeverityInformational AlertSeverity = "Informational" + AlertSeverityLow AlertSeverity = "Low" + AlertSeverityMedium AlertSeverity = "Medium" +) + +func PossibleValuesForAlertSeverity() []string { + return []string{ + string(AlertSeverityHigh), + string(AlertSeverityInformational), + string(AlertSeverityLow), + string(AlertSeverityMedium), + } +} + +func parseAlertSeverity(input string) (*AlertSeverity, error) { + vals := map[string]AlertSeverity{ + "high": AlertSeverityHigh, + "informational": AlertSeverityInformational, + "low": AlertSeverityLow, + "medium": AlertSeverityMedium, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AlertSeverity(input) + return &out, nil +} + +type AttackTactic string + +const ( + AttackTacticCollection AttackTactic = "Collection" + AttackTacticCommandAndControl AttackTactic = "CommandAndControl" + AttackTacticCredentialAccess AttackTactic = "CredentialAccess" + AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" + AttackTacticDiscovery AttackTactic = "Discovery" + AttackTacticExecution AttackTactic = "Execution" + AttackTacticExfiltration AttackTactic = "Exfiltration" + AttackTacticImpact AttackTactic = "Impact" + AttackTacticInitialAccess AttackTactic = "InitialAccess" + AttackTacticLateralMovement AttackTactic = "LateralMovement" + AttackTacticPersistence AttackTactic = "Persistence" + AttackTacticPreAttack AttackTactic = "PreAttack" + AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" +) + +func PossibleValuesForAttackTactic() []string { + return []string{ + string(AttackTacticCollection), + string(AttackTacticCommandAndControl), + string(AttackTacticCredentialAccess), + string(AttackTacticDefenseEvasion), + string(AttackTacticDiscovery), + string(AttackTacticExecution), + string(AttackTacticExfiltration), + string(AttackTacticImpact), + string(AttackTacticInitialAccess), + string(AttackTacticLateralMovement), + string(AttackTacticPersistence), + string(AttackTacticPreAttack), + string(AttackTacticPrivilegeEscalation), + } +} + +func parseAttackTactic(input string) (*AttackTactic, error) { + vals := map[string]AttackTactic{ + "collection": AttackTacticCollection, + "commandandcontrol": AttackTacticCommandAndControl, + "credentialaccess": AttackTacticCredentialAccess, + "defenseevasion": AttackTacticDefenseEvasion, + "discovery": AttackTacticDiscovery, + "execution": AttackTacticExecution, + "exfiltration": AttackTacticExfiltration, + "impact": AttackTacticImpact, + "initialaccess": AttackTacticInitialAccess, + "lateralmovement": AttackTacticLateralMovement, + "persistence": AttackTacticPersistence, + "preattack": AttackTacticPreAttack, + "privilegeescalation": AttackTacticPrivilegeEscalation, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AttackTactic(input) + return &out, nil +} + +type EntityMappingType string + +const ( + EntityMappingTypeAccount EntityMappingType = "Account" + EntityMappingTypeAzureResource EntityMappingType = "AzureResource" + EntityMappingTypeCloudApplication EntityMappingType = "CloudApplication" + EntityMappingTypeDNS EntityMappingType = "DNS" + EntityMappingTypeFile EntityMappingType = "File" + EntityMappingTypeFileHash EntityMappingType = "FileHash" + EntityMappingTypeHost EntityMappingType = "Host" + EntityMappingTypeIP EntityMappingType = "IP" + EntityMappingTypeMailCluster EntityMappingType = "MailCluster" + EntityMappingTypeMailMessage EntityMappingType = "MailMessage" + EntityMappingTypeMailbox EntityMappingType = "Mailbox" + EntityMappingTypeMalware EntityMappingType = "Malware" + EntityMappingTypeProcess EntityMappingType = "Process" + EntityMappingTypeRegistryKey EntityMappingType = "RegistryKey" + EntityMappingTypeRegistryValue EntityMappingType = "RegistryValue" + EntityMappingTypeSecurityGroup EntityMappingType = "SecurityGroup" + EntityMappingTypeSubmissionMail EntityMappingType = "SubmissionMail" + EntityMappingTypeURL EntityMappingType = "URL" +) + +func PossibleValuesForEntityMappingType() []string { + return []string{ + string(EntityMappingTypeAccount), + string(EntityMappingTypeAzureResource), + string(EntityMappingTypeCloudApplication), + string(EntityMappingTypeDNS), + string(EntityMappingTypeFile), + string(EntityMappingTypeFileHash), + string(EntityMappingTypeHost), + string(EntityMappingTypeIP), + string(EntityMappingTypeMailCluster), + string(EntityMappingTypeMailMessage), + string(EntityMappingTypeMailbox), + string(EntityMappingTypeMalware), + string(EntityMappingTypeProcess), + string(EntityMappingTypeRegistryKey), + string(EntityMappingTypeRegistryValue), + string(EntityMappingTypeSecurityGroup), + string(EntityMappingTypeSubmissionMail), + string(EntityMappingTypeURL), + } +} + +func parseEntityMappingType(input string) (*EntityMappingType, error) { + vals := map[string]EntityMappingType{ + "account": EntityMappingTypeAccount, + "azureresource": EntityMappingTypeAzureResource, + "cloudapplication": EntityMappingTypeCloudApplication, + "dns": EntityMappingTypeDNS, + "file": EntityMappingTypeFile, + "filehash": EntityMappingTypeFileHash, + "host": EntityMappingTypeHost, + "ip": EntityMappingTypeIP, + "mailcluster": EntityMappingTypeMailCluster, + "mailmessage": EntityMappingTypeMailMessage, + "mailbox": EntityMappingTypeMailbox, + "malware": EntityMappingTypeMalware, + "process": EntityMappingTypeProcess, + "registrykey": EntityMappingTypeRegistryKey, + "registryvalue": EntityMappingTypeRegistryValue, + "securitygroup": EntityMappingTypeSecurityGroup, + "submissionmail": EntityMappingTypeSubmissionMail, + "url": EntityMappingTypeURL, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EntityMappingType(input) + return &out, nil +} + +type EventGroupingAggregationKind string + +const ( + EventGroupingAggregationKindAlertPerResult EventGroupingAggregationKind = "AlertPerResult" + EventGroupingAggregationKindSingleAlert EventGroupingAggregationKind = "SingleAlert" +) + +func PossibleValuesForEventGroupingAggregationKind() []string { + return []string{ + string(EventGroupingAggregationKindAlertPerResult), + string(EventGroupingAggregationKindSingleAlert), + } +} + +func parseEventGroupingAggregationKind(input string) (*EventGroupingAggregationKind, error) { + vals := map[string]EventGroupingAggregationKind{ + "alertperresult": EventGroupingAggregationKindAlertPerResult, + "singlealert": EventGroupingAggregationKindSingleAlert, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EventGroupingAggregationKind(input) + return &out, nil +} + +type MicrosoftSecurityProductName string + +const ( + MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection MicrosoftSecurityProductName = "Azure Active Directory Identity Protection" + MicrosoftSecurityProductNameAzureAdvancedThreatProtection MicrosoftSecurityProductName = "Azure Advanced Threat Protection" + MicrosoftSecurityProductNameAzureSecurityCenter MicrosoftSecurityProductName = "Azure Security Center" + MicrosoftSecurityProductNameAzureSecurityCenterForIoT MicrosoftSecurityProductName = "Azure Security Center for IoT" + MicrosoftSecurityProductNameMicrosoftCloudAppSecurity MicrosoftSecurityProductName = "Microsoft Cloud App Security" + MicrosoftSecurityProductNameMicrosoftDefenderAdvancedThreatProtection MicrosoftSecurityProductName = "Microsoft Defender Advanced Threat Protection" + MicrosoftSecurityProductNameOfficeThreeSixFiveAdvancedThreatProtection MicrosoftSecurityProductName = "Office 365 Advanced Threat Protection" +) + +func PossibleValuesForMicrosoftSecurityProductName() []string { + return []string{ + string(MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection), + string(MicrosoftSecurityProductNameAzureAdvancedThreatProtection), + string(MicrosoftSecurityProductNameAzureSecurityCenter), + string(MicrosoftSecurityProductNameAzureSecurityCenterForIoT), + string(MicrosoftSecurityProductNameMicrosoftCloudAppSecurity), + string(MicrosoftSecurityProductNameMicrosoftDefenderAdvancedThreatProtection), + string(MicrosoftSecurityProductNameOfficeThreeSixFiveAdvancedThreatProtection), + } +} + +func parseMicrosoftSecurityProductName(input string) (*MicrosoftSecurityProductName, error) { + vals := map[string]MicrosoftSecurityProductName{ + "azure active directory identity protection": MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection, + "azure advanced threat protection": MicrosoftSecurityProductNameAzureAdvancedThreatProtection, + "azure security center": MicrosoftSecurityProductNameAzureSecurityCenter, + "azure security center for iot": MicrosoftSecurityProductNameAzureSecurityCenterForIoT, + "microsoft cloud app security": MicrosoftSecurityProductNameMicrosoftCloudAppSecurity, + "microsoft defender advanced threat protection": MicrosoftSecurityProductNameMicrosoftDefenderAdvancedThreatProtection, + "office 365 advanced threat protection": MicrosoftSecurityProductNameOfficeThreeSixFiveAdvancedThreatProtection, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MicrosoftSecurityProductName(input) + return &out, nil +} + +type TemplateStatus string + +const ( + TemplateStatusAvailable TemplateStatus = "Available" + TemplateStatusInstalled TemplateStatus = "Installed" + TemplateStatusNotAvailable TemplateStatus = "NotAvailable" +) + +func PossibleValuesForTemplateStatus() []string { + return []string{ + string(TemplateStatusAvailable), + string(TemplateStatusInstalled), + string(TemplateStatusNotAvailable), + } +} + +func parseTemplateStatus(input string) (*TemplateStatus, error) { + vals := map[string]TemplateStatus{ + "available": TemplateStatusAvailable, + "installed": TemplateStatusInstalled, + "notavailable": TemplateStatusNotAvailable, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TemplateStatus(input) + return &out, nil +} + +type TriggerOperator string + +const ( + TriggerOperatorEqual TriggerOperator = "Equal" + TriggerOperatorGreaterThan TriggerOperator = "GreaterThan" + TriggerOperatorLessThan TriggerOperator = "LessThan" + TriggerOperatorNotEqual TriggerOperator = "NotEqual" +) + +func PossibleValuesForTriggerOperator() []string { + return []string{ + string(TriggerOperatorEqual), + string(TriggerOperatorGreaterThan), + string(TriggerOperatorLessThan), + string(TriggerOperatorNotEqual), + } +} + +func parseTriggerOperator(input string) (*TriggerOperator, error) { + vals := map[string]TriggerOperator{ + "equal": TriggerOperatorEqual, + "greaterthan": TriggerOperatorGreaterThan, + "lessthan": TriggerOperatorLessThan, + "notequal": TriggerOperatorNotEqual, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TriggerOperator(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_alertruletemplate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_alertruletemplate.go new file mode 100644 index 000000000000..106e81ff68dc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_alertruletemplate.go @@ -0,0 +1,142 @@ +package alertruletemplates + +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 = AlertRuleTemplateId{} + +// AlertRuleTemplateId is a struct representing the Resource ID for a Alert Rule Template +type AlertRuleTemplateId struct { + SubscriptionId string + ResourceGroupName string + WorkspaceName string + AlertRuleTemplateId string +} + +// NewAlertRuleTemplateID returns a new AlertRuleTemplateId struct +func NewAlertRuleTemplateID(subscriptionId string, resourceGroupName string, workspaceName string, alertRuleTemplateId string) AlertRuleTemplateId { + return AlertRuleTemplateId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + WorkspaceName: workspaceName, + AlertRuleTemplateId: alertRuleTemplateId, + } +} + +// ParseAlertRuleTemplateID parses 'input' into a AlertRuleTemplateId +func ParseAlertRuleTemplateID(input string) (*AlertRuleTemplateId, error) { + parser := resourceids.NewParserFromResourceIdType(AlertRuleTemplateId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := AlertRuleTemplateId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + if id.AlertRuleTemplateId, ok = parsed.Parsed["alertRuleTemplateId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "alertRuleTemplateId", *parsed) + } + + return &id, nil +} + +// ParseAlertRuleTemplateIDInsensitively parses 'input' case-insensitively into a AlertRuleTemplateId +// note: this method should only be used for API response data and not user input +func ParseAlertRuleTemplateIDInsensitively(input string) (*AlertRuleTemplateId, error) { + parser := resourceids.NewParserFromResourceIdType(AlertRuleTemplateId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := AlertRuleTemplateId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + if id.AlertRuleTemplateId, ok = parsed.Parsed["alertRuleTemplateId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "alertRuleTemplateId", *parsed) + } + + return &id, nil +} + +// ValidateAlertRuleTemplateID checks that 'input' can be parsed as a Alert Rule Template ID +func ValidateAlertRuleTemplateID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseAlertRuleTemplateID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Alert Rule Template ID +func (id AlertRuleTemplateId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/alertRuleTemplates/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.AlertRuleTemplateId) +} + +// Segments returns a slice of Resource ID Segments which comprise this Alert Rule Template ID +func (id AlertRuleTemplateId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), + resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), + resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), + resourceids.StaticSegment("staticProviders2", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), + resourceids.StaticSegment("staticAlertRuleTemplates", "alertRuleTemplates", "alertRuleTemplates"), + resourceids.UserSpecifiedSegment("alertRuleTemplateId", "alertRuleTemplateIdValue"), + } +} + +// String returns a human-readable description of this Alert Rule Template ID +func (id AlertRuleTemplateId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), + fmt.Sprintf("Alert Rule Template: %q", id.AlertRuleTemplateId), + } + return fmt.Sprintf("Alert Rule Template (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_workspace.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_workspace.go new file mode 100644 index 000000000000..20a51851397a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_workspace.go @@ -0,0 +1,127 @@ +package alertruletemplates + +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 = WorkspaceId{} + +// WorkspaceId is a struct representing the Resource ID for a Workspace +type WorkspaceId struct { + SubscriptionId string + ResourceGroupName string + WorkspaceName string +} + +// NewWorkspaceID returns a new WorkspaceId struct +func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { + return WorkspaceId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + WorkspaceName: workspaceName, + } +} + +// ParseWorkspaceID parses 'input' into a WorkspaceId +func ParseWorkspaceID(input string) (*WorkspaceId, error) { + parser := resourceids.NewParserFromResourceIdType(WorkspaceId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := WorkspaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + return &id, nil +} + +// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId +// note: this method should only be used for API response data and not user input +func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { + parser := resourceids.NewParserFromResourceIdType(WorkspaceId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := WorkspaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + return &id, nil +} + +// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID +func ValidateWorkspaceID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseWorkspaceID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Workspace ID +func (id WorkspaceId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Workspace ID +func (id WorkspaceId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), + resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), + resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), + } +} + +// String returns a human-readable description of this Workspace ID +func (id WorkspaceId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), + } + return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/method_alertruletemplatesget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/method_alertruletemplatesget_autorest.go new file mode 100644 index 000000000000..dd9df8dbdb85 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/method_alertruletemplatesget_autorest.go @@ -0,0 +1,77 @@ +package alertruletemplates + +import ( + "context" + "encoding/json" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AlertRuleTemplatesGetOperationResponse struct { + HttpResponse *http.Response + Model *AlertRuleTemplate +} + +// AlertRuleTemplatesGet ... +func (c AlertRuleTemplatesClient) AlertRuleTemplatesGet(ctx context.Context, id AlertRuleTemplateId) (result AlertRuleTemplatesGetOperationResponse, err error) { + req, err := c.preparerForAlertRuleTemplatesGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "alertruletemplates.AlertRuleTemplatesClient", "AlertRuleTemplatesGet", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "alertruletemplates.AlertRuleTemplatesClient", "AlertRuleTemplatesGet", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForAlertRuleTemplatesGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "alertruletemplates.AlertRuleTemplatesClient", "AlertRuleTemplatesGet", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForAlertRuleTemplatesGet prepares the AlertRuleTemplatesGet request. +func (c AlertRuleTemplatesClient) preparerForAlertRuleTemplatesGet(ctx context.Context, id AlertRuleTemplateId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForAlertRuleTemplatesGet handles the response to the AlertRuleTemplatesGet request. The method always +// closes the http.Response Body. +func (c AlertRuleTemplatesClient) responderForAlertRuleTemplatesGet(resp *http.Response) (result AlertRuleTemplatesGetOperationResponse, err error) { + var respObj json.RawMessage + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + if err != nil { + return + } + model, err := unmarshalAlertRuleTemplateImplementation(respObj) + if err != nil { + return + } + result.Model = &model + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/method_alertruletemplateslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/method_alertruletemplateslist_autorest.go new file mode 100644 index 000000000000..17a9ea43de8b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/method_alertruletemplateslist_autorest.go @@ -0,0 +1,196 @@ +package alertruletemplates + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AlertRuleTemplatesListOperationResponse struct { + HttpResponse *http.Response + Model *[]AlertRuleTemplate + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (AlertRuleTemplatesListOperationResponse, error) +} + +type AlertRuleTemplatesListCompleteResult struct { + Items []AlertRuleTemplate +} + +func (r AlertRuleTemplatesListOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r AlertRuleTemplatesListOperationResponse) LoadMore(ctx context.Context) (resp AlertRuleTemplatesListOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +// AlertRuleTemplatesList ... +func (c AlertRuleTemplatesClient) AlertRuleTemplatesList(ctx context.Context, id WorkspaceId) (resp AlertRuleTemplatesListOperationResponse, err error) { + req, err := c.preparerForAlertRuleTemplatesList(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "alertruletemplates.AlertRuleTemplatesClient", "AlertRuleTemplatesList", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "alertruletemplates.AlertRuleTemplatesClient", "AlertRuleTemplatesList", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForAlertRuleTemplatesList(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "alertruletemplates.AlertRuleTemplatesClient", "AlertRuleTemplatesList", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForAlertRuleTemplatesList prepares the AlertRuleTemplatesList request. +func (c AlertRuleTemplatesClient) preparerForAlertRuleTemplatesList(ctx context.Context, id WorkspaceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/alertRuleTemplates", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForAlertRuleTemplatesListWithNextLink prepares the AlertRuleTemplatesList request with the given nextLink token. +func (c AlertRuleTemplatesClient) preparerForAlertRuleTemplatesListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForAlertRuleTemplatesList handles the response to the AlertRuleTemplatesList request. The method always +// closes the http.Response Body. +func (c AlertRuleTemplatesClient) responderForAlertRuleTemplatesList(resp *http.Response) (result AlertRuleTemplatesListOperationResponse, err error) { + type page struct { + Values []json.RawMessage `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + temp := make([]AlertRuleTemplate, 0) + for i, v := range respObj.Values { + val, err := unmarshalAlertRuleTemplateImplementation(v) + if err != nil { + err = fmt.Errorf("unmarshalling item %d for AlertRuleTemplate (%q): %+v", i, v, err) + return result, err + } + temp = append(temp, val) + } + result.Model = &temp + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result AlertRuleTemplatesListOperationResponse, err error) { + req, err := c.preparerForAlertRuleTemplatesListWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "alertruletemplates.AlertRuleTemplatesClient", "AlertRuleTemplatesList", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "alertruletemplates.AlertRuleTemplatesClient", "AlertRuleTemplatesList", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForAlertRuleTemplatesList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "alertruletemplates.AlertRuleTemplatesClient", "AlertRuleTemplatesList", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// AlertRuleTemplatesListComplete retrieves all of the results into a single object +func (c AlertRuleTemplatesClient) AlertRuleTemplatesListComplete(ctx context.Context, id WorkspaceId) (AlertRuleTemplatesListCompleteResult, error) { + return c.AlertRuleTemplatesListCompleteMatchingPredicate(ctx, id, AlertRuleTemplateOperationPredicate{}) +} + +// AlertRuleTemplatesListCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c AlertRuleTemplatesClient) AlertRuleTemplatesListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate AlertRuleTemplateOperationPredicate) (resp AlertRuleTemplatesListCompleteResult, err error) { + items := make([]AlertRuleTemplate, 0) + + page, err := c.AlertRuleTemplatesList(ctx, id) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := AlertRuleTemplatesListCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertdetailsoverride.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertdetailsoverride.go new file mode 100644 index 000000000000..136748927ba5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertdetailsoverride.go @@ -0,0 +1,11 @@ +package alertruletemplates + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AlertDetailsOverride struct { + AlertDescriptionFormat *string `json:"alertDescriptionFormat,omitempty"` + AlertDisplayNameFormat *string `json:"alertDisplayNameFormat,omitempty"` + AlertSeverityColumnName *string `json:"alertSeverityColumnName,omitempty"` + AlertTacticsColumnName *string `json:"alertTacticsColumnName,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplate.go new file mode 100644 index 000000000000..81169aee0394 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplate.go @@ -0,0 +1,88 @@ +package alertruletemplates + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AlertRuleTemplate interface { +} + +func unmarshalAlertRuleTemplateImplementation(input []byte) (AlertRuleTemplate, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling AlertRuleTemplate into map[string]interface: %+v", err) + } + + value, ok := temp["kind"].(string) + if !ok { + return nil, nil + } + + if strings.EqualFold(value, "Fusion") { + var out FusionAlertRuleTemplate + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FusionAlertRuleTemplate: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MLBehaviorAnalytics") { + var out MLBehaviorAnalyticsAlertRuleTemplate + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MLBehaviorAnalyticsAlertRuleTemplate: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MicrosoftSecurityIncidentCreation") { + var out MicrosoftSecurityIncidentCreationAlertRuleTemplate + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MicrosoftSecurityIncidentCreationAlertRuleTemplate: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "NRT") { + var out NrtAlertRuleTemplate + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into NrtAlertRuleTemplate: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Scheduled") { + var out ScheduledAlertRuleTemplate + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ScheduledAlertRuleTemplate: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ThreatIntelligence") { + var out ThreatIntelligenceAlertRuleTemplate + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ThreatIntelligenceAlertRuleTemplate: %+v", err) + } + return out, nil + } + + type RawAlertRuleTemplateImpl struct { + Type string `json:"-"` + Values map[string]interface{} `json:"-"` + } + out := RawAlertRuleTemplateImpl{ + Type: value, + Values: temp, + } + return out, nil + +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplatedatasource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplatedatasource.go new file mode 100644 index 000000000000..519fd6e1fe4d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplatedatasource.go @@ -0,0 +1,9 @@ +package alertruletemplates + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AlertRuleTemplateDataSource struct { + ConnectorId *string `json:"connectorId,omitempty"` + DataTypes *[]string `json:"dataTypes,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_entitymapping.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_entitymapping.go new file mode 100644 index 000000000000..86cf5667f041 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_entitymapping.go @@ -0,0 +1,9 @@ +package alertruletemplates + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EntityMapping struct { + EntityType *EntityMappingType `json:"entityType,omitempty"` + FieldMappings *[]FieldMapping `json:"fieldMappings,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_eventgroupingsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_eventgroupingsettings.go new file mode 100644 index 000000000000..3d80ecdb592f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_eventgroupingsettings.go @@ -0,0 +1,8 @@ +package alertruletemplates + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EventGroupingSettings struct { + AggregationKind *EventGroupingAggregationKind `json:"aggregationKind,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fieldmapping.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fieldmapping.go new file mode 100644 index 000000000000..be96362b1358 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fieldmapping.go @@ -0,0 +1,9 @@ +package alertruletemplates + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FieldMapping struct { + ColumnName *string `json:"columnName,omitempty"` + Identifier *string `json:"identifier,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplate.go new file mode 100644 index 000000000000..c2b4d8c30777 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplate.go @@ -0,0 +1,47 @@ +package alertruletemplates + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ AlertRuleTemplate = FusionAlertRuleTemplate{} + +type FusionAlertRuleTemplate struct { + Properties *FusionAlertRuleTemplateProperties `json:"properties,omitempty"` + + // Fields inherited from AlertRuleTemplate + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Marshaler = FusionAlertRuleTemplate{} + +func (s FusionAlertRuleTemplate) MarshalJSON() ([]byte, error) { + type wrapper FusionAlertRuleTemplate + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FusionAlertRuleTemplate: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FusionAlertRuleTemplate: %+v", err) + } + decoded["kind"] = "Fusion" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FusionAlertRuleTemplate: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplateproperties.go new file mode 100644 index 000000000000..f55a7b59b287 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplateproperties.go @@ -0,0 +1,46 @@ +package alertruletemplates + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FusionAlertRuleTemplateProperties struct { + AlertRulesCreatedByTemplateCount int64 `json:"alertRulesCreatedByTemplateCount"` + CreatedDateUTC *string `json:"createdDateUTC,omitempty"` + Description string `json:"description"` + DisplayName string `json:"displayName"` + LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` + RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` + Severity AlertSeverity `json:"severity"` + Status TemplateStatus `json:"status"` + Tactics *[]AttackTactic `json:"tactics,omitempty"` +} + +func (o *FusionAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { + if o.CreatedDateUTC == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") +} + +func (o *FusionAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedDateUTC = &formatted +} + +func (o *FusionAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { + if o.LastUpdatedDateUTC == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") +} + +func (o *FusionAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastUpdatedDateUTC = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplate.go new file mode 100644 index 000000000000..515a47767b2a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplate.go @@ -0,0 +1,47 @@ +package alertruletemplates + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ AlertRuleTemplate = MicrosoftSecurityIncidentCreationAlertRuleTemplate{} + +type MicrosoftSecurityIncidentCreationAlertRuleTemplate struct { + Properties *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties `json:"properties,omitempty"` + + // Fields inherited from AlertRuleTemplate + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Marshaler = MicrosoftSecurityIncidentCreationAlertRuleTemplate{} + +func (s MicrosoftSecurityIncidentCreationAlertRuleTemplate) MarshalJSON() ([]byte, error) { + type wrapper MicrosoftSecurityIncidentCreationAlertRuleTemplate + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MicrosoftSecurityIncidentCreationAlertRuleTemplate: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MicrosoftSecurityIncidentCreationAlertRuleTemplate: %+v", err) + } + decoded["kind"] = "MicrosoftSecurityIncidentCreation" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MicrosoftSecurityIncidentCreationAlertRuleTemplate: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplateproperties.go new file mode 100644 index 000000000000..0a2b5025a2e5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplateproperties.go @@ -0,0 +1,45 @@ +package alertruletemplates + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties struct { + AlertRulesCreatedByTemplateCount int64 `json:"alertRulesCreatedByTemplateCount"` + CreatedDateUTC string `json:"createdDateUTC"` + Description string `json:"description"` + DisplayName string `json:"displayName"` + DisplayNamesExcludeFilter *[]string `json:"displayNamesExcludeFilter,omitempty"` + DisplayNamesFilter *[]string `json:"displayNamesFilter,omitempty"` + LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` + ProductFilter MicrosoftSecurityProductName `json:"productFilter"` + RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` + SeveritiesFilter *[]AlertSeverity `json:"severitiesFilter,omitempty"` + Status TemplateStatus `json:"status"` +} + +func (o *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { + return dates.ParseAsFormat(&o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") +} + +func (o *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedDateUTC = formatted +} + +func (o *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { + if o.LastUpdatedDateUTC == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") +} + +func (o *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastUpdatedDateUTC = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplate.go new file mode 100644 index 000000000000..51e12f5562f6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplate.go @@ -0,0 +1,47 @@ +package alertruletemplates + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ AlertRuleTemplate = MLBehaviorAnalyticsAlertRuleTemplate{} + +type MLBehaviorAnalyticsAlertRuleTemplate struct { + Properties *MLBehaviorAnalyticsAlertRuleTemplateProperties `json:"properties,omitempty"` + + // Fields inherited from AlertRuleTemplate + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Marshaler = MLBehaviorAnalyticsAlertRuleTemplate{} + +func (s MLBehaviorAnalyticsAlertRuleTemplate) MarshalJSON() ([]byte, error) { + type wrapper MLBehaviorAnalyticsAlertRuleTemplate + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MLBehaviorAnalyticsAlertRuleTemplate: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MLBehaviorAnalyticsAlertRuleTemplate: %+v", err) + } + decoded["kind"] = "MLBehaviorAnalytics" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MLBehaviorAnalyticsAlertRuleTemplate: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplateproperties.go new file mode 100644 index 000000000000..1ece40f5e844 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplateproperties.go @@ -0,0 +1,46 @@ +package alertruletemplates + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MLBehaviorAnalyticsAlertRuleTemplateProperties struct { + AlertRulesCreatedByTemplateCount int64 `json:"alertRulesCreatedByTemplateCount"` + CreatedDateUTC *string `json:"createdDateUTC,omitempty"` + Description string `json:"description"` + DisplayName string `json:"displayName"` + LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` + RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` + Severity AlertSeverity `json:"severity"` + Status TemplateStatus `json:"status"` + Tactics *[]AttackTactic `json:"tactics,omitempty"` +} + +func (o *MLBehaviorAnalyticsAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { + if o.CreatedDateUTC == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") +} + +func (o *MLBehaviorAnalyticsAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedDateUTC = &formatted +} + +func (o *MLBehaviorAnalyticsAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { + if o.LastUpdatedDateUTC == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") +} + +func (o *MLBehaviorAnalyticsAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastUpdatedDateUTC = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplate.go new file mode 100644 index 000000000000..9f13bfa8160b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplate.go @@ -0,0 +1,47 @@ +package alertruletemplates + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ AlertRuleTemplate = NrtAlertRuleTemplate{} + +type NrtAlertRuleTemplate struct { + Properties *NrtAlertRuleTemplateProperties `json:"properties,omitempty"` + + // Fields inherited from AlertRuleTemplate + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Marshaler = NrtAlertRuleTemplate{} + +func (s NrtAlertRuleTemplate) MarshalJSON() ([]byte, error) { + type wrapper NrtAlertRuleTemplate + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling NrtAlertRuleTemplate: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling NrtAlertRuleTemplate: %+v", err) + } + decoded["kind"] = "NRT" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling NrtAlertRuleTemplate: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplateproperties.go new file mode 100644 index 000000000000..b0dcc457bf0e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplateproperties.go @@ -0,0 +1,51 @@ +package alertruletemplates + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NrtAlertRuleTemplateProperties struct { + AlertDetailsOverride *AlertDetailsOverride `json:"alertDetailsOverride,omitempty"` + AlertRulesCreatedByTemplateCount int64 `json:"alertRulesCreatedByTemplateCount"` + CreatedDateUTC *string `json:"createdDateUTC,omitempty"` + CustomDetails *map[string]string `json:"customDetails,omitempty"` + Description string `json:"description"` + DisplayName string `json:"displayName"` + EntityMappings *[]EntityMapping `json:"entityMappings,omitempty"` + LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` + Query string `json:"query"` + RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` + Severity AlertSeverity `json:"severity"` + Status TemplateStatus `json:"status"` + Tactics *[]AttackTactic `json:"tactics,omitempty"` + Version string `json:"version"` +} + +func (o *NrtAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { + if o.CreatedDateUTC == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") +} + +func (o *NrtAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedDateUTC = &formatted +} + +func (o *NrtAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { + if o.LastUpdatedDateUTC == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") +} + +func (o *NrtAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastUpdatedDateUTC = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplate.go new file mode 100644 index 000000000000..c3428ada14d8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplate.go @@ -0,0 +1,47 @@ +package alertruletemplates + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ AlertRuleTemplate = ScheduledAlertRuleTemplate{} + +type ScheduledAlertRuleTemplate struct { + Properties *ScheduledAlertRuleTemplateProperties `json:"properties,omitempty"` + + // Fields inherited from AlertRuleTemplate + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Marshaler = ScheduledAlertRuleTemplate{} + +func (s ScheduledAlertRuleTemplate) MarshalJSON() ([]byte, error) { + type wrapper ScheduledAlertRuleTemplate + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ScheduledAlertRuleTemplate: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ScheduledAlertRuleTemplate: %+v", err) + } + decoded["kind"] = "Scheduled" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ScheduledAlertRuleTemplate: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplateproperties.go new file mode 100644 index 000000000000..ea9625850261 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplateproperties.go @@ -0,0 +1,56 @@ +package alertruletemplates + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ScheduledAlertRuleTemplateProperties struct { + AlertDetailsOverride *AlertDetailsOverride `json:"alertDetailsOverride,omitempty"` + AlertRulesCreatedByTemplateCount int64 `json:"alertRulesCreatedByTemplateCount"` + CreatedDateUTC *string `json:"createdDateUTC,omitempty"` + CustomDetails *map[string]string `json:"customDetails,omitempty"` + Description string `json:"description"` + DisplayName string `json:"displayName"` + EntityMappings *[]EntityMapping `json:"entityMappings,omitempty"` + EventGroupingSettings *EventGroupingSettings `json:"eventGroupingSettings,omitempty"` + LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` + Query string `json:"query"` + QueryFrequency string `json:"queryFrequency"` + QueryPeriod string `json:"queryPeriod"` + RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` + Severity AlertSeverity `json:"severity"` + Status TemplateStatus `json:"status"` + Tactics *[]AttackTactic `json:"tactics,omitempty"` + TriggerOperator TriggerOperator `json:"triggerOperator"` + TriggerThreshold int64 `json:"triggerThreshold"` + Version string `json:"version"` +} + +func (o *ScheduledAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { + if o.CreatedDateUTC == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") +} + +func (o *ScheduledAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedDateUTC = &formatted +} + +func (o *ScheduledAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { + if o.LastUpdatedDateUTC == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") +} + +func (o *ScheduledAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastUpdatedDateUTC = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplate.go new file mode 100644 index 000000000000..1f39f219a07b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplate.go @@ -0,0 +1,47 @@ +package alertruletemplates + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ AlertRuleTemplate = ThreatIntelligenceAlertRuleTemplate{} + +type ThreatIntelligenceAlertRuleTemplate struct { + Properties *ThreatIntelligenceAlertRuleTemplateProperties `json:"properties,omitempty"` + + // Fields inherited from AlertRuleTemplate + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Marshaler = ThreatIntelligenceAlertRuleTemplate{} + +func (s ThreatIntelligenceAlertRuleTemplate) MarshalJSON() ([]byte, error) { + type wrapper ThreatIntelligenceAlertRuleTemplate + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ThreatIntelligenceAlertRuleTemplate: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ThreatIntelligenceAlertRuleTemplate: %+v", err) + } + decoded["kind"] = "ThreatIntelligence" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ThreatIntelligenceAlertRuleTemplate: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplateproperties.go new file mode 100644 index 000000000000..ca0f00247e9f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplateproperties.go @@ -0,0 +1,46 @@ +package alertruletemplates + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligenceAlertRuleTemplateProperties struct { + AlertRulesCreatedByTemplateCount int64 `json:"alertRulesCreatedByTemplateCount"` + CreatedDateUTC *string `json:"createdDateUTC,omitempty"` + Description string `json:"description"` + DisplayName string `json:"displayName"` + LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` + RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` + Severity AlertSeverity `json:"severity"` + Status TemplateStatus `json:"status"` + Tactics *[]AttackTactic `json:"tactics,omitempty"` +} + +func (o *ThreatIntelligenceAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { + if o.CreatedDateUTC == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") +} + +func (o *ThreatIntelligenceAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedDateUTC = &formatted +} + +func (o *ThreatIntelligenceAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { + if o.LastUpdatedDateUTC == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") +} + +func (o *ThreatIntelligenceAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastUpdatedDateUTC = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/predicates.go new file mode 100644 index 000000000000..093c50e1616b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/predicates.go @@ -0,0 +1,12 @@ +package alertruletemplates + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AlertRuleTemplateOperationPredicate struct { +} + +func (p AlertRuleTemplateOperationPredicate) Matches(input AlertRuleTemplate) bool { + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/version.go new file mode 100644 index 000000000000..0bf4ef8ed58f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/version.go @@ -0,0 +1,12 @@ +package alertruletemplates + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2021-09-01-preview" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/alertruletemplates/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/README.md new file mode 100644 index 000000000000..e45d8331aceb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/README.md @@ -0,0 +1,90 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors` Documentation + +The `dataconnectors` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-11-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors" +``` + + +### Client Initialization + +```go +client := dataconnectors.NewDataConnectorsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `DataConnectorsClient.DataConnectorsCreateOrUpdate` + +```go +ctx := context.TODO() +id := dataconnectors.NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") + +payload := dataconnectors.DataConnector{ + // ... +} + + +read, err := client.DataConnectorsCreateOrUpdate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DataConnectorsClient.DataConnectorsDelete` + +```go +ctx := context.TODO() +id := dataconnectors.NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") + +read, err := client.DataConnectorsDelete(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DataConnectorsClient.DataConnectorsGet` + +```go +ctx := context.TODO() +id := dataconnectors.NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") + +read, err := client.DataConnectorsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DataConnectorsClient.DataConnectorsList` + +```go +ctx := context.TODO() +id := dataconnectors.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") + +// alternatively `client.DataConnectorsList(ctx, id)` can be used to do batched pagination +items, err := client.DataConnectorsListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/client.go new file mode 100644 index 000000000000..cf334b725685 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/client.go @@ -0,0 +1,18 @@ +package dataconnectors + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataConnectorsClient struct { + Client autorest.Client + baseUri string +} + +func NewDataConnectorsClientWithBaseURI(endpoint string) DataConnectorsClient { + return DataConnectorsClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/constants.go new file mode 100644 index 000000000000..db98dc835770 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/constants.go @@ -0,0 +1,80 @@ +package dataconnectors + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataConnectorKind string + +const ( + DataConnectorKindAmazonWebServicesCloudTrail DataConnectorKind = "AmazonWebServicesCloudTrail" + DataConnectorKindAzureActiveDirectory DataConnectorKind = "AzureActiveDirectory" + DataConnectorKindAzureAdvancedThreatProtection DataConnectorKind = "AzureAdvancedThreatProtection" + DataConnectorKindAzureSecurityCenter DataConnectorKind = "AzureSecurityCenter" + DataConnectorKindMicrosoftCloudAppSecurity DataConnectorKind = "MicrosoftCloudAppSecurity" + DataConnectorKindMicrosoftDefenderAdvancedThreatProtection DataConnectorKind = "MicrosoftDefenderAdvancedThreatProtection" + DataConnectorKindOfficeThreeSixFive DataConnectorKind = "Office365" + DataConnectorKindThreatIntelligence DataConnectorKind = "ThreatIntelligence" +) + +func PossibleValuesForDataConnectorKind() []string { + return []string{ + string(DataConnectorKindAmazonWebServicesCloudTrail), + string(DataConnectorKindAzureActiveDirectory), + string(DataConnectorKindAzureAdvancedThreatProtection), + string(DataConnectorKindAzureSecurityCenter), + string(DataConnectorKindMicrosoftCloudAppSecurity), + string(DataConnectorKindMicrosoftDefenderAdvancedThreatProtection), + string(DataConnectorKindOfficeThreeSixFive), + string(DataConnectorKindThreatIntelligence), + } +} + +func parseDataConnectorKind(input string) (*DataConnectorKind, error) { + vals := map[string]DataConnectorKind{ + "amazonwebservicescloudtrail": DataConnectorKindAmazonWebServicesCloudTrail, + "azureactivedirectory": DataConnectorKindAzureActiveDirectory, + "azureadvancedthreatprotection": DataConnectorKindAzureAdvancedThreatProtection, + "azuresecuritycenter": DataConnectorKindAzureSecurityCenter, + "microsoftcloudappsecurity": DataConnectorKindMicrosoftCloudAppSecurity, + "microsoftdefenderadvancedthreatprotection": DataConnectorKindMicrosoftDefenderAdvancedThreatProtection, + "office365": DataConnectorKindOfficeThreeSixFive, + "threatintelligence": DataConnectorKindThreatIntelligence, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DataConnectorKind(input) + return &out, nil +} + +type DataTypeState string + +const ( + DataTypeStateDisabled DataTypeState = "Disabled" + DataTypeStateEnabled DataTypeState = "Enabled" +) + +func PossibleValuesForDataTypeState() []string { + return []string{ + string(DataTypeStateDisabled), + string(DataTypeStateEnabled), + } +} + +func parseDataTypeState(input string) (*DataTypeState, error) { + vals := map[string]DataTypeState{ + "disabled": DataTypeStateDisabled, + "enabled": DataTypeStateEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DataTypeState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/id_dataconnector.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/id_dataconnector.go new file mode 100644 index 000000000000..0b754d6b3c1e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/id_dataconnector.go @@ -0,0 +1,142 @@ +package dataconnectors + +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 = DataConnectorId{} + +// DataConnectorId is a struct representing the Resource ID for a Data Connector +type DataConnectorId struct { + SubscriptionId string + ResourceGroupName string + WorkspaceName string + DataConnectorId string +} + +// NewDataConnectorID returns a new DataConnectorId struct +func NewDataConnectorID(subscriptionId string, resourceGroupName string, workspaceName string, dataConnectorId string) DataConnectorId { + return DataConnectorId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + WorkspaceName: workspaceName, + DataConnectorId: dataConnectorId, + } +} + +// ParseDataConnectorID parses 'input' into a DataConnectorId +func ParseDataConnectorID(input string) (*DataConnectorId, error) { + parser := resourceids.NewParserFromResourceIdType(DataConnectorId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := DataConnectorId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + if id.DataConnectorId, ok = parsed.Parsed["dataConnectorId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "dataConnectorId", *parsed) + } + + return &id, nil +} + +// ParseDataConnectorIDInsensitively parses 'input' case-insensitively into a DataConnectorId +// note: this method should only be used for API response data and not user input +func ParseDataConnectorIDInsensitively(input string) (*DataConnectorId, error) { + parser := resourceids.NewParserFromResourceIdType(DataConnectorId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := DataConnectorId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + if id.DataConnectorId, ok = parsed.Parsed["dataConnectorId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "dataConnectorId", *parsed) + } + + return &id, nil +} + +// ValidateDataConnectorID checks that 'input' can be parsed as a Data Connector ID +func ValidateDataConnectorID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseDataConnectorID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Data Connector ID +func (id DataConnectorId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/dataConnectors/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.DataConnectorId) +} + +// Segments returns a slice of Resource ID Segments which comprise this Data Connector ID +func (id DataConnectorId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), + resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), + resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), + resourceids.StaticSegment("staticProviders2", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), + resourceids.StaticSegment("staticDataConnectors", "dataConnectors", "dataConnectors"), + resourceids.UserSpecifiedSegment("dataConnectorId", "dataConnectorIdValue"), + } +} + +// String returns a human-readable description of this Data Connector ID +func (id DataConnectorId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), + fmt.Sprintf("Data Connector: %q", id.DataConnectorId), + } + return fmt.Sprintf("Data Connector (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/id_workspace.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/id_workspace.go new file mode 100644 index 000000000000..16107cbce7b5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/id_workspace.go @@ -0,0 +1,127 @@ +package dataconnectors + +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 = WorkspaceId{} + +// WorkspaceId is a struct representing the Resource ID for a Workspace +type WorkspaceId struct { + SubscriptionId string + ResourceGroupName string + WorkspaceName string +} + +// NewWorkspaceID returns a new WorkspaceId struct +func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { + return WorkspaceId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + WorkspaceName: workspaceName, + } +} + +// ParseWorkspaceID parses 'input' into a WorkspaceId +func ParseWorkspaceID(input string) (*WorkspaceId, error) { + parser := resourceids.NewParserFromResourceIdType(WorkspaceId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := WorkspaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + return &id, nil +} + +// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId +// note: this method should only be used for API response data and not user input +func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { + parser := resourceids.NewParserFromResourceIdType(WorkspaceId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := WorkspaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + return &id, nil +} + +// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID +func ValidateWorkspaceID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseWorkspaceID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Workspace ID +func (id WorkspaceId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Workspace ID +func (id WorkspaceId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), + resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), + resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), + } +} + +// String returns a human-readable description of this Workspace ID +func (id WorkspaceId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), + } + return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorscreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorscreateorupdate_autorest.go new file mode 100644 index 000000000000..074bc6ae5055 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorscreateorupdate_autorest.go @@ -0,0 +1,78 @@ +package dataconnectors + +import ( + "context" + "encoding/json" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataConnectorsCreateOrUpdateOperationResponse struct { + HttpResponse *http.Response + Model *DataConnector +} + +// DataConnectorsCreateOrUpdate ... +func (c DataConnectorsClient) DataConnectorsCreateOrUpdate(ctx context.Context, id DataConnectorId, input DataConnector) (result DataConnectorsCreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForDataConnectorsCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsCreateOrUpdate", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsCreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDataConnectorsCreateOrUpdate(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsCreateOrUpdate", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForDataConnectorsCreateOrUpdate prepares the DataConnectorsCreateOrUpdate request. +func (c DataConnectorsClient) preparerForDataConnectorsCreateOrUpdate(ctx context.Context, id DataConnectorId, input DataConnector) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDataConnectorsCreateOrUpdate handles the response to the DataConnectorsCreateOrUpdate request. The method always +// closes the http.Response Body. +func (c DataConnectorsClient) responderForDataConnectorsCreateOrUpdate(resp *http.Response) (result DataConnectorsCreateOrUpdateOperationResponse, err error) { + var respObj json.RawMessage + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + if err != nil { + return + } + model, err := unmarshalDataConnectorImplementation(respObj) + if err != nil { + return + } + result.Model = &model + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorsdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorsdelete_autorest.go new file mode 100644 index 000000000000..f0b32c9b0096 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorsdelete_autorest.go @@ -0,0 +1,66 @@ +package dataconnectors + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataConnectorsDeleteOperationResponse struct { + HttpResponse *http.Response +} + +// DataConnectorsDelete ... +func (c DataConnectorsClient) DataConnectorsDelete(ctx context.Context, id DataConnectorId) (result DataConnectorsDeleteOperationResponse, err error) { + req, err := c.preparerForDataConnectorsDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsDelete", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsDelete", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDataConnectorsDelete(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsDelete", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForDataConnectorsDelete prepares the DataConnectorsDelete request. +func (c DataConnectorsClient) preparerForDataConnectorsDelete(ctx context.Context, id DataConnectorId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDataConnectorsDelete handles the response to the DataConnectorsDelete request. The method always +// closes the http.Response Body. +func (c DataConnectorsClient) responderForDataConnectorsDelete(resp *http.Response) (result DataConnectorsDeleteOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorsget_autorest.go new file mode 100644 index 000000000000..eb34ebc2be58 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorsget_autorest.go @@ -0,0 +1,77 @@ +package dataconnectors + +import ( + "context" + "encoding/json" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataConnectorsGetOperationResponse struct { + HttpResponse *http.Response + Model *DataConnector +} + +// DataConnectorsGet ... +func (c DataConnectorsClient) DataConnectorsGet(ctx context.Context, id DataConnectorId) (result DataConnectorsGetOperationResponse, err error) { + req, err := c.preparerForDataConnectorsGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsGet", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsGet", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDataConnectorsGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsGet", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForDataConnectorsGet prepares the DataConnectorsGet request. +func (c DataConnectorsClient) preparerForDataConnectorsGet(ctx context.Context, id DataConnectorId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDataConnectorsGet handles the response to the DataConnectorsGet request. The method always +// closes the http.Response Body. +func (c DataConnectorsClient) responderForDataConnectorsGet(resp *http.Response) (result DataConnectorsGetOperationResponse, err error) { + var respObj json.RawMessage + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + if err != nil { + return + } + model, err := unmarshalDataConnectorImplementation(respObj) + if err != nil { + return + } + result.Model = &model + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorslist_autorest.go new file mode 100644 index 000000000000..22cba5c26890 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorslist_autorest.go @@ -0,0 +1,196 @@ +package dataconnectors + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataConnectorsListOperationResponse struct { + HttpResponse *http.Response + Model *[]DataConnector + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (DataConnectorsListOperationResponse, error) +} + +type DataConnectorsListCompleteResult struct { + Items []DataConnector +} + +func (r DataConnectorsListOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r DataConnectorsListOperationResponse) LoadMore(ctx context.Context) (resp DataConnectorsListOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +// DataConnectorsList ... +func (c DataConnectorsClient) DataConnectorsList(ctx context.Context, id WorkspaceId) (resp DataConnectorsListOperationResponse, err error) { + req, err := c.preparerForDataConnectorsList(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsList", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsList", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForDataConnectorsList(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsList", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForDataConnectorsList prepares the DataConnectorsList request. +func (c DataConnectorsClient) preparerForDataConnectorsList(ctx context.Context, id WorkspaceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/dataConnectors", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForDataConnectorsListWithNextLink prepares the DataConnectorsList request with the given nextLink token. +func (c DataConnectorsClient) preparerForDataConnectorsListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDataConnectorsList handles the response to the DataConnectorsList request. The method always +// closes the http.Response Body. +func (c DataConnectorsClient) responderForDataConnectorsList(resp *http.Response) (result DataConnectorsListOperationResponse, err error) { + type page struct { + Values []json.RawMessage `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + temp := make([]DataConnector, 0) + for i, v := range respObj.Values { + val, err := unmarshalDataConnectorImplementation(v) + if err != nil { + err = fmt.Errorf("unmarshalling item %d for DataConnector (%q): %+v", i, v, err) + return result, err + } + temp = append(temp, val) + } + result.Model = &temp + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result DataConnectorsListOperationResponse, err error) { + req, err := c.preparerForDataConnectorsListWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsList", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsList", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDataConnectorsList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsList", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// DataConnectorsListComplete retrieves all of the results into a single object +func (c DataConnectorsClient) DataConnectorsListComplete(ctx context.Context, id WorkspaceId) (DataConnectorsListCompleteResult, error) { + return c.DataConnectorsListCompleteMatchingPredicate(ctx, id, DataConnectorOperationPredicate{}) +} + +// DataConnectorsListCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c DataConnectorsClient) DataConnectorsListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate DataConnectorOperationPredicate) (resp DataConnectorsListCompleteResult, err error) { + items := make([]DataConnector, 0) + + page, err := c.DataConnectorsList(ctx, id) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := DataConnectorsListCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aaddataconnector.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aaddataconnector.go new file mode 100644 index 000000000000..dd0ca1af664c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aaddataconnector.go @@ -0,0 +1,48 @@ +package dataconnectors + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DataConnector = AADDataConnector{} + +type AADDataConnector struct { + Properties *AADDataConnectorProperties `json:"properties,omitempty"` + + // Fields inherited from DataConnector + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Marshaler = AADDataConnector{} + +func (s AADDataConnector) MarshalJSON() ([]byte, error) { + type wrapper AADDataConnector + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AADDataConnector: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AADDataConnector: %+v", err) + } + decoded["kind"] = "AzureActiveDirectory" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AADDataConnector: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aaddataconnectorproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aaddataconnectorproperties.go new file mode 100644 index 000000000000..eed0b8838ede --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aaddataconnectorproperties.go @@ -0,0 +1,9 @@ +package dataconnectors + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AADDataConnectorProperties struct { + DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` + TenantId *string `json:"tenantId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aatpdataconnector.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aatpdataconnector.go new file mode 100644 index 000000000000..e1cd013bbd78 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aatpdataconnector.go @@ -0,0 +1,48 @@ +package dataconnectors + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DataConnector = AATPDataConnector{} + +type AATPDataConnector struct { + Properties *AATPDataConnectorProperties `json:"properties,omitempty"` + + // Fields inherited from DataConnector + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Marshaler = AATPDataConnector{} + +func (s AATPDataConnector) MarshalJSON() ([]byte, error) { + type wrapper AATPDataConnector + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AATPDataConnector: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AATPDataConnector: %+v", err) + } + decoded["kind"] = "AzureAdvancedThreatProtection" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AATPDataConnector: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aatpdataconnectorproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aatpdataconnectorproperties.go new file mode 100644 index 000000000000..5f2791c58d28 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aatpdataconnectorproperties.go @@ -0,0 +1,9 @@ +package dataconnectors + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AATPDataConnectorProperties struct { + DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` + TenantId *string `json:"tenantId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_alertsdatatypeofdataconnector.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_alertsdatatypeofdataconnector.go new file mode 100644 index 000000000000..b61a1a7a1965 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_alertsdatatypeofdataconnector.go @@ -0,0 +1,8 @@ +package dataconnectors + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AlertsDataTypeOfDataConnector struct { + Alerts *DataConnectorDataTypeCommon `json:"alerts,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_ascdataconnector.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_ascdataconnector.go new file mode 100644 index 000000000000..3af09c2ff8b1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_ascdataconnector.go @@ -0,0 +1,48 @@ +package dataconnectors + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DataConnector = ASCDataConnector{} + +type ASCDataConnector struct { + Properties *ASCDataConnectorProperties `json:"properties,omitempty"` + + // Fields inherited from DataConnector + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Marshaler = ASCDataConnector{} + +func (s ASCDataConnector) MarshalJSON() ([]byte, error) { + type wrapper ASCDataConnector + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ASCDataConnector: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ASCDataConnector: %+v", err) + } + decoded["kind"] = "AzureSecurityCenter" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ASCDataConnector: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_ascdataconnectorproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_ascdataconnectorproperties.go new file mode 100644 index 000000000000..ab5b1ceb1725 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_ascdataconnectorproperties.go @@ -0,0 +1,9 @@ +package dataconnectors + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ASCDataConnectorProperties struct { + DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnector.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnector.go new file mode 100644 index 000000000000..b0ef7fdd2854 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnector.go @@ -0,0 +1,48 @@ +package dataconnectors + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DataConnector = AwsCloudTrailDataConnector{} + +type AwsCloudTrailDataConnector struct { + Properties *AwsCloudTrailDataConnectorProperties `json:"properties,omitempty"` + + // Fields inherited from DataConnector + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Marshaler = AwsCloudTrailDataConnector{} + +func (s AwsCloudTrailDataConnector) MarshalJSON() ([]byte, error) { + type wrapper AwsCloudTrailDataConnector + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AwsCloudTrailDataConnector: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AwsCloudTrailDataConnector: %+v", err) + } + decoded["kind"] = "AmazonWebServicesCloudTrail" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AwsCloudTrailDataConnector: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnectordatatypes.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnectordatatypes.go new file mode 100644 index 000000000000..9d19a2feb9cf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnectordatatypes.go @@ -0,0 +1,8 @@ +package dataconnectors + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AwsCloudTrailDataConnectorDataTypes struct { + Logs *DataConnectorDataTypeCommon `json:"logs,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnectorproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnectorproperties.go new file mode 100644 index 000000000000..42ac71deecaf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnectorproperties.go @@ -0,0 +1,9 @@ +package dataconnectors + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AwsCloudTrailDataConnectorProperties struct { + AwsRoleArn *string `json:"awsRoleArn,omitempty"` + DataTypes *AwsCloudTrailDataConnectorDataTypes `json:"dataTypes,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_dataconnector.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_dataconnector.go new file mode 100644 index 000000000000..4ff82add4cc2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_dataconnector.go @@ -0,0 +1,104 @@ +package dataconnectors + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataConnector interface { +} + +func unmarshalDataConnectorImplementation(input []byte) (DataConnector, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling DataConnector into map[string]interface: %+v", err) + } + + value, ok := temp["kind"].(string) + if !ok { + return nil, nil + } + + if strings.EqualFold(value, "AzureActiveDirectory") { + var out AADDataConnector + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AADDataConnector: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureAdvancedThreatProtection") { + var out AATPDataConnector + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AATPDataConnector: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureSecurityCenter") { + var out ASCDataConnector + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ASCDataConnector: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AmazonWebServicesCloudTrail") { + var out AwsCloudTrailDataConnector + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AwsCloudTrailDataConnector: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MicrosoftCloudAppSecurity") { + var out MCASDataConnector + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MCASDataConnector: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MicrosoftDefenderAdvancedThreatProtection") { + var out MDATPDataConnector + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MDATPDataConnector: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Office365") { + var out OfficeDataConnector + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OfficeDataConnector: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ThreatIntelligence") { + var out TIDataConnector + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into TIDataConnector: %+v", err) + } + return out, nil + } + + type RawDataConnectorImpl struct { + Type string `json:"-"` + Values map[string]interface{} `json:"-"` + } + out := RawDataConnectorImpl{ + Type: value, + Values: temp, + } + return out, nil + +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_dataconnectordatatypecommon.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_dataconnectordatatypecommon.go new file mode 100644 index 000000000000..acf362026c45 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_dataconnectordatatypecommon.go @@ -0,0 +1,8 @@ +package dataconnectors + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataConnectorDataTypeCommon struct { + State *DataTypeState `json:"state,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnector.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnector.go new file mode 100644 index 000000000000..6a0c9aebea05 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnector.go @@ -0,0 +1,48 @@ +package dataconnectors + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DataConnector = MCASDataConnector{} + +type MCASDataConnector struct { + Properties *MCASDataConnectorProperties `json:"properties,omitempty"` + + // Fields inherited from DataConnector + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Marshaler = MCASDataConnector{} + +func (s MCASDataConnector) MarshalJSON() ([]byte, error) { + type wrapper MCASDataConnector + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MCASDataConnector: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MCASDataConnector: %+v", err) + } + decoded["kind"] = "MicrosoftCloudAppSecurity" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MCASDataConnector: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnectordatatypes.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnectordatatypes.go new file mode 100644 index 000000000000..95d056b9518e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnectordatatypes.go @@ -0,0 +1,9 @@ +package dataconnectors + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MCASDataConnectorDataTypes struct { + Alerts *DataConnectorDataTypeCommon `json:"alerts,omitempty"` + DiscoveryLogs *DataConnectorDataTypeCommon `json:"discoveryLogs,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnectorproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnectorproperties.go new file mode 100644 index 000000000000..c4145588ffe6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnectorproperties.go @@ -0,0 +1,9 @@ +package dataconnectors + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MCASDataConnectorProperties struct { + DataTypes *MCASDataConnectorDataTypes `json:"dataTypes,omitempty"` + TenantId *string `json:"tenantId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mdatpdataconnector.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mdatpdataconnector.go new file mode 100644 index 000000000000..1a6bcbcb7bfd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mdatpdataconnector.go @@ -0,0 +1,48 @@ +package dataconnectors + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DataConnector = MDATPDataConnector{} + +type MDATPDataConnector struct { + Properties *MDATPDataConnectorProperties `json:"properties,omitempty"` + + // Fields inherited from DataConnector + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Marshaler = MDATPDataConnector{} + +func (s MDATPDataConnector) MarshalJSON() ([]byte, error) { + type wrapper MDATPDataConnector + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MDATPDataConnector: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MDATPDataConnector: %+v", err) + } + decoded["kind"] = "MicrosoftDefenderAdvancedThreatProtection" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MDATPDataConnector: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mdatpdataconnectorproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mdatpdataconnectorproperties.go new file mode 100644 index 000000000000..b0d40d216ace --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mdatpdataconnectorproperties.go @@ -0,0 +1,9 @@ +package dataconnectors + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MDATPDataConnectorProperties struct { + DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` + TenantId *string `json:"tenantId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnector.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnector.go new file mode 100644 index 000000000000..25b5a25e44d4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnector.go @@ -0,0 +1,48 @@ +package dataconnectors + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DataConnector = OfficeDataConnector{} + +type OfficeDataConnector struct { + Properties *OfficeDataConnectorProperties `json:"properties,omitempty"` + + // Fields inherited from DataConnector + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Marshaler = OfficeDataConnector{} + +func (s OfficeDataConnector) MarshalJSON() ([]byte, error) { + type wrapper OfficeDataConnector + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OfficeDataConnector: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OfficeDataConnector: %+v", err) + } + decoded["kind"] = "Office365" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OfficeDataConnector: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnectordatatypes.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnectordatatypes.go new file mode 100644 index 000000000000..5b562d095757 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnectordatatypes.go @@ -0,0 +1,10 @@ +package dataconnectors + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OfficeDataConnectorDataTypes struct { + Exchange *DataConnectorDataTypeCommon `json:"exchange,omitempty"` + SharePoint *DataConnectorDataTypeCommon `json:"sharePoint,omitempty"` + Teams *DataConnectorDataTypeCommon `json:"teams,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnectorproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnectorproperties.go new file mode 100644 index 000000000000..bf8da2781c8d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnectorproperties.go @@ -0,0 +1,9 @@ +package dataconnectors + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OfficeDataConnectorProperties struct { + DataTypes *OfficeDataConnectorDataTypes `json:"dataTypes,omitempty"` + TenantId *string `json:"tenantId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnector.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnector.go new file mode 100644 index 000000000000..208513ef9aa7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnector.go @@ -0,0 +1,48 @@ +package dataconnectors + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DataConnector = TIDataConnector{} + +type TIDataConnector struct { + Properties *TIDataConnectorProperties `json:"properties,omitempty"` + + // Fields inherited from DataConnector + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Marshaler = TIDataConnector{} + +func (s TIDataConnector) MarshalJSON() ([]byte, error) { + type wrapper TIDataConnector + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling TIDataConnector: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling TIDataConnector: %+v", err) + } + decoded["kind"] = "ThreatIntelligence" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling TIDataConnector: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnectordatatypes.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnectordatatypes.go new file mode 100644 index 000000000000..be5cade481c8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnectordatatypes.go @@ -0,0 +1,8 @@ +package dataconnectors + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TIDataConnectorDataTypes struct { + Indicators *DataConnectorDataTypeCommon `json:"indicators,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnectorproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnectorproperties.go new file mode 100644 index 000000000000..4fce93cbd33e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnectorproperties.go @@ -0,0 +1,28 @@ +package dataconnectors + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TIDataConnectorProperties struct { + DataTypes *TIDataConnectorDataTypes `json:"dataTypes,omitempty"` + TenantId *string `json:"tenantId,omitempty"` + TipLookbackPeriod *string `json:"tipLookbackPeriod,omitempty"` +} + +func (o *TIDataConnectorProperties) GetTipLookbackPeriodAsTime() (*time.Time, error) { + if o.TipLookbackPeriod == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TipLookbackPeriod, "2006-01-02T15:04:05Z07:00") +} + +func (o *TIDataConnectorProperties) SetTipLookbackPeriodAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TipLookbackPeriod = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/predicates.go new file mode 100644 index 000000000000..4521c20e58ed --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/predicates.go @@ -0,0 +1,12 @@ +package dataconnectors + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataConnectorOperationPredicate struct { +} + +func (p DataConnectorOperationPredicate) Matches(input DataConnector) bool { + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/version.go new file mode 100644 index 000000000000..b6fde46b21ce --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/version.go @@ -0,0 +1,12 @@ +package dataconnectors + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/dataconnectors/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/README.md new file mode 100644 index 000000000000..a4bab19be74b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/README.md @@ -0,0 +1,90 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings` Documentation + +The `securitymlanalyticssettings` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-11-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings" +``` + + +### Client Initialization + +```go +client := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `SecurityMLAnalyticsSettingsClient.SecurityMLAnalyticsSettingsCreateOrUpdate` + +```go +ctx := context.TODO() +id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "securityMLAnalyticsSettingValue") + +payload := securitymlanalyticssettings.SecurityMLAnalyticsSetting{ + // ... +} + + +read, err := client.SecurityMLAnalyticsSettingsCreateOrUpdate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SecurityMLAnalyticsSettingsClient.SecurityMLAnalyticsSettingsDelete` + +```go +ctx := context.TODO() +id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "securityMLAnalyticsSettingValue") + +read, err := client.SecurityMLAnalyticsSettingsDelete(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SecurityMLAnalyticsSettingsClient.SecurityMLAnalyticsSettingsGet` + +```go +ctx := context.TODO() +id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "securityMLAnalyticsSettingValue") + +read, err := client.SecurityMLAnalyticsSettingsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SecurityMLAnalyticsSettingsClient.SecurityMLAnalyticsSettingsList` + +```go +ctx := context.TODO() +id := securitymlanalyticssettings.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") + +// alternatively `client.SecurityMLAnalyticsSettingsList(ctx, id)` can be used to do batched pagination +items, err := client.SecurityMLAnalyticsSettingsListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/client.go new file mode 100644 index 000000000000..50d64fb429c8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/client.go @@ -0,0 +1,18 @@ +package securitymlanalyticssettings + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityMLAnalyticsSettingsClient struct { + Client autorest.Client + baseUri string +} + +func NewSecurityMLAnalyticsSettingsClientWithBaseURI(endpoint string) SecurityMLAnalyticsSettingsClient { + return SecurityMLAnalyticsSettingsClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/constants.go new file mode 100644 index 000000000000..47b13b875e2d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/constants.go @@ -0,0 +1,132 @@ +package securitymlanalyticssettings + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AttackTactic string + +const ( + AttackTacticCollection AttackTactic = "Collection" + AttackTacticCommandAndControl AttackTactic = "CommandAndControl" + AttackTacticCredentialAccess AttackTactic = "CredentialAccess" + AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" + AttackTacticDiscovery AttackTactic = "Discovery" + AttackTacticExecution AttackTactic = "Execution" + AttackTacticExfiltration AttackTactic = "Exfiltration" + AttackTacticImpact AttackTactic = "Impact" + AttackTacticImpairProcessControl AttackTactic = "ImpairProcessControl" + AttackTacticInhibitResponseFunction AttackTactic = "InhibitResponseFunction" + AttackTacticInitialAccess AttackTactic = "InitialAccess" + AttackTacticLateralMovement AttackTactic = "LateralMovement" + AttackTacticPersistence AttackTactic = "Persistence" + AttackTacticPreAttack AttackTactic = "PreAttack" + AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" + AttackTacticReconnaissance AttackTactic = "Reconnaissance" + AttackTacticResourceDevelopment AttackTactic = "ResourceDevelopment" +) + +func PossibleValuesForAttackTactic() []string { + return []string{ + string(AttackTacticCollection), + string(AttackTacticCommandAndControl), + string(AttackTacticCredentialAccess), + string(AttackTacticDefenseEvasion), + string(AttackTacticDiscovery), + string(AttackTacticExecution), + string(AttackTacticExfiltration), + string(AttackTacticImpact), + string(AttackTacticImpairProcessControl), + string(AttackTacticInhibitResponseFunction), + string(AttackTacticInitialAccess), + string(AttackTacticLateralMovement), + string(AttackTacticPersistence), + string(AttackTacticPreAttack), + string(AttackTacticPrivilegeEscalation), + string(AttackTacticReconnaissance), + string(AttackTacticResourceDevelopment), + } +} + +func parseAttackTactic(input string) (*AttackTactic, error) { + vals := map[string]AttackTactic{ + "collection": AttackTacticCollection, + "commandandcontrol": AttackTacticCommandAndControl, + "credentialaccess": AttackTacticCredentialAccess, + "defenseevasion": AttackTacticDefenseEvasion, + "discovery": AttackTacticDiscovery, + "execution": AttackTacticExecution, + "exfiltration": AttackTacticExfiltration, + "impact": AttackTacticImpact, + "impairprocesscontrol": AttackTacticImpairProcessControl, + "inhibitresponsefunction": AttackTacticInhibitResponseFunction, + "initialaccess": AttackTacticInitialAccess, + "lateralmovement": AttackTacticLateralMovement, + "persistence": AttackTacticPersistence, + "preattack": AttackTacticPreAttack, + "privilegeescalation": AttackTacticPrivilegeEscalation, + "reconnaissance": AttackTacticReconnaissance, + "resourcedevelopment": AttackTacticResourceDevelopment, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AttackTactic(input) + return &out, nil +} + +type SecurityMLAnalyticsSettingsKind string + +const ( + SecurityMLAnalyticsSettingsKindAnomaly SecurityMLAnalyticsSettingsKind = "Anomaly" +) + +func PossibleValuesForSecurityMLAnalyticsSettingsKind() []string { + return []string{ + string(SecurityMLAnalyticsSettingsKindAnomaly), + } +} + +func parseSecurityMLAnalyticsSettingsKind(input string) (*SecurityMLAnalyticsSettingsKind, error) { + vals := map[string]SecurityMLAnalyticsSettingsKind{ + "anomaly": SecurityMLAnalyticsSettingsKindAnomaly, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityMLAnalyticsSettingsKind(input) + return &out, nil +} + +type SettingsStatus string + +const ( + SettingsStatusFlighting SettingsStatus = "Flighting" + SettingsStatusProduction SettingsStatus = "Production" +) + +func PossibleValuesForSettingsStatus() []string { + return []string{ + string(SettingsStatusFlighting), + string(SettingsStatusProduction), + } +} + +func parseSettingsStatus(input string) (*SettingsStatus, error) { + vals := map[string]SettingsStatus{ + "flighting": SettingsStatusFlighting, + "production": SettingsStatusProduction, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SettingsStatus(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go new file mode 100644 index 000000000000..e67cc6eb48b6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go @@ -0,0 +1,142 @@ +package securitymlanalyticssettings + +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 = SecurityMLAnalyticsSettingId{} + +// SecurityMLAnalyticsSettingId is a struct representing the Resource ID for a Security M L Analytics Setting +type SecurityMLAnalyticsSettingId struct { + SubscriptionId string + ResourceGroupName string + WorkspaceName string + SecurityMLAnalyticsSettingName string +} + +// NewSecurityMLAnalyticsSettingID returns a new SecurityMLAnalyticsSettingId struct +func NewSecurityMLAnalyticsSettingID(subscriptionId string, resourceGroupName string, workspaceName string, securityMLAnalyticsSettingName string) SecurityMLAnalyticsSettingId { + return SecurityMLAnalyticsSettingId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + WorkspaceName: workspaceName, + SecurityMLAnalyticsSettingName: securityMLAnalyticsSettingName, + } +} + +// ParseSecurityMLAnalyticsSettingID parses 'input' into a SecurityMLAnalyticsSettingId +func ParseSecurityMLAnalyticsSettingID(input string) (*SecurityMLAnalyticsSettingId, error) { + parser := resourceids.NewParserFromResourceIdType(SecurityMLAnalyticsSettingId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SecurityMLAnalyticsSettingId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + if id.SecurityMLAnalyticsSettingName, ok = parsed.Parsed["securityMLAnalyticsSettingName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "securityMLAnalyticsSettingName", *parsed) + } + + return &id, nil +} + +// ParseSecurityMLAnalyticsSettingIDInsensitively parses 'input' case-insensitively into a SecurityMLAnalyticsSettingId +// note: this method should only be used for API response data and not user input +func ParseSecurityMLAnalyticsSettingIDInsensitively(input string) (*SecurityMLAnalyticsSettingId, error) { + parser := resourceids.NewParserFromResourceIdType(SecurityMLAnalyticsSettingId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SecurityMLAnalyticsSettingId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + if id.SecurityMLAnalyticsSettingName, ok = parsed.Parsed["securityMLAnalyticsSettingName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "securityMLAnalyticsSettingName", *parsed) + } + + return &id, nil +} + +// ValidateSecurityMLAnalyticsSettingID checks that 'input' can be parsed as a Security M L Analytics Setting ID +func ValidateSecurityMLAnalyticsSettingID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseSecurityMLAnalyticsSettingID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Security M L Analytics Setting ID +func (id SecurityMLAnalyticsSettingId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.SecurityMLAnalyticsSettingName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Security M L Analytics Setting ID +func (id SecurityMLAnalyticsSettingId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), + resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), + resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), + resourceids.StaticSegment("staticProviders2", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), + resourceids.StaticSegment("staticSecurityMLAnalyticsSettings", "securityMLAnalyticsSettings", "securityMLAnalyticsSettings"), + resourceids.UserSpecifiedSegment("securityMLAnalyticsSettingName", "securityMLAnalyticsSettingValue"), + } +} + +// String returns a human-readable description of this Security M L Analytics Setting ID +func (id SecurityMLAnalyticsSettingId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), + fmt.Sprintf("Security M L Analytics Setting Name: %q", id.SecurityMLAnalyticsSettingName), + } + return fmt.Sprintf("Security M L Analytics Setting (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_workspace.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_workspace.go new file mode 100644 index 000000000000..6459961e86c2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_workspace.go @@ -0,0 +1,127 @@ +package securitymlanalyticssettings + +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 = WorkspaceId{} + +// WorkspaceId is a struct representing the Resource ID for a Workspace +type WorkspaceId struct { + SubscriptionId string + ResourceGroupName string + WorkspaceName string +} + +// NewWorkspaceID returns a new WorkspaceId struct +func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { + return WorkspaceId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + WorkspaceName: workspaceName, + } +} + +// ParseWorkspaceID parses 'input' into a WorkspaceId +func ParseWorkspaceID(input string) (*WorkspaceId, error) { + parser := resourceids.NewParserFromResourceIdType(WorkspaceId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := WorkspaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + return &id, nil +} + +// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId +// note: this method should only be used for API response data and not user input +func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { + parser := resourceids.NewParserFromResourceIdType(WorkspaceId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := WorkspaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + return &id, nil +} + +// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID +func ValidateWorkspaceID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseWorkspaceID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Workspace ID +func (id WorkspaceId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Workspace ID +func (id WorkspaceId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), + resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), + resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), + } +} + +// String returns a human-readable description of this Workspace ID +func (id WorkspaceId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), + } + return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingscreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingscreateorupdate_autorest.go new file mode 100644 index 000000000000..11e3f24ada46 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingscreateorupdate_autorest.go @@ -0,0 +1,78 @@ +package securitymlanalyticssettings + +import ( + "context" + "encoding/json" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityMLAnalyticsSettingsCreateOrUpdateOperationResponse struct { + HttpResponse *http.Response + Model *SecurityMLAnalyticsSetting +} + +// SecurityMLAnalyticsSettingsCreateOrUpdate ... +func (c SecurityMLAnalyticsSettingsClient) SecurityMLAnalyticsSettingsCreateOrUpdate(ctx context.Context, id SecurityMLAnalyticsSettingId, input SecurityMLAnalyticsSetting) (result SecurityMLAnalyticsSettingsCreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForSecurityMLAnalyticsSettingsCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsCreateOrUpdate", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsCreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSecurityMLAnalyticsSettingsCreateOrUpdate(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsCreateOrUpdate", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSecurityMLAnalyticsSettingsCreateOrUpdate prepares the SecurityMLAnalyticsSettingsCreateOrUpdate request. +func (c SecurityMLAnalyticsSettingsClient) preparerForSecurityMLAnalyticsSettingsCreateOrUpdate(ctx context.Context, id SecurityMLAnalyticsSettingId, input SecurityMLAnalyticsSetting) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSecurityMLAnalyticsSettingsCreateOrUpdate handles the response to the SecurityMLAnalyticsSettingsCreateOrUpdate request. The method always +// closes the http.Response Body. +func (c SecurityMLAnalyticsSettingsClient) responderForSecurityMLAnalyticsSettingsCreateOrUpdate(resp *http.Response) (result SecurityMLAnalyticsSettingsCreateOrUpdateOperationResponse, err error) { + var respObj json.RawMessage + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + if err != nil { + return + } + model, err := unmarshalSecurityMLAnalyticsSettingImplementation(respObj) + if err != nil { + return + } + result.Model = &model + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingsdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingsdelete_autorest.go new file mode 100644 index 000000000000..99b9057725e9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingsdelete_autorest.go @@ -0,0 +1,66 @@ +package securitymlanalyticssettings + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityMLAnalyticsSettingsDeleteOperationResponse struct { + HttpResponse *http.Response +} + +// SecurityMLAnalyticsSettingsDelete ... +func (c SecurityMLAnalyticsSettingsClient) SecurityMLAnalyticsSettingsDelete(ctx context.Context, id SecurityMLAnalyticsSettingId) (result SecurityMLAnalyticsSettingsDeleteOperationResponse, err error) { + req, err := c.preparerForSecurityMLAnalyticsSettingsDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsDelete", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsDelete", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSecurityMLAnalyticsSettingsDelete(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsDelete", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSecurityMLAnalyticsSettingsDelete prepares the SecurityMLAnalyticsSettingsDelete request. +func (c SecurityMLAnalyticsSettingsClient) preparerForSecurityMLAnalyticsSettingsDelete(ctx context.Context, id SecurityMLAnalyticsSettingId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSecurityMLAnalyticsSettingsDelete handles the response to the SecurityMLAnalyticsSettingsDelete request. The method always +// closes the http.Response Body. +func (c SecurityMLAnalyticsSettingsClient) responderForSecurityMLAnalyticsSettingsDelete(resp *http.Response) (result SecurityMLAnalyticsSettingsDeleteOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingsget_autorest.go new file mode 100644 index 000000000000..25749db15571 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingsget_autorest.go @@ -0,0 +1,77 @@ +package securitymlanalyticssettings + +import ( + "context" + "encoding/json" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityMLAnalyticsSettingsGetOperationResponse struct { + HttpResponse *http.Response + Model *SecurityMLAnalyticsSetting +} + +// SecurityMLAnalyticsSettingsGet ... +func (c SecurityMLAnalyticsSettingsClient) SecurityMLAnalyticsSettingsGet(ctx context.Context, id SecurityMLAnalyticsSettingId) (result SecurityMLAnalyticsSettingsGetOperationResponse, err error) { + req, err := c.preparerForSecurityMLAnalyticsSettingsGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsGet", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsGet", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSecurityMLAnalyticsSettingsGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsGet", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSecurityMLAnalyticsSettingsGet prepares the SecurityMLAnalyticsSettingsGet request. +func (c SecurityMLAnalyticsSettingsClient) preparerForSecurityMLAnalyticsSettingsGet(ctx context.Context, id SecurityMLAnalyticsSettingId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSecurityMLAnalyticsSettingsGet handles the response to the SecurityMLAnalyticsSettingsGet request. The method always +// closes the http.Response Body. +func (c SecurityMLAnalyticsSettingsClient) responderForSecurityMLAnalyticsSettingsGet(resp *http.Response) (result SecurityMLAnalyticsSettingsGetOperationResponse, err error) { + var respObj json.RawMessage + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + if err != nil { + return + } + model, err := unmarshalSecurityMLAnalyticsSettingImplementation(respObj) + if err != nil { + return + } + result.Model = &model + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingslist_autorest.go new file mode 100644 index 000000000000..1ecf7c02cc8d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingslist_autorest.go @@ -0,0 +1,196 @@ +package securitymlanalyticssettings + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityMLAnalyticsSettingsListOperationResponse struct { + HttpResponse *http.Response + Model *[]SecurityMLAnalyticsSetting + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (SecurityMLAnalyticsSettingsListOperationResponse, error) +} + +type SecurityMLAnalyticsSettingsListCompleteResult struct { + Items []SecurityMLAnalyticsSetting +} + +func (r SecurityMLAnalyticsSettingsListOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r SecurityMLAnalyticsSettingsListOperationResponse) LoadMore(ctx context.Context) (resp SecurityMLAnalyticsSettingsListOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +// SecurityMLAnalyticsSettingsList ... +func (c SecurityMLAnalyticsSettingsClient) SecurityMLAnalyticsSettingsList(ctx context.Context, id WorkspaceId) (resp SecurityMLAnalyticsSettingsListOperationResponse, err error) { + req, err := c.preparerForSecurityMLAnalyticsSettingsList(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsList", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsList", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForSecurityMLAnalyticsSettingsList(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsList", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForSecurityMLAnalyticsSettingsList prepares the SecurityMLAnalyticsSettingsList request. +func (c SecurityMLAnalyticsSettingsClient) preparerForSecurityMLAnalyticsSettingsList(ctx context.Context, id WorkspaceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForSecurityMLAnalyticsSettingsListWithNextLink prepares the SecurityMLAnalyticsSettingsList request with the given nextLink token. +func (c SecurityMLAnalyticsSettingsClient) preparerForSecurityMLAnalyticsSettingsListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSecurityMLAnalyticsSettingsList handles the response to the SecurityMLAnalyticsSettingsList request. The method always +// closes the http.Response Body. +func (c SecurityMLAnalyticsSettingsClient) responderForSecurityMLAnalyticsSettingsList(resp *http.Response) (result SecurityMLAnalyticsSettingsListOperationResponse, err error) { + type page struct { + Values []json.RawMessage `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + temp := make([]SecurityMLAnalyticsSetting, 0) + for i, v := range respObj.Values { + val, err := unmarshalSecurityMLAnalyticsSettingImplementation(v) + if err != nil { + err = fmt.Errorf("unmarshalling item %d for SecurityMLAnalyticsSetting (%q): %+v", i, v, err) + return result, err + } + temp = append(temp, val) + } + result.Model = &temp + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result SecurityMLAnalyticsSettingsListOperationResponse, err error) { + req, err := c.preparerForSecurityMLAnalyticsSettingsListWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsList", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsList", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSecurityMLAnalyticsSettingsList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsList", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// SecurityMLAnalyticsSettingsListComplete retrieves all of the results into a single object +func (c SecurityMLAnalyticsSettingsClient) SecurityMLAnalyticsSettingsListComplete(ctx context.Context, id WorkspaceId) (SecurityMLAnalyticsSettingsListCompleteResult, error) { + return c.SecurityMLAnalyticsSettingsListCompleteMatchingPredicate(ctx, id, SecurityMLAnalyticsSettingOperationPredicate{}) +} + +// SecurityMLAnalyticsSettingsListCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c SecurityMLAnalyticsSettingsClient) SecurityMLAnalyticsSettingsListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate SecurityMLAnalyticsSettingOperationPredicate) (resp SecurityMLAnalyticsSettingsListCompleteResult, err error) { + items := make([]SecurityMLAnalyticsSetting, 0) + + page, err := c.SecurityMLAnalyticsSettingsList(ctx, id) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := SecurityMLAnalyticsSettingsListCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettings.go new file mode 100644 index 000000000000..488f0b735f12 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettings.go @@ -0,0 +1,48 @@ +package securitymlanalyticssettings + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ SecurityMLAnalyticsSetting = AnomalySecurityMLAnalyticsSettings{} + +type AnomalySecurityMLAnalyticsSettings struct { + Properties *AnomalySecurityMLAnalyticsSettingsProperties `json:"properties,omitempty"` + + // Fields inherited from SecurityMLAnalyticsSetting + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Marshaler = AnomalySecurityMLAnalyticsSettings{} + +func (s AnomalySecurityMLAnalyticsSettings) MarshalJSON() ([]byte, error) { + type wrapper AnomalySecurityMLAnalyticsSettings + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AnomalySecurityMLAnalyticsSettings: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AnomalySecurityMLAnalyticsSettings: %+v", err) + } + decoded["kind"] = "Anomaly" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AnomalySecurityMLAnalyticsSettings: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettingsproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettingsproperties.go new file mode 100644 index 000000000000..99a6e024a1cc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettingsproperties.go @@ -0,0 +1,39 @@ +package securitymlanalyticssettings + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AnomalySecurityMLAnalyticsSettingsProperties struct { + AnomalySettingsVersion *int64 `json:"anomalySettingsVersion,omitempty"` + AnomalyVersion string `json:"anomalyVersion"` + CustomizableObservations *interface{} `json:"customizableObservations,omitempty"` + Description *string `json:"description,omitempty"` + DisplayName string `json:"displayName"` + Enabled bool `json:"enabled"` + Frequency string `json:"frequency"` + IsDefaultSettings bool `json:"isDefaultSettings"` + LastModifiedUtc *string `json:"lastModifiedUtc,omitempty"` + RequiredDataConnectors *[]SecurityMLAnalyticsSettingsDataSource `json:"requiredDataConnectors,omitempty"` + SettingsDefinitionId *string `json:"settingsDefinitionId,omitempty"` + SettingsStatus SettingsStatus `json:"settingsStatus"` + Tactics *[]AttackTactic `json:"tactics,omitempty"` + Techniques *[]string `json:"techniques,omitempty"` +} + +func (o *AnomalySecurityMLAnalyticsSettingsProperties) GetLastModifiedUtcAsTime() (*time.Time, error) { + if o.LastModifiedUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *AnomalySecurityMLAnalyticsSettingsProperties) SetLastModifiedUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedUtc = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_securitymlanalyticssetting.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_securitymlanalyticssetting.go new file mode 100644 index 000000000000..3492bcf1c4af --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_securitymlanalyticssetting.go @@ -0,0 +1,48 @@ +package securitymlanalyticssettings + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityMLAnalyticsSetting interface { +} + +func unmarshalSecurityMLAnalyticsSettingImplementation(input []byte) (SecurityMLAnalyticsSetting, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling SecurityMLAnalyticsSetting into map[string]interface: %+v", err) + } + + value, ok := temp["kind"].(string) + if !ok { + return nil, nil + } + + if strings.EqualFold(value, "Anomaly") { + var out AnomalySecurityMLAnalyticsSettings + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AnomalySecurityMLAnalyticsSettings: %+v", err) + } + return out, nil + } + + type RawSecurityMLAnalyticsSettingImpl struct { + Type string `json:"-"` + Values map[string]interface{} `json:"-"` + } + out := RawSecurityMLAnalyticsSettingImpl{ + Type: value, + Values: temp, + } + return out, nil + +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_securitymlanalyticssettingsdatasource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_securitymlanalyticssettingsdatasource.go new file mode 100644 index 000000000000..6258b6b3094d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_securitymlanalyticssettingsdatasource.go @@ -0,0 +1,9 @@ +package securitymlanalyticssettings + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityMLAnalyticsSettingsDataSource struct { + ConnectorId *string `json:"connectorId,omitempty"` + DataTypes *[]string `json:"dataTypes,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/predicates.go new file mode 100644 index 000000000000..7e6211c7d91b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/predicates.go @@ -0,0 +1,12 @@ +package securitymlanalyticssettings + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityMLAnalyticsSettingOperationPredicate struct { +} + +func (p SecurityMLAnalyticsSettingOperationPredicate) Matches(input SecurityMLAnalyticsSetting) bool { + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/version.go new file mode 100644 index 000000000000..48725fb8f8a7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/version.go @@ -0,0 +1,12 @@ +package securitymlanalyticssettings + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/securitymlanalyticssettings/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/README.md new file mode 100644 index 000000000000..c58184318881 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/README.md @@ -0,0 +1,191 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence` Documentation + +The `threatintelligence` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-11-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence" +``` + + +### Client Initialization + +```go +client := threatintelligence.NewThreatIntelligenceClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ThreatIntelligenceClient.IndicatorAppendTags` + +```go +ctx := context.TODO() +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") + +payload := threatintelligence.ThreatIntelligenceAppendTags{ + // ... +} + + +read, err := client.IndicatorAppendTags(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ThreatIntelligenceClient.IndicatorCreate` + +```go +ctx := context.TODO() +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") + +payload := threatintelligence.ThreatIntelligenceIndicatorModel{ + // ... +} + + +read, err := client.IndicatorCreate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ThreatIntelligenceClient.IndicatorCreateIndicator` + +```go +ctx := context.TODO() +id := threatintelligence.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") + +payload := threatintelligence.ThreatIntelligenceIndicatorModel{ + // ... +} + + +read, err := client.IndicatorCreateIndicator(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ThreatIntelligenceClient.IndicatorDelete` + +```go +ctx := context.TODO() +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") + +read, err := client.IndicatorDelete(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ThreatIntelligenceClient.IndicatorGet` + +```go +ctx := context.TODO() +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") + +read, err := client.IndicatorGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ThreatIntelligenceClient.IndicatorMetricsList` + +```go +ctx := context.TODO() +id := threatintelligence.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") + +read, err := client.IndicatorMetricsList(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ThreatIntelligenceClient.IndicatorQueryIndicators` + +```go +ctx := context.TODO() +id := threatintelligence.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") + +payload := threatintelligence.ThreatIntelligenceFilteringCriteria{ + // ... +} + + +// alternatively `client.IndicatorQueryIndicators(ctx, id, payload)` can be used to do batched pagination +items, err := client.IndicatorQueryIndicatorsComplete(ctx, id, payload) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `ThreatIntelligenceClient.IndicatorReplaceTags` + +```go +ctx := context.TODO() +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") + +payload := threatintelligence.ThreatIntelligenceIndicatorModel{ + // ... +} + + +read, err := client.IndicatorReplaceTags(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ThreatIntelligenceClient.IndicatorsList` + +```go +ctx := context.TODO() +id := threatintelligence.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") + +// alternatively `client.IndicatorsList(ctx, id, threatintelligence.DefaultIndicatorsListOperationOptions())` can be used to do batched pagination +items, err := client.IndicatorsListComplete(ctx, id, threatintelligence.DefaultIndicatorsListOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/client.go new file mode 100644 index 000000000000..35caff313570 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/client.go @@ -0,0 +1,18 @@ +package threatintelligence + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligenceClient struct { + Client autorest.Client + baseUri string +} + +func NewThreatIntelligenceClientWithBaseURI(endpoint string) ThreatIntelligenceClient { + return ThreatIntelligenceClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/constants.go new file mode 100644 index 000000000000..76610b311011 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/constants.go @@ -0,0 +1,62 @@ +package threatintelligence + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligenceResourceInnerKind string + +const ( + ThreatIntelligenceResourceInnerKindIndicator ThreatIntelligenceResourceInnerKind = "indicator" +) + +func PossibleValuesForThreatIntelligenceResourceInnerKind() []string { + return []string{ + string(ThreatIntelligenceResourceInnerKindIndicator), + } +} + +func parseThreatIntelligenceResourceInnerKind(input string) (*ThreatIntelligenceResourceInnerKind, error) { + vals := map[string]ThreatIntelligenceResourceInnerKind{ + "indicator": ThreatIntelligenceResourceInnerKindIndicator, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ThreatIntelligenceResourceInnerKind(input) + return &out, nil +} + +type ThreatIntelligenceSortingOrder string + +const ( + ThreatIntelligenceSortingOrderAscending ThreatIntelligenceSortingOrder = "ascending" + ThreatIntelligenceSortingOrderDescending ThreatIntelligenceSortingOrder = "descending" + ThreatIntelligenceSortingOrderUnsorted ThreatIntelligenceSortingOrder = "unsorted" +) + +func PossibleValuesForThreatIntelligenceSortingOrder() []string { + return []string{ + string(ThreatIntelligenceSortingOrderAscending), + string(ThreatIntelligenceSortingOrderDescending), + string(ThreatIntelligenceSortingOrderUnsorted), + } +} + +func parseThreatIntelligenceSortingOrder(input string) (*ThreatIntelligenceSortingOrder, error) { + vals := map[string]ThreatIntelligenceSortingOrder{ + "ascending": ThreatIntelligenceSortingOrderAscending, + "descending": ThreatIntelligenceSortingOrderDescending, + "unsorted": ThreatIntelligenceSortingOrderUnsorted, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ThreatIntelligenceSortingOrder(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/id_indicator.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/id_indicator.go new file mode 100644 index 000000000000..fe680d054de0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/id_indicator.go @@ -0,0 +1,144 @@ +package threatintelligence + +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 = IndicatorId{} + +// IndicatorId is a struct representing the Resource ID for a Indicator +type IndicatorId struct { + SubscriptionId string + ResourceGroupName string + WorkspaceName string + IndicatorName string +} + +// NewIndicatorID returns a new IndicatorId struct +func NewIndicatorID(subscriptionId string, resourceGroupName string, workspaceName string, indicatorName string) IndicatorId { + return IndicatorId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + WorkspaceName: workspaceName, + IndicatorName: indicatorName, + } +} + +// ParseIndicatorID parses 'input' into a IndicatorId +func ParseIndicatorID(input string) (*IndicatorId, error) { + parser := resourceids.NewParserFromResourceIdType(IndicatorId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := IndicatorId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + if id.IndicatorName, ok = parsed.Parsed["indicatorName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "indicatorName", *parsed) + } + + return &id, nil +} + +// ParseIndicatorIDInsensitively parses 'input' case-insensitively into a IndicatorId +// note: this method should only be used for API response data and not user input +func ParseIndicatorIDInsensitively(input string) (*IndicatorId, error) { + parser := resourceids.NewParserFromResourceIdType(IndicatorId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := IndicatorId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + if id.IndicatorName, ok = parsed.Parsed["indicatorName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "indicatorName", *parsed) + } + + return &id, nil +} + +// ValidateIndicatorID checks that 'input' can be parsed as a Indicator ID +func ValidateIndicatorID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseIndicatorID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Indicator ID +func (id IndicatorId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IndicatorName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Indicator ID +func (id IndicatorId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), + resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), + resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), + resourceids.StaticSegment("staticProviders2", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), + resourceids.StaticSegment("staticThreatIntelligence", "threatIntelligence", "threatIntelligence"), + resourceids.StaticSegment("staticMain", "main", "main"), + resourceids.StaticSegment("staticIndicators", "indicators", "indicators"), + resourceids.UserSpecifiedSegment("indicatorName", "indicatorValue"), + } +} + +// String returns a human-readable description of this Indicator ID +func (id IndicatorId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), + fmt.Sprintf("Indicator Name: %q", id.IndicatorName), + } + return fmt.Sprintf("Indicator (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/id_workspace.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/id_workspace.go new file mode 100644 index 000000000000..c3245ebd1b3b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/id_workspace.go @@ -0,0 +1,127 @@ +package threatintelligence + +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 = WorkspaceId{} + +// WorkspaceId is a struct representing the Resource ID for a Workspace +type WorkspaceId struct { + SubscriptionId string + ResourceGroupName string + WorkspaceName string +} + +// NewWorkspaceID returns a new WorkspaceId struct +func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { + return WorkspaceId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + WorkspaceName: workspaceName, + } +} + +// ParseWorkspaceID parses 'input' into a WorkspaceId +func ParseWorkspaceID(input string) (*WorkspaceId, error) { + parser := resourceids.NewParserFromResourceIdType(WorkspaceId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := WorkspaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + return &id, nil +} + +// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId +// note: this method should only be used for API response data and not user input +func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { + parser := resourceids.NewParserFromResourceIdType(WorkspaceId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := WorkspaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + return &id, nil +} + +// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID +func ValidateWorkspaceID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseWorkspaceID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Workspace ID +func (id WorkspaceId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Workspace ID +func (id WorkspaceId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), + resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), + resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), + } +} + +// String returns a human-readable description of this Workspace ID +func (id WorkspaceId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), + } + return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorappendtags_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorappendtags_autorest.go new file mode 100644 index 000000000000..18b86a166fe9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorappendtags_autorest.go @@ -0,0 +1,68 @@ +package threatintelligence + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IndicatorAppendTagsOperationResponse struct { + HttpResponse *http.Response +} + +// IndicatorAppendTags ... +func (c ThreatIntelligenceClient) IndicatorAppendTags(ctx context.Context, id IndicatorId, input ThreatIntelligenceAppendTags) (result IndicatorAppendTagsOperationResponse, err error) { + req, err := c.preparerForIndicatorAppendTags(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorAppendTags", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorAppendTags", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForIndicatorAppendTags(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorAppendTags", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForIndicatorAppendTags prepares the IndicatorAppendTags request. +func (c ThreatIntelligenceClient) preparerForIndicatorAppendTags(ctx context.Context, id IndicatorId, input ThreatIntelligenceAppendTags) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/appendTags", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForIndicatorAppendTags handles the response to the IndicatorAppendTags request. The method always +// closes the http.Response Body. +func (c ThreatIntelligenceClient) responderForIndicatorAppendTags(resp *http.Response) (result IndicatorAppendTagsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorcreate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorcreate_autorest.go new file mode 100644 index 000000000000..98609062b7f6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorcreate_autorest.go @@ -0,0 +1,78 @@ +package threatintelligence + +import ( + "context" + "encoding/json" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IndicatorCreateOperationResponse struct { + HttpResponse *http.Response + Model *ThreatIntelligenceInformation +} + +// IndicatorCreate ... +func (c ThreatIntelligenceClient) IndicatorCreate(ctx context.Context, id IndicatorId, input ThreatIntelligenceIndicatorModel) (result IndicatorCreateOperationResponse, err error) { + req, err := c.preparerForIndicatorCreate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorCreate", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorCreate", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForIndicatorCreate(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorCreate", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForIndicatorCreate prepares the IndicatorCreate request. +func (c ThreatIntelligenceClient) preparerForIndicatorCreate(ctx context.Context, id IndicatorId, input ThreatIntelligenceIndicatorModel) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForIndicatorCreate handles the response to the IndicatorCreate request. The method always +// closes the http.Response Body. +func (c ThreatIntelligenceClient) responderForIndicatorCreate(resp *http.Response) (result IndicatorCreateOperationResponse, err error) { + var respObj json.RawMessage + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + if err != nil { + return + } + model, err := unmarshalThreatIntelligenceInformationImplementation(respObj) + if err != nil { + return + } + result.Model = &model + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorcreateindicator_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorcreateindicator_autorest.go new file mode 100644 index 000000000000..ecc76b88f5c7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorcreateindicator_autorest.go @@ -0,0 +1,79 @@ +package threatintelligence + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IndicatorCreateIndicatorOperationResponse struct { + HttpResponse *http.Response + Model *ThreatIntelligenceInformation +} + +// IndicatorCreateIndicator ... +func (c ThreatIntelligenceClient) IndicatorCreateIndicator(ctx context.Context, id WorkspaceId, input ThreatIntelligenceIndicatorModel) (result IndicatorCreateIndicatorOperationResponse, err error) { + req, err := c.preparerForIndicatorCreateIndicator(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorCreateIndicator", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorCreateIndicator", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForIndicatorCreateIndicator(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorCreateIndicator", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForIndicatorCreateIndicator prepares the IndicatorCreateIndicator request. +func (c ThreatIntelligenceClient) preparerForIndicatorCreateIndicator(ctx context.Context, id WorkspaceId, input ThreatIntelligenceIndicatorModel) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/createIndicator", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForIndicatorCreateIndicator handles the response to the IndicatorCreateIndicator request. The method always +// closes the http.Response Body. +func (c ThreatIntelligenceClient) responderForIndicatorCreateIndicator(resp *http.Response) (result IndicatorCreateIndicatorOperationResponse, err error) { + var respObj json.RawMessage + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + if err != nil { + return + } + model, err := unmarshalThreatIntelligenceInformationImplementation(respObj) + if err != nil { + return + } + result.Model = &model + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatordelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatordelete_autorest.go new file mode 100644 index 000000000000..825d3b911ce9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatordelete_autorest.go @@ -0,0 +1,66 @@ +package threatintelligence + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IndicatorDeleteOperationResponse struct { + HttpResponse *http.Response +} + +// IndicatorDelete ... +func (c ThreatIntelligenceClient) IndicatorDelete(ctx context.Context, id IndicatorId) (result IndicatorDeleteOperationResponse, err error) { + req, err := c.preparerForIndicatorDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorDelete", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorDelete", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForIndicatorDelete(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorDelete", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForIndicatorDelete prepares the IndicatorDelete request. +func (c ThreatIntelligenceClient) preparerForIndicatorDelete(ctx context.Context, id IndicatorId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForIndicatorDelete handles the response to the IndicatorDelete request. The method always +// closes the http.Response Body. +func (c ThreatIntelligenceClient) responderForIndicatorDelete(resp *http.Response) (result IndicatorDeleteOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorget_autorest.go new file mode 100644 index 000000000000..ac1187fb285e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorget_autorest.go @@ -0,0 +1,77 @@ +package threatintelligence + +import ( + "context" + "encoding/json" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IndicatorGetOperationResponse struct { + HttpResponse *http.Response + Model *ThreatIntelligenceInformation +} + +// IndicatorGet ... +func (c ThreatIntelligenceClient) IndicatorGet(ctx context.Context, id IndicatorId) (result IndicatorGetOperationResponse, err error) { + req, err := c.preparerForIndicatorGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorGet", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorGet", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForIndicatorGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorGet", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForIndicatorGet prepares the IndicatorGet request. +func (c ThreatIntelligenceClient) preparerForIndicatorGet(ctx context.Context, id IndicatorId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForIndicatorGet handles the response to the IndicatorGet request. The method always +// closes the http.Response Body. +func (c ThreatIntelligenceClient) responderForIndicatorGet(resp *http.Response) (result IndicatorGetOperationResponse, err error) { + var respObj json.RawMessage + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + if err != nil { + return + } + model, err := unmarshalThreatIntelligenceInformationImplementation(respObj) + if err != nil { + return + } + result.Model = &model + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatormetricslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatormetricslist_autorest.go new file mode 100644 index 000000000000..1835c26ed964 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatormetricslist_autorest.go @@ -0,0 +1,69 @@ +package threatintelligence + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IndicatorMetricsListOperationResponse struct { + HttpResponse *http.Response + Model *ThreatIntelligenceMetricsList +} + +// IndicatorMetricsList ... +func (c ThreatIntelligenceClient) IndicatorMetricsList(ctx context.Context, id WorkspaceId) (result IndicatorMetricsListOperationResponse, err error) { + req, err := c.preparerForIndicatorMetricsList(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorMetricsList", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorMetricsList", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForIndicatorMetricsList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorMetricsList", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForIndicatorMetricsList prepares the IndicatorMetricsList request. +func (c ThreatIntelligenceClient) preparerForIndicatorMetricsList(ctx context.Context, id WorkspaceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/metrics", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForIndicatorMetricsList handles the response to the IndicatorMetricsList request. The method always +// closes the http.Response Body. +func (c ThreatIntelligenceClient) responderForIndicatorMetricsList(resp *http.Response) (result IndicatorMetricsListOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorqueryindicators_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorqueryindicators_autorest.go new file mode 100644 index 000000000000..fcbe7c747581 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorqueryindicators_autorest.go @@ -0,0 +1,197 @@ +package threatintelligence + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IndicatorQueryIndicatorsOperationResponse struct { + HttpResponse *http.Response + Model *[]ThreatIntelligenceInformation + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (IndicatorQueryIndicatorsOperationResponse, error) +} + +type IndicatorQueryIndicatorsCompleteResult struct { + Items []ThreatIntelligenceInformation +} + +func (r IndicatorQueryIndicatorsOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r IndicatorQueryIndicatorsOperationResponse) LoadMore(ctx context.Context) (resp IndicatorQueryIndicatorsOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +// IndicatorQueryIndicators ... +func (c ThreatIntelligenceClient) IndicatorQueryIndicators(ctx context.Context, id WorkspaceId, input ThreatIntelligenceFilteringCriteria) (resp IndicatorQueryIndicatorsOperationResponse, err error) { + req, err := c.preparerForIndicatorQueryIndicators(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorQueryIndicators", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorQueryIndicators", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForIndicatorQueryIndicators(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorQueryIndicators", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForIndicatorQueryIndicators prepares the IndicatorQueryIndicators request. +func (c ThreatIntelligenceClient) preparerForIndicatorQueryIndicators(ctx context.Context, id WorkspaceId, input ThreatIntelligenceFilteringCriteria) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/queryIndicators", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForIndicatorQueryIndicatorsWithNextLink prepares the IndicatorQueryIndicators request with the given nextLink token. +func (c ThreatIntelligenceClient) preparerForIndicatorQueryIndicatorsWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForIndicatorQueryIndicators handles the response to the IndicatorQueryIndicators request. The method always +// closes the http.Response Body. +func (c ThreatIntelligenceClient) responderForIndicatorQueryIndicators(resp *http.Response) (result IndicatorQueryIndicatorsOperationResponse, err error) { + type page struct { + Values []json.RawMessage `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + temp := make([]ThreatIntelligenceInformation, 0) + for i, v := range respObj.Values { + val, err := unmarshalThreatIntelligenceInformationImplementation(v) + if err != nil { + err = fmt.Errorf("unmarshalling item %d for ThreatIntelligenceInformation (%q): %+v", i, v, err) + return result, err + } + temp = append(temp, val) + } + result.Model = &temp + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result IndicatorQueryIndicatorsOperationResponse, err error) { + req, err := c.preparerForIndicatorQueryIndicatorsWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorQueryIndicators", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorQueryIndicators", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForIndicatorQueryIndicators(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorQueryIndicators", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// IndicatorQueryIndicatorsComplete retrieves all of the results into a single object +func (c ThreatIntelligenceClient) IndicatorQueryIndicatorsComplete(ctx context.Context, id WorkspaceId, input ThreatIntelligenceFilteringCriteria) (IndicatorQueryIndicatorsCompleteResult, error) { + return c.IndicatorQueryIndicatorsCompleteMatchingPredicate(ctx, id, input, ThreatIntelligenceInformationOperationPredicate{}) +} + +// IndicatorQueryIndicatorsCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c ThreatIntelligenceClient) IndicatorQueryIndicatorsCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, input ThreatIntelligenceFilteringCriteria, predicate ThreatIntelligenceInformationOperationPredicate) (resp IndicatorQueryIndicatorsCompleteResult, err error) { + items := make([]ThreatIntelligenceInformation, 0) + + page, err := c.IndicatorQueryIndicators(ctx, id, input) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := IndicatorQueryIndicatorsCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorreplacetags_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorreplacetags_autorest.go new file mode 100644 index 000000000000..01efbe5b7780 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorreplacetags_autorest.go @@ -0,0 +1,79 @@ +package threatintelligence + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IndicatorReplaceTagsOperationResponse struct { + HttpResponse *http.Response + Model *ThreatIntelligenceInformation +} + +// IndicatorReplaceTags ... +func (c ThreatIntelligenceClient) IndicatorReplaceTags(ctx context.Context, id IndicatorId, input ThreatIntelligenceIndicatorModel) (result IndicatorReplaceTagsOperationResponse, err error) { + req, err := c.preparerForIndicatorReplaceTags(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorReplaceTags", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorReplaceTags", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForIndicatorReplaceTags(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorReplaceTags", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForIndicatorReplaceTags prepares the IndicatorReplaceTags request. +func (c ThreatIntelligenceClient) preparerForIndicatorReplaceTags(ctx context.Context, id IndicatorId, input ThreatIntelligenceIndicatorModel) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/replaceTags", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForIndicatorReplaceTags handles the response to the IndicatorReplaceTags request. The method always +// closes the http.Response Body. +func (c ThreatIntelligenceClient) responderForIndicatorReplaceTags(resp *http.Response) (result IndicatorReplaceTagsOperationResponse, err error) { + var respObj json.RawMessage + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + if err != nil { + return + } + model, err := unmarshalThreatIntelligenceInformationImplementation(respObj) + if err != nil { + return + } + result.Model = &model + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorslist_autorest.go new file mode 100644 index 000000000000..22ef9d7b193e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorslist_autorest.go @@ -0,0 +1,235 @@ +package threatintelligence + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IndicatorsListOperationResponse struct { + HttpResponse *http.Response + Model *[]ThreatIntelligenceInformation + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (IndicatorsListOperationResponse, error) +} + +type IndicatorsListCompleteResult struct { + Items []ThreatIntelligenceInformation +} + +func (r IndicatorsListOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r IndicatorsListOperationResponse) LoadMore(ctx context.Context) (resp IndicatorsListOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +type IndicatorsListOperationOptions struct { + Filter *string + Orderby *string + Top *int64 +} + +func DefaultIndicatorsListOperationOptions() IndicatorsListOperationOptions { + return IndicatorsListOperationOptions{} +} + +func (o IndicatorsListOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o IndicatorsListOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Filter != nil { + out["$filter"] = *o.Filter + } + + if o.Orderby != nil { + out["$orderby"] = *o.Orderby + } + + if o.Top != nil { + out["$top"] = *o.Top + } + + return out +} + +// IndicatorsList ... +func (c ThreatIntelligenceClient) IndicatorsList(ctx context.Context, id WorkspaceId, options IndicatorsListOperationOptions) (resp IndicatorsListOperationResponse, err error) { + req, err := c.preparerForIndicatorsList(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorsList", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorsList", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForIndicatorsList(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorsList", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForIndicatorsList prepares the IndicatorsList request. +func (c ThreatIntelligenceClient) preparerForIndicatorsList(ctx context.Context, id WorkspaceId, options IndicatorsListOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForIndicatorsListWithNextLink prepares the IndicatorsList request with the given nextLink token. +func (c ThreatIntelligenceClient) preparerForIndicatorsListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForIndicatorsList handles the response to the IndicatorsList request. The method always +// closes the http.Response Body. +func (c ThreatIntelligenceClient) responderForIndicatorsList(resp *http.Response) (result IndicatorsListOperationResponse, err error) { + type page struct { + Values []json.RawMessage `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + temp := make([]ThreatIntelligenceInformation, 0) + for i, v := range respObj.Values { + val, err := unmarshalThreatIntelligenceInformationImplementation(v) + if err != nil { + err = fmt.Errorf("unmarshalling item %d for ThreatIntelligenceInformation (%q): %+v", i, v, err) + return result, err + } + temp = append(temp, val) + } + result.Model = &temp + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result IndicatorsListOperationResponse, err error) { + req, err := c.preparerForIndicatorsListWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorsList", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorsList", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForIndicatorsList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorsList", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// IndicatorsListComplete retrieves all of the results into a single object +func (c ThreatIntelligenceClient) IndicatorsListComplete(ctx context.Context, id WorkspaceId, options IndicatorsListOperationOptions) (IndicatorsListCompleteResult, error) { + return c.IndicatorsListCompleteMatchingPredicate(ctx, id, options, ThreatIntelligenceInformationOperationPredicate{}) +} + +// IndicatorsListCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c ThreatIntelligenceClient) IndicatorsListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, options IndicatorsListOperationOptions, predicate ThreatIntelligenceInformationOperationPredicate) (resp IndicatorsListCompleteResult, err error) { + items := make([]ThreatIntelligenceInformation, 0) + + page, err := c.IndicatorsList(ctx, id, options) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := IndicatorsListCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceappendtags.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceappendtags.go new file mode 100644 index 000000000000..d864022037fb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceappendtags.go @@ -0,0 +1,8 @@ +package threatintelligence + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligenceAppendTags struct { + ThreatIntelligenceTags *[]string `json:"threatIntelligenceTags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceexternalreference.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceexternalreference.go new file mode 100644 index 000000000000..52978aae6368 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceexternalreference.go @@ -0,0 +1,12 @@ +package threatintelligence + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligenceExternalReference struct { + Description *string `json:"description,omitempty"` + ExternalId *string `json:"externalId,omitempty"` + Hashes *map[string]string `json:"hashes,omitempty"` + SourceName *string `json:"sourceName,omitempty"` + Url *string `json:"url,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencefilteringcriteria.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencefilteringcriteria.go new file mode 100644 index 000000000000..181ef4790bf0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencefilteringcriteria.go @@ -0,0 +1,20 @@ +package threatintelligence + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligenceFilteringCriteria struct { + Ids *[]string `json:"ids,omitempty"` + IncludeDisabled *bool `json:"includeDisabled,omitempty"` + Keywords *[]string `json:"keywords,omitempty"` + MaxConfidence *int64 `json:"maxConfidence,omitempty"` + MaxValidUntil *string `json:"maxValidUntil,omitempty"` + MinConfidence *int64 `json:"minConfidence,omitempty"` + MinValidUntil *string `json:"minValidUntil,omitempty"` + PageSize *int64 `json:"pageSize,omitempty"` + PatternTypes *[]string `json:"patternTypes,omitempty"` + SkipToken *string `json:"skipToken,omitempty"` + SortBy *[]ThreatIntelligenceSortingCriteria `json:"sortBy,omitempty"` + Sources *[]string `json:"sources,omitempty"` + ThreatTypes *[]string `json:"threatTypes,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencegranularmarkingmodel.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencegranularmarkingmodel.go new file mode 100644 index 000000000000..f35c4df440d4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencegranularmarkingmodel.go @@ -0,0 +1,10 @@ +package threatintelligence + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligenceGranularMarkingModel struct { + Language *string `json:"language,omitempty"` + MarkingRef *int64 `json:"markingRef,omitempty"` + Selectors *[]string `json:"selectors,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceindicatormodel.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceindicatormodel.go new file mode 100644 index 000000000000..9ee1b5778ede --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceindicatormodel.go @@ -0,0 +1,48 @@ +package threatintelligence + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ThreatIntelligenceInformation = ThreatIntelligenceIndicatorModel{} + +type ThreatIntelligenceIndicatorModel struct { + Properties *ThreatIntelligenceIndicatorProperties `json:"properties,omitempty"` + + // Fields inherited from ThreatIntelligenceInformation + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Marshaler = ThreatIntelligenceIndicatorModel{} + +func (s ThreatIntelligenceIndicatorModel) MarshalJSON() ([]byte, error) { + type wrapper ThreatIntelligenceIndicatorModel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ThreatIntelligenceIndicatorModel: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ThreatIntelligenceIndicatorModel: %+v", err) + } + decoded["kind"] = "indicator" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ThreatIntelligenceIndicatorModel: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceindicatorproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceindicatorproperties.go new file mode 100644 index 000000000000..49660ed57921 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceindicatorproperties.go @@ -0,0 +1,37 @@ +package threatintelligence + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligenceIndicatorProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Confidence *int64 `json:"confidence,omitempty"` + Created *string `json:"created,omitempty"` + CreatedByRef *string `json:"createdByRef,omitempty"` + Defanged *bool `json:"defanged,omitempty"` + Description *string `json:"description,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Extensions *interface{} `json:"extensions,omitempty"` + ExternalId *string `json:"externalId,omitempty"` + ExternalLastUpdatedTimeUtc *string `json:"externalLastUpdatedTimeUtc,omitempty"` + ExternalReferences *[]ThreatIntelligenceExternalReference `json:"externalReferences,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + GranularMarkings *[]ThreatIntelligenceGranularMarkingModel `json:"granularMarkings,omitempty"` + IndicatorTypes *[]string `json:"indicatorTypes,omitempty"` + KillChainPhases *[]ThreatIntelligenceKillChainPhase `json:"killChainPhases,omitempty"` + Labels *[]string `json:"labels,omitempty"` + Language *string `json:"language,omitempty"` + LastUpdatedTimeUtc *string `json:"lastUpdatedTimeUtc,omitempty"` + Modified *string `json:"modified,omitempty"` + ObjectMarkingRefs *[]string `json:"objectMarkingRefs,omitempty"` + ParsedPattern *[]ThreatIntelligenceParsedPattern `json:"parsedPattern,omitempty"` + Pattern *string `json:"pattern,omitempty"` + PatternType *string `json:"patternType,omitempty"` + PatternVersion *string `json:"patternVersion,omitempty"` + Revoked *bool `json:"revoked,omitempty"` + Source *string `json:"source,omitempty"` + ThreatIntelligenceTags *[]string `json:"threatIntelligenceTags,omitempty"` + ThreatTypes *[]string `json:"threatTypes,omitempty"` + ValidFrom *string `json:"validFrom,omitempty"` + ValidUntil *string `json:"validUntil,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceinformation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceinformation.go new file mode 100644 index 000000000000..567adeee2e9f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceinformation.go @@ -0,0 +1,48 @@ +package threatintelligence + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligenceInformation interface { +} + +func unmarshalThreatIntelligenceInformationImplementation(input []byte) (ThreatIntelligenceInformation, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ThreatIntelligenceInformation into map[string]interface: %+v", err) + } + + value, ok := temp["kind"].(string) + if !ok { + return nil, nil + } + + if strings.EqualFold(value, "indicator") { + var out ThreatIntelligenceIndicatorModel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ThreatIntelligenceIndicatorModel: %+v", err) + } + return out, nil + } + + type RawThreatIntelligenceInformationImpl struct { + Type string `json:"-"` + Values map[string]interface{} `json:"-"` + } + out := RawThreatIntelligenceInformationImpl{ + Type: value, + Values: temp, + } + return out, nil + +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencekillchainphase.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencekillchainphase.go new file mode 100644 index 000000000000..69319b0f6161 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencekillchainphase.go @@ -0,0 +1,9 @@ +package threatintelligence + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligenceKillChainPhase struct { + KillChainName *string `json:"killChainName,omitempty"` + PhaseName *string `json:"phaseName,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetric.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetric.go new file mode 100644 index 000000000000..a6af38280393 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetric.go @@ -0,0 +1,11 @@ +package threatintelligence + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligenceMetric struct { + LastUpdatedTimeUtc *string `json:"lastUpdatedTimeUtc,omitempty"` + PatternTypeMetrics *[]ThreatIntelligenceMetricEntity `json:"patternTypeMetrics,omitempty"` + SourceMetrics *[]ThreatIntelligenceMetricEntity `json:"sourceMetrics,omitempty"` + ThreatTypeMetrics *[]ThreatIntelligenceMetricEntity `json:"threatTypeMetrics,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetricentity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetricentity.go new file mode 100644 index 000000000000..562f12dd822d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetricentity.go @@ -0,0 +1,9 @@ +package threatintelligence + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligenceMetricEntity struct { + MetricName *string `json:"metricName,omitempty"` + MetricValue *int64 `json:"metricValue,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetrics.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetrics.go new file mode 100644 index 000000000000..14a6959c8737 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetrics.go @@ -0,0 +1,8 @@ +package threatintelligence + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligenceMetrics struct { + Properties *ThreatIntelligenceMetric `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetricslist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetricslist.go new file mode 100644 index 000000000000..68025bf73cb1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetricslist.go @@ -0,0 +1,8 @@ +package threatintelligence + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligenceMetricsList struct { + Value []ThreatIntelligenceMetrics `json:"value"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceparsedpattern.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceparsedpattern.go new file mode 100644 index 000000000000..432ca8c997be --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceparsedpattern.go @@ -0,0 +1,9 @@ +package threatintelligence + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligenceParsedPattern struct { + PatternTypeKey *string `json:"patternTypeKey,omitempty"` + PatternTypeValues *[]ThreatIntelligenceParsedPatternTypeValue `json:"patternTypeValues,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceparsedpatterntypevalue.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceparsedpatterntypevalue.go new file mode 100644 index 000000000000..e65b31999037 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceparsedpatterntypevalue.go @@ -0,0 +1,9 @@ +package threatintelligence + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligenceParsedPatternTypeValue struct { + Value *string `json:"value,omitempty"` + ValueType *string `json:"valueType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencesortingcriteria.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencesortingcriteria.go new file mode 100644 index 000000000000..4b63a0af69ef --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencesortingcriteria.go @@ -0,0 +1,9 @@ +package threatintelligence + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligenceSortingCriteria struct { + ItemKey *string `json:"itemKey,omitempty"` + SortOrder *ThreatIntelligenceSortingOrder `json:"sortOrder,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/predicates.go new file mode 100644 index 000000000000..6020562ed4b7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/predicates.go @@ -0,0 +1,12 @@ +package threatintelligence + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligenceInformationOperationPredicate struct { +} + +func (p ThreatIntelligenceInformationOperationPredicate) Matches(input ThreatIntelligenceInformation) bool { + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/version.go new file mode 100644 index 000000000000..07547975f9ce --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/version.go @@ -0,0 +1,12 @@ +package threatintelligence + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/threatintelligence/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/README.md new file mode 100644 index 000000000000..0c691ae868e0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/README.md @@ -0,0 +1,90 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems` Documentation + +The `watchlistitems` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-11-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems" +``` + + +### Client Initialization + +```go +client := watchlistitems.NewWatchlistItemsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `WatchlistItemsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := watchlistitems.NewWatchlistItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue", "watchlistItemIdValue") + +payload := watchlistitems.WatchlistItem{ + // ... +} + + +read, err := client.CreateOrUpdate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `WatchlistItemsClient.Delete` + +```go +ctx := context.TODO() +id := watchlistitems.NewWatchlistItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue", "watchlistItemIdValue") + +read, err := client.Delete(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `WatchlistItemsClient.Get` + +```go +ctx := context.TODO() +id := watchlistitems.NewWatchlistItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue", "watchlistItemIdValue") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `WatchlistItemsClient.List` + +```go +ctx := context.TODO() +id := watchlistitems.NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/client.go new file mode 100644 index 000000000000..9403755456ec --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/client.go @@ -0,0 +1,18 @@ +package watchlistitems + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WatchlistItemsClient struct { + Client autorest.Client + baseUri string +} + +func NewWatchlistItemsClientWithBaseURI(endpoint string) WatchlistItemsClient { + return WatchlistItemsClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/id_watchlist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/id_watchlist.go new file mode 100644 index 000000000000..c2ad57d7be48 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/id_watchlist.go @@ -0,0 +1,142 @@ +package watchlistitems + +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 = WatchlistId{} + +// WatchlistId is a struct representing the Resource ID for a Watchlist +type WatchlistId struct { + SubscriptionId string + ResourceGroupName string + WorkspaceName string + WatchlistAlias string +} + +// NewWatchlistID returns a new WatchlistId struct +func NewWatchlistID(subscriptionId string, resourceGroupName string, workspaceName string, watchlistAlias string) WatchlistId { + return WatchlistId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + WorkspaceName: workspaceName, + WatchlistAlias: watchlistAlias, + } +} + +// ParseWatchlistID parses 'input' into a WatchlistId +func ParseWatchlistID(input string) (*WatchlistId, error) { + parser := resourceids.NewParserFromResourceIdType(WatchlistId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := WatchlistId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + if id.WatchlistAlias, ok = parsed.Parsed["watchlistAlias"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "watchlistAlias", *parsed) + } + + return &id, nil +} + +// ParseWatchlistIDInsensitively parses 'input' case-insensitively into a WatchlistId +// note: this method should only be used for API response data and not user input +func ParseWatchlistIDInsensitively(input string) (*WatchlistId, error) { + parser := resourceids.NewParserFromResourceIdType(WatchlistId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := WatchlistId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + if id.WatchlistAlias, ok = parsed.Parsed["watchlistAlias"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "watchlistAlias", *parsed) + } + + return &id, nil +} + +// ValidateWatchlistID checks that 'input' can be parsed as a Watchlist ID +func ValidateWatchlistID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseWatchlistID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Watchlist ID +func (id WatchlistId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/watchlists/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.WatchlistAlias) +} + +// Segments returns a slice of Resource ID Segments which comprise this Watchlist ID +func (id WatchlistId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), + resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), + resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), + resourceids.StaticSegment("staticProviders2", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), + resourceids.StaticSegment("staticWatchlists", "watchlists", "watchlists"), + resourceids.UserSpecifiedSegment("watchlistAlias", "watchlistAliasValue"), + } +} + +// String returns a human-readable description of this Watchlist ID +func (id WatchlistId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), + fmt.Sprintf("Watchlist Alias: %q", id.WatchlistAlias), + } + return fmt.Sprintf("Watchlist (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/id_watchlistitem.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/id_watchlistitem.go new file mode 100644 index 000000000000..d816793fdbb0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/id_watchlistitem.go @@ -0,0 +1,155 @@ +package watchlistitems + +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 = WatchlistItemId{} + +// WatchlistItemId is a struct representing the Resource ID for a Watchlist Item +type WatchlistItemId struct { + SubscriptionId string + ResourceGroupName string + WorkspaceName string + WatchlistAlias string + WatchlistItemId string +} + +// NewWatchlistItemID returns a new WatchlistItemId struct +func NewWatchlistItemID(subscriptionId string, resourceGroupName string, workspaceName string, watchlistAlias string, watchlistItemId string) WatchlistItemId { + return WatchlistItemId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + WorkspaceName: workspaceName, + WatchlistAlias: watchlistAlias, + WatchlistItemId: watchlistItemId, + } +} + +// ParseWatchlistItemID parses 'input' into a WatchlistItemId +func ParseWatchlistItemID(input string) (*WatchlistItemId, error) { + parser := resourceids.NewParserFromResourceIdType(WatchlistItemId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := WatchlistItemId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + if id.WatchlistAlias, ok = parsed.Parsed["watchlistAlias"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "watchlistAlias", *parsed) + } + + if id.WatchlistItemId, ok = parsed.Parsed["watchlistItemId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "watchlistItemId", *parsed) + } + + return &id, nil +} + +// ParseWatchlistItemIDInsensitively parses 'input' case-insensitively into a WatchlistItemId +// note: this method should only be used for API response data and not user input +func ParseWatchlistItemIDInsensitively(input string) (*WatchlistItemId, error) { + parser := resourceids.NewParserFromResourceIdType(WatchlistItemId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := WatchlistItemId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + if id.WatchlistAlias, ok = parsed.Parsed["watchlistAlias"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "watchlistAlias", *parsed) + } + + if id.WatchlistItemId, ok = parsed.Parsed["watchlistItemId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "watchlistItemId", *parsed) + } + + return &id, nil +} + +// ValidateWatchlistItemID checks that 'input' can be parsed as a Watchlist Item ID +func ValidateWatchlistItemID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseWatchlistItemID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Watchlist Item ID +func (id WatchlistItemId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/watchlists/%s/watchlistItems/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.WatchlistAlias, id.WatchlistItemId) +} + +// Segments returns a slice of Resource ID Segments which comprise this Watchlist Item ID +func (id WatchlistItemId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), + resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), + resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), + resourceids.StaticSegment("staticProviders2", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), + resourceids.StaticSegment("staticWatchlists", "watchlists", "watchlists"), + resourceids.UserSpecifiedSegment("watchlistAlias", "watchlistAliasValue"), + resourceids.StaticSegment("staticWatchlistItems", "watchlistItems", "watchlistItems"), + resourceids.UserSpecifiedSegment("watchlistItemId", "watchlistItemIdValue"), + } +} + +// String returns a human-readable description of this Watchlist Item ID +func (id WatchlistItemId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), + fmt.Sprintf("Watchlist Alias: %q", id.WatchlistAlias), + fmt.Sprintf("Watchlist Item: %q", id.WatchlistItemId), + } + return fmt.Sprintf("Watchlist Item (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/method_createorupdate_autorest.go new file mode 100644 index 000000000000..15d8fdcc2bec --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/method_createorupdate_autorest.go @@ -0,0 +1,69 @@ +package watchlistitems + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + HttpResponse *http.Response + Model *WatchlistItem +} + +// CreateOrUpdate ... +func (c WatchlistItemsClient) CreateOrUpdate(ctx context.Context, id WatchlistItemId, input WatchlistItem) (result CreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlistitems.WatchlistItemsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlistitems.WatchlistItemsClient", "CreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForCreateOrUpdate(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlistitems.WatchlistItemsClient", "CreateOrUpdate", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForCreateOrUpdate prepares the CreateOrUpdate request. +func (c WatchlistItemsClient) preparerForCreateOrUpdate(ctx context.Context, id WatchlistItemId, input WatchlistItem) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForCreateOrUpdate handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (c WatchlistItemsClient) responderForCreateOrUpdate(resp *http.Response) (result CreateOrUpdateOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/method_delete_autorest.go new file mode 100644 index 000000000000..c9b8c46f9e5d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/method_delete_autorest.go @@ -0,0 +1,66 @@ +package watchlistitems + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + HttpResponse *http.Response +} + +// Delete ... +func (c WatchlistItemsClient) Delete(ctx context.Context, id WatchlistItemId) (result DeleteOperationResponse, err error) { + req, err := c.preparerForDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlistitems.WatchlistItemsClient", "Delete", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlistitems.WatchlistItemsClient", "Delete", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDelete(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlistitems.WatchlistItemsClient", "Delete", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForDelete prepares the Delete request. +func (c WatchlistItemsClient) preparerForDelete(ctx context.Context, id WatchlistItemId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDelete handles the response to the Delete request. The method always +// closes the http.Response Body. +func (c WatchlistItemsClient) responderForDelete(resp *http.Response) (result DeleteOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/method_get_autorest.go new file mode 100644 index 000000000000..b294f999f647 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/method_get_autorest.go @@ -0,0 +1,68 @@ +package watchlistitems + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + Model *WatchlistItem +} + +// Get ... +func (c WatchlistItemsClient) Get(ctx context.Context, id WatchlistItemId) (result GetOperationResponse, err error) { + req, err := c.preparerForGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlistitems.WatchlistItemsClient", "Get", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlistitems.WatchlistItemsClient", "Get", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlistitems.WatchlistItemsClient", "Get", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGet prepares the Get request. +func (c WatchlistItemsClient) preparerForGet(ctx context.Context, id WatchlistItemId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGet handles the response to the Get request. The method always +// closes the http.Response Body. +func (c WatchlistItemsClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/method_list_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/method_list_autorest.go new file mode 100644 index 000000000000..d8e4bf85bf1d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/method_list_autorest.go @@ -0,0 +1,186 @@ +package watchlistitems + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + Model *[]WatchlistItem + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (ListOperationResponse, error) +} + +type ListCompleteResult struct { + Items []WatchlistItem +} + +func (r ListOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +// List ... +func (c WatchlistItemsClient) List(ctx context.Context, id WatchlistId) (resp ListOperationResponse, err error) { + req, err := c.preparerForList(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlistitems.WatchlistItemsClient", "List", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlistitems.WatchlistItemsClient", "List", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForList(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlistitems.WatchlistItemsClient", "List", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForList prepares the List request. +func (c WatchlistItemsClient) preparerForList(ctx context.Context, id WatchlistId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/watchlistItems", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForListWithNextLink prepares the List request with the given nextLink token. +func (c WatchlistItemsClient) preparerForListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForList handles the response to the List request. The method always +// closes the http.Response Body. +func (c WatchlistItemsClient) responderForList(resp *http.Response) (result ListOperationResponse, err error) { + type page struct { + Values []WatchlistItem `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListOperationResponse, err error) { + req, err := c.preparerForListWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlistitems.WatchlistItemsClient", "List", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlistitems.WatchlistItemsClient", "List", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlistitems.WatchlistItemsClient", "List", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// ListComplete retrieves all of the results into a single object +func (c WatchlistItemsClient) ListComplete(ctx context.Context, id WatchlistId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, WatchlistItemOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c WatchlistItemsClient) ListCompleteMatchingPredicate(ctx context.Context, id WatchlistId, predicate WatchlistItemOperationPredicate) (resp ListCompleteResult, err error) { + items := make([]WatchlistItem, 0) + + page, err := c.List(ctx, id) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := ListCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/model_userinfo.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/model_userinfo.go new file mode 100644 index 000000000000..9d03c24555b0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/model_userinfo.go @@ -0,0 +1,10 @@ +package watchlistitems + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UserInfo struct { + Email *string `json:"email,omitempty"` + Name *string `json:"name,omitempty"` + ObjectId *string `json:"objectId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/model_watchlistitem.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/model_watchlistitem.go new file mode 100644 index 000000000000..1b198fb819b9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/model_watchlistitem.go @@ -0,0 +1,17 @@ +package watchlistitems + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WatchlistItem struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *WatchlistItemProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/model_watchlistitemproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/model_watchlistitemproperties.go new file mode 100644 index 000000000000..77f219a0cce6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/model_watchlistitemproperties.go @@ -0,0 +1,47 @@ +package watchlistitems + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WatchlistItemProperties struct { + Created *string `json:"created,omitempty"` + CreatedBy *UserInfo `json:"createdBy,omitempty"` + EntityMapping *interface{} `json:"entityMapping,omitempty"` + IsDeleted *bool `json:"isDeleted,omitempty"` + ItemsKeyValue interface{} `json:"itemsKeyValue"` + TenantId *string `json:"tenantId,omitempty"` + Updated *string `json:"updated,omitempty"` + UpdatedBy *UserInfo `json:"updatedBy,omitempty"` + WatchlistItemId *string `json:"watchlistItemId,omitempty"` + WatchlistItemType *string `json:"watchlistItemType,omitempty"` +} + +func (o *WatchlistItemProperties) GetCreatedAsTime() (*time.Time, error) { + if o.Created == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") +} + +func (o *WatchlistItemProperties) SetCreatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Created = &formatted +} + +func (o *WatchlistItemProperties) GetUpdatedAsTime() (*time.Time, error) { + if o.Updated == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") +} + +func (o *WatchlistItemProperties) SetUpdatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Updated = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/predicates.go new file mode 100644 index 000000000000..d595873ebcfd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/predicates.go @@ -0,0 +1,32 @@ +package watchlistitems + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WatchlistItemOperationPredicate struct { + Etag *string + Id *string + Name *string + Type *string +} + +func (p WatchlistItemOperationPredicate) Matches(input WatchlistItem) bool { + + if p.Etag != nil && (input.Etag == nil && *p.Etag != *input.Etag) { + return false + } + + if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/version.go new file mode 100644 index 000000000000..ec616dc40971 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems/version.go @@ -0,0 +1,12 @@ +package watchlistitems + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/watchlistitems/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/README.md new file mode 100644 index 000000000000..3ba89e2e84ba --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/README.md @@ -0,0 +1,90 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists` Documentation + +The `watchlists` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-11-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists" +``` + + +### Client Initialization + +```go +client := watchlists.NewWatchlistsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `WatchlistsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := watchlists.NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue") + +payload := watchlists.Watchlist{ + // ... +} + + +read, err := client.CreateOrUpdate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `WatchlistsClient.Delete` + +```go +ctx := context.TODO() +id := watchlists.NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue") + +read, err := client.Delete(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `WatchlistsClient.Get` + +```go +ctx := context.TODO() +id := watchlists.NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `WatchlistsClient.List` + +```go +ctx := context.TODO() +id := watchlists.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/client.go new file mode 100644 index 000000000000..61cfa3d0ac3b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/client.go @@ -0,0 +1,18 @@ +package watchlists + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WatchlistsClient struct { + Client autorest.Client + baseUri string +} + +func NewWatchlistsClientWithBaseURI(endpoint string) WatchlistsClient { + return WatchlistsClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/constants.go new file mode 100644 index 000000000000..504c5ecef48a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/constants.go @@ -0,0 +1,34 @@ +package watchlists + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Source string + +const ( + SourceLocalFile Source = "Local file" + SourceRemoteStorage Source = "Remote storage" +) + +func PossibleValuesForSource() []string { + return []string{ + string(SourceLocalFile), + string(SourceRemoteStorage), + } +} + +func parseSource(input string) (*Source, error) { + vals := map[string]Source{ + "local file": SourceLocalFile, + "remote storage": SourceRemoteStorage, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Source(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/id_watchlist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/id_watchlist.go new file mode 100644 index 000000000000..7d34645a0671 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/id_watchlist.go @@ -0,0 +1,142 @@ +package watchlists + +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 = WatchlistId{} + +// WatchlistId is a struct representing the Resource ID for a Watchlist +type WatchlistId struct { + SubscriptionId string + ResourceGroupName string + WorkspaceName string + WatchlistAlias string +} + +// NewWatchlistID returns a new WatchlistId struct +func NewWatchlistID(subscriptionId string, resourceGroupName string, workspaceName string, watchlistAlias string) WatchlistId { + return WatchlistId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + WorkspaceName: workspaceName, + WatchlistAlias: watchlistAlias, + } +} + +// ParseWatchlistID parses 'input' into a WatchlistId +func ParseWatchlistID(input string) (*WatchlistId, error) { + parser := resourceids.NewParserFromResourceIdType(WatchlistId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := WatchlistId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + if id.WatchlistAlias, ok = parsed.Parsed["watchlistAlias"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "watchlistAlias", *parsed) + } + + return &id, nil +} + +// ParseWatchlistIDInsensitively parses 'input' case-insensitively into a WatchlistId +// note: this method should only be used for API response data and not user input +func ParseWatchlistIDInsensitively(input string) (*WatchlistId, error) { + parser := resourceids.NewParserFromResourceIdType(WatchlistId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := WatchlistId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + if id.WatchlistAlias, ok = parsed.Parsed["watchlistAlias"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "watchlistAlias", *parsed) + } + + return &id, nil +} + +// ValidateWatchlistID checks that 'input' can be parsed as a Watchlist ID +func ValidateWatchlistID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseWatchlistID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Watchlist ID +func (id WatchlistId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/watchlists/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.WatchlistAlias) +} + +// Segments returns a slice of Resource ID Segments which comprise this Watchlist ID +func (id WatchlistId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), + resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), + resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), + resourceids.StaticSegment("staticProviders2", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), + resourceids.StaticSegment("staticWatchlists", "watchlists", "watchlists"), + resourceids.UserSpecifiedSegment("watchlistAlias", "watchlistAliasValue"), + } +} + +// String returns a human-readable description of this Watchlist ID +func (id WatchlistId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), + fmt.Sprintf("Watchlist Alias: %q", id.WatchlistAlias), + } + return fmt.Sprintf("Watchlist (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/id_workspace.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/id_workspace.go new file mode 100644 index 000000000000..488ed03ba59b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/id_workspace.go @@ -0,0 +1,127 @@ +package watchlists + +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 = WorkspaceId{} + +// WorkspaceId is a struct representing the Resource ID for a Workspace +type WorkspaceId struct { + SubscriptionId string + ResourceGroupName string + WorkspaceName string +} + +// NewWorkspaceID returns a new WorkspaceId struct +func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { + return WorkspaceId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + WorkspaceName: workspaceName, + } +} + +// ParseWorkspaceID parses 'input' into a WorkspaceId +func ParseWorkspaceID(input string) (*WorkspaceId, error) { + parser := resourceids.NewParserFromResourceIdType(WorkspaceId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := WorkspaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + return &id, nil +} + +// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId +// note: this method should only be used for API response data and not user input +func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { + parser := resourceids.NewParserFromResourceIdType(WorkspaceId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := WorkspaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) + } + + return &id, nil +} + +// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID +func ValidateWorkspaceID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseWorkspaceID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Workspace ID +func (id WorkspaceId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Workspace ID +func (id WorkspaceId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), + resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), + resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), + } +} + +// String returns a human-readable description of this Workspace ID +func (id WorkspaceId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), + } + return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/method_createorupdate_autorest.go new file mode 100644 index 000000000000..e6d8a5976b83 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/method_createorupdate_autorest.go @@ -0,0 +1,69 @@ +package watchlists + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + HttpResponse *http.Response + Model *Watchlist +} + +// CreateOrUpdate ... +func (c WatchlistsClient) CreateOrUpdate(ctx context.Context, id WatchlistId, input Watchlist) (result CreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlists.WatchlistsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlists.WatchlistsClient", "CreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForCreateOrUpdate(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlists.WatchlistsClient", "CreateOrUpdate", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForCreateOrUpdate prepares the CreateOrUpdate request. +func (c WatchlistsClient) preparerForCreateOrUpdate(ctx context.Context, id WatchlistId, input Watchlist) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForCreateOrUpdate handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (c WatchlistsClient) responderForCreateOrUpdate(resp *http.Response) (result CreateOrUpdateOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/method_delete_autorest.go new file mode 100644 index 000000000000..56234124b824 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/method_delete_autorest.go @@ -0,0 +1,66 @@ +package watchlists + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + HttpResponse *http.Response +} + +// Delete ... +func (c WatchlistsClient) Delete(ctx context.Context, id WatchlistId) (result DeleteOperationResponse, err error) { + req, err := c.preparerForDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlists.WatchlistsClient", "Delete", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlists.WatchlistsClient", "Delete", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDelete(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlists.WatchlistsClient", "Delete", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForDelete prepares the Delete request. +func (c WatchlistsClient) preparerForDelete(ctx context.Context, id WatchlistId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDelete handles the response to the Delete request. The method always +// closes the http.Response Body. +func (c WatchlistsClient) responderForDelete(resp *http.Response) (result DeleteOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/method_get_autorest.go new file mode 100644 index 000000000000..d7253f62215f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/method_get_autorest.go @@ -0,0 +1,68 @@ +package watchlists + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + Model *Watchlist +} + +// Get ... +func (c WatchlistsClient) Get(ctx context.Context, id WatchlistId) (result GetOperationResponse, err error) { + req, err := c.preparerForGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlists.WatchlistsClient", "Get", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlists.WatchlistsClient", "Get", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlists.WatchlistsClient", "Get", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGet prepares the Get request. +func (c WatchlistsClient) preparerForGet(ctx context.Context, id WatchlistId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGet handles the response to the Get request. The method always +// closes the http.Response Body. +func (c WatchlistsClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/method_list_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/method_list_autorest.go new file mode 100644 index 000000000000..a3a2c27c15ef --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/method_list_autorest.go @@ -0,0 +1,186 @@ +package watchlists + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + Model *[]Watchlist + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (ListOperationResponse, error) +} + +type ListCompleteResult struct { + Items []Watchlist +} + +func (r ListOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +// List ... +func (c WatchlistsClient) List(ctx context.Context, id WorkspaceId) (resp ListOperationResponse, err error) { + req, err := c.preparerForList(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlists.WatchlistsClient", "List", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlists.WatchlistsClient", "List", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForList(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlists.WatchlistsClient", "List", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForList prepares the List request. +func (c WatchlistsClient) preparerForList(ctx context.Context, id WorkspaceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/watchlists", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForListWithNextLink prepares the List request with the given nextLink token. +func (c WatchlistsClient) preparerForListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForList handles the response to the List request. The method always +// closes the http.Response Body. +func (c WatchlistsClient) responderForList(resp *http.Response) (result ListOperationResponse, err error) { + type page struct { + Values []Watchlist `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListOperationResponse, err error) { + req, err := c.preparerForListWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlists.WatchlistsClient", "List", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlists.WatchlistsClient", "List", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "watchlists.WatchlistsClient", "List", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// ListComplete retrieves all of the results into a single object +func (c WatchlistsClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, WatchlistOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c WatchlistsClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate WatchlistOperationPredicate) (resp ListCompleteResult, err error) { + items := make([]Watchlist, 0) + + page, err := c.List(ctx, id) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := ListCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/model_userinfo.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/model_userinfo.go new file mode 100644 index 000000000000..5c0e0c296176 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/model_userinfo.go @@ -0,0 +1,10 @@ +package watchlists + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UserInfo struct { + Email *string `json:"email,omitempty"` + Name *string `json:"name,omitempty"` + ObjectId *string `json:"objectId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/model_watchlist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/model_watchlist.go new file mode 100644 index 000000000000..2c34c33bb588 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/model_watchlist.go @@ -0,0 +1,17 @@ +package watchlists + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Watchlist struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *WatchlistProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/model_watchlistproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/model_watchlistproperties.go new file mode 100644 index 000000000000..9d5c01a1dbc3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/model_watchlistproperties.go @@ -0,0 +1,57 @@ +package watchlists + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WatchlistProperties struct { + ContentType *string `json:"contentType,omitempty"` + Created *string `json:"created,omitempty"` + CreatedBy *UserInfo `json:"createdBy,omitempty"` + DefaultDuration *string `json:"defaultDuration,omitempty"` + Description *string `json:"description,omitempty"` + DisplayName string `json:"displayName"` + IsDeleted *bool `json:"isDeleted,omitempty"` + ItemsSearchKey string `json:"itemsSearchKey"` + Labels *[]string `json:"labels,omitempty"` + NumberOfLinesToSkip *int64 `json:"numberOfLinesToSkip,omitempty"` + Provider string `json:"provider"` + RawContent *string `json:"rawContent,omitempty"` + Source Source `json:"source"` + TenantId *string `json:"tenantId,omitempty"` + Updated *string `json:"updated,omitempty"` + UpdatedBy *UserInfo `json:"updatedBy,omitempty"` + UploadStatus *string `json:"uploadStatus,omitempty"` + WatchlistAlias *string `json:"watchlistAlias,omitempty"` + WatchlistId *string `json:"watchlistId,omitempty"` + WatchlistType *string `json:"watchlistType,omitempty"` +} + +func (o *WatchlistProperties) GetCreatedAsTime() (*time.Time, error) { + if o.Created == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") +} + +func (o *WatchlistProperties) SetCreatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Created = &formatted +} + +func (o *WatchlistProperties) GetUpdatedAsTime() (*time.Time, error) { + if o.Updated == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") +} + +func (o *WatchlistProperties) SetUpdatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Updated = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/predicates.go new file mode 100644 index 000000000000..1b743bb52b6a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/predicates.go @@ -0,0 +1,32 @@ +package watchlists + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WatchlistOperationPredicate struct { + Etag *string + Id *string + Name *string + Type *string +} + +func (p WatchlistOperationPredicate) Matches(input Watchlist) bool { + + if p.Etag != nil && (input.Etag == nil && *p.Etag != *input.Etag) { + return false + } + + if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/version.go new file mode 100644 index 000000000000..788356a761df --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists/version.go @@ -0,0 +1,12 @@ +package watchlists + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/watchlists/%s", defaultApiVersion) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index ca1940e95aca..e618d6bea9b1 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -546,10 +546,16 @@ github.com/hashicorp/go-azure-sdk/resource-manager/search/2022-09-01/querykeys github.com/hashicorp/go-azure-sdk/resource-manager/search/2022-09-01/services github.com/hashicorp/go-azure-sdk/resource-manager/search/2022-09-01/sharedprivatelinkresources github.com/hashicorp/go-azure-sdk/resource-manager/security/2023-01-01/pricings +github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-10-01-preview/alertrules github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-10-01-preview/automationrules github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-10-01-preview/metadata +github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors +github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/sentinelonboardingstates +github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence +github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems +github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists github.com/hashicorp/go-azure-sdk/resource-manager/servicebus/2021-06-01-preview/disasterrecoveryconfigs github.com/hashicorp/go-azure-sdk/resource-manager/servicebus/2021-06-01-preview/namespacesauthorizationrule github.com/hashicorp/go-azure-sdk/resource-manager/servicebus/2021-06-01-preview/queues From 7560fe14fdc48f1986b996c31c21d04224b27a5a Mon Sep 17 00:00:00 2001 From: kt Date: Thu, 25 May 2023 22:29:28 -0700 Subject: [PATCH 2/4] go mod tidy --- .../alertruletemplates/README.md | 53 --- .../alertruletemplates/client.go | 18 - .../alertruletemplates/constants.go | 353 ------------------ .../id_alertruletemplate.go | 142 ------- .../alertruletemplates/id_workspace.go | 127 ------- .../method_alertruletemplatesget_autorest.go | 77 ---- .../method_alertruletemplateslist_autorest.go | 196 ---------- .../model_alertdetailsoverride.go | 11 - .../model_alertruletemplate.go | 88 ----- .../model_alertruletemplatedatasource.go | 9 - .../alertruletemplates/model_entitymapping.go | 9 - .../model_eventgroupingsettings.go | 8 - .../alertruletemplates/model_fieldmapping.go | 9 - .../model_fusionalertruletemplate.go | 47 --- ...model_fusionalertruletemplateproperties.go | 46 --- ...curityincidentcreationalertruletemplate.go | 47 --- ...dentcreationalertruletemplateproperties.go | 45 --- ...el_mlbehavioranalyticsalertruletemplate.go | 47 --- ...ioranalyticsalertruletemplateproperties.go | 46 --- .../model_nrtalertruletemplate.go | 47 --- .../model_nrtalertruletemplateproperties.go | 51 --- .../model_scheduledalertruletemplate.go | 47 --- ...el_scheduledalertruletemplateproperties.go | 56 --- ...del_threatintelligencealertruletemplate.go | 47 --- ...intelligencealertruletemplateproperties.go | 46 --- .../alertruletemplates/predicates.go | 12 - .../alertruletemplates/version.go | 12 - .../2022-11-01/dataconnectors/README.md | 90 ----- .../2022-11-01/dataconnectors/client.go | 18 - .../2022-11-01/dataconnectors/constants.go | 80 ---- .../dataconnectors/id_dataconnector.go | 142 ------- .../2022-11-01/dataconnectors/id_workspace.go | 127 ------- ...d_dataconnectorscreateorupdate_autorest.go | 78 ---- .../method_dataconnectorsdelete_autorest.go | 66 ---- .../method_dataconnectorsget_autorest.go | 77 ---- .../method_dataconnectorslist_autorest.go | 196 ---------- .../dataconnectors/model_aaddataconnector.go | 48 --- .../model_aaddataconnectorproperties.go | 9 - .../dataconnectors/model_aatpdataconnector.go | 48 --- .../model_aatpdataconnectorproperties.go | 9 - .../model_alertsdatatypeofdataconnector.go | 8 - .../dataconnectors/model_ascdataconnector.go | 48 --- .../model_ascdataconnectorproperties.go | 9 - .../model_awscloudtraildataconnector.go | 48 --- ...del_awscloudtraildataconnectordatatypes.go | 8 - ...el_awscloudtraildataconnectorproperties.go | 9 - .../dataconnectors/model_dataconnector.go | 104 ------ .../model_dataconnectordatatypecommon.go | 8 - .../dataconnectors/model_mcasdataconnector.go | 48 --- .../model_mcasdataconnectordatatypes.go | 9 - .../model_mcasdataconnectorproperties.go | 9 - .../model_mdatpdataconnector.go | 48 --- .../model_mdatpdataconnectorproperties.go | 9 - .../model_officedataconnector.go | 48 --- .../model_officedataconnectordatatypes.go | 10 - .../model_officedataconnectorproperties.go | 9 - .../dataconnectors/model_tidataconnector.go | 48 --- .../model_tidataconnectordatatypes.go | 8 - .../model_tidataconnectorproperties.go | 28 -- .../2022-11-01/dataconnectors/predicates.go | 12 - .../2022-11-01/dataconnectors/version.go | 12 - .../securitymlanalyticssettings/README.md | 90 ----- .../securitymlanalyticssettings/client.go | 18 - .../securitymlanalyticssettings/constants.go | 132 ------- .../id_securitymlanalyticssetting.go | 142 ------- .../id_workspace.go | 127 ------- ...nalyticssettingscreateorupdate_autorest.go | 78 ---- ...uritymlanalyticssettingsdelete_autorest.go | 66 ---- ...securitymlanalyticssettingsget_autorest.go | 77 ---- ...ecuritymlanalyticssettingslist_autorest.go | 196 ---------- ...odel_anomalysecuritymlanalyticssettings.go | 48 --- ...lysecuritymlanalyticssettingsproperties.go | 39 -- .../model_securitymlanalyticssetting.go | 48 --- ...l_securitymlanalyticssettingsdatasource.go | 9 - .../securitymlanalyticssettings/predicates.go | 12 - .../securitymlanalyticssettings/version.go | 12 - .../2022-11-01/threatintelligence/README.md | 191 ---------- .../2022-11-01/threatintelligence/client.go | 18 - .../threatintelligence/constants.go | 62 --- .../threatintelligence/id_indicator.go | 144 ------- .../threatintelligence/id_workspace.go | 127 ------- .../method_indicatorappendtags_autorest.go | 68 ---- .../method_indicatorcreate_autorest.go | 78 ---- ...ethod_indicatorcreateindicator_autorest.go | 79 ---- .../method_indicatordelete_autorest.go | 66 ---- .../method_indicatorget_autorest.go | 77 ---- .../method_indicatormetricslist_autorest.go | 69 ---- ...ethod_indicatorqueryindicators_autorest.go | 197 ---------- .../method_indicatorreplacetags_autorest.go | 79 ---- .../method_indicatorslist_autorest.go | 235 ------------ .../model_threatintelligenceappendtags.go | 8 - ...del_threatintelligenceexternalreference.go | 12 - ...del_threatintelligencefilteringcriteria.go | 20 - ..._threatintelligencegranularmarkingmodel.go | 10 - .../model_threatintelligenceindicatormodel.go | 48 --- ...l_threatintelligenceindicatorproperties.go | 37 -- .../model_threatintelligenceinformation.go | 48 --- .../model_threatintelligencekillchainphase.go | 9 - .../model_threatintelligencemetric.go | 11 - .../model_threatintelligencemetricentity.go | 9 - .../model_threatintelligencemetrics.go | 8 - .../model_threatintelligencemetricslist.go | 8 - .../model_threatintelligenceparsedpattern.go | 9 - ...hreatintelligenceparsedpatterntypevalue.go | 9 - ...model_threatintelligencesortingcriteria.go | 9 - .../threatintelligence/predicates.go | 12 - .../2022-11-01/threatintelligence/version.go | 12 - vendor/modules.txt | 4 - 108 files changed, 6091 deletions(-) delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_alertruletemplate.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_workspace.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/method_alertruletemplatesget_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/method_alertruletemplateslist_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertdetailsoverride.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplate.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplatedatasource.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_entitymapping.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_eventgroupingsettings.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fieldmapping.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplate.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplateproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplate.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplateproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplate.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplateproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplate.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplateproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplate.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplateproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplate.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplateproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/predicates.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/version.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/id_dataconnector.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/id_workspace.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorscreateorupdate_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorsdelete_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorsget_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorslist_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aaddataconnector.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aaddataconnectorproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aatpdataconnector.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aatpdataconnectorproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_alertsdatatypeofdataconnector.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_ascdataconnector.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_ascdataconnectorproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnector.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnectordatatypes.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnectorproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_dataconnector.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_dataconnectordatatypecommon.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnector.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnectordatatypes.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnectorproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mdatpdataconnector.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mdatpdataconnectorproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnector.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnectordatatypes.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnectorproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnector.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnectordatatypes.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnectorproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/predicates.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/version.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_workspace.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingscreateorupdate_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingsdelete_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingsget_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingslist_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettings.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettingsproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_securitymlanalyticssetting.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_securitymlanalyticssettingsdatasource.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/predicates.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/version.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/id_indicator.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/id_workspace.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorappendtags_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorcreate_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorcreateindicator_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatordelete_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorget_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatormetricslist_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorqueryindicators_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorreplacetags_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorslist_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceappendtags.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceexternalreference.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencefilteringcriteria.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencegranularmarkingmodel.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceindicatormodel.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceindicatorproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceinformation.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencekillchainphase.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetric.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetricentity.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetrics.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetricslist.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceparsedpattern.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceparsedpatterntypevalue.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencesortingcriteria.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/predicates.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/version.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/README.md deleted file mode 100644 index 70edfc2f92f0..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates` Documentation - -The `alertruletemplates` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-preview`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates" -``` - - -### Client Initialization - -```go -client := alertruletemplates.NewAlertRuleTemplatesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AlertRuleTemplatesClient.AlertRuleTemplatesGet` - -```go -ctx := context.TODO() -id := alertruletemplates.NewAlertRuleTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "alertRuleTemplateIdValue") - -read, err := client.AlertRuleTemplatesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `AlertRuleTemplatesClient.AlertRuleTemplatesList` - -```go -ctx := context.TODO() -id := alertruletemplates.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// alternatively `client.AlertRuleTemplatesList(ctx, id)` can be used to do batched pagination -items, err := client.AlertRuleTemplatesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/client.go deleted file mode 100644 index c439e5a41c7c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package alertruletemplates - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertRuleTemplatesClient struct { - Client autorest.Client - baseUri string -} - -func NewAlertRuleTemplatesClientWithBaseURI(endpoint string) AlertRuleTemplatesClient { - return AlertRuleTemplatesClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/constants.go deleted file mode 100644 index bf41995ac98f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/constants.go +++ /dev/null @@ -1,353 +0,0 @@ -package alertruletemplates - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertRuleKind string - -const ( - AlertRuleKindFusion AlertRuleKind = "Fusion" - AlertRuleKindMLBehaviorAnalytics AlertRuleKind = "MLBehaviorAnalytics" - AlertRuleKindMicrosoftSecurityIncidentCreation AlertRuleKind = "MicrosoftSecurityIncidentCreation" - AlertRuleKindNRT AlertRuleKind = "NRT" - AlertRuleKindScheduled AlertRuleKind = "Scheduled" - AlertRuleKindThreatIntelligence AlertRuleKind = "ThreatIntelligence" -) - -func PossibleValuesForAlertRuleKind() []string { - return []string{ - string(AlertRuleKindFusion), - string(AlertRuleKindMLBehaviorAnalytics), - string(AlertRuleKindMicrosoftSecurityIncidentCreation), - string(AlertRuleKindNRT), - string(AlertRuleKindScheduled), - string(AlertRuleKindThreatIntelligence), - } -} - -func parseAlertRuleKind(input string) (*AlertRuleKind, error) { - vals := map[string]AlertRuleKind{ - "fusion": AlertRuleKindFusion, - "mlbehavioranalytics": AlertRuleKindMLBehaviorAnalytics, - "microsoftsecurityincidentcreation": AlertRuleKindMicrosoftSecurityIncidentCreation, - "nrt": AlertRuleKindNRT, - "scheduled": AlertRuleKindScheduled, - "threatintelligence": AlertRuleKindThreatIntelligence, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertRuleKind(input) - return &out, nil -} - -type AlertSeverity string - -const ( - AlertSeverityHigh AlertSeverity = "High" - AlertSeverityInformational AlertSeverity = "Informational" - AlertSeverityLow AlertSeverity = "Low" - AlertSeverityMedium AlertSeverity = "Medium" -) - -func PossibleValuesForAlertSeverity() []string { - return []string{ - string(AlertSeverityHigh), - string(AlertSeverityInformational), - string(AlertSeverityLow), - string(AlertSeverityMedium), - } -} - -func parseAlertSeverity(input string) (*AlertSeverity, error) { - vals := map[string]AlertSeverity{ - "high": AlertSeverityHigh, - "informational": AlertSeverityInformational, - "low": AlertSeverityLow, - "medium": AlertSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertSeverity(input) - return &out, nil -} - -type AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - } -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type EntityMappingType string - -const ( - EntityMappingTypeAccount EntityMappingType = "Account" - EntityMappingTypeAzureResource EntityMappingType = "AzureResource" - EntityMappingTypeCloudApplication EntityMappingType = "CloudApplication" - EntityMappingTypeDNS EntityMappingType = "DNS" - EntityMappingTypeFile EntityMappingType = "File" - EntityMappingTypeFileHash EntityMappingType = "FileHash" - EntityMappingTypeHost EntityMappingType = "Host" - EntityMappingTypeIP EntityMappingType = "IP" - EntityMappingTypeMailCluster EntityMappingType = "MailCluster" - EntityMappingTypeMailMessage EntityMappingType = "MailMessage" - EntityMappingTypeMailbox EntityMappingType = "Mailbox" - EntityMappingTypeMalware EntityMappingType = "Malware" - EntityMappingTypeProcess EntityMappingType = "Process" - EntityMappingTypeRegistryKey EntityMappingType = "RegistryKey" - EntityMappingTypeRegistryValue EntityMappingType = "RegistryValue" - EntityMappingTypeSecurityGroup EntityMappingType = "SecurityGroup" - EntityMappingTypeSubmissionMail EntityMappingType = "SubmissionMail" - EntityMappingTypeURL EntityMappingType = "URL" -) - -func PossibleValuesForEntityMappingType() []string { - return []string{ - string(EntityMappingTypeAccount), - string(EntityMappingTypeAzureResource), - string(EntityMappingTypeCloudApplication), - string(EntityMappingTypeDNS), - string(EntityMappingTypeFile), - string(EntityMappingTypeFileHash), - string(EntityMappingTypeHost), - string(EntityMappingTypeIP), - string(EntityMappingTypeMailCluster), - string(EntityMappingTypeMailMessage), - string(EntityMappingTypeMailbox), - string(EntityMappingTypeMalware), - string(EntityMappingTypeProcess), - string(EntityMappingTypeRegistryKey), - string(EntityMappingTypeRegistryValue), - string(EntityMappingTypeSecurityGroup), - string(EntityMappingTypeSubmissionMail), - string(EntityMappingTypeURL), - } -} - -func parseEntityMappingType(input string) (*EntityMappingType, error) { - vals := map[string]EntityMappingType{ - "account": EntityMappingTypeAccount, - "azureresource": EntityMappingTypeAzureResource, - "cloudapplication": EntityMappingTypeCloudApplication, - "dns": EntityMappingTypeDNS, - "file": EntityMappingTypeFile, - "filehash": EntityMappingTypeFileHash, - "host": EntityMappingTypeHost, - "ip": EntityMappingTypeIP, - "mailcluster": EntityMappingTypeMailCluster, - "mailmessage": EntityMappingTypeMailMessage, - "mailbox": EntityMappingTypeMailbox, - "malware": EntityMappingTypeMalware, - "process": EntityMappingTypeProcess, - "registrykey": EntityMappingTypeRegistryKey, - "registryvalue": EntityMappingTypeRegistryValue, - "securitygroup": EntityMappingTypeSecurityGroup, - "submissionmail": EntityMappingTypeSubmissionMail, - "url": EntityMappingTypeURL, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityMappingType(input) - return &out, nil -} - -type EventGroupingAggregationKind string - -const ( - EventGroupingAggregationKindAlertPerResult EventGroupingAggregationKind = "AlertPerResult" - EventGroupingAggregationKindSingleAlert EventGroupingAggregationKind = "SingleAlert" -) - -func PossibleValuesForEventGroupingAggregationKind() []string { - return []string{ - string(EventGroupingAggregationKindAlertPerResult), - string(EventGroupingAggregationKindSingleAlert), - } -} - -func parseEventGroupingAggregationKind(input string) (*EventGroupingAggregationKind, error) { - vals := map[string]EventGroupingAggregationKind{ - "alertperresult": EventGroupingAggregationKindAlertPerResult, - "singlealert": EventGroupingAggregationKindSingleAlert, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EventGroupingAggregationKind(input) - return &out, nil -} - -type MicrosoftSecurityProductName string - -const ( - MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection MicrosoftSecurityProductName = "Azure Active Directory Identity Protection" - MicrosoftSecurityProductNameAzureAdvancedThreatProtection MicrosoftSecurityProductName = "Azure Advanced Threat Protection" - MicrosoftSecurityProductNameAzureSecurityCenter MicrosoftSecurityProductName = "Azure Security Center" - MicrosoftSecurityProductNameAzureSecurityCenterForIoT MicrosoftSecurityProductName = "Azure Security Center for IoT" - MicrosoftSecurityProductNameMicrosoftCloudAppSecurity MicrosoftSecurityProductName = "Microsoft Cloud App Security" - MicrosoftSecurityProductNameMicrosoftDefenderAdvancedThreatProtection MicrosoftSecurityProductName = "Microsoft Defender Advanced Threat Protection" - MicrosoftSecurityProductNameOfficeThreeSixFiveAdvancedThreatProtection MicrosoftSecurityProductName = "Office 365 Advanced Threat Protection" -) - -func PossibleValuesForMicrosoftSecurityProductName() []string { - return []string{ - string(MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection), - string(MicrosoftSecurityProductNameAzureAdvancedThreatProtection), - string(MicrosoftSecurityProductNameAzureSecurityCenter), - string(MicrosoftSecurityProductNameAzureSecurityCenterForIoT), - string(MicrosoftSecurityProductNameMicrosoftCloudAppSecurity), - string(MicrosoftSecurityProductNameMicrosoftDefenderAdvancedThreatProtection), - string(MicrosoftSecurityProductNameOfficeThreeSixFiveAdvancedThreatProtection), - } -} - -func parseMicrosoftSecurityProductName(input string) (*MicrosoftSecurityProductName, error) { - vals := map[string]MicrosoftSecurityProductName{ - "azure active directory identity protection": MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection, - "azure advanced threat protection": MicrosoftSecurityProductNameAzureAdvancedThreatProtection, - "azure security center": MicrosoftSecurityProductNameAzureSecurityCenter, - "azure security center for iot": MicrosoftSecurityProductNameAzureSecurityCenterForIoT, - "microsoft cloud app security": MicrosoftSecurityProductNameMicrosoftCloudAppSecurity, - "microsoft defender advanced threat protection": MicrosoftSecurityProductNameMicrosoftDefenderAdvancedThreatProtection, - "office 365 advanced threat protection": MicrosoftSecurityProductNameOfficeThreeSixFiveAdvancedThreatProtection, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := MicrosoftSecurityProductName(input) - return &out, nil -} - -type TemplateStatus string - -const ( - TemplateStatusAvailable TemplateStatus = "Available" - TemplateStatusInstalled TemplateStatus = "Installed" - TemplateStatusNotAvailable TemplateStatus = "NotAvailable" -) - -func PossibleValuesForTemplateStatus() []string { - return []string{ - string(TemplateStatusAvailable), - string(TemplateStatusInstalled), - string(TemplateStatusNotAvailable), - } -} - -func parseTemplateStatus(input string) (*TemplateStatus, error) { - vals := map[string]TemplateStatus{ - "available": TemplateStatusAvailable, - "installed": TemplateStatusInstalled, - "notavailable": TemplateStatusNotAvailable, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TemplateStatus(input) - return &out, nil -} - -type TriggerOperator string - -const ( - TriggerOperatorEqual TriggerOperator = "Equal" - TriggerOperatorGreaterThan TriggerOperator = "GreaterThan" - TriggerOperatorLessThan TriggerOperator = "LessThan" - TriggerOperatorNotEqual TriggerOperator = "NotEqual" -) - -func PossibleValuesForTriggerOperator() []string { - return []string{ - string(TriggerOperatorEqual), - string(TriggerOperatorGreaterThan), - string(TriggerOperatorLessThan), - string(TriggerOperatorNotEqual), - } -} - -func parseTriggerOperator(input string) (*TriggerOperator, error) { - vals := map[string]TriggerOperator{ - "equal": TriggerOperatorEqual, - "greaterthan": TriggerOperatorGreaterThan, - "lessthan": TriggerOperatorLessThan, - "notequal": TriggerOperatorNotEqual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TriggerOperator(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_alertruletemplate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_alertruletemplate.go deleted file mode 100644 index 106e81ff68dc..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_alertruletemplate.go +++ /dev/null @@ -1,142 +0,0 @@ -package alertruletemplates - -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 = AlertRuleTemplateId{} - -// AlertRuleTemplateId is a struct representing the Resource ID for a Alert Rule Template -type AlertRuleTemplateId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - AlertRuleTemplateId string -} - -// NewAlertRuleTemplateID returns a new AlertRuleTemplateId struct -func NewAlertRuleTemplateID(subscriptionId string, resourceGroupName string, workspaceName string, alertRuleTemplateId string) AlertRuleTemplateId { - return AlertRuleTemplateId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - AlertRuleTemplateId: alertRuleTemplateId, - } -} - -// ParseAlertRuleTemplateID parses 'input' into a AlertRuleTemplateId -func ParseAlertRuleTemplateID(input string) (*AlertRuleTemplateId, error) { - parser := resourceids.NewParserFromResourceIdType(AlertRuleTemplateId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := AlertRuleTemplateId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) - } - - if id.AlertRuleTemplateId, ok = parsed.Parsed["alertRuleTemplateId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "alertRuleTemplateId", *parsed) - } - - return &id, nil -} - -// ParseAlertRuleTemplateIDInsensitively parses 'input' case-insensitively into a AlertRuleTemplateId -// note: this method should only be used for API response data and not user input -func ParseAlertRuleTemplateIDInsensitively(input string) (*AlertRuleTemplateId, error) { - parser := resourceids.NewParserFromResourceIdType(AlertRuleTemplateId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := AlertRuleTemplateId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) - } - - if id.AlertRuleTemplateId, ok = parsed.Parsed["alertRuleTemplateId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "alertRuleTemplateId", *parsed) - } - - return &id, nil -} - -// ValidateAlertRuleTemplateID checks that 'input' can be parsed as a Alert Rule Template ID -func ValidateAlertRuleTemplateID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseAlertRuleTemplateID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Alert Rule Template ID -func (id AlertRuleTemplateId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/alertRuleTemplates/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.AlertRuleTemplateId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Alert Rule Template ID -func (id AlertRuleTemplateId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticAlertRuleTemplates", "alertRuleTemplates", "alertRuleTemplates"), - resourceids.UserSpecifiedSegment("alertRuleTemplateId", "alertRuleTemplateIdValue"), - } -} - -// String returns a human-readable description of this Alert Rule Template ID -func (id AlertRuleTemplateId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Alert Rule Template: %q", id.AlertRuleTemplateId), - } - return fmt.Sprintf("Alert Rule Template (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_workspace.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_workspace.go deleted file mode 100644 index 20a51851397a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_workspace.go +++ /dev/null @@ -1,127 +0,0 @@ -package alertruletemplates - -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 = WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := WorkspaceId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := WorkspaceId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) - } - - return &id, nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/method_alertruletemplatesget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/method_alertruletemplatesget_autorest.go deleted file mode 100644 index dd9df8dbdb85..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/method_alertruletemplatesget_autorest.go +++ /dev/null @@ -1,77 +0,0 @@ -package alertruletemplates - -import ( - "context" - "encoding/json" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertRuleTemplatesGetOperationResponse struct { - HttpResponse *http.Response - Model *AlertRuleTemplate -} - -// AlertRuleTemplatesGet ... -func (c AlertRuleTemplatesClient) AlertRuleTemplatesGet(ctx context.Context, id AlertRuleTemplateId) (result AlertRuleTemplatesGetOperationResponse, err error) { - req, err := c.preparerForAlertRuleTemplatesGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "alertruletemplates.AlertRuleTemplatesClient", "AlertRuleTemplatesGet", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "alertruletemplates.AlertRuleTemplatesClient", "AlertRuleTemplatesGet", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForAlertRuleTemplatesGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "alertruletemplates.AlertRuleTemplatesClient", "AlertRuleTemplatesGet", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForAlertRuleTemplatesGet prepares the AlertRuleTemplatesGet request. -func (c AlertRuleTemplatesClient) preparerForAlertRuleTemplatesGet(ctx context.Context, id AlertRuleTemplateId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForAlertRuleTemplatesGet handles the response to the AlertRuleTemplatesGet request. The method always -// closes the http.Response Body. -func (c AlertRuleTemplatesClient) responderForAlertRuleTemplatesGet(resp *http.Response) (result AlertRuleTemplatesGetOperationResponse, err error) { - var respObj json.RawMessage - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - if err != nil { - return - } - model, err := unmarshalAlertRuleTemplateImplementation(respObj) - if err != nil { - return - } - result.Model = &model - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/method_alertruletemplateslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/method_alertruletemplateslist_autorest.go deleted file mode 100644 index 17a9ea43de8b..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/method_alertruletemplateslist_autorest.go +++ /dev/null @@ -1,196 +0,0 @@ -package alertruletemplates - -import ( - "context" - "encoding/json" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertRuleTemplatesListOperationResponse struct { - HttpResponse *http.Response - Model *[]AlertRuleTemplate - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (AlertRuleTemplatesListOperationResponse, error) -} - -type AlertRuleTemplatesListCompleteResult struct { - Items []AlertRuleTemplate -} - -func (r AlertRuleTemplatesListOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r AlertRuleTemplatesListOperationResponse) LoadMore(ctx context.Context) (resp AlertRuleTemplatesListOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -// AlertRuleTemplatesList ... -func (c AlertRuleTemplatesClient) AlertRuleTemplatesList(ctx context.Context, id WorkspaceId) (resp AlertRuleTemplatesListOperationResponse, err error) { - req, err := c.preparerForAlertRuleTemplatesList(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "alertruletemplates.AlertRuleTemplatesClient", "AlertRuleTemplatesList", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "alertruletemplates.AlertRuleTemplatesClient", "AlertRuleTemplatesList", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForAlertRuleTemplatesList(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "alertruletemplates.AlertRuleTemplatesClient", "AlertRuleTemplatesList", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// preparerForAlertRuleTemplatesList prepares the AlertRuleTemplatesList request. -func (c AlertRuleTemplatesClient) preparerForAlertRuleTemplatesList(ctx context.Context, id WorkspaceId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/alertRuleTemplates", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForAlertRuleTemplatesListWithNextLink prepares the AlertRuleTemplatesList request with the given nextLink token. -func (c AlertRuleTemplatesClient) preparerForAlertRuleTemplatesListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForAlertRuleTemplatesList handles the response to the AlertRuleTemplatesList request. The method always -// closes the http.Response Body. -func (c AlertRuleTemplatesClient) responderForAlertRuleTemplatesList(resp *http.Response) (result AlertRuleTemplatesListOperationResponse, err error) { - type page struct { - Values []json.RawMessage `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - temp := make([]AlertRuleTemplate, 0) - for i, v := range respObj.Values { - val, err := unmarshalAlertRuleTemplateImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for AlertRuleTemplate (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - result.Model = &temp - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result AlertRuleTemplatesListOperationResponse, err error) { - req, err := c.preparerForAlertRuleTemplatesListWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "alertruletemplates.AlertRuleTemplatesClient", "AlertRuleTemplatesList", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "alertruletemplates.AlertRuleTemplatesClient", "AlertRuleTemplatesList", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForAlertRuleTemplatesList(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "alertruletemplates.AlertRuleTemplatesClient", "AlertRuleTemplatesList", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} - -// AlertRuleTemplatesListComplete retrieves all of the results into a single object -func (c AlertRuleTemplatesClient) AlertRuleTemplatesListComplete(ctx context.Context, id WorkspaceId) (AlertRuleTemplatesListCompleteResult, error) { - return c.AlertRuleTemplatesListCompleteMatchingPredicate(ctx, id, AlertRuleTemplateOperationPredicate{}) -} - -// AlertRuleTemplatesListCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c AlertRuleTemplatesClient) AlertRuleTemplatesListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate AlertRuleTemplateOperationPredicate) (resp AlertRuleTemplatesListCompleteResult, err error) { - items := make([]AlertRuleTemplate, 0) - - page, err := c.AlertRuleTemplatesList(ctx, id) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := AlertRuleTemplatesListCompleteResult{ - Items: items, - } - return out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertdetailsoverride.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertdetailsoverride.go deleted file mode 100644 index 136748927ba5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertdetailsoverride.go +++ /dev/null @@ -1,11 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertDetailsOverride struct { - AlertDescriptionFormat *string `json:"alertDescriptionFormat,omitempty"` - AlertDisplayNameFormat *string `json:"alertDisplayNameFormat,omitempty"` - AlertSeverityColumnName *string `json:"alertSeverityColumnName,omitempty"` - AlertTacticsColumnName *string `json:"alertTacticsColumnName,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplate.go deleted file mode 100644 index 81169aee0394..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplate.go +++ /dev/null @@ -1,88 +0,0 @@ -package alertruletemplates - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertRuleTemplate interface { -} - -func unmarshalAlertRuleTemplateImplementation(input []byte) (AlertRuleTemplate, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling AlertRuleTemplate into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Fusion") { - var out FusionAlertRuleTemplate - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into FusionAlertRuleTemplate: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MLBehaviorAnalytics") { - var out MLBehaviorAnalyticsAlertRuleTemplate - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MLBehaviorAnalyticsAlertRuleTemplate: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftSecurityIncidentCreation") { - var out MicrosoftSecurityIncidentCreationAlertRuleTemplate - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MicrosoftSecurityIncidentCreationAlertRuleTemplate: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "NRT") { - var out NrtAlertRuleTemplate - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into NrtAlertRuleTemplate: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Scheduled") { - var out ScheduledAlertRuleTemplate - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ScheduledAlertRuleTemplate: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "ThreatIntelligence") { - var out ThreatIntelligenceAlertRuleTemplate - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ThreatIntelligenceAlertRuleTemplate: %+v", err) - } - return out, nil - } - - type RawAlertRuleTemplateImpl struct { - Type string `json:"-"` - Values map[string]interface{} `json:"-"` - } - out := RawAlertRuleTemplateImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplatedatasource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplatedatasource.go deleted file mode 100644 index 519fd6e1fe4d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplatedatasource.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertRuleTemplateDataSource struct { - ConnectorId *string `json:"connectorId,omitempty"` - DataTypes *[]string `json:"dataTypes,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_entitymapping.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_entitymapping.go deleted file mode 100644 index 86cf5667f041..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_entitymapping.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityMapping struct { - EntityType *EntityMappingType `json:"entityType,omitempty"` - FieldMappings *[]FieldMapping `json:"fieldMappings,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_eventgroupingsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_eventgroupingsettings.go deleted file mode 100644 index 3d80ecdb592f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_eventgroupingsettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EventGroupingSettings struct { - AggregationKind *EventGroupingAggregationKind `json:"aggregationKind,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fieldmapping.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fieldmapping.go deleted file mode 100644 index be96362b1358..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fieldmapping.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FieldMapping struct { - ColumnName *string `json:"columnName,omitempty"` - Identifier *string `json:"identifier,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplate.go deleted file mode 100644 index c2b4d8c30777..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplate.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertruletemplates - -import ( - "encoding/json" - "fmt" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ AlertRuleTemplate = FusionAlertRuleTemplate{} - -type FusionAlertRuleTemplate struct { - Properties *FusionAlertRuleTemplateProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRuleTemplate - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = FusionAlertRuleTemplate{} - -func (s FusionAlertRuleTemplate) MarshalJSON() ([]byte, error) { - type wrapper FusionAlertRuleTemplate - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling FusionAlertRuleTemplate: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling FusionAlertRuleTemplate: %+v", err) - } - decoded["kind"] = "Fusion" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling FusionAlertRuleTemplate: %+v", err) - } - - return encoded, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplateproperties.go deleted file mode 100644 index f55a7b59b287..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplateproperties.go +++ /dev/null @@ -1,46 +0,0 @@ -package alertruletemplates - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FusionAlertRuleTemplateProperties struct { - AlertRulesCreatedByTemplateCount int64 `json:"alertRulesCreatedByTemplateCount"` - CreatedDateUTC *string `json:"createdDateUTC,omitempty"` - Description string `json:"description"` - DisplayName string `json:"displayName"` - LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` - RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` - Severity AlertSeverity `json:"severity"` - Status TemplateStatus `json:"status"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` -} - -func (o *FusionAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { - if o.CreatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *FusionAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedDateUTC = &formatted -} - -func (o *FusionAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { - if o.LastUpdatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *FusionAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedDateUTC = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplate.go deleted file mode 100644 index 515a47767b2a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplate.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertruletemplates - -import ( - "encoding/json" - "fmt" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ AlertRuleTemplate = MicrosoftSecurityIncidentCreationAlertRuleTemplate{} - -type MicrosoftSecurityIncidentCreationAlertRuleTemplate struct { - Properties *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRuleTemplate - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MicrosoftSecurityIncidentCreationAlertRuleTemplate{} - -func (s MicrosoftSecurityIncidentCreationAlertRuleTemplate) MarshalJSON() ([]byte, error) { - type wrapper MicrosoftSecurityIncidentCreationAlertRuleTemplate - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MicrosoftSecurityIncidentCreationAlertRuleTemplate: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MicrosoftSecurityIncidentCreationAlertRuleTemplate: %+v", err) - } - decoded["kind"] = "MicrosoftSecurityIncidentCreation" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MicrosoftSecurityIncidentCreationAlertRuleTemplate: %+v", err) - } - - return encoded, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplateproperties.go deleted file mode 100644 index 0a2b5025a2e5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplateproperties.go +++ /dev/null @@ -1,45 +0,0 @@ -package alertruletemplates - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties struct { - AlertRulesCreatedByTemplateCount int64 `json:"alertRulesCreatedByTemplateCount"` - CreatedDateUTC string `json:"createdDateUTC"` - Description string `json:"description"` - DisplayName string `json:"displayName"` - DisplayNamesExcludeFilter *[]string `json:"displayNamesExcludeFilter,omitempty"` - DisplayNamesFilter *[]string `json:"displayNamesFilter,omitempty"` - LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` - ProductFilter MicrosoftSecurityProductName `json:"productFilter"` - RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` - SeveritiesFilter *[]AlertSeverity `json:"severitiesFilter,omitempty"` - Status TemplateStatus `json:"status"` -} - -func (o *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { - return dates.ParseAsFormat(&o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedDateUTC = formatted -} - -func (o *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { - if o.LastUpdatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedDateUTC = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplate.go deleted file mode 100644 index 51e12f5562f6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplate.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertruletemplates - -import ( - "encoding/json" - "fmt" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ AlertRuleTemplate = MLBehaviorAnalyticsAlertRuleTemplate{} - -type MLBehaviorAnalyticsAlertRuleTemplate struct { - Properties *MLBehaviorAnalyticsAlertRuleTemplateProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRuleTemplate - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MLBehaviorAnalyticsAlertRuleTemplate{} - -func (s MLBehaviorAnalyticsAlertRuleTemplate) MarshalJSON() ([]byte, error) { - type wrapper MLBehaviorAnalyticsAlertRuleTemplate - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MLBehaviorAnalyticsAlertRuleTemplate: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MLBehaviorAnalyticsAlertRuleTemplate: %+v", err) - } - decoded["kind"] = "MLBehaviorAnalytics" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MLBehaviorAnalyticsAlertRuleTemplate: %+v", err) - } - - return encoded, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplateproperties.go deleted file mode 100644 index 1ece40f5e844..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplateproperties.go +++ /dev/null @@ -1,46 +0,0 @@ -package alertruletemplates - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MLBehaviorAnalyticsAlertRuleTemplateProperties struct { - AlertRulesCreatedByTemplateCount int64 `json:"alertRulesCreatedByTemplateCount"` - CreatedDateUTC *string `json:"createdDateUTC,omitempty"` - Description string `json:"description"` - DisplayName string `json:"displayName"` - LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` - RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` - Severity AlertSeverity `json:"severity"` - Status TemplateStatus `json:"status"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` -} - -func (o *MLBehaviorAnalyticsAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { - if o.CreatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *MLBehaviorAnalyticsAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedDateUTC = &formatted -} - -func (o *MLBehaviorAnalyticsAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { - if o.LastUpdatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *MLBehaviorAnalyticsAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedDateUTC = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplate.go deleted file mode 100644 index 9f13bfa8160b..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplate.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertruletemplates - -import ( - "encoding/json" - "fmt" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ AlertRuleTemplate = NrtAlertRuleTemplate{} - -type NrtAlertRuleTemplate struct { - Properties *NrtAlertRuleTemplateProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRuleTemplate - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = NrtAlertRuleTemplate{} - -func (s NrtAlertRuleTemplate) MarshalJSON() ([]byte, error) { - type wrapper NrtAlertRuleTemplate - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling NrtAlertRuleTemplate: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling NrtAlertRuleTemplate: %+v", err) - } - decoded["kind"] = "NRT" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling NrtAlertRuleTemplate: %+v", err) - } - - return encoded, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplateproperties.go deleted file mode 100644 index b0dcc457bf0e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplateproperties.go +++ /dev/null @@ -1,51 +0,0 @@ -package alertruletemplates - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NrtAlertRuleTemplateProperties struct { - AlertDetailsOverride *AlertDetailsOverride `json:"alertDetailsOverride,omitempty"` - AlertRulesCreatedByTemplateCount int64 `json:"alertRulesCreatedByTemplateCount"` - CreatedDateUTC *string `json:"createdDateUTC,omitempty"` - CustomDetails *map[string]string `json:"customDetails,omitempty"` - Description string `json:"description"` - DisplayName string `json:"displayName"` - EntityMappings *[]EntityMapping `json:"entityMappings,omitempty"` - LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` - Query string `json:"query"` - RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` - Severity AlertSeverity `json:"severity"` - Status TemplateStatus `json:"status"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - Version string `json:"version"` -} - -func (o *NrtAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { - if o.CreatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *NrtAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedDateUTC = &formatted -} - -func (o *NrtAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { - if o.LastUpdatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *NrtAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedDateUTC = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplate.go deleted file mode 100644 index c3428ada14d8..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplate.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertruletemplates - -import ( - "encoding/json" - "fmt" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ AlertRuleTemplate = ScheduledAlertRuleTemplate{} - -type ScheduledAlertRuleTemplate struct { - Properties *ScheduledAlertRuleTemplateProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRuleTemplate - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ScheduledAlertRuleTemplate{} - -func (s ScheduledAlertRuleTemplate) MarshalJSON() ([]byte, error) { - type wrapper ScheduledAlertRuleTemplate - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ScheduledAlertRuleTemplate: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ScheduledAlertRuleTemplate: %+v", err) - } - decoded["kind"] = "Scheduled" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ScheduledAlertRuleTemplate: %+v", err) - } - - return encoded, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplateproperties.go deleted file mode 100644 index ea9625850261..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplateproperties.go +++ /dev/null @@ -1,56 +0,0 @@ -package alertruletemplates - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ScheduledAlertRuleTemplateProperties struct { - AlertDetailsOverride *AlertDetailsOverride `json:"alertDetailsOverride,omitempty"` - AlertRulesCreatedByTemplateCount int64 `json:"alertRulesCreatedByTemplateCount"` - CreatedDateUTC *string `json:"createdDateUTC,omitempty"` - CustomDetails *map[string]string `json:"customDetails,omitempty"` - Description string `json:"description"` - DisplayName string `json:"displayName"` - EntityMappings *[]EntityMapping `json:"entityMappings,omitempty"` - EventGroupingSettings *EventGroupingSettings `json:"eventGroupingSettings,omitempty"` - LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` - Query string `json:"query"` - QueryFrequency string `json:"queryFrequency"` - QueryPeriod string `json:"queryPeriod"` - RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` - Severity AlertSeverity `json:"severity"` - Status TemplateStatus `json:"status"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - TriggerOperator TriggerOperator `json:"triggerOperator"` - TriggerThreshold int64 `json:"triggerThreshold"` - Version string `json:"version"` -} - -func (o *ScheduledAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { - if o.CreatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *ScheduledAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedDateUTC = &formatted -} - -func (o *ScheduledAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { - if o.LastUpdatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *ScheduledAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedDateUTC = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplate.go deleted file mode 100644 index 1f39f219a07b..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplate.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertruletemplates - -import ( - "encoding/json" - "fmt" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ AlertRuleTemplate = ThreatIntelligenceAlertRuleTemplate{} - -type ThreatIntelligenceAlertRuleTemplate struct { - Properties *ThreatIntelligenceAlertRuleTemplateProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRuleTemplate - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ThreatIntelligenceAlertRuleTemplate{} - -func (s ThreatIntelligenceAlertRuleTemplate) MarshalJSON() ([]byte, error) { - type wrapper ThreatIntelligenceAlertRuleTemplate - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ThreatIntelligenceAlertRuleTemplate: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ThreatIntelligenceAlertRuleTemplate: %+v", err) - } - decoded["kind"] = "ThreatIntelligence" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ThreatIntelligenceAlertRuleTemplate: %+v", err) - } - - return encoded, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplateproperties.go deleted file mode 100644 index ca0f00247e9f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplateproperties.go +++ /dev/null @@ -1,46 +0,0 @@ -package alertruletemplates - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceAlertRuleTemplateProperties struct { - AlertRulesCreatedByTemplateCount int64 `json:"alertRulesCreatedByTemplateCount"` - CreatedDateUTC *string `json:"createdDateUTC,omitempty"` - Description string `json:"description"` - DisplayName string `json:"displayName"` - LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` - RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` - Severity AlertSeverity `json:"severity"` - Status TemplateStatus `json:"status"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` -} - -func (o *ThreatIntelligenceAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { - if o.CreatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *ThreatIntelligenceAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedDateUTC = &formatted -} - -func (o *ThreatIntelligenceAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { - if o.LastUpdatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *ThreatIntelligenceAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedDateUTC = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/predicates.go deleted file mode 100644 index 093c50e1616b..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/predicates.go +++ /dev/null @@ -1,12 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertRuleTemplateOperationPredicate struct { -} - -func (p AlertRuleTemplateOperationPredicate) Matches(input AlertRuleTemplate) bool { - - return true -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/version.go deleted file mode 100644 index 0bf4ef8ed58f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package alertruletemplates - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/alertruletemplates/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/README.md deleted file mode 100644 index e45d8331aceb..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors` Documentation - -The `dataconnectors` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-11-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors" -``` - - -### Client Initialization - -```go -client := dataconnectors.NewDataConnectorsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DataConnectorsClient.DataConnectorsCreateOrUpdate` - -```go -ctx := context.TODO() -id := dataconnectors.NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") - -payload := dataconnectors.DataConnector{ - // ... -} - - -read, err := client.DataConnectorsCreateOrUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `DataConnectorsClient.DataConnectorsDelete` - -```go -ctx := context.TODO() -id := dataconnectors.NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") - -read, err := client.DataConnectorsDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `DataConnectorsClient.DataConnectorsGet` - -```go -ctx := context.TODO() -id := dataconnectors.NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") - -read, err := client.DataConnectorsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `DataConnectorsClient.DataConnectorsList` - -```go -ctx := context.TODO() -id := dataconnectors.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// alternatively `client.DataConnectorsList(ctx, id)` can be used to do batched pagination -items, err := client.DataConnectorsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/client.go deleted file mode 100644 index cf334b725685..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package dataconnectors - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataConnectorsClient struct { - Client autorest.Client - baseUri string -} - -func NewDataConnectorsClientWithBaseURI(endpoint string) DataConnectorsClient { - return DataConnectorsClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/constants.go deleted file mode 100644 index db98dc835770..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/constants.go +++ /dev/null @@ -1,80 +0,0 @@ -package dataconnectors - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataConnectorKind string - -const ( - DataConnectorKindAmazonWebServicesCloudTrail DataConnectorKind = "AmazonWebServicesCloudTrail" - DataConnectorKindAzureActiveDirectory DataConnectorKind = "AzureActiveDirectory" - DataConnectorKindAzureAdvancedThreatProtection DataConnectorKind = "AzureAdvancedThreatProtection" - DataConnectorKindAzureSecurityCenter DataConnectorKind = "AzureSecurityCenter" - DataConnectorKindMicrosoftCloudAppSecurity DataConnectorKind = "MicrosoftCloudAppSecurity" - DataConnectorKindMicrosoftDefenderAdvancedThreatProtection DataConnectorKind = "MicrosoftDefenderAdvancedThreatProtection" - DataConnectorKindOfficeThreeSixFive DataConnectorKind = "Office365" - DataConnectorKindThreatIntelligence DataConnectorKind = "ThreatIntelligence" -) - -func PossibleValuesForDataConnectorKind() []string { - return []string{ - string(DataConnectorKindAmazonWebServicesCloudTrail), - string(DataConnectorKindAzureActiveDirectory), - string(DataConnectorKindAzureAdvancedThreatProtection), - string(DataConnectorKindAzureSecurityCenter), - string(DataConnectorKindMicrosoftCloudAppSecurity), - string(DataConnectorKindMicrosoftDefenderAdvancedThreatProtection), - string(DataConnectorKindOfficeThreeSixFive), - string(DataConnectorKindThreatIntelligence), - } -} - -func parseDataConnectorKind(input string) (*DataConnectorKind, error) { - vals := map[string]DataConnectorKind{ - "amazonwebservicescloudtrail": DataConnectorKindAmazonWebServicesCloudTrail, - "azureactivedirectory": DataConnectorKindAzureActiveDirectory, - "azureadvancedthreatprotection": DataConnectorKindAzureAdvancedThreatProtection, - "azuresecuritycenter": DataConnectorKindAzureSecurityCenter, - "microsoftcloudappsecurity": DataConnectorKindMicrosoftCloudAppSecurity, - "microsoftdefenderadvancedthreatprotection": DataConnectorKindMicrosoftDefenderAdvancedThreatProtection, - "office365": DataConnectorKindOfficeThreeSixFive, - "threatintelligence": DataConnectorKindThreatIntelligence, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DataConnectorKind(input) - return &out, nil -} - -type DataTypeState string - -const ( - DataTypeStateDisabled DataTypeState = "Disabled" - DataTypeStateEnabled DataTypeState = "Enabled" -) - -func PossibleValuesForDataTypeState() []string { - return []string{ - string(DataTypeStateDisabled), - string(DataTypeStateEnabled), - } -} - -func parseDataTypeState(input string) (*DataTypeState, error) { - vals := map[string]DataTypeState{ - "disabled": DataTypeStateDisabled, - "enabled": DataTypeStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DataTypeState(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/id_dataconnector.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/id_dataconnector.go deleted file mode 100644 index 0b754d6b3c1e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/id_dataconnector.go +++ /dev/null @@ -1,142 +0,0 @@ -package dataconnectors - -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 = DataConnectorId{} - -// DataConnectorId is a struct representing the Resource ID for a Data Connector -type DataConnectorId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - DataConnectorId string -} - -// NewDataConnectorID returns a new DataConnectorId struct -func NewDataConnectorID(subscriptionId string, resourceGroupName string, workspaceName string, dataConnectorId string) DataConnectorId { - return DataConnectorId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - DataConnectorId: dataConnectorId, - } -} - -// ParseDataConnectorID parses 'input' into a DataConnectorId -func ParseDataConnectorID(input string) (*DataConnectorId, error) { - parser := resourceids.NewParserFromResourceIdType(DataConnectorId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := DataConnectorId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) - } - - if id.DataConnectorId, ok = parsed.Parsed["dataConnectorId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "dataConnectorId", *parsed) - } - - return &id, nil -} - -// ParseDataConnectorIDInsensitively parses 'input' case-insensitively into a DataConnectorId -// note: this method should only be used for API response data and not user input -func ParseDataConnectorIDInsensitively(input string) (*DataConnectorId, error) { - parser := resourceids.NewParserFromResourceIdType(DataConnectorId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := DataConnectorId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) - } - - if id.DataConnectorId, ok = parsed.Parsed["dataConnectorId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "dataConnectorId", *parsed) - } - - return &id, nil -} - -// ValidateDataConnectorID checks that 'input' can be parsed as a Data Connector ID -func ValidateDataConnectorID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseDataConnectorID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Data Connector ID -func (id DataConnectorId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/dataConnectors/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.DataConnectorId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Data Connector ID -func (id DataConnectorId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticDataConnectors", "dataConnectors", "dataConnectors"), - resourceids.UserSpecifiedSegment("dataConnectorId", "dataConnectorIdValue"), - } -} - -// String returns a human-readable description of this Data Connector ID -func (id DataConnectorId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Data Connector: %q", id.DataConnectorId), - } - return fmt.Sprintf("Data Connector (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/id_workspace.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/id_workspace.go deleted file mode 100644 index 16107cbce7b5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/id_workspace.go +++ /dev/null @@ -1,127 +0,0 @@ -package dataconnectors - -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 = WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := WorkspaceId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := WorkspaceId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) - } - - return &id, nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorscreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorscreateorupdate_autorest.go deleted file mode 100644 index 074bc6ae5055..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorscreateorupdate_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package dataconnectors - -import ( - "context" - "encoding/json" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataConnectorsCreateOrUpdateOperationResponse struct { - HttpResponse *http.Response - Model *DataConnector -} - -// DataConnectorsCreateOrUpdate ... -func (c DataConnectorsClient) DataConnectorsCreateOrUpdate(ctx context.Context, id DataConnectorId, input DataConnector) (result DataConnectorsCreateOrUpdateOperationResponse, err error) { - req, err := c.preparerForDataConnectorsCreateOrUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsCreateOrUpdate", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsCreateOrUpdate", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForDataConnectorsCreateOrUpdate(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsCreateOrUpdate", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForDataConnectorsCreateOrUpdate prepares the DataConnectorsCreateOrUpdate request. -func (c DataConnectorsClient) preparerForDataConnectorsCreateOrUpdate(ctx context.Context, id DataConnectorId, input DataConnector) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForDataConnectorsCreateOrUpdate handles the response to the DataConnectorsCreateOrUpdate request. The method always -// closes the http.Response Body. -func (c DataConnectorsClient) responderForDataConnectorsCreateOrUpdate(resp *http.Response) (result DataConnectorsCreateOrUpdateOperationResponse, err error) { - var respObj json.RawMessage - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - if err != nil { - return - } - model, err := unmarshalDataConnectorImplementation(respObj) - if err != nil { - return - } - result.Model = &model - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorsdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorsdelete_autorest.go deleted file mode 100644 index f0b32c9b0096..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorsdelete_autorest.go +++ /dev/null @@ -1,66 +0,0 @@ -package dataconnectors - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataConnectorsDeleteOperationResponse struct { - HttpResponse *http.Response -} - -// DataConnectorsDelete ... -func (c DataConnectorsClient) DataConnectorsDelete(ctx context.Context, id DataConnectorId) (result DataConnectorsDeleteOperationResponse, err error) { - req, err := c.preparerForDataConnectorsDelete(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsDelete", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsDelete", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForDataConnectorsDelete(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsDelete", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForDataConnectorsDelete prepares the DataConnectorsDelete request. -func (c DataConnectorsClient) preparerForDataConnectorsDelete(ctx context.Context, id DataConnectorId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForDataConnectorsDelete handles the response to the DataConnectorsDelete request. The method always -// closes the http.Response Body. -func (c DataConnectorsClient) responderForDataConnectorsDelete(resp *http.Response) (result DataConnectorsDeleteOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorsget_autorest.go deleted file mode 100644 index eb34ebc2be58..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorsget_autorest.go +++ /dev/null @@ -1,77 +0,0 @@ -package dataconnectors - -import ( - "context" - "encoding/json" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataConnectorsGetOperationResponse struct { - HttpResponse *http.Response - Model *DataConnector -} - -// DataConnectorsGet ... -func (c DataConnectorsClient) DataConnectorsGet(ctx context.Context, id DataConnectorId) (result DataConnectorsGetOperationResponse, err error) { - req, err := c.preparerForDataConnectorsGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsGet", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsGet", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForDataConnectorsGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsGet", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForDataConnectorsGet prepares the DataConnectorsGet request. -func (c DataConnectorsClient) preparerForDataConnectorsGet(ctx context.Context, id DataConnectorId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForDataConnectorsGet handles the response to the DataConnectorsGet request. The method always -// closes the http.Response Body. -func (c DataConnectorsClient) responderForDataConnectorsGet(resp *http.Response) (result DataConnectorsGetOperationResponse, err error) { - var respObj json.RawMessage - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - if err != nil { - return - } - model, err := unmarshalDataConnectorImplementation(respObj) - if err != nil { - return - } - result.Model = &model - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorslist_autorest.go deleted file mode 100644 index 22cba5c26890..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/method_dataconnectorslist_autorest.go +++ /dev/null @@ -1,196 +0,0 @@ -package dataconnectors - -import ( - "context" - "encoding/json" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataConnectorsListOperationResponse struct { - HttpResponse *http.Response - Model *[]DataConnector - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (DataConnectorsListOperationResponse, error) -} - -type DataConnectorsListCompleteResult struct { - Items []DataConnector -} - -func (r DataConnectorsListOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r DataConnectorsListOperationResponse) LoadMore(ctx context.Context) (resp DataConnectorsListOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -// DataConnectorsList ... -func (c DataConnectorsClient) DataConnectorsList(ctx context.Context, id WorkspaceId) (resp DataConnectorsListOperationResponse, err error) { - req, err := c.preparerForDataConnectorsList(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsList", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsList", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForDataConnectorsList(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsList", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// preparerForDataConnectorsList prepares the DataConnectorsList request. -func (c DataConnectorsClient) preparerForDataConnectorsList(ctx context.Context, id WorkspaceId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/dataConnectors", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForDataConnectorsListWithNextLink prepares the DataConnectorsList request with the given nextLink token. -func (c DataConnectorsClient) preparerForDataConnectorsListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForDataConnectorsList handles the response to the DataConnectorsList request. The method always -// closes the http.Response Body. -func (c DataConnectorsClient) responderForDataConnectorsList(resp *http.Response) (result DataConnectorsListOperationResponse, err error) { - type page struct { - Values []json.RawMessage `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - temp := make([]DataConnector, 0) - for i, v := range respObj.Values { - val, err := unmarshalDataConnectorImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for DataConnector (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - result.Model = &temp - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result DataConnectorsListOperationResponse, err error) { - req, err := c.preparerForDataConnectorsListWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsList", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsList", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForDataConnectorsList(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "dataconnectors.DataConnectorsClient", "DataConnectorsList", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} - -// DataConnectorsListComplete retrieves all of the results into a single object -func (c DataConnectorsClient) DataConnectorsListComplete(ctx context.Context, id WorkspaceId) (DataConnectorsListCompleteResult, error) { - return c.DataConnectorsListCompleteMatchingPredicate(ctx, id, DataConnectorOperationPredicate{}) -} - -// DataConnectorsListCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c DataConnectorsClient) DataConnectorsListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate DataConnectorOperationPredicate) (resp DataConnectorsListCompleteResult, err error) { - items := make([]DataConnector, 0) - - page, err := c.DataConnectorsList(ctx, id) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := DataConnectorsListCompleteResult{ - Items: items, - } - return out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aaddataconnector.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aaddataconnector.go deleted file mode 100644 index dd0ca1af664c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aaddataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnector = AADDataConnector{} - -type AADDataConnector struct { - Properties *AADDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AADDataConnector{} - -func (s AADDataConnector) MarshalJSON() ([]byte, error) { - type wrapper AADDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AADDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AADDataConnector: %+v", err) - } - decoded["kind"] = "AzureActiveDirectory" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AADDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aaddataconnectorproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aaddataconnectorproperties.go deleted file mode 100644 index eed0b8838ede..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aaddataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AADDataConnectorProperties struct { - DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` - TenantId *string `json:"tenantId,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aatpdataconnector.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aatpdataconnector.go deleted file mode 100644 index e1cd013bbd78..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aatpdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnector = AATPDataConnector{} - -type AATPDataConnector struct { - Properties *AATPDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AATPDataConnector{} - -func (s AATPDataConnector) MarshalJSON() ([]byte, error) { - type wrapper AATPDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AATPDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AATPDataConnector: %+v", err) - } - decoded["kind"] = "AzureAdvancedThreatProtection" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AATPDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aatpdataconnectorproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aatpdataconnectorproperties.go deleted file mode 100644 index 5f2791c58d28..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_aatpdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AATPDataConnectorProperties struct { - DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` - TenantId *string `json:"tenantId,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_alertsdatatypeofdataconnector.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_alertsdatatypeofdataconnector.go deleted file mode 100644 index b61a1a7a1965..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_alertsdatatypeofdataconnector.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertsDataTypeOfDataConnector struct { - Alerts *DataConnectorDataTypeCommon `json:"alerts,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_ascdataconnector.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_ascdataconnector.go deleted file mode 100644 index 3af09c2ff8b1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_ascdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnector = ASCDataConnector{} - -type ASCDataConnector struct { - Properties *ASCDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ASCDataConnector{} - -func (s ASCDataConnector) MarshalJSON() ([]byte, error) { - type wrapper ASCDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ASCDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ASCDataConnector: %+v", err) - } - decoded["kind"] = "AzureSecurityCenter" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ASCDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_ascdataconnectorproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_ascdataconnectorproperties.go deleted file mode 100644 index ab5b1ceb1725..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_ascdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ASCDataConnectorProperties struct { - DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` - SubscriptionId *string `json:"subscriptionId,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnector.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnector.go deleted file mode 100644 index b0ef7fdd2854..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnector = AwsCloudTrailDataConnector{} - -type AwsCloudTrailDataConnector struct { - Properties *AwsCloudTrailDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AwsCloudTrailDataConnector{} - -func (s AwsCloudTrailDataConnector) MarshalJSON() ([]byte, error) { - type wrapper AwsCloudTrailDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AwsCloudTrailDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AwsCloudTrailDataConnector: %+v", err) - } - decoded["kind"] = "AmazonWebServicesCloudTrail" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AwsCloudTrailDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnectordatatypes.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnectordatatypes.go deleted file mode 100644 index 9d19a2feb9cf..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnectordatatypes.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AwsCloudTrailDataConnectorDataTypes struct { - Logs *DataConnectorDataTypeCommon `json:"logs,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnectorproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnectorproperties.go deleted file mode 100644 index 42ac71deecaf..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_awscloudtraildataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AwsCloudTrailDataConnectorProperties struct { - AwsRoleArn *string `json:"awsRoleArn,omitempty"` - DataTypes *AwsCloudTrailDataConnectorDataTypes `json:"dataTypes,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_dataconnector.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_dataconnector.go deleted file mode 100644 index 4ff82add4cc2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_dataconnector.go +++ /dev/null @@ -1,104 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataConnector interface { -} - -func unmarshalDataConnectorImplementation(input []byte) (DataConnector, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling DataConnector into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "AzureActiveDirectory") { - var out AADDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AADDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureAdvancedThreatProtection") { - var out AATPDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AATPDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureSecurityCenter") { - var out ASCDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ASCDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AmazonWebServicesCloudTrail") { - var out AwsCloudTrailDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AwsCloudTrailDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftCloudAppSecurity") { - var out MCASDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MCASDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftDefenderAdvancedThreatProtection") { - var out MDATPDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MDATPDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Office365") { - var out OfficeDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into OfficeDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "ThreatIntelligence") { - var out TIDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into TIDataConnector: %+v", err) - } - return out, nil - } - - type RawDataConnectorImpl struct { - Type string `json:"-"` - Values map[string]interface{} `json:"-"` - } - out := RawDataConnectorImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_dataconnectordatatypecommon.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_dataconnectordatatypecommon.go deleted file mode 100644 index acf362026c45..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_dataconnectordatatypecommon.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataConnectorDataTypeCommon struct { - State *DataTypeState `json:"state,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnector.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnector.go deleted file mode 100644 index 6a0c9aebea05..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnector = MCASDataConnector{} - -type MCASDataConnector struct { - Properties *MCASDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MCASDataConnector{} - -func (s MCASDataConnector) MarshalJSON() ([]byte, error) { - type wrapper MCASDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MCASDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MCASDataConnector: %+v", err) - } - decoded["kind"] = "MicrosoftCloudAppSecurity" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MCASDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnectordatatypes.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnectordatatypes.go deleted file mode 100644 index 95d056b9518e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnectordatatypes.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MCASDataConnectorDataTypes struct { - Alerts *DataConnectorDataTypeCommon `json:"alerts,omitempty"` - DiscoveryLogs *DataConnectorDataTypeCommon `json:"discoveryLogs,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnectorproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnectorproperties.go deleted file mode 100644 index c4145588ffe6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mcasdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MCASDataConnectorProperties struct { - DataTypes *MCASDataConnectorDataTypes `json:"dataTypes,omitempty"` - TenantId *string `json:"tenantId,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mdatpdataconnector.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mdatpdataconnector.go deleted file mode 100644 index 1a6bcbcb7bfd..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mdatpdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnector = MDATPDataConnector{} - -type MDATPDataConnector struct { - Properties *MDATPDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MDATPDataConnector{} - -func (s MDATPDataConnector) MarshalJSON() ([]byte, error) { - type wrapper MDATPDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MDATPDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MDATPDataConnector: %+v", err) - } - decoded["kind"] = "MicrosoftDefenderAdvancedThreatProtection" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MDATPDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mdatpdataconnectorproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mdatpdataconnectorproperties.go deleted file mode 100644 index b0d40d216ace..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_mdatpdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MDATPDataConnectorProperties struct { - DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` - TenantId *string `json:"tenantId,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnector.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnector.go deleted file mode 100644 index 25b5a25e44d4..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnector = OfficeDataConnector{} - -type OfficeDataConnector struct { - Properties *OfficeDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = OfficeDataConnector{} - -func (s OfficeDataConnector) MarshalJSON() ([]byte, error) { - type wrapper OfficeDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling OfficeDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling OfficeDataConnector: %+v", err) - } - decoded["kind"] = "Office365" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling OfficeDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnectordatatypes.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnectordatatypes.go deleted file mode 100644 index 5b562d095757..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnectordatatypes.go +++ /dev/null @@ -1,10 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OfficeDataConnectorDataTypes struct { - Exchange *DataConnectorDataTypeCommon `json:"exchange,omitempty"` - SharePoint *DataConnectorDataTypeCommon `json:"sharePoint,omitempty"` - Teams *DataConnectorDataTypeCommon `json:"teams,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnectorproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnectorproperties.go deleted file mode 100644 index bf8da2781c8d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_officedataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OfficeDataConnectorProperties struct { - DataTypes *OfficeDataConnectorDataTypes `json:"dataTypes,omitempty"` - TenantId *string `json:"tenantId,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnector.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnector.go deleted file mode 100644 index 208513ef9aa7..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnector = TIDataConnector{} - -type TIDataConnector struct { - Properties *TIDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = TIDataConnector{} - -func (s TIDataConnector) MarshalJSON() ([]byte, error) { - type wrapper TIDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling TIDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling TIDataConnector: %+v", err) - } - decoded["kind"] = "ThreatIntelligence" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling TIDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnectordatatypes.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnectordatatypes.go deleted file mode 100644 index be5cade481c8..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnectordatatypes.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TIDataConnectorDataTypes struct { - Indicators *DataConnectorDataTypeCommon `json:"indicators,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnectorproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnectorproperties.go deleted file mode 100644 index 4fce93cbd33e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/model_tidataconnectorproperties.go +++ /dev/null @@ -1,28 +0,0 @@ -package dataconnectors - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TIDataConnectorProperties struct { - DataTypes *TIDataConnectorDataTypes `json:"dataTypes,omitempty"` - TenantId *string `json:"tenantId,omitempty"` - TipLookbackPeriod *string `json:"tipLookbackPeriod,omitempty"` -} - -func (o *TIDataConnectorProperties) GetTipLookbackPeriodAsTime() (*time.Time, error) { - if o.TipLookbackPeriod == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TipLookbackPeriod, "2006-01-02T15:04:05Z07:00") -} - -func (o *TIDataConnectorProperties) SetTipLookbackPeriodAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TipLookbackPeriod = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/predicates.go deleted file mode 100644 index 4521c20e58ed..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/predicates.go +++ /dev/null @@ -1,12 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataConnectorOperationPredicate struct { -} - -func (p DataConnectorOperationPredicate) Matches(input DataConnector) bool { - - return true -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/version.go deleted file mode 100644 index b6fde46b21ce..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package dataconnectors - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-11-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/dataconnectors/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/README.md deleted file mode 100644 index a4bab19be74b..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings` Documentation - -The `securitymlanalyticssettings` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-11-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings" -``` - - -### Client Initialization - -```go -client := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SecurityMLAnalyticsSettingsClient.SecurityMLAnalyticsSettingsCreateOrUpdate` - -```go -ctx := context.TODO() -id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "securityMLAnalyticsSettingValue") - -payload := securitymlanalyticssettings.SecurityMLAnalyticsSetting{ - // ... -} - - -read, err := client.SecurityMLAnalyticsSettingsCreateOrUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SecurityMLAnalyticsSettingsClient.SecurityMLAnalyticsSettingsDelete` - -```go -ctx := context.TODO() -id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "securityMLAnalyticsSettingValue") - -read, err := client.SecurityMLAnalyticsSettingsDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SecurityMLAnalyticsSettingsClient.SecurityMLAnalyticsSettingsGet` - -```go -ctx := context.TODO() -id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "securityMLAnalyticsSettingValue") - -read, err := client.SecurityMLAnalyticsSettingsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SecurityMLAnalyticsSettingsClient.SecurityMLAnalyticsSettingsList` - -```go -ctx := context.TODO() -id := securitymlanalyticssettings.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// alternatively `client.SecurityMLAnalyticsSettingsList(ctx, id)` can be used to do batched pagination -items, err := client.SecurityMLAnalyticsSettingsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/client.go deleted file mode 100644 index 50d64fb429c8..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package securitymlanalyticssettings - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityMLAnalyticsSettingsClient struct { - Client autorest.Client - baseUri string -} - -func NewSecurityMLAnalyticsSettingsClientWithBaseURI(endpoint string) SecurityMLAnalyticsSettingsClient { - return SecurityMLAnalyticsSettingsClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/constants.go deleted file mode 100644 index 47b13b875e2d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/constants.go +++ /dev/null @@ -1,132 +0,0 @@ -package securitymlanalyticssettings - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticImpairProcessControl AttackTactic = "ImpairProcessControl" - AttackTacticInhibitResponseFunction AttackTactic = "InhibitResponseFunction" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" - AttackTacticReconnaissance AttackTactic = "Reconnaissance" - AttackTacticResourceDevelopment AttackTactic = "ResourceDevelopment" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticImpairProcessControl), - string(AttackTacticInhibitResponseFunction), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - string(AttackTacticReconnaissance), - string(AttackTacticResourceDevelopment), - } -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "impairprocesscontrol": AttackTacticImpairProcessControl, - "inhibitresponsefunction": AttackTacticInhibitResponseFunction, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - "reconnaissance": AttackTacticReconnaissance, - "resourcedevelopment": AttackTacticResourceDevelopment, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type SecurityMLAnalyticsSettingsKind string - -const ( - SecurityMLAnalyticsSettingsKindAnomaly SecurityMLAnalyticsSettingsKind = "Anomaly" -) - -func PossibleValuesForSecurityMLAnalyticsSettingsKind() []string { - return []string{ - string(SecurityMLAnalyticsSettingsKindAnomaly), - } -} - -func parseSecurityMLAnalyticsSettingsKind(input string) (*SecurityMLAnalyticsSettingsKind, error) { - vals := map[string]SecurityMLAnalyticsSettingsKind{ - "anomaly": SecurityMLAnalyticsSettingsKindAnomaly, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityMLAnalyticsSettingsKind(input) - return &out, nil -} - -type SettingsStatus string - -const ( - SettingsStatusFlighting SettingsStatus = "Flighting" - SettingsStatusProduction SettingsStatus = "Production" -) - -func PossibleValuesForSettingsStatus() []string { - return []string{ - string(SettingsStatusFlighting), - string(SettingsStatusProduction), - } -} - -func parseSettingsStatus(input string) (*SettingsStatus, error) { - vals := map[string]SettingsStatus{ - "flighting": SettingsStatusFlighting, - "production": SettingsStatusProduction, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SettingsStatus(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go deleted file mode 100644 index e67cc6eb48b6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go +++ /dev/null @@ -1,142 +0,0 @@ -package securitymlanalyticssettings - -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 = SecurityMLAnalyticsSettingId{} - -// SecurityMLAnalyticsSettingId is a struct representing the Resource ID for a Security M L Analytics Setting -type SecurityMLAnalyticsSettingId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - SecurityMLAnalyticsSettingName string -} - -// NewSecurityMLAnalyticsSettingID returns a new SecurityMLAnalyticsSettingId struct -func NewSecurityMLAnalyticsSettingID(subscriptionId string, resourceGroupName string, workspaceName string, securityMLAnalyticsSettingName string) SecurityMLAnalyticsSettingId { - return SecurityMLAnalyticsSettingId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - SecurityMLAnalyticsSettingName: securityMLAnalyticsSettingName, - } -} - -// ParseSecurityMLAnalyticsSettingID parses 'input' into a SecurityMLAnalyticsSettingId -func ParseSecurityMLAnalyticsSettingID(input string) (*SecurityMLAnalyticsSettingId, error) { - parser := resourceids.NewParserFromResourceIdType(SecurityMLAnalyticsSettingId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := SecurityMLAnalyticsSettingId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) - } - - if id.SecurityMLAnalyticsSettingName, ok = parsed.Parsed["securityMLAnalyticsSettingName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "securityMLAnalyticsSettingName", *parsed) - } - - return &id, nil -} - -// ParseSecurityMLAnalyticsSettingIDInsensitively parses 'input' case-insensitively into a SecurityMLAnalyticsSettingId -// note: this method should only be used for API response data and not user input -func ParseSecurityMLAnalyticsSettingIDInsensitively(input string) (*SecurityMLAnalyticsSettingId, error) { - parser := resourceids.NewParserFromResourceIdType(SecurityMLAnalyticsSettingId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := SecurityMLAnalyticsSettingId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) - } - - if id.SecurityMLAnalyticsSettingName, ok = parsed.Parsed["securityMLAnalyticsSettingName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "securityMLAnalyticsSettingName", *parsed) - } - - return &id, nil -} - -// ValidateSecurityMLAnalyticsSettingID checks that 'input' can be parsed as a Security M L Analytics Setting ID -func ValidateSecurityMLAnalyticsSettingID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseSecurityMLAnalyticsSettingID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Security M L Analytics Setting ID -func (id SecurityMLAnalyticsSettingId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.SecurityMLAnalyticsSettingName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Security M L Analytics Setting ID -func (id SecurityMLAnalyticsSettingId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticSecurityMLAnalyticsSettings", "securityMLAnalyticsSettings", "securityMLAnalyticsSettings"), - resourceids.UserSpecifiedSegment("securityMLAnalyticsSettingName", "securityMLAnalyticsSettingValue"), - } -} - -// String returns a human-readable description of this Security M L Analytics Setting ID -func (id SecurityMLAnalyticsSettingId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Security M L Analytics Setting Name: %q", id.SecurityMLAnalyticsSettingName), - } - return fmt.Sprintf("Security M L Analytics Setting (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_workspace.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_workspace.go deleted file mode 100644 index 6459961e86c2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_workspace.go +++ /dev/null @@ -1,127 +0,0 @@ -package securitymlanalyticssettings - -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 = WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := WorkspaceId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := WorkspaceId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) - } - - return &id, nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingscreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingscreateorupdate_autorest.go deleted file mode 100644 index 11e3f24ada46..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingscreateorupdate_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package securitymlanalyticssettings - -import ( - "context" - "encoding/json" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityMLAnalyticsSettingsCreateOrUpdateOperationResponse struct { - HttpResponse *http.Response - Model *SecurityMLAnalyticsSetting -} - -// SecurityMLAnalyticsSettingsCreateOrUpdate ... -func (c SecurityMLAnalyticsSettingsClient) SecurityMLAnalyticsSettingsCreateOrUpdate(ctx context.Context, id SecurityMLAnalyticsSettingId, input SecurityMLAnalyticsSetting) (result SecurityMLAnalyticsSettingsCreateOrUpdateOperationResponse, err error) { - req, err := c.preparerForSecurityMLAnalyticsSettingsCreateOrUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsCreateOrUpdate", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsCreateOrUpdate", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForSecurityMLAnalyticsSettingsCreateOrUpdate(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsCreateOrUpdate", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForSecurityMLAnalyticsSettingsCreateOrUpdate prepares the SecurityMLAnalyticsSettingsCreateOrUpdate request. -func (c SecurityMLAnalyticsSettingsClient) preparerForSecurityMLAnalyticsSettingsCreateOrUpdate(ctx context.Context, id SecurityMLAnalyticsSettingId, input SecurityMLAnalyticsSetting) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForSecurityMLAnalyticsSettingsCreateOrUpdate handles the response to the SecurityMLAnalyticsSettingsCreateOrUpdate request. The method always -// closes the http.Response Body. -func (c SecurityMLAnalyticsSettingsClient) responderForSecurityMLAnalyticsSettingsCreateOrUpdate(resp *http.Response) (result SecurityMLAnalyticsSettingsCreateOrUpdateOperationResponse, err error) { - var respObj json.RawMessage - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - if err != nil { - return - } - model, err := unmarshalSecurityMLAnalyticsSettingImplementation(respObj) - if err != nil { - return - } - result.Model = &model - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingsdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingsdelete_autorest.go deleted file mode 100644 index 99b9057725e9..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingsdelete_autorest.go +++ /dev/null @@ -1,66 +0,0 @@ -package securitymlanalyticssettings - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityMLAnalyticsSettingsDeleteOperationResponse struct { - HttpResponse *http.Response -} - -// SecurityMLAnalyticsSettingsDelete ... -func (c SecurityMLAnalyticsSettingsClient) SecurityMLAnalyticsSettingsDelete(ctx context.Context, id SecurityMLAnalyticsSettingId) (result SecurityMLAnalyticsSettingsDeleteOperationResponse, err error) { - req, err := c.preparerForSecurityMLAnalyticsSettingsDelete(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsDelete", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsDelete", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForSecurityMLAnalyticsSettingsDelete(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsDelete", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForSecurityMLAnalyticsSettingsDelete prepares the SecurityMLAnalyticsSettingsDelete request. -func (c SecurityMLAnalyticsSettingsClient) preparerForSecurityMLAnalyticsSettingsDelete(ctx context.Context, id SecurityMLAnalyticsSettingId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForSecurityMLAnalyticsSettingsDelete handles the response to the SecurityMLAnalyticsSettingsDelete request. The method always -// closes the http.Response Body. -func (c SecurityMLAnalyticsSettingsClient) responderForSecurityMLAnalyticsSettingsDelete(resp *http.Response) (result SecurityMLAnalyticsSettingsDeleteOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingsget_autorest.go deleted file mode 100644 index 25749db15571..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingsget_autorest.go +++ /dev/null @@ -1,77 +0,0 @@ -package securitymlanalyticssettings - -import ( - "context" - "encoding/json" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityMLAnalyticsSettingsGetOperationResponse struct { - HttpResponse *http.Response - Model *SecurityMLAnalyticsSetting -} - -// SecurityMLAnalyticsSettingsGet ... -func (c SecurityMLAnalyticsSettingsClient) SecurityMLAnalyticsSettingsGet(ctx context.Context, id SecurityMLAnalyticsSettingId) (result SecurityMLAnalyticsSettingsGetOperationResponse, err error) { - req, err := c.preparerForSecurityMLAnalyticsSettingsGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsGet", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsGet", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForSecurityMLAnalyticsSettingsGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsGet", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForSecurityMLAnalyticsSettingsGet prepares the SecurityMLAnalyticsSettingsGet request. -func (c SecurityMLAnalyticsSettingsClient) preparerForSecurityMLAnalyticsSettingsGet(ctx context.Context, id SecurityMLAnalyticsSettingId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForSecurityMLAnalyticsSettingsGet handles the response to the SecurityMLAnalyticsSettingsGet request. The method always -// closes the http.Response Body. -func (c SecurityMLAnalyticsSettingsClient) responderForSecurityMLAnalyticsSettingsGet(resp *http.Response) (result SecurityMLAnalyticsSettingsGetOperationResponse, err error) { - var respObj json.RawMessage - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - if err != nil { - return - } - model, err := unmarshalSecurityMLAnalyticsSettingImplementation(respObj) - if err != nil { - return - } - result.Model = &model - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingslist_autorest.go deleted file mode 100644 index 1ecf7c02cc8d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/method_securitymlanalyticssettingslist_autorest.go +++ /dev/null @@ -1,196 +0,0 @@ -package securitymlanalyticssettings - -import ( - "context" - "encoding/json" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityMLAnalyticsSettingsListOperationResponse struct { - HttpResponse *http.Response - Model *[]SecurityMLAnalyticsSetting - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (SecurityMLAnalyticsSettingsListOperationResponse, error) -} - -type SecurityMLAnalyticsSettingsListCompleteResult struct { - Items []SecurityMLAnalyticsSetting -} - -func (r SecurityMLAnalyticsSettingsListOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r SecurityMLAnalyticsSettingsListOperationResponse) LoadMore(ctx context.Context) (resp SecurityMLAnalyticsSettingsListOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -// SecurityMLAnalyticsSettingsList ... -func (c SecurityMLAnalyticsSettingsClient) SecurityMLAnalyticsSettingsList(ctx context.Context, id WorkspaceId) (resp SecurityMLAnalyticsSettingsListOperationResponse, err error) { - req, err := c.preparerForSecurityMLAnalyticsSettingsList(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsList", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsList", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForSecurityMLAnalyticsSettingsList(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsList", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// preparerForSecurityMLAnalyticsSettingsList prepares the SecurityMLAnalyticsSettingsList request. -func (c SecurityMLAnalyticsSettingsClient) preparerForSecurityMLAnalyticsSettingsList(ctx context.Context, id WorkspaceId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForSecurityMLAnalyticsSettingsListWithNextLink prepares the SecurityMLAnalyticsSettingsList request with the given nextLink token. -func (c SecurityMLAnalyticsSettingsClient) preparerForSecurityMLAnalyticsSettingsListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForSecurityMLAnalyticsSettingsList handles the response to the SecurityMLAnalyticsSettingsList request. The method always -// closes the http.Response Body. -func (c SecurityMLAnalyticsSettingsClient) responderForSecurityMLAnalyticsSettingsList(resp *http.Response) (result SecurityMLAnalyticsSettingsListOperationResponse, err error) { - type page struct { - Values []json.RawMessage `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - temp := make([]SecurityMLAnalyticsSetting, 0) - for i, v := range respObj.Values { - val, err := unmarshalSecurityMLAnalyticsSettingImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for SecurityMLAnalyticsSetting (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - result.Model = &temp - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result SecurityMLAnalyticsSettingsListOperationResponse, err error) { - req, err := c.preparerForSecurityMLAnalyticsSettingsListWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsList", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsList", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForSecurityMLAnalyticsSettingsList(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient", "SecurityMLAnalyticsSettingsList", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} - -// SecurityMLAnalyticsSettingsListComplete retrieves all of the results into a single object -func (c SecurityMLAnalyticsSettingsClient) SecurityMLAnalyticsSettingsListComplete(ctx context.Context, id WorkspaceId) (SecurityMLAnalyticsSettingsListCompleteResult, error) { - return c.SecurityMLAnalyticsSettingsListCompleteMatchingPredicate(ctx, id, SecurityMLAnalyticsSettingOperationPredicate{}) -} - -// SecurityMLAnalyticsSettingsListCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c SecurityMLAnalyticsSettingsClient) SecurityMLAnalyticsSettingsListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate SecurityMLAnalyticsSettingOperationPredicate) (resp SecurityMLAnalyticsSettingsListCompleteResult, err error) { - items := make([]SecurityMLAnalyticsSetting, 0) - - page, err := c.SecurityMLAnalyticsSettingsList(ctx, id) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := SecurityMLAnalyticsSettingsListCompleteResult{ - Items: items, - } - return out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettings.go deleted file mode 100644 index 488f0b735f12..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettings.go +++ /dev/null @@ -1,48 +0,0 @@ -package securitymlanalyticssettings - -import ( - "encoding/json" - "fmt" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ SecurityMLAnalyticsSetting = AnomalySecurityMLAnalyticsSettings{} - -type AnomalySecurityMLAnalyticsSettings struct { - Properties *AnomalySecurityMLAnalyticsSettingsProperties `json:"properties,omitempty"` - - // Fields inherited from SecurityMLAnalyticsSetting - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AnomalySecurityMLAnalyticsSettings{} - -func (s AnomalySecurityMLAnalyticsSettings) MarshalJSON() ([]byte, error) { - type wrapper AnomalySecurityMLAnalyticsSettings - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AnomalySecurityMLAnalyticsSettings: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AnomalySecurityMLAnalyticsSettings: %+v", err) - } - decoded["kind"] = "Anomaly" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AnomalySecurityMLAnalyticsSettings: %+v", err) - } - - return encoded, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettingsproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettingsproperties.go deleted file mode 100644 index 99a6e024a1cc..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettingsproperties.go +++ /dev/null @@ -1,39 +0,0 @@ -package securitymlanalyticssettings - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AnomalySecurityMLAnalyticsSettingsProperties struct { - AnomalySettingsVersion *int64 `json:"anomalySettingsVersion,omitempty"` - AnomalyVersion string `json:"anomalyVersion"` - CustomizableObservations *interface{} `json:"customizableObservations,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - Enabled bool `json:"enabled"` - Frequency string `json:"frequency"` - IsDefaultSettings bool `json:"isDefaultSettings"` - LastModifiedUtc *string `json:"lastModifiedUtc,omitempty"` - RequiredDataConnectors *[]SecurityMLAnalyticsSettingsDataSource `json:"requiredDataConnectors,omitempty"` - SettingsDefinitionId *string `json:"settingsDefinitionId,omitempty"` - SettingsStatus SettingsStatus `json:"settingsStatus"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - Techniques *[]string `json:"techniques,omitempty"` -} - -func (o *AnomalySecurityMLAnalyticsSettingsProperties) GetLastModifiedUtcAsTime() (*time.Time, error) { - if o.LastModifiedUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *AnomalySecurityMLAnalyticsSettingsProperties) SetLastModifiedUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedUtc = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_securitymlanalyticssetting.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_securitymlanalyticssetting.go deleted file mode 100644 index 3492bcf1c4af..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_securitymlanalyticssetting.go +++ /dev/null @@ -1,48 +0,0 @@ -package securitymlanalyticssettings - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityMLAnalyticsSetting interface { -} - -func unmarshalSecurityMLAnalyticsSettingImplementation(input []byte) (SecurityMLAnalyticsSetting, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling SecurityMLAnalyticsSetting into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Anomaly") { - var out AnomalySecurityMLAnalyticsSettings - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AnomalySecurityMLAnalyticsSettings: %+v", err) - } - return out, nil - } - - type RawSecurityMLAnalyticsSettingImpl struct { - Type string `json:"-"` - Values map[string]interface{} `json:"-"` - } - out := RawSecurityMLAnalyticsSettingImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_securitymlanalyticssettingsdatasource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_securitymlanalyticssettingsdatasource.go deleted file mode 100644 index 6258b6b3094d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/model_securitymlanalyticssettingsdatasource.go +++ /dev/null @@ -1,9 +0,0 @@ -package securitymlanalyticssettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityMLAnalyticsSettingsDataSource struct { - ConnectorId *string `json:"connectorId,omitempty"` - DataTypes *[]string `json:"dataTypes,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/predicates.go deleted file mode 100644 index 7e6211c7d91b..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/predicates.go +++ /dev/null @@ -1,12 +0,0 @@ -package securitymlanalyticssettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityMLAnalyticsSettingOperationPredicate struct { -} - -func (p SecurityMLAnalyticsSettingOperationPredicate) Matches(input SecurityMLAnalyticsSetting) bool { - - return true -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/version.go deleted file mode 100644 index 48725fb8f8a7..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package securitymlanalyticssettings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-11-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/securitymlanalyticssettings/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/README.md deleted file mode 100644 index c58184318881..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/README.md +++ /dev/null @@ -1,191 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence` Documentation - -The `threatintelligence` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-11-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence" -``` - - -### Client Initialization - -```go -client := threatintelligence.NewThreatIntelligenceClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorAppendTags` - -```go -ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") - -payload := threatintelligence.ThreatIntelligenceAppendTags{ - // ... -} - - -read, err := client.IndicatorAppendTags(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorCreate` - -```go -ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") - -payload := threatintelligence.ThreatIntelligenceIndicatorModel{ - // ... -} - - -read, err := client.IndicatorCreate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorCreateIndicator` - -```go -ctx := context.TODO() -id := threatintelligence.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -payload := threatintelligence.ThreatIntelligenceIndicatorModel{ - // ... -} - - -read, err := client.IndicatorCreateIndicator(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorDelete` - -```go -ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") - -read, err := client.IndicatorDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorGet` - -```go -ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") - -read, err := client.IndicatorGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorMetricsList` - -```go -ctx := context.TODO() -id := threatintelligence.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -read, err := client.IndicatorMetricsList(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorQueryIndicators` - -```go -ctx := context.TODO() -id := threatintelligence.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -payload := threatintelligence.ThreatIntelligenceFilteringCriteria{ - // ... -} - - -// alternatively `client.IndicatorQueryIndicators(ctx, id, payload)` can be used to do batched pagination -items, err := client.IndicatorQueryIndicatorsComplete(ctx, id, payload) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorReplaceTags` - -```go -ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") - -payload := threatintelligence.ThreatIntelligenceIndicatorModel{ - // ... -} - - -read, err := client.IndicatorReplaceTags(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorsList` - -```go -ctx := context.TODO() -id := threatintelligence.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// alternatively `client.IndicatorsList(ctx, id, threatintelligence.DefaultIndicatorsListOperationOptions())` can be used to do batched pagination -items, err := client.IndicatorsListComplete(ctx, id, threatintelligence.DefaultIndicatorsListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/client.go deleted file mode 100644 index 35caff313570..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package threatintelligence - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceClient struct { - Client autorest.Client - baseUri string -} - -func NewThreatIntelligenceClientWithBaseURI(endpoint string) ThreatIntelligenceClient { - return ThreatIntelligenceClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/constants.go deleted file mode 100644 index 76610b311011..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/constants.go +++ /dev/null @@ -1,62 +0,0 @@ -package threatintelligence - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceResourceInnerKind string - -const ( - ThreatIntelligenceResourceInnerKindIndicator ThreatIntelligenceResourceInnerKind = "indicator" -) - -func PossibleValuesForThreatIntelligenceResourceInnerKind() []string { - return []string{ - string(ThreatIntelligenceResourceInnerKindIndicator), - } -} - -func parseThreatIntelligenceResourceInnerKind(input string) (*ThreatIntelligenceResourceInnerKind, error) { - vals := map[string]ThreatIntelligenceResourceInnerKind{ - "indicator": ThreatIntelligenceResourceInnerKindIndicator, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ThreatIntelligenceResourceInnerKind(input) - return &out, nil -} - -type ThreatIntelligenceSortingOrder string - -const ( - ThreatIntelligenceSortingOrderAscending ThreatIntelligenceSortingOrder = "ascending" - ThreatIntelligenceSortingOrderDescending ThreatIntelligenceSortingOrder = "descending" - ThreatIntelligenceSortingOrderUnsorted ThreatIntelligenceSortingOrder = "unsorted" -) - -func PossibleValuesForThreatIntelligenceSortingOrder() []string { - return []string{ - string(ThreatIntelligenceSortingOrderAscending), - string(ThreatIntelligenceSortingOrderDescending), - string(ThreatIntelligenceSortingOrderUnsorted), - } -} - -func parseThreatIntelligenceSortingOrder(input string) (*ThreatIntelligenceSortingOrder, error) { - vals := map[string]ThreatIntelligenceSortingOrder{ - "ascending": ThreatIntelligenceSortingOrderAscending, - "descending": ThreatIntelligenceSortingOrderDescending, - "unsorted": ThreatIntelligenceSortingOrderUnsorted, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ThreatIntelligenceSortingOrder(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/id_indicator.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/id_indicator.go deleted file mode 100644 index fe680d054de0..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/id_indicator.go +++ /dev/null @@ -1,144 +0,0 @@ -package threatintelligence - -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 = IndicatorId{} - -// IndicatorId is a struct representing the Resource ID for a Indicator -type IndicatorId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IndicatorName string -} - -// NewIndicatorID returns a new IndicatorId struct -func NewIndicatorID(subscriptionId string, resourceGroupName string, workspaceName string, indicatorName string) IndicatorId { - return IndicatorId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IndicatorName: indicatorName, - } -} - -// ParseIndicatorID parses 'input' into a IndicatorId -func ParseIndicatorID(input string) (*IndicatorId, error) { - parser := resourceids.NewParserFromResourceIdType(IndicatorId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := IndicatorId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) - } - - if id.IndicatorName, ok = parsed.Parsed["indicatorName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "indicatorName", *parsed) - } - - return &id, nil -} - -// ParseIndicatorIDInsensitively parses 'input' case-insensitively into a IndicatorId -// note: this method should only be used for API response data and not user input -func ParseIndicatorIDInsensitively(input string) (*IndicatorId, error) { - parser := resourceids.NewParserFromResourceIdType(IndicatorId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := IndicatorId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) - } - - if id.IndicatorName, ok = parsed.Parsed["indicatorName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "indicatorName", *parsed) - } - - return &id, nil -} - -// ValidateIndicatorID checks that 'input' can be parsed as a Indicator ID -func ValidateIndicatorID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseIndicatorID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Indicator ID -func (id IndicatorId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IndicatorName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Indicator ID -func (id IndicatorId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticThreatIntelligence", "threatIntelligence", "threatIntelligence"), - resourceids.StaticSegment("staticMain", "main", "main"), - resourceids.StaticSegment("staticIndicators", "indicators", "indicators"), - resourceids.UserSpecifiedSegment("indicatorName", "indicatorValue"), - } -} - -// String returns a human-readable description of this Indicator ID -func (id IndicatorId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Indicator Name: %q", id.IndicatorName), - } - return fmt.Sprintf("Indicator (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/id_workspace.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/id_workspace.go deleted file mode 100644 index c3245ebd1b3b..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/id_workspace.go +++ /dev/null @@ -1,127 +0,0 @@ -package threatintelligence - -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 = WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := WorkspaceId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := WorkspaceId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", *parsed) - } - - return &id, nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorappendtags_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorappendtags_autorest.go deleted file mode 100644 index 18b86a166fe9..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorappendtags_autorest.go +++ /dev/null @@ -1,68 +0,0 @@ -package threatintelligence - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IndicatorAppendTagsOperationResponse struct { - HttpResponse *http.Response -} - -// IndicatorAppendTags ... -func (c ThreatIntelligenceClient) IndicatorAppendTags(ctx context.Context, id IndicatorId, input ThreatIntelligenceAppendTags) (result IndicatorAppendTagsOperationResponse, err error) { - req, err := c.preparerForIndicatorAppendTags(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorAppendTags", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorAppendTags", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForIndicatorAppendTags(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorAppendTags", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForIndicatorAppendTags prepares the IndicatorAppendTags request. -func (c ThreatIntelligenceClient) preparerForIndicatorAppendTags(ctx context.Context, id IndicatorId, input ThreatIntelligenceAppendTags) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/appendTags", id.ID())), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForIndicatorAppendTags handles the response to the IndicatorAppendTags request. The method always -// closes the http.Response Body. -func (c ThreatIntelligenceClient) responderForIndicatorAppendTags(resp *http.Response) (result IndicatorAppendTagsOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorcreate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorcreate_autorest.go deleted file mode 100644 index 98609062b7f6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorcreate_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IndicatorCreateOperationResponse struct { - HttpResponse *http.Response - Model *ThreatIntelligenceInformation -} - -// IndicatorCreate ... -func (c ThreatIntelligenceClient) IndicatorCreate(ctx context.Context, id IndicatorId, input ThreatIntelligenceIndicatorModel) (result IndicatorCreateOperationResponse, err error) { - req, err := c.preparerForIndicatorCreate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorCreate", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorCreate", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForIndicatorCreate(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorCreate", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForIndicatorCreate prepares the IndicatorCreate request. -func (c ThreatIntelligenceClient) preparerForIndicatorCreate(ctx context.Context, id IndicatorId, input ThreatIntelligenceIndicatorModel) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForIndicatorCreate handles the response to the IndicatorCreate request. The method always -// closes the http.Response Body. -func (c ThreatIntelligenceClient) responderForIndicatorCreate(resp *http.Response) (result IndicatorCreateOperationResponse, err error) { - var respObj json.RawMessage - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - if err != nil { - return - } - model, err := unmarshalThreatIntelligenceInformationImplementation(respObj) - if err != nil { - return - } - result.Model = &model - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorcreateindicator_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorcreateindicator_autorest.go deleted file mode 100644 index ecc76b88f5c7..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorcreateindicator_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IndicatorCreateIndicatorOperationResponse struct { - HttpResponse *http.Response - Model *ThreatIntelligenceInformation -} - -// IndicatorCreateIndicator ... -func (c ThreatIntelligenceClient) IndicatorCreateIndicator(ctx context.Context, id WorkspaceId, input ThreatIntelligenceIndicatorModel) (result IndicatorCreateIndicatorOperationResponse, err error) { - req, err := c.preparerForIndicatorCreateIndicator(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorCreateIndicator", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorCreateIndicator", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForIndicatorCreateIndicator(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorCreateIndicator", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForIndicatorCreateIndicator prepares the IndicatorCreateIndicator request. -func (c ThreatIntelligenceClient) preparerForIndicatorCreateIndicator(ctx context.Context, id WorkspaceId, input ThreatIntelligenceIndicatorModel) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/createIndicator", id.ID())), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForIndicatorCreateIndicator handles the response to the IndicatorCreateIndicator request. The method always -// closes the http.Response Body. -func (c ThreatIntelligenceClient) responderForIndicatorCreateIndicator(resp *http.Response) (result IndicatorCreateIndicatorOperationResponse, err error) { - var respObj json.RawMessage - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - if err != nil { - return - } - model, err := unmarshalThreatIntelligenceInformationImplementation(respObj) - if err != nil { - return - } - result.Model = &model - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatordelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatordelete_autorest.go deleted file mode 100644 index 825d3b911ce9..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatordelete_autorest.go +++ /dev/null @@ -1,66 +0,0 @@ -package threatintelligence - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IndicatorDeleteOperationResponse struct { - HttpResponse *http.Response -} - -// IndicatorDelete ... -func (c ThreatIntelligenceClient) IndicatorDelete(ctx context.Context, id IndicatorId) (result IndicatorDeleteOperationResponse, err error) { - req, err := c.preparerForIndicatorDelete(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorDelete", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorDelete", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForIndicatorDelete(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorDelete", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForIndicatorDelete prepares the IndicatorDelete request. -func (c ThreatIntelligenceClient) preparerForIndicatorDelete(ctx context.Context, id IndicatorId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForIndicatorDelete handles the response to the IndicatorDelete request. The method always -// closes the http.Response Body. -func (c ThreatIntelligenceClient) responderForIndicatorDelete(resp *http.Response) (result IndicatorDeleteOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorget_autorest.go deleted file mode 100644 index ac1187fb285e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorget_autorest.go +++ /dev/null @@ -1,77 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IndicatorGetOperationResponse struct { - HttpResponse *http.Response - Model *ThreatIntelligenceInformation -} - -// IndicatorGet ... -func (c ThreatIntelligenceClient) IndicatorGet(ctx context.Context, id IndicatorId) (result IndicatorGetOperationResponse, err error) { - req, err := c.preparerForIndicatorGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorGet", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorGet", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForIndicatorGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorGet", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForIndicatorGet prepares the IndicatorGet request. -func (c ThreatIntelligenceClient) preparerForIndicatorGet(ctx context.Context, id IndicatorId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForIndicatorGet handles the response to the IndicatorGet request. The method always -// closes the http.Response Body. -func (c ThreatIntelligenceClient) responderForIndicatorGet(resp *http.Response) (result IndicatorGetOperationResponse, err error) { - var respObj json.RawMessage - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - if err != nil { - return - } - model, err := unmarshalThreatIntelligenceInformationImplementation(respObj) - if err != nil { - return - } - result.Model = &model - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatormetricslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatormetricslist_autorest.go deleted file mode 100644 index 1835c26ed964..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatormetricslist_autorest.go +++ /dev/null @@ -1,69 +0,0 @@ -package threatintelligence - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IndicatorMetricsListOperationResponse struct { - HttpResponse *http.Response - Model *ThreatIntelligenceMetricsList -} - -// IndicatorMetricsList ... -func (c ThreatIntelligenceClient) IndicatorMetricsList(ctx context.Context, id WorkspaceId) (result IndicatorMetricsListOperationResponse, err error) { - req, err := c.preparerForIndicatorMetricsList(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorMetricsList", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorMetricsList", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForIndicatorMetricsList(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorMetricsList", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForIndicatorMetricsList prepares the IndicatorMetricsList request. -func (c ThreatIntelligenceClient) preparerForIndicatorMetricsList(ctx context.Context, id WorkspaceId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/metrics", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForIndicatorMetricsList handles the response to the IndicatorMetricsList request. The method always -// closes the http.Response Body. -func (c ThreatIntelligenceClient) responderForIndicatorMetricsList(resp *http.Response) (result IndicatorMetricsListOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorqueryindicators_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorqueryindicators_autorest.go deleted file mode 100644 index fcbe7c747581..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorqueryindicators_autorest.go +++ /dev/null @@ -1,197 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IndicatorQueryIndicatorsOperationResponse struct { - HttpResponse *http.Response - Model *[]ThreatIntelligenceInformation - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (IndicatorQueryIndicatorsOperationResponse, error) -} - -type IndicatorQueryIndicatorsCompleteResult struct { - Items []ThreatIntelligenceInformation -} - -func (r IndicatorQueryIndicatorsOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r IndicatorQueryIndicatorsOperationResponse) LoadMore(ctx context.Context) (resp IndicatorQueryIndicatorsOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -// IndicatorQueryIndicators ... -func (c ThreatIntelligenceClient) IndicatorQueryIndicators(ctx context.Context, id WorkspaceId, input ThreatIntelligenceFilteringCriteria) (resp IndicatorQueryIndicatorsOperationResponse, err error) { - req, err := c.preparerForIndicatorQueryIndicators(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorQueryIndicators", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorQueryIndicators", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForIndicatorQueryIndicators(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorQueryIndicators", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// preparerForIndicatorQueryIndicators prepares the IndicatorQueryIndicators request. -func (c ThreatIntelligenceClient) preparerForIndicatorQueryIndicators(ctx context.Context, id WorkspaceId, input ThreatIntelligenceFilteringCriteria) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/queryIndicators", id.ID())), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForIndicatorQueryIndicatorsWithNextLink prepares the IndicatorQueryIndicators request with the given nextLink token. -func (c ThreatIntelligenceClient) preparerForIndicatorQueryIndicatorsWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForIndicatorQueryIndicators handles the response to the IndicatorQueryIndicators request. The method always -// closes the http.Response Body. -func (c ThreatIntelligenceClient) responderForIndicatorQueryIndicators(resp *http.Response) (result IndicatorQueryIndicatorsOperationResponse, err error) { - type page struct { - Values []json.RawMessage `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - temp := make([]ThreatIntelligenceInformation, 0) - for i, v := range respObj.Values { - val, err := unmarshalThreatIntelligenceInformationImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for ThreatIntelligenceInformation (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - result.Model = &temp - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result IndicatorQueryIndicatorsOperationResponse, err error) { - req, err := c.preparerForIndicatorQueryIndicatorsWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorQueryIndicators", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorQueryIndicators", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForIndicatorQueryIndicators(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorQueryIndicators", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} - -// IndicatorQueryIndicatorsComplete retrieves all of the results into a single object -func (c ThreatIntelligenceClient) IndicatorQueryIndicatorsComplete(ctx context.Context, id WorkspaceId, input ThreatIntelligenceFilteringCriteria) (IndicatorQueryIndicatorsCompleteResult, error) { - return c.IndicatorQueryIndicatorsCompleteMatchingPredicate(ctx, id, input, ThreatIntelligenceInformationOperationPredicate{}) -} - -// IndicatorQueryIndicatorsCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c ThreatIntelligenceClient) IndicatorQueryIndicatorsCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, input ThreatIntelligenceFilteringCriteria, predicate ThreatIntelligenceInformationOperationPredicate) (resp IndicatorQueryIndicatorsCompleteResult, err error) { - items := make([]ThreatIntelligenceInformation, 0) - - page, err := c.IndicatorQueryIndicators(ctx, id, input) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := IndicatorQueryIndicatorsCompleteResult{ - Items: items, - } - return out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorreplacetags_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorreplacetags_autorest.go deleted file mode 100644 index 01efbe5b7780..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorreplacetags_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IndicatorReplaceTagsOperationResponse struct { - HttpResponse *http.Response - Model *ThreatIntelligenceInformation -} - -// IndicatorReplaceTags ... -func (c ThreatIntelligenceClient) IndicatorReplaceTags(ctx context.Context, id IndicatorId, input ThreatIntelligenceIndicatorModel) (result IndicatorReplaceTagsOperationResponse, err error) { - req, err := c.preparerForIndicatorReplaceTags(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorReplaceTags", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorReplaceTags", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForIndicatorReplaceTags(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorReplaceTags", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForIndicatorReplaceTags prepares the IndicatorReplaceTags request. -func (c ThreatIntelligenceClient) preparerForIndicatorReplaceTags(ctx context.Context, id IndicatorId, input ThreatIntelligenceIndicatorModel) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/replaceTags", id.ID())), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForIndicatorReplaceTags handles the response to the IndicatorReplaceTags request. The method always -// closes the http.Response Body. -func (c ThreatIntelligenceClient) responderForIndicatorReplaceTags(resp *http.Response) (result IndicatorReplaceTagsOperationResponse, err error) { - var respObj json.RawMessage - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - if err != nil { - return - } - model, err := unmarshalThreatIntelligenceInformationImplementation(respObj) - if err != nil { - return - } - result.Model = &model - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorslist_autorest.go deleted file mode 100644 index 22ef9d7b193e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/method_indicatorslist_autorest.go +++ /dev/null @@ -1,235 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IndicatorsListOperationResponse struct { - HttpResponse *http.Response - Model *[]ThreatIntelligenceInformation - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (IndicatorsListOperationResponse, error) -} - -type IndicatorsListCompleteResult struct { - Items []ThreatIntelligenceInformation -} - -func (r IndicatorsListOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r IndicatorsListOperationResponse) LoadMore(ctx context.Context) (resp IndicatorsListOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -type IndicatorsListOperationOptions struct { - Filter *string - Orderby *string - Top *int64 -} - -func DefaultIndicatorsListOperationOptions() IndicatorsListOperationOptions { - return IndicatorsListOperationOptions{} -} - -func (o IndicatorsListOperationOptions) toHeaders() map[string]interface{} { - out := make(map[string]interface{}) - - return out -} - -func (o IndicatorsListOperationOptions) toQueryString() map[string]interface{} { - out := make(map[string]interface{}) - - if o.Filter != nil { - out["$filter"] = *o.Filter - } - - if o.Orderby != nil { - out["$orderby"] = *o.Orderby - } - - if o.Top != nil { - out["$top"] = *o.Top - } - - return out -} - -// IndicatorsList ... -func (c ThreatIntelligenceClient) IndicatorsList(ctx context.Context, id WorkspaceId, options IndicatorsListOperationOptions) (resp IndicatorsListOperationResponse, err error) { - req, err := c.preparerForIndicatorsList(ctx, id, options) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorsList", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorsList", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForIndicatorsList(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorsList", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// preparerForIndicatorsList prepares the IndicatorsList request. -func (c ThreatIntelligenceClient) preparerForIndicatorsList(ctx context.Context, id WorkspaceId, options IndicatorsListOperationOptions) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - for k, v := range options.toQueryString() { - queryParameters[k] = autorest.Encode("query", v) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithHeaders(options.toHeaders()), - autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForIndicatorsListWithNextLink prepares the IndicatorsList request with the given nextLink token. -func (c ThreatIntelligenceClient) preparerForIndicatorsListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForIndicatorsList handles the response to the IndicatorsList request. The method always -// closes the http.Response Body. -func (c ThreatIntelligenceClient) responderForIndicatorsList(resp *http.Response) (result IndicatorsListOperationResponse, err error) { - type page struct { - Values []json.RawMessage `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - temp := make([]ThreatIntelligenceInformation, 0) - for i, v := range respObj.Values { - val, err := unmarshalThreatIntelligenceInformationImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for ThreatIntelligenceInformation (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - result.Model = &temp - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result IndicatorsListOperationResponse, err error) { - req, err := c.preparerForIndicatorsListWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorsList", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorsList", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForIndicatorsList(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "threatintelligence.ThreatIntelligenceClient", "IndicatorsList", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} - -// IndicatorsListComplete retrieves all of the results into a single object -func (c ThreatIntelligenceClient) IndicatorsListComplete(ctx context.Context, id WorkspaceId, options IndicatorsListOperationOptions) (IndicatorsListCompleteResult, error) { - return c.IndicatorsListCompleteMatchingPredicate(ctx, id, options, ThreatIntelligenceInformationOperationPredicate{}) -} - -// IndicatorsListCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c ThreatIntelligenceClient) IndicatorsListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, options IndicatorsListOperationOptions, predicate ThreatIntelligenceInformationOperationPredicate) (resp IndicatorsListCompleteResult, err error) { - items := make([]ThreatIntelligenceInformation, 0) - - page, err := c.IndicatorsList(ctx, id, options) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := IndicatorsListCompleteResult{ - Items: items, - } - return out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceappendtags.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceappendtags.go deleted file mode 100644 index d864022037fb..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceappendtags.go +++ /dev/null @@ -1,8 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceAppendTags struct { - ThreatIntelligenceTags *[]string `json:"threatIntelligenceTags,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceexternalreference.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceexternalreference.go deleted file mode 100644 index 52978aae6368..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceexternalreference.go +++ /dev/null @@ -1,12 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceExternalReference struct { - Description *string `json:"description,omitempty"` - ExternalId *string `json:"externalId,omitempty"` - Hashes *map[string]string `json:"hashes,omitempty"` - SourceName *string `json:"sourceName,omitempty"` - Url *string `json:"url,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencefilteringcriteria.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencefilteringcriteria.go deleted file mode 100644 index 181ef4790bf0..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencefilteringcriteria.go +++ /dev/null @@ -1,20 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceFilteringCriteria struct { - Ids *[]string `json:"ids,omitempty"` - IncludeDisabled *bool `json:"includeDisabled,omitempty"` - Keywords *[]string `json:"keywords,omitempty"` - MaxConfidence *int64 `json:"maxConfidence,omitempty"` - MaxValidUntil *string `json:"maxValidUntil,omitempty"` - MinConfidence *int64 `json:"minConfidence,omitempty"` - MinValidUntil *string `json:"minValidUntil,omitempty"` - PageSize *int64 `json:"pageSize,omitempty"` - PatternTypes *[]string `json:"patternTypes,omitempty"` - SkipToken *string `json:"skipToken,omitempty"` - SortBy *[]ThreatIntelligenceSortingCriteria `json:"sortBy,omitempty"` - Sources *[]string `json:"sources,omitempty"` - ThreatTypes *[]string `json:"threatTypes,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencegranularmarkingmodel.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencegranularmarkingmodel.go deleted file mode 100644 index f35c4df440d4..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencegranularmarkingmodel.go +++ /dev/null @@ -1,10 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceGranularMarkingModel struct { - Language *string `json:"language,omitempty"` - MarkingRef *int64 `json:"markingRef,omitempty"` - Selectors *[]string `json:"selectors,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceindicatormodel.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceindicatormodel.go deleted file mode 100644 index 9ee1b5778ede..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceindicatormodel.go +++ /dev/null @@ -1,48 +0,0 @@ -package threatintelligence - -import ( - "encoding/json" - "fmt" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ ThreatIntelligenceInformation = ThreatIntelligenceIndicatorModel{} - -type ThreatIntelligenceIndicatorModel struct { - Properties *ThreatIntelligenceIndicatorProperties `json:"properties,omitempty"` - - // Fields inherited from ThreatIntelligenceInformation - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ThreatIntelligenceIndicatorModel{} - -func (s ThreatIntelligenceIndicatorModel) MarshalJSON() ([]byte, error) { - type wrapper ThreatIntelligenceIndicatorModel - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ThreatIntelligenceIndicatorModel: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ThreatIntelligenceIndicatorModel: %+v", err) - } - decoded["kind"] = "indicator" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ThreatIntelligenceIndicatorModel: %+v", err) - } - - return encoded, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceindicatorproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceindicatorproperties.go deleted file mode 100644 index 49660ed57921..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceindicatorproperties.go +++ /dev/null @@ -1,37 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceIndicatorProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Confidence *int64 `json:"confidence,omitempty"` - Created *string `json:"created,omitempty"` - CreatedByRef *string `json:"createdByRef,omitempty"` - Defanged *bool `json:"defanged,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Extensions *interface{} `json:"extensions,omitempty"` - ExternalId *string `json:"externalId,omitempty"` - ExternalLastUpdatedTimeUtc *string `json:"externalLastUpdatedTimeUtc,omitempty"` - ExternalReferences *[]ThreatIntelligenceExternalReference `json:"externalReferences,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - GranularMarkings *[]ThreatIntelligenceGranularMarkingModel `json:"granularMarkings,omitempty"` - IndicatorTypes *[]string `json:"indicatorTypes,omitempty"` - KillChainPhases *[]ThreatIntelligenceKillChainPhase `json:"killChainPhases,omitempty"` - Labels *[]string `json:"labels,omitempty"` - Language *string `json:"language,omitempty"` - LastUpdatedTimeUtc *string `json:"lastUpdatedTimeUtc,omitempty"` - Modified *string `json:"modified,omitempty"` - ObjectMarkingRefs *[]string `json:"objectMarkingRefs,omitempty"` - ParsedPattern *[]ThreatIntelligenceParsedPattern `json:"parsedPattern,omitempty"` - Pattern *string `json:"pattern,omitempty"` - PatternType *string `json:"patternType,omitempty"` - PatternVersion *string `json:"patternVersion,omitempty"` - Revoked *bool `json:"revoked,omitempty"` - Source *string `json:"source,omitempty"` - ThreatIntelligenceTags *[]string `json:"threatIntelligenceTags,omitempty"` - ThreatTypes *[]string `json:"threatTypes,omitempty"` - ValidFrom *string `json:"validFrom,omitempty"` - ValidUntil *string `json:"validUntil,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceinformation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceinformation.go deleted file mode 100644 index 567adeee2e9f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceinformation.go +++ /dev/null @@ -1,48 +0,0 @@ -package threatintelligence - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceInformation interface { -} - -func unmarshalThreatIntelligenceInformationImplementation(input []byte) (ThreatIntelligenceInformation, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling ThreatIntelligenceInformation into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "indicator") { - var out ThreatIntelligenceIndicatorModel - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ThreatIntelligenceIndicatorModel: %+v", err) - } - return out, nil - } - - type RawThreatIntelligenceInformationImpl struct { - Type string `json:"-"` - Values map[string]interface{} `json:"-"` - } - out := RawThreatIntelligenceInformationImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencekillchainphase.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencekillchainphase.go deleted file mode 100644 index 69319b0f6161..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencekillchainphase.go +++ /dev/null @@ -1,9 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceKillChainPhase struct { - KillChainName *string `json:"killChainName,omitempty"` - PhaseName *string `json:"phaseName,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetric.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetric.go deleted file mode 100644 index a6af38280393..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetric.go +++ /dev/null @@ -1,11 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceMetric struct { - LastUpdatedTimeUtc *string `json:"lastUpdatedTimeUtc,omitempty"` - PatternTypeMetrics *[]ThreatIntelligenceMetricEntity `json:"patternTypeMetrics,omitempty"` - SourceMetrics *[]ThreatIntelligenceMetricEntity `json:"sourceMetrics,omitempty"` - ThreatTypeMetrics *[]ThreatIntelligenceMetricEntity `json:"threatTypeMetrics,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetricentity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetricentity.go deleted file mode 100644 index 562f12dd822d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetricentity.go +++ /dev/null @@ -1,9 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceMetricEntity struct { - MetricName *string `json:"metricName,omitempty"` - MetricValue *int64 `json:"metricValue,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetrics.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetrics.go deleted file mode 100644 index 14a6959c8737..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetrics.go +++ /dev/null @@ -1,8 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceMetrics struct { - Properties *ThreatIntelligenceMetric `json:"properties,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetricslist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetricslist.go deleted file mode 100644 index 68025bf73cb1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencemetricslist.go +++ /dev/null @@ -1,8 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceMetricsList struct { - Value []ThreatIntelligenceMetrics `json:"value"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceparsedpattern.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceparsedpattern.go deleted file mode 100644 index 432ca8c997be..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceparsedpattern.go +++ /dev/null @@ -1,9 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceParsedPattern struct { - PatternTypeKey *string `json:"patternTypeKey,omitempty"` - PatternTypeValues *[]ThreatIntelligenceParsedPatternTypeValue `json:"patternTypeValues,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceparsedpatterntypevalue.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceparsedpatterntypevalue.go deleted file mode 100644 index e65b31999037..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceparsedpatterntypevalue.go +++ /dev/null @@ -1,9 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceParsedPatternTypeValue struct { - Value *string `json:"value,omitempty"` - ValueType *string `json:"valueType,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencesortingcriteria.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencesortingcriteria.go deleted file mode 100644 index 4b63a0af69ef..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligencesortingcriteria.go +++ /dev/null @@ -1,9 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceSortingCriteria struct { - ItemKey *string `json:"itemKey,omitempty"` - SortOrder *ThreatIntelligenceSortingOrder `json:"sortOrder,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/predicates.go deleted file mode 100644 index 6020562ed4b7..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/predicates.go +++ /dev/null @@ -1,12 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceInformationOperationPredicate struct { -} - -func (p ThreatIntelligenceInformationOperationPredicate) Matches(input ThreatIntelligenceInformation) bool { - - return true -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/version.go deleted file mode 100644 index 07547975f9ce..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package threatintelligence - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-11-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/threatintelligence/%s", defaultApiVersion) -} diff --git a/vendor/modules.txt b/vendor/modules.txt index e618d6bea9b1..85500b34c725 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -546,14 +546,10 @@ github.com/hashicorp/go-azure-sdk/resource-manager/search/2022-09-01/querykeys github.com/hashicorp/go-azure-sdk/resource-manager/search/2022-09-01/services github.com/hashicorp/go-azure-sdk/resource-manager/search/2022-09-01/sharedprivatelinkresources github.com/hashicorp/go-azure-sdk/resource-manager/security/2023-01-01/pricings -github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-10-01-preview/alertrules github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-10-01-preview/automationrules github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-10-01-preview/metadata -github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/dataconnectors -github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/sentinelonboardingstates -github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/threatintelligence github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlistitems github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/watchlists github.com/hashicorp/go-azure-sdk/resource-manager/servicebus/2021-06-01-preview/disasterrecoveryconfigs From 6f906e00d046567b8838a76398bdb7e7a9982ede Mon Sep 17 00:00:00 2001 From: Matthew Frahry Date: Wed, 31 May 2023 10:02:56 -0700 Subject: [PATCH 3/4] Update sentinel_watchlist_item_resource.go --- internal/services/sentinel/sentinel_watchlist_item_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/sentinel/sentinel_watchlist_item_resource.go b/internal/services/sentinel/sentinel_watchlist_item_resource.go index 9af4179196e0..ec514aa70615 100644 --- a/internal/services/sentinel/sentinel_watchlist_item_resource.go +++ b/internal/services/sentinel/sentinel_watchlist_item_resource.go @@ -165,7 +165,7 @@ func (r WatchlistItemResource) Update() sdk.ResourceFunc { return fmt.Errorf("decoding %+v", err) } - watchlistId, err := watchlistitems.ParseWatchlistItemID(model.WatchlistID) + watchlistId, err := watchlistitems.ParseWatchlistID(model.WatchlistID) if err != nil { return err } From 635fab43417676fde5f61aa9a288256051538ffb Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 31 May 2023 10:51:36 -0700 Subject: [PATCH 4/4] Fix TestAccWatchlistItem_update --- internal/services/sentinel/sentinel_watchlist_item_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/sentinel/sentinel_watchlist_item_resource.go b/internal/services/sentinel/sentinel_watchlist_item_resource.go index ec514aa70615..3a69f9c5ee25 100644 --- a/internal/services/sentinel/sentinel_watchlist_item_resource.go +++ b/internal/services/sentinel/sentinel_watchlist_item_resource.go @@ -188,7 +188,7 @@ func (r WatchlistItemResource) Update() sdk.ResourceFunc { update.Properties.ItemsKeyValue = model.Properties } - if _, err = client.CreateOrUpdate(ctx, *watchlistId, update); err != nil { + if _, err = client.CreateOrUpdate(ctx, id, update); err != nil { return fmt.Errorf("creating %s: %+v", id, err) }