From 4fd21a307c11b8a3756bd5804ec6f16be7804b3a Mon Sep 17 00:00:00 2001 From: magodo Date: Fri, 18 Jun 2021 13:00:38 +0800 Subject: [PATCH 1/2] update Go SDK to v55.3.0 --- .../security_center_automation_resource.go | 10 +- ...erver_vulnerability_assessment_resource.go | 15 +- go.mod | 2 +- go.sum | 4 +- .../security/mgmt/v3.0/security/CHANGELOG.md | 616 +++++- .../security/mgmt/v3.0/security/_meta.json | 2 +- .../security/mgmt/v3.0/security/alerts.go | 423 ++-- .../security/mgmt/v3.0/security/enums.go | 232 ++- .../mgmt/v3.0/security/ingestionsettings.go | 555 +++++ .../security/mgmt/v3.0/security/iotalerts.go | 307 +-- .../mgmt/v3.0/security/iotalerttypes.go | 206 +- .../mgmt/v3.0/security/iotrecommendations.go | 291 +-- .../v3.0/security/iotrecommendationtypes.go | 202 +- .../mgmt/v3.0/security/iotsecuritysolution.go | 1 + .../security/mgmt/v3.0/security/models.go | 1828 ++++++++++++----- .../security/servervulnerabilityassessment.go | 32 +- .../mgmt/v3.0/security/softwareinventories.go | 378 ++++ .../Azure/azure-sdk-for-go/version/version.go | 2 +- vendor/modules.txt | 2 +- 19 files changed, 3331 insertions(+), 1777 deletions(-) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/ingestionsettings.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/softwareinventories.go diff --git a/azurerm/internal/services/securitycenter/security_center_automation_resource.go b/azurerm/internal/services/securitycenter/security_center_automation_resource.go index 4177ebec489e..081aae83dfb0 100644 --- a/azurerm/internal/services/securitycenter/security_center_automation_resource.go +++ b/azurerm/internal/services/securitycenter/security_center_automation_resource.go @@ -127,11 +127,11 @@ func resourceSecurityCenterAutomation() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ - string(security.Alerts), - string(security.Assessments), - string(security.SecureScoreControls), - string(security.SecureScores), - string(security.SubAssessments), + string(security.EventSourceAlerts), + string(security.EventSourceAssessments), + string(security.EventSourceSecureScoreControls), + string(security.EventSourceSecureScores), + string(security.EventSourceSubAssessments), }, false), }, diff --git a/azurerm/internal/services/securitycenter/security_center_server_vulnerability_assessment_resource.go b/azurerm/internal/services/securitycenter/security_center_server_vulnerability_assessment_resource.go index cf1b463992be..27a3fb85fb46 100644 --- a/azurerm/internal/services/securitycenter/security_center_server_vulnerability_assessment_resource.go +++ b/azurerm/internal/services/securitycenter/security_center_server_vulnerability_assessment_resource.go @@ -147,17 +147,14 @@ func resourceServerVulnerabilityAssessmentDelete(d *pluginsdk.ResourceData, meta time.Sleep(time.Duration(retry) * time.Second) } - response, err := client.Delete(ctx, targetId.ResourceGroup, targetId.Provider, targetId.ResourceType, targetId.Name) + future, err := client.Delete(ctx, targetId.ResourceGroup, targetId.Provider, targetId.ResourceType, targetId.Name) if err != nil { - // https://github.com/Azure/azure-rest-api-specs/issues/12308 the API report error even if delete was successful - if utils.ResponseWasStatusCode(response, 202) { - return nil - } else { - return fmt.Errorf("removing Server Vulnerability Assessment for %q: %+v\n", targetId.Id, err) - } - } else { - return nil + return fmt.Errorf("deleting Server Vulnerability Assessment %s: %v", targetId.Id, err) } + if err := future.WaitForCompletionRef(ctx, client.Client); err != nil { + return fmt.Errorf("waiting for deletion of Server Vulnerability Assessment %s: %v", targetId.Id, err) + } + return nil } type TargetId struct { diff --git a/go.mod b/go.mod index 3abe0487bedc..d333a8c8115a 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,7 @@ module github.com/terraform-providers/terraform-provider-azurerm require ( - github.com/Azure/azure-sdk-for-go v55.2.0+incompatible + github.com/Azure/azure-sdk-for-go v55.3.0+incompatible github.com/Azure/go-autorest/autorest v0.11.18 github.com/Azure/go-autorest/autorest/date v0.3.0 github.com/Azure/go-autorest/autorest/to v0.4.0 diff --git a/go.sum b/go.sum index f4c8bb0f0891..834c50e72ffc 100644 --- a/go.sum +++ b/go.sum @@ -38,8 +38,8 @@ github.com/Azure/azure-sdk-for-go v42.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9mo github.com/Azure/azure-sdk-for-go v45.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v47.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v51.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v55.2.0+incompatible h1:TL2/vJWJEPOrmv97nHcbvjXES0Ntlb9P95hqGA1J2dU= -github.com/Azure/azure-sdk-for-go v55.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go v55.3.0+incompatible h1:rLKCdFMMCAXt/QZ96skZJUArYS3UDo9Qm1ZWzoDtC9E= +github.com/Azure/azure-sdk-for-go v55.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/CHANGELOG.md index ead67f78da9a..aa3fea66c4aa 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/CHANGELOG.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/CHANGELOG.md @@ -1,66 +1,562 @@ # Change History -## Additive Changes +## Breaking Changes -### New Funcs +### Removed Constants + +1. EnforcementMode.Audit +1. EnforcementMode.Enforce +1. EventSource.Assessments +1. EventSource.SecureScoreControls +1. EventSource.SecureScores +1. EventSource.SubAssessments + +### Removed Funcs -1. AllowedConnectionsList.MarshalJSON() ([]byte, error) -1. AllowedConnectionsResourceProperties.MarshalJSON() ([]byte, error) -1. AscLocationList.MarshalJSON() ([]byte, error) -1. AssessmentLinks.MarshalJSON() ([]byte, error) -1. AssessmentList.MarshalJSON() ([]byte, error) -1. AssessmentMetadataList.MarshalJSON() ([]byte, error) -1. AzureResourceLink.MarshalJSON() ([]byte, error) -1. CVE.MarshalJSON() ([]byte, error) -1. CVSS.MarshalJSON() ([]byte, error) -1. CloudErrorBody.MarshalJSON() ([]byte, error) -1. ComplianceProperties.MarshalJSON() ([]byte, error) -1. ComplianceResultProperties.MarshalJSON() ([]byte, error) -1. ComplianceSegment.MarshalJSON() ([]byte, error) -1. ConnectableResource.MarshalJSON() ([]byte, error) -1. ConnectedResource.MarshalJSON() ([]byte, error) -1. ContactList.MarshalJSON() ([]byte, error) -1. Firmware.MarshalJSON() ([]byte, error) -1. IPAddress.MarshalJSON() ([]byte, error) -1. IoTSecurityAggregatedAlertProperties.MarshalJSON() ([]byte, error) -1. IoTSecurityAggregatedAlertPropertiesTopDevicesListItem.MarshalJSON() ([]byte, error) -1. IoTSecurityAlertedDevice.MarshalJSON() ([]byte, error) -1. IoTSecurityDeviceAlert.MarshalJSON() ([]byte, error) -1. IoTSecurityDeviceRecommendation.MarshalJSON() ([]byte, error) +1. *IotAlert.UnmarshalJSON([]byte) error +1. *IotAlertListIterator.Next() error +1. *IotAlertListIterator.NextWithContext(context.Context) error +1. *IotAlertListPage.Next() error +1. *IotAlertListPage.NextWithContext(context.Context) error +1. *IotRecommendation.UnmarshalJSON([]byte) error +1. *IotRecommendationListIterator.Next() error +1. *IotRecommendationListIterator.NextWithContext(context.Context) error +1. *IotRecommendationListPage.Next() error +1. *IotRecommendationListPage.NextWithContext(context.Context) error +1. AlertsClient.GetResourceGroupLevelAlerts(context.Context, string, string) (Alert, error) +1. AlertsClient.GetResourceGroupLevelAlertsPreparer(context.Context, string, string) (*http.Request, error) +1. AlertsClient.GetResourceGroupLevelAlertsResponder(*http.Response) (Alert, error) +1. AlertsClient.GetResourceGroupLevelAlertsSender(*http.Request) (*http.Response, error) +1. AlertsClient.GetSubscriptionLevelAlert(context.Context, string) (Alert, error) +1. AlertsClient.GetSubscriptionLevelAlertPreparer(context.Context, string) (*http.Request, error) +1. AlertsClient.GetSubscriptionLevelAlertResponder(*http.Response) (Alert, error) +1. AlertsClient.GetSubscriptionLevelAlertSender(*http.Request) (*http.Response, error) +1. AlertsClient.ListResourceGroupLevelAlertsByRegion(context.Context, string) (AlertListPage, error) +1. AlertsClient.ListResourceGroupLevelAlertsByRegionComplete(context.Context, string) (AlertListIterator, error) +1. AlertsClient.ListResourceGroupLevelAlertsByRegionPreparer(context.Context, string) (*http.Request, error) +1. AlertsClient.ListResourceGroupLevelAlertsByRegionResponder(*http.Response) (AlertList, error) +1. AlertsClient.ListResourceGroupLevelAlertsByRegionSender(*http.Request) (*http.Response, error) +1. AlertsClient.ListSubscriptionLevelAlertsByRegion(context.Context) (AlertListPage, error) +1. AlertsClient.ListSubscriptionLevelAlertsByRegionComplete(context.Context) (AlertListIterator, error) +1. AlertsClient.ListSubscriptionLevelAlertsByRegionPreparer(context.Context) (*http.Request, error) +1. AlertsClient.ListSubscriptionLevelAlertsByRegionResponder(*http.Response) (AlertList, error) +1. AlertsClient.ListSubscriptionLevelAlertsByRegionSender(*http.Request) (*http.Response, error) +1. AlertsClient.UpdateResourceGroupLevelAlertStateToDismiss(context.Context, string, string) (autorest.Response, error) +1. AlertsClient.UpdateResourceGroupLevelAlertStateToDismissPreparer(context.Context, string, string) (*http.Request, error) +1. AlertsClient.UpdateResourceGroupLevelAlertStateToDismissResponder(*http.Response) (autorest.Response, error) +1. AlertsClient.UpdateResourceGroupLevelAlertStateToDismissSender(*http.Request) (*http.Response, error) +1. AlertsClient.UpdateResourceGroupLevelAlertStateToReactivate(context.Context, string, string) (autorest.Response, error) +1. AlertsClient.UpdateResourceGroupLevelAlertStateToReactivatePreparer(context.Context, string, string) (*http.Request, error) +1. AlertsClient.UpdateResourceGroupLevelAlertStateToReactivateResponder(*http.Response) (autorest.Response, error) +1. AlertsClient.UpdateResourceGroupLevelAlertStateToReactivateSender(*http.Request) (*http.Response, error) +1. AlertsClient.UpdateSubscriptionLevelAlertStateToDismiss(context.Context, string) (autorest.Response, error) +1. AlertsClient.UpdateSubscriptionLevelAlertStateToDismissPreparer(context.Context, string) (*http.Request, error) +1. AlertsClient.UpdateSubscriptionLevelAlertStateToDismissResponder(*http.Response) (autorest.Response, error) +1. AlertsClient.UpdateSubscriptionLevelAlertStateToDismissSender(*http.Request) (*http.Response, error) +1. AlertsClient.UpdateSubscriptionLevelAlertStateToReactivate(context.Context, string) (autorest.Response, error) +1. AlertsClient.UpdateSubscriptionLevelAlertStateToReactivatePreparer(context.Context, string) (*http.Request, error) +1. AlertsClient.UpdateSubscriptionLevelAlertStateToReactivateResponder(*http.Response) (autorest.Response, error) +1. AlertsClient.UpdateSubscriptionLevelAlertStateToReactivateSender(*http.Request) (*http.Response, error) +1. IotAlert.MarshalJSON() ([]byte, error) +1. IotAlertList.IsEmpty() bool 1. IotAlertList.MarshalJSON() ([]byte, error) -1. IotAlertListModel.MarshalJSON() ([]byte, error) -1. IotAlertTypeProperties.MarshalJSON() ([]byte, error) -1. IotDefenderSettingsList.MarshalJSON() ([]byte, error) +1. IotAlertListIterator.NotDone() bool +1. IotAlertListIterator.Response() IotAlertList +1. IotAlertListIterator.Value() IotAlert +1. IotAlertListPage.NotDone() bool +1. IotAlertListPage.Response() IotAlertList +1. IotAlertListPage.Values() []IotAlert +1. IotAlertProperties.MarshalJSON() ([]byte, error) +1. IotAlertTypesClient.Get1(context.Context, string) (IotAlertType, error) +1. IotAlertTypesClient.Get1Preparer(context.Context, string) (*http.Request, error) +1. IotAlertTypesClient.Get1Responder(*http.Response) (IotAlertType, error) +1. IotAlertTypesClient.Get1Sender(*http.Request) (*http.Response, error) +1. IotAlertTypesClient.List1(context.Context) (IotAlertTypeList, error) +1. IotAlertTypesClient.List1Preparer(context.Context) (*http.Request, error) +1. IotAlertTypesClient.List1Responder(*http.Response) (IotAlertTypeList, error) +1. IotAlertTypesClient.List1Sender(*http.Request) (*http.Response, error) +1. IotAlertsClient.Get1(context.Context, string, string) (IotAlertModel, error) +1. IotAlertsClient.Get1Preparer(context.Context, string, string) (*http.Request, error) +1. IotAlertsClient.Get1Responder(*http.Response) (IotAlertModel, error) +1. IotAlertsClient.Get1Sender(*http.Request) (*http.Response, error) +1. IotAlertsClient.List1(context.Context, string, string, string, string, ManagementState, string, *int32, string) (IotAlertListModelPage, error) +1. IotAlertsClient.List1Complete(context.Context, string, string, string, string, ManagementState, string, *int32, string) (IotAlertListModelIterator, error) +1. IotAlertsClient.List1Preparer(context.Context, string, string, string, string, ManagementState, string, *int32, string) (*http.Request, error) +1. IotAlertsClient.List1Responder(*http.Response) (IotAlertListModel, error) +1. IotAlertsClient.List1Sender(*http.Request) (*http.Response, error) +1. IotRecommendation.MarshalJSON() ([]byte, error) +1. IotRecommendationList.IsEmpty() bool 1. IotRecommendationList.MarshalJSON() ([]byte, error) -1. IotRecommendationListModel.MarshalJSON() ([]byte, error) -1. IotRecommendationTypeProperties.MarshalJSON() ([]byte, error) -1. IotSensorsList.MarshalJSON() ([]byte, error) -1. IotSitesList.MarshalJSON() ([]byte, error) -1. Location.MarshalJSON() ([]byte, error) -1. MacAddress.MarshalJSON() ([]byte, error) -1. OnPremiseIotSensorsList.MarshalJSON() ([]byte, error) -1. OperationDisplay.MarshalJSON() ([]byte, error) -1. PackageDownloads.MarshalJSON() ([]byte, error) -1. PackageDownloadsCentralManager.MarshalJSON() ([]byte, error) -1. PackageDownloadsCentralManagerFull.MarshalJSON() ([]byte, error) -1. PackageDownloadsCentralManagerFullOvf.MarshalJSON() ([]byte, error) -1. PackageDownloadsSensorFullOvf.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) -1. ScoreDetails.MarshalJSON() ([]byte, error) -1. SecureScoreControlDefinitionItemProperties.MarshalJSON() ([]byte, error) -1. SecureScoreControlDefinitionList.MarshalJSON() ([]byte, error) -1. SecureScoreControlList.MarshalJSON() ([]byte, error) -1. SecureScoreControlScore.MarshalJSON() ([]byte, error) -1. SecureScoresList.MarshalJSON() ([]byte, error) -1. Sensor.MarshalJSON() ([]byte, error) -1. ServerVulnerabilityAssessmentProperties.MarshalJSON() ([]byte, error) -1. Site.MarshalJSON() ([]byte, error) -1. SubAssessmentList.MarshalJSON() ([]byte, error) -1. SubAssessmentStatus.MarshalJSON() ([]byte, error) -1. TaskList.MarshalJSON() ([]byte, error) -1. TopologyList.MarshalJSON() ([]byte, error) -1. TopologyResourceProperties.MarshalJSON() ([]byte, error) -1. TopologySingleResource.MarshalJSON() ([]byte, error) -1. TopologySingleResourceChild.MarshalJSON() ([]byte, error) -1. TopologySingleResourceParent.MarshalJSON() ([]byte, error) -1. VendorReference.MarshalJSON() ([]byte, error) +1. IotRecommendationListIterator.NotDone() bool +1. IotRecommendationListIterator.Response() IotRecommendationList +1. IotRecommendationListIterator.Value() IotRecommendation +1. IotRecommendationListPage.NotDone() bool +1. IotRecommendationListPage.Response() IotRecommendationList +1. IotRecommendationListPage.Values() []IotRecommendation +1. IotRecommendationProperties.MarshalJSON() ([]byte, error) +1. IotRecommendationTypesClient.Get1(context.Context, string) (IotRecommendationType, error) +1. IotRecommendationTypesClient.Get1Preparer(context.Context, string) (*http.Request, error) +1. IotRecommendationTypesClient.Get1Responder(*http.Response) (IotRecommendationType, error) +1. IotRecommendationTypesClient.Get1Sender(*http.Request) (*http.Response, error) +1. IotRecommendationTypesClient.List1(context.Context) (IotRecommendationTypeList, error) +1. IotRecommendationTypesClient.List1Preparer(context.Context) (*http.Request, error) +1. IotRecommendationTypesClient.List1Responder(*http.Response) (IotRecommendationTypeList, error) +1. IotRecommendationTypesClient.List1Sender(*http.Request) (*http.Response, error) +1. IotRecommendationsClient.Get1(context.Context, string, string) (IotRecommendationModel, error) +1. IotRecommendationsClient.Get1Preparer(context.Context, string, string) (*http.Request, error) +1. IotRecommendationsClient.Get1Responder(*http.Response) (IotRecommendationModel, error) +1. IotRecommendationsClient.Get1Sender(*http.Request) (*http.Response, error) +1. IotRecommendationsClient.List1(context.Context, string, string, string, *int32, string) (IotRecommendationListModelPage, error) +1. IotRecommendationsClient.List1Complete(context.Context, string, string, string, *int32, string) (IotRecommendationListModelIterator, error) +1. IotRecommendationsClient.List1Preparer(context.Context, string, string, string, *int32, string) (*http.Request, error) +1. IotRecommendationsClient.List1Responder(*http.Response) (IotRecommendationListModel, error) +1. IotRecommendationsClient.List1Sender(*http.Request) (*http.Response, error) +1. NewIotAlertListIterator(IotAlertListPage) IotAlertListIterator +1. NewIotAlertListPage(IotAlertList, func(context.Context, IotAlertList) (IotAlertList, error)) IotAlertListPage +1. NewIotRecommendationListIterator(IotRecommendationListPage) IotRecommendationListIterator +1. NewIotRecommendationListPage(IotRecommendationList, func(context.Context, IotRecommendationList) (IotRecommendationList, error)) IotRecommendationListPage +1. PossibleCategoryValues() []Category + +### Struct Changes + +#### Removed Structs + +1. IotAlert +1. IotAlertList +1. IotAlertListIterator +1. IotAlertListPage +1. IotAlertProperties +1. IotRecommendation +1. IotRecommendationList +1. IotRecommendationListIterator +1. IotRecommendationListPage +1. IotRecommendationProperties + +#### Removed Struct Fields + +1. AssessmentMetadataProperties.Category + +### Signature Changes + +#### Const Types + +1. Alerts changed type from EventSource to AdditionalWorkspaceDataType +1. Compute changed type from Category to Categories +1. Data changed type from Category to Categories +1. IdentityAndAccess changed type from Category to Categories +1. IoT changed type from Category to Categories +1. Networking changed type from Category to Categories +1. None changed type from EnforcementMode to EndOfSupportStatus +1. RawEvents changed type from ExportData to AdditionalWorkspaceDataType + +#### Funcs + +1. IotAlertTypesClient.Get + - Params + - From: context.Context, string, string, string + - To: context.Context, string +1. IotAlertTypesClient.GetPreparer + - Params + - From: context.Context, string, string, string + - To: context.Context, string +1. IotAlertTypesClient.List + - Params + - From: context.Context, string, string + - To: context.Context +1. IotAlertTypesClient.ListPreparer + - Params + - From: context.Context, string, string + - To: context.Context +1. IotAlertsClient.Get + - Params + - From: context.Context, string, string, string + - To: context.Context, string, string + - Returns + - From: IotAlert, error + - To: IotAlertModel, error +1. IotAlertsClient.GetPreparer + - Params + - From: context.Context, string, string, string + - To: context.Context, string, string +1. IotAlertsClient.GetResponder + - Returns + - From: IotAlert, error + - To: IotAlertModel, error +1. IotAlertsClient.List + - Params + - From: context.Context, string, string, string, string, string, string, *int32, string + - To: context.Context, string, string, string, string, ManagementState, string, *int32, string + - Returns + - From: IotAlertListPage, error + - To: IotAlertListModelPage, error +1. IotAlertsClient.ListComplete + - Params + - From: context.Context, string, string, string, string, string, string, *int32, string + - To: context.Context, string, string, string, string, ManagementState, string, *int32, string + - Returns + - From: IotAlertListIterator, error + - To: IotAlertListModelIterator, error +1. IotAlertsClient.ListPreparer + - Params + - From: context.Context, string, string, string, string, string, string, *int32, string + - To: context.Context, string, string, string, string, ManagementState, string, *int32, string +1. IotAlertsClient.ListResponder + - Returns + - From: IotAlertList, error + - To: IotAlertListModel, error +1. IotRecommendationTypesClient.Get + - Params + - From: context.Context, string, string, string + - To: context.Context, string +1. IotRecommendationTypesClient.GetPreparer + - Params + - From: context.Context, string, string, string + - To: context.Context, string +1. IotRecommendationTypesClient.List + - Params + - From: context.Context, string, string + - To: context.Context +1. IotRecommendationTypesClient.ListPreparer + - Params + - From: context.Context, string, string + - To: context.Context +1. IotRecommendationsClient.Get + - Params + - From: context.Context, string, string, string + - To: context.Context, string, string + - Returns + - From: IotRecommendation, error + - To: IotRecommendationModel, error +1. IotRecommendationsClient.GetPreparer + - Params + - From: context.Context, string, string, string + - To: context.Context, string, string +1. IotRecommendationsClient.GetResponder + - Returns + - From: IotRecommendation, error + - To: IotRecommendationModel, error +1. IotRecommendationsClient.List + - Params + - From: context.Context, string, string, string, string, *int32, string + - To: context.Context, string, string, string, *int32, string + - Returns + - From: IotRecommendationListPage, error + - To: IotRecommendationListModelPage, error +1. IotRecommendationsClient.ListComplete + - Params + - From: context.Context, string, string, string, string, *int32, string + - To: context.Context, string, string, string, *int32, string + - Returns + - From: IotRecommendationListIterator, error + - To: IotRecommendationListModelIterator, error +1. IotRecommendationsClient.ListPreparer + - Params + - From: context.Context, string, string, string, string, *int32, string + - To: context.Context, string, string, string, *int32, string +1. IotRecommendationsClient.ListResponder + - Returns + - From: IotRecommendationList, error + - To: IotRecommendationListModel, error +1. ServerVulnerabilityAssessmentClient.Delete + - Returns + - From: autorest.Response, error + - To: ServerVulnerabilityAssessmentDeleteFuture, error +1. ServerVulnerabilityAssessmentClient.DeleteSender + - Returns + - From: *http.Response, error + - To: ServerVulnerabilityAssessmentDeleteFuture, error + +#### Struct Fields + +1. IoTSecurityAggregatedAlertProperties.Count changed type from *int32 to *int64 +1. IoTSecurityAggregatedAlertPropertiesTopDevicesListItem.AlertsCount changed type from *int32 to *int64 +1. IoTSecurityAggregatedRecommendationProperties.HealthyDevices changed type from *int32 to *int64 +1. IoTSecurityAggregatedRecommendationProperties.UnhealthyDeviceCount changed type from *int32 to *int64 +1. IoTSecurityAlertedDevice.AlertsCount changed type from *int32 to *int64 +1. IoTSecurityDeviceAlert.AlertsCount changed type from *int32 to *int64 +1. IoTSecurityDeviceRecommendation.DevicesCount changed type from *int32 to *int64 +1. IoTSecuritySolutionAnalyticsModelProperties.UnhealthyDeviceCount changed type from *int32 to *int64 +1. IoTSeverityMetrics.High changed type from *int32 to *int64 +1. IoTSeverityMetrics.Low changed type from *int32 to *int64 +1. IoTSeverityMetrics.Medium changed type from *int32 to *int64 + +## Additive Changes + +### New Constants + +1. AdditionalWorkspaceType.Sentinel +1. BundleType.AppServices +1. BundleType.DNS +1. BundleType.KeyVaults +1. BundleType.KubernetesService +1. BundleType.ResourceManager +1. BundleType.SQLServers +1. BundleType.StorageAccounts +1. BundleType.VirtualMachines +1. CreatedByType.Application +1. CreatedByType.Key +1. CreatedByType.ManagedIdentity +1. CreatedByType.User +1. EndOfSupportStatus.NoLongerSupported +1. EndOfSupportStatus.UpcomingNoLongerSupported +1. EndOfSupportStatus.UpcomingVersionNoLongerSupported +1. EndOfSupportStatus.VersionNoLongerSupported +1. EnforcementMode.EnforcementModeAudit +1. EnforcementMode.EnforcementModeEnforce +1. EnforcementMode.EnforcementModeNone +1. EventSource.EventSourceAlerts +1. EventSource.EventSourceAssessments +1. EventSource.EventSourceRegulatoryComplianceAssessment +1. EventSource.EventSourceRegulatoryComplianceAssessmentSnapshot +1. EventSource.EventSourceSecureScoreControls +1. EventSource.EventSourceSecureScoreControlsSnapshot +1. EventSource.EventSourceSecureScores +1. EventSource.EventSourceSecureScoresSnapshot +1. EventSource.EventSourceSubAssessments +1. ExportData.ExportDataRawEvents +1. KindEnum2.KindAlertSimulatorRequestProperties +1. KindEnum2.KindBundles +1. OnboardingKind.Default +1. OnboardingKind.MigratedToAzure +1. RuleTypeBasicCustomAlertRule.RuleTypeConnectionFromIPNotAllowed +1. SensorType.SensorTypeEnterprise +1. SensorType.SensorTypeOt + +### New Funcs + +1. *AlertSimulatorBundlesRequestProperties.UnmarshalJSON([]byte) error +1. *AlertSimulatorRequestBody.UnmarshalJSON([]byte) error +1. *AlertSimulatorRequestProperties.UnmarshalJSON([]byte) error +1. *AlertsSimulateFuture.UnmarshalJSON([]byte) error +1. *IngestionSettingListIterator.Next() error +1. *IngestionSettingListIterator.NextWithContext(context.Context) error +1. *IngestionSettingListPage.Next() error +1. *IngestionSettingListPage.NextWithContext(context.Context) error +1. *ServerVulnerabilityAssessmentDeleteFuture.UnmarshalJSON([]byte) error +1. *Software.UnmarshalJSON([]byte) error +1. *SoftwaresListIterator.Next() error +1. *SoftwaresListIterator.NextWithContext(context.Context) error +1. *SoftwaresListPage.Next() error +1. *SoftwaresListPage.NextWithContext(context.Context) error +1. ActiveConnectionsNotInAllowedRange.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. AlertSimulatorBundlesRequestProperties.AsAlertSimulatorBundlesRequestProperties() (*AlertSimulatorBundlesRequestProperties, bool) +1. AlertSimulatorBundlesRequestProperties.AsAlertSimulatorRequestProperties() (*AlertSimulatorRequestProperties, bool) +1. AlertSimulatorBundlesRequestProperties.AsBasicAlertSimulatorRequestProperties() (BasicAlertSimulatorRequestProperties, bool) +1. AlertSimulatorBundlesRequestProperties.MarshalJSON() ([]byte, error) +1. AlertSimulatorRequestProperties.AsAlertSimulatorBundlesRequestProperties() (*AlertSimulatorBundlesRequestProperties, bool) +1. AlertSimulatorRequestProperties.AsAlertSimulatorRequestProperties() (*AlertSimulatorRequestProperties, bool) +1. AlertSimulatorRequestProperties.AsBasicAlertSimulatorRequestProperties() (BasicAlertSimulatorRequestProperties, bool) +1. AlertSimulatorRequestProperties.MarshalJSON() ([]byte, error) +1. AlertsClient.GetResourceGroupLevel(context.Context, string, string) (Alert, error) +1. AlertsClient.GetResourceGroupLevelPreparer(context.Context, string, string) (*http.Request, error) +1. AlertsClient.GetResourceGroupLevelResponder(*http.Response) (Alert, error) +1. AlertsClient.GetResourceGroupLevelSender(*http.Request) (*http.Response, error) +1. AlertsClient.GetSubscriptionLevel(context.Context, string) (Alert, error) +1. AlertsClient.GetSubscriptionLevelPreparer(context.Context, string) (*http.Request, error) +1. AlertsClient.GetSubscriptionLevelResponder(*http.Response) (Alert, error) +1. AlertsClient.GetSubscriptionLevelSender(*http.Request) (*http.Response, error) +1. AlertsClient.ListResourceGroupLevelByRegion(context.Context, string) (AlertListPage, error) +1. AlertsClient.ListResourceGroupLevelByRegionComplete(context.Context, string) (AlertListIterator, error) +1. AlertsClient.ListResourceGroupLevelByRegionPreparer(context.Context, string) (*http.Request, error) +1. AlertsClient.ListResourceGroupLevelByRegionResponder(*http.Response) (AlertList, error) +1. AlertsClient.ListResourceGroupLevelByRegionSender(*http.Request) (*http.Response, error) +1. AlertsClient.ListSubscriptionLevelByRegion(context.Context) (AlertListPage, error) +1. AlertsClient.ListSubscriptionLevelByRegionComplete(context.Context) (AlertListIterator, error) +1. AlertsClient.ListSubscriptionLevelByRegionPreparer(context.Context) (*http.Request, error) +1. AlertsClient.ListSubscriptionLevelByRegionResponder(*http.Response) (AlertList, error) +1. AlertsClient.ListSubscriptionLevelByRegionSender(*http.Request) (*http.Response, error) +1. AlertsClient.Simulate(context.Context, AlertSimulatorRequestBody) (AlertsSimulateFuture, error) +1. AlertsClient.SimulatePreparer(context.Context, AlertSimulatorRequestBody) (*http.Request, error) +1. AlertsClient.SimulateResponder(*http.Response) (autorest.Response, error) +1. AlertsClient.SimulateSender(*http.Request) (AlertsSimulateFuture, error) +1. AlertsClient.UpdateResourceGroupLevelStateToActivate(context.Context, string, string) (autorest.Response, error) +1. AlertsClient.UpdateResourceGroupLevelStateToActivatePreparer(context.Context, string, string) (*http.Request, error) +1. AlertsClient.UpdateResourceGroupLevelStateToActivateResponder(*http.Response) (autorest.Response, error) +1. AlertsClient.UpdateResourceGroupLevelStateToActivateSender(*http.Request) (*http.Response, error) +1. AlertsClient.UpdateResourceGroupLevelStateToDismiss(context.Context, string, string) (autorest.Response, error) +1. AlertsClient.UpdateResourceGroupLevelStateToDismissPreparer(context.Context, string, string) (*http.Request, error) +1. AlertsClient.UpdateResourceGroupLevelStateToDismissResponder(*http.Response) (autorest.Response, error) +1. AlertsClient.UpdateResourceGroupLevelStateToDismissSender(*http.Request) (*http.Response, error) +1. AlertsClient.UpdateSubscriptionLevelStateToActivate(context.Context, string) (autorest.Response, error) +1. AlertsClient.UpdateSubscriptionLevelStateToActivatePreparer(context.Context, string) (*http.Request, error) +1. AlertsClient.UpdateSubscriptionLevelStateToActivateResponder(*http.Response) (autorest.Response, error) +1. AlertsClient.UpdateSubscriptionLevelStateToActivateSender(*http.Request) (*http.Response, error) +1. AlertsClient.UpdateSubscriptionLevelStateToDismiss(context.Context, string) (autorest.Response, error) +1. AlertsClient.UpdateSubscriptionLevelStateToDismissPreparer(context.Context, string) (*http.Request, error) +1. AlertsClient.UpdateSubscriptionLevelStateToDismissResponder(*http.Response) (autorest.Response, error) +1. AlertsClient.UpdateSubscriptionLevelStateToDismissSender(*http.Request) (*http.Response, error) +1. AllowlistCustomAlertRule.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. AmqpC2DMessagesNotInAllowedRange.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. AmqpC2DRejectedMessagesNotInAllowedRange.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. AmqpD2CMessagesNotInAllowedRange.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. ConnectionFromIPNotAllowed.AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) +1. ConnectionFromIPNotAllowed.AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) +1. ConnectionFromIPNotAllowed.AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) +1. ConnectionFromIPNotAllowed.AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) +1. ConnectionFromIPNotAllowed.AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) +1. ConnectionFromIPNotAllowed.AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) +1. ConnectionFromIPNotAllowed.AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) +1. ConnectionFromIPNotAllowed.AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) +1. ConnectionFromIPNotAllowed.AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) +1. ConnectionFromIPNotAllowed.AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) +1. ConnectionFromIPNotAllowed.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. ConnectionFromIPNotAllowed.AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) +1. ConnectionFromIPNotAllowed.AsCustomAlertRule() (*CustomAlertRule, bool) +1. ConnectionFromIPNotAllowed.AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) +1. ConnectionFromIPNotAllowed.AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) +1. ConnectionFromIPNotAllowed.AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) +1. ConnectionFromIPNotAllowed.AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) +1. ConnectionFromIPNotAllowed.AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) +1. ConnectionFromIPNotAllowed.AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) +1. ConnectionFromIPNotAllowed.AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) +1. ConnectionFromIPNotAllowed.AsListCustomAlertRule() (*ListCustomAlertRule, bool) +1. ConnectionFromIPNotAllowed.AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) +1. ConnectionFromIPNotAllowed.AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) +1. ConnectionFromIPNotAllowed.AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) +1. ConnectionFromIPNotAllowed.AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) +1. ConnectionFromIPNotAllowed.AsProcessNotAllowed() (*ProcessNotAllowed, bool) +1. ConnectionFromIPNotAllowed.AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) +1. ConnectionFromIPNotAllowed.AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) +1. ConnectionFromIPNotAllowed.AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) +1. ConnectionFromIPNotAllowed.AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) +1. ConnectionFromIPNotAllowed.AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) +1. ConnectionFromIPNotAllowed.MarshalJSON() ([]byte, error) +1. ConnectionToIPNotAllowed.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. CustomAlertRule.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. DenylistCustomAlertRule.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. DirectMethodInvokesNotInAllowedRange.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. ErrorAdditionalInfo.MarshalJSON() ([]byte, error) +1. FailedLocalLoginsNotInAllowedRange.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. FileUploadsNotInAllowedRange.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. HTTPC2DMessagesNotInAllowedRange.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. HTTPC2DRejectedMessagesNotInAllowedRange.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. HTTPD2CMessagesNotInAllowedRange.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. IngestionConnectionString.MarshalJSON() ([]byte, error) +1. IngestionSetting.MarshalJSON() ([]byte, error) +1. IngestionSettingList.IsEmpty() bool +1. IngestionSettingList.MarshalJSON() ([]byte, error) +1. IngestionSettingListIterator.NotDone() bool +1. IngestionSettingListIterator.Response() IngestionSettingList +1. IngestionSettingListIterator.Value() IngestionSetting +1. IngestionSettingListPage.NotDone() bool +1. IngestionSettingListPage.Response() IngestionSettingList +1. IngestionSettingListPage.Values() []IngestionSetting +1. IngestionSettingToken.MarshalJSON() ([]byte, error) +1. IngestionSettingsClient.Create(context.Context, string, IngestionSetting) (IngestionSetting, error) +1. IngestionSettingsClient.CreatePreparer(context.Context, string, IngestionSetting) (*http.Request, error) +1. IngestionSettingsClient.CreateResponder(*http.Response) (IngestionSetting, error) +1. IngestionSettingsClient.CreateSender(*http.Request) (*http.Response, error) +1. IngestionSettingsClient.Delete(context.Context, string) (autorest.Response, error) +1. IngestionSettingsClient.DeletePreparer(context.Context, string) (*http.Request, error) +1. IngestionSettingsClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. IngestionSettingsClient.DeleteSender(*http.Request) (*http.Response, error) +1. IngestionSettingsClient.Get(context.Context, string) (IngestionSetting, error) +1. IngestionSettingsClient.GetPreparer(context.Context, string) (*http.Request, error) +1. IngestionSettingsClient.GetResponder(*http.Response) (IngestionSetting, error) +1. IngestionSettingsClient.GetSender(*http.Request) (*http.Response, error) +1. IngestionSettingsClient.List(context.Context) (IngestionSettingListPage, error) +1. IngestionSettingsClient.ListComplete(context.Context) (IngestionSettingListIterator, error) +1. IngestionSettingsClient.ListConnectionStrings(context.Context, string) (ConnectionStrings, error) +1. IngestionSettingsClient.ListConnectionStringsPreparer(context.Context, string) (*http.Request, error) +1. IngestionSettingsClient.ListConnectionStringsResponder(*http.Response) (ConnectionStrings, error) +1. IngestionSettingsClient.ListConnectionStringsSender(*http.Request) (*http.Response, error) +1. IngestionSettingsClient.ListPreparer(context.Context) (*http.Request, error) +1. IngestionSettingsClient.ListResponder(*http.Response) (IngestionSettingList, error) +1. IngestionSettingsClient.ListSender(*http.Request) (*http.Response, error) +1. IngestionSettingsClient.ListTokens(context.Context, string) (IngestionSettingToken, error) +1. IngestionSettingsClient.ListTokensPreparer(context.Context, string) (*http.Request, error) +1. IngestionSettingsClient.ListTokensResponder(*http.Response) (IngestionSettingToken, error) +1. IngestionSettingsClient.ListTokensSender(*http.Request) (*http.Response, error) +1. ListCustomAlertRule.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. LocalUserNotAllowed.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. MqttC2DMessagesNotInAllowedRange.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. MqttC2DRejectedMessagesNotInAllowedRange.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. MqttD2CMessagesNotInAllowedRange.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. NewIngestionSettingListIterator(IngestionSettingListPage) IngestionSettingListIterator +1. NewIngestionSettingListPage(IngestionSettingList, func(context.Context, IngestionSettingList) (IngestionSettingList, error)) IngestionSettingListPage +1. NewIngestionSettingsClient(string, string) IngestionSettingsClient +1. NewIngestionSettingsClientWithBaseURI(string, string, string) IngestionSettingsClient +1. NewSoftwareInventoriesClient(string, string) SoftwareInventoriesClient +1. NewSoftwareInventoriesClientWithBaseURI(string, string, string) SoftwareInventoriesClient +1. NewSoftwaresListIterator(SoftwaresListPage) SoftwaresListIterator +1. NewSoftwaresListPage(SoftwaresList, func(context.Context, SoftwaresList) (SoftwaresList, error)) SoftwaresListPage +1. PossibleAdditionalWorkspaceDataTypeValues() []AdditionalWorkspaceDataType +1. PossibleAdditionalWorkspaceTypeValues() []AdditionalWorkspaceType +1. PossibleBundleTypeValues() []BundleType +1. PossibleCategoriesValues() []Categories +1. PossibleCreatedByTypeValues() []CreatedByType +1. PossibleEndOfSupportStatusValues() []EndOfSupportStatus +1. PossibleKindEnum2Values() []KindEnum2 +1. PossibleOnboardingKindValues() []OnboardingKind +1. PossibleSensorTypeValues() []SensorType +1. ProcessNotAllowed.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. QueuePurgesNotInAllowedRange.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. Software.MarshalJSON() ([]byte, error) +1. SoftwareInventoriesClient.Get(context.Context, string, string, string, string, string) (Software, error) +1. SoftwareInventoriesClient.GetPreparer(context.Context, string, string, string, string, string) (*http.Request, error) +1. SoftwareInventoriesClient.GetResponder(*http.Response) (Software, error) +1. SoftwareInventoriesClient.GetSender(*http.Request) (*http.Response, error) +1. SoftwareInventoriesClient.ListByExtendedResource(context.Context, string, string, string, string) (SoftwaresListPage, error) +1. SoftwareInventoriesClient.ListByExtendedResourceComplete(context.Context, string, string, string, string) (SoftwaresListIterator, error) +1. SoftwareInventoriesClient.ListByExtendedResourcePreparer(context.Context, string, string, string, string) (*http.Request, error) +1. SoftwareInventoriesClient.ListByExtendedResourceResponder(*http.Response) (SoftwaresList, error) +1. SoftwareInventoriesClient.ListByExtendedResourceSender(*http.Request) (*http.Response, error) +1. SoftwareInventoriesClient.ListBySubscription(context.Context) (SoftwaresListPage, error) +1. SoftwareInventoriesClient.ListBySubscriptionComplete(context.Context) (SoftwaresListIterator, error) +1. SoftwareInventoriesClient.ListBySubscriptionPreparer(context.Context) (*http.Request, error) +1. SoftwareInventoriesClient.ListBySubscriptionResponder(*http.Response) (SoftwaresList, error) +1. SoftwareInventoriesClient.ListBySubscriptionSender(*http.Request) (*http.Response, error) +1. SoftwaresList.IsEmpty() bool +1. SoftwaresList.MarshalJSON() ([]byte, error) +1. SoftwaresListIterator.NotDone() bool +1. SoftwaresListIterator.Response() SoftwaresList +1. SoftwaresListIterator.Value() Software +1. SoftwaresListPage.NotDone() bool +1. SoftwaresListPage.Response() SoftwaresList +1. SoftwaresListPage.Values() []Software +1. ThresholdCustomAlertRule.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. TimeWindowCustomAlertRule.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. TwinUpdatesNotInAllowedRange.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) +1. UnauthorizedOperationsNotInAllowedRange.AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) + +### Struct Changes + +#### New Structs + +1. AdditionalWorkspacesProperties +1. AlertSimulatorBundlesRequestProperties +1. AlertSimulatorRequestBody +1. AlertSimulatorRequestProperties +1. AlertsSimulateFuture +1. ConnectionFromIPNotAllowed +1. ConnectionStrings +1. ErrorAdditionalInfo +1. IngestionConnectionString +1. IngestionSetting +1. IngestionSettingList +1. IngestionSettingListIterator +1. IngestionSettingListPage +1. IngestionSettingToken +1. IngestionSettingsClient +1. ServerVulnerabilityAssessmentDeleteFuture +1. Software +1. SoftwareInventoriesClient +1. SoftwareProperties +1. SoftwaresList +1. SoftwaresListIterator +1. SoftwaresListPage +1. SystemData + +#### New Struct Fields + +1. AssessmentMetadataProperties.Categories +1. CloudErrorBody.AdditionalInfo +1. CloudErrorBody.Details +1. CloudErrorBody.Target +1. IoTSecuritySolutionModel.SystemData +1. IoTSecuritySolutionProperties.AdditionalWorkspaces +1. IotAlertModel.ID +1. IotAlertModel.Name +1. IotAlertModel.Type +1. IotDefenderSettingsProperties.OnboardingKind +1. IotSensorProperties.SensorType diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/_meta.json index fa4db040bff6..5f95c7bcb6c4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/_meta.json +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3a3a9452f965a227ce43e6b545035b99dd175f23", + "commit": "2b0b50e3e5bd467aa039a51cafa2a071593eca28", "readme": "/_/azure-rest-api-specs/specification/security/resource-manager/readme.md", "tag": "package-composite-v3", "use": "@microsoft.azure/autorest.go@2.1.183", diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/alerts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/alerts.go index 1076bb2ad6ad..700b821ab120 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/alerts.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/alerts.go @@ -31,14 +31,14 @@ func NewAlertsClientWithBaseURI(baseURI string, subscriptionID string, ascLocati return AlertsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} } -// GetResourceGroupLevelAlerts get an alert that is associated a resource group or a resource in a resource group +// GetResourceGroupLevel get an alert that is associated a resource group or a resource in a resource group // Parameters: // alertName - name of the alert object // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. -func (client AlertsClient) GetResourceGroupLevelAlerts(ctx context.Context, alertName string, resourceGroupName string) (result Alert, err error) { +func (client AlertsClient) GetResourceGroupLevel(ctx context.Context, alertName string, resourceGroupName string) (result Alert, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.GetResourceGroupLevelAlerts") + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.GetResourceGroupLevel") defer func() { sc := -1 if result.Response.Response != nil { @@ -54,33 +54,33 @@ func (client AlertsClient) GetResourceGroupLevelAlerts(ctx context.Context, aler Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AlertsClient", "GetResourceGroupLevelAlerts", err.Error()) + return result, validation.NewError("security.AlertsClient", "GetResourceGroupLevel", err.Error()) } - req, err := client.GetResourceGroupLevelAlertsPreparer(ctx, alertName, resourceGroupName) + req, err := client.GetResourceGroupLevelPreparer(ctx, alertName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetResourceGroupLevelAlerts", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetResourceGroupLevel", nil, "Failure preparing request") return } - resp, err := client.GetResourceGroupLevelAlertsSender(req) + resp, err := client.GetResourceGroupLevelSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetResourceGroupLevelAlerts", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetResourceGroupLevel", resp, "Failure sending request") return } - result, err = client.GetResourceGroupLevelAlertsResponder(resp) + result, err = client.GetResourceGroupLevelResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetResourceGroupLevelAlerts", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetResourceGroupLevel", resp, "Failure responding to request") return } return } -// GetResourceGroupLevelAlertsPreparer prepares the GetResourceGroupLevelAlerts request. -func (client AlertsClient) GetResourceGroupLevelAlertsPreparer(ctx context.Context, alertName string, resourceGroupName string) (*http.Request, error) { +// GetResourceGroupLevelPreparer prepares the GetResourceGroupLevel request. +func (client AlertsClient) GetResourceGroupLevelPreparer(ctx context.Context, alertName string, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), "ascLocation": autorest.Encode("path", client.AscLocation), @@ -88,7 +88,7 @@ func (client AlertsClient) GetResourceGroupLevelAlertsPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -101,15 +101,15 @@ func (client AlertsClient) GetResourceGroupLevelAlertsPreparer(ctx context.Conte return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetResourceGroupLevelAlertsSender sends the GetResourceGroupLevelAlerts request. The method will close the +// GetResourceGroupLevelSender sends the GetResourceGroupLevel request. The method will close the // http.Response Body if it receives an error. -func (client AlertsClient) GetResourceGroupLevelAlertsSender(req *http.Request) (*http.Response, error) { +func (client AlertsClient) GetResourceGroupLevelSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// GetResourceGroupLevelAlertsResponder handles the response to the GetResourceGroupLevelAlerts request. The method always +// GetResourceGroupLevelResponder handles the response to the GetResourceGroupLevel request. The method always // closes the http.Response Body. -func (client AlertsClient) GetResourceGroupLevelAlertsResponder(resp *http.Response) (result Alert, err error) { +func (client AlertsClient) GetResourceGroupLevelResponder(resp *http.Response) (result Alert, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -119,12 +119,12 @@ func (client AlertsClient) GetResourceGroupLevelAlertsResponder(resp *http.Respo return } -// GetSubscriptionLevelAlert get an alert that is associated with a subscription +// GetSubscriptionLevel get an alert that is associated with a subscription // Parameters: // alertName - name of the alert object -func (client AlertsClient) GetSubscriptionLevelAlert(ctx context.Context, alertName string) (result Alert, err error) { +func (client AlertsClient) GetSubscriptionLevel(ctx context.Context, alertName string) (result Alert, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.GetSubscriptionLevelAlert") + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.GetSubscriptionLevel") defer func() { sc := -1 if result.Response.Response != nil { @@ -136,40 +136,40 @@ func (client AlertsClient) GetSubscriptionLevelAlert(ctx context.Context, alertN if err := validation.Validate([]validation.Validation{ {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AlertsClient", "GetSubscriptionLevelAlert", err.Error()) + return result, validation.NewError("security.AlertsClient", "GetSubscriptionLevel", err.Error()) } - req, err := client.GetSubscriptionLevelAlertPreparer(ctx, alertName) + req, err := client.GetSubscriptionLevelPreparer(ctx, alertName) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetSubscriptionLevelAlert", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetSubscriptionLevel", nil, "Failure preparing request") return } - resp, err := client.GetSubscriptionLevelAlertSender(req) + resp, err := client.GetSubscriptionLevelSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetSubscriptionLevelAlert", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetSubscriptionLevel", resp, "Failure sending request") return } - result, err = client.GetSubscriptionLevelAlertResponder(resp) + result, err = client.GetSubscriptionLevelResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetSubscriptionLevelAlert", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetSubscriptionLevel", resp, "Failure responding to request") return } return } -// GetSubscriptionLevelAlertPreparer prepares the GetSubscriptionLevelAlert request. -func (client AlertsClient) GetSubscriptionLevelAlertPreparer(ctx context.Context, alertName string) (*http.Request, error) { +// GetSubscriptionLevelPreparer prepares the GetSubscriptionLevel request. +func (client AlertsClient) GetSubscriptionLevelPreparer(ctx context.Context, alertName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), "ascLocation": autorest.Encode("path", client.AscLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -182,15 +182,15 @@ func (client AlertsClient) GetSubscriptionLevelAlertPreparer(ctx context.Context return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetSubscriptionLevelAlertSender sends the GetSubscriptionLevelAlert request. The method will close the +// GetSubscriptionLevelSender sends the GetSubscriptionLevel request. The method will close the // http.Response Body if it receives an error. -func (client AlertsClient) GetSubscriptionLevelAlertSender(req *http.Request) (*http.Response, error) { +func (client AlertsClient) GetSubscriptionLevelSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// GetSubscriptionLevelAlertResponder handles the response to the GetSubscriptionLevelAlert request. The method always +// GetSubscriptionLevelResponder handles the response to the GetSubscriptionLevel request. The method always // closes the http.Response Body. -func (client AlertsClient) GetSubscriptionLevelAlertResponder(resp *http.Response) (result Alert, err error) { +func (client AlertsClient) GetSubscriptionLevelResponder(resp *http.Response) (result Alert, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -251,7 +251,7 @@ func (client AlertsClient) ListPreparer(ctx context.Context) (*http.Request, err "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -378,7 +378,7 @@ func (client AlertsClient) ListByResourceGroupPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -446,14 +446,14 @@ func (client AlertsClient) ListByResourceGroupComplete(ctx context.Context, reso return } -// ListResourceGroupLevelAlertsByRegion list all the alerts that are associated with the resource group that are stored -// in a specific location +// ListResourceGroupLevelByRegion list all the alerts that are associated with the resource group that are stored in a +// specific location // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. -func (client AlertsClient) ListResourceGroupLevelAlertsByRegion(ctx context.Context, resourceGroupName string) (result AlertListPage, err error) { +func (client AlertsClient) ListResourceGroupLevelByRegion(ctx context.Context, resourceGroupName string) (result AlertListPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListResourceGroupLevelAlertsByRegion") + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListResourceGroupLevelByRegion") defer func() { sc := -1 if result.al.Response.Response != nil { @@ -469,26 +469,26 @@ func (client AlertsClient) ListResourceGroupLevelAlertsByRegion(ctx context.Cont Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AlertsClient", "ListResourceGroupLevelAlertsByRegion", err.Error()) + return result, validation.NewError("security.AlertsClient", "ListResourceGroupLevelByRegion", err.Error()) } - result.fn = client.listResourceGroupLevelAlertsByRegionNextResults - req, err := client.ListResourceGroupLevelAlertsByRegionPreparer(ctx, resourceGroupName) + result.fn = client.listResourceGroupLevelByRegionNextResults + req, err := client.ListResourceGroupLevelByRegionPreparer(ctx, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListResourceGroupLevelAlertsByRegion", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListResourceGroupLevelByRegion", nil, "Failure preparing request") return } - resp, err := client.ListResourceGroupLevelAlertsByRegionSender(req) + resp, err := client.ListResourceGroupLevelByRegionSender(req) if err != nil { result.al.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListResourceGroupLevelAlertsByRegion", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListResourceGroupLevelByRegion", resp, "Failure sending request") return } - result.al, err = client.ListResourceGroupLevelAlertsByRegionResponder(resp) + result.al, err = client.ListResourceGroupLevelByRegionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListResourceGroupLevelAlertsByRegion", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListResourceGroupLevelByRegion", resp, "Failure responding to request") return } if result.al.hasNextLink() && result.al.IsEmpty() { @@ -499,15 +499,15 @@ func (client AlertsClient) ListResourceGroupLevelAlertsByRegion(ctx context.Cont return } -// ListResourceGroupLevelAlertsByRegionPreparer prepares the ListResourceGroupLevelAlertsByRegion request. -func (client AlertsClient) ListResourceGroupLevelAlertsByRegionPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { +// ListResourceGroupLevelByRegionPreparer prepares the ListResourceGroupLevelByRegion request. +func (client AlertsClient) ListResourceGroupLevelByRegionPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "ascLocation": autorest.Encode("path", client.AscLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -520,15 +520,15 @@ func (client AlertsClient) ListResourceGroupLevelAlertsByRegionPreparer(ctx cont return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListResourceGroupLevelAlertsByRegionSender sends the ListResourceGroupLevelAlertsByRegion request. The method will close the +// ListResourceGroupLevelByRegionSender sends the ListResourceGroupLevelByRegion request. The method will close the // http.Response Body if it receives an error. -func (client AlertsClient) ListResourceGroupLevelAlertsByRegionSender(req *http.Request) (*http.Response, error) { +func (client AlertsClient) ListResourceGroupLevelByRegionSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// ListResourceGroupLevelAlertsByRegionResponder handles the response to the ListResourceGroupLevelAlertsByRegion request. The method always +// ListResourceGroupLevelByRegionResponder handles the response to the ListResourceGroupLevelByRegion request. The method always // closes the http.Response Body. -func (client AlertsClient) ListResourceGroupLevelAlertsByRegionResponder(resp *http.Response) (result AlertList, err error) { +func (client AlertsClient) ListResourceGroupLevelByRegionResponder(resp *http.Response) (result AlertList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -538,31 +538,31 @@ func (client AlertsClient) ListResourceGroupLevelAlertsByRegionResponder(resp *h return } -// listResourceGroupLevelAlertsByRegionNextResults retrieves the next set of results, if any. -func (client AlertsClient) listResourceGroupLevelAlertsByRegionNextResults(ctx context.Context, lastResults AlertList) (result AlertList, err error) { +// listResourceGroupLevelByRegionNextResults retrieves the next set of results, if any. +func (client AlertsClient) listResourceGroupLevelByRegionNextResults(ctx context.Context, lastResults AlertList) (result AlertList, err error) { req, err := lastResults.alertListPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "security.AlertsClient", "listResourceGroupLevelAlertsByRegionNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "security.AlertsClient", "listResourceGroupLevelByRegionNextResults", nil, "Failure preparing next results request") } if req == nil { return } - resp, err := client.ListResourceGroupLevelAlertsByRegionSender(req) + resp, err := client.ListResourceGroupLevelByRegionSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "security.AlertsClient", "listResourceGroupLevelAlertsByRegionNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "security.AlertsClient", "listResourceGroupLevelByRegionNextResults", resp, "Failure sending next results request") } - result, err = client.ListResourceGroupLevelAlertsByRegionResponder(resp) + result, err = client.ListResourceGroupLevelByRegionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "listResourceGroupLevelAlertsByRegionNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "listResourceGroupLevelByRegionNextResults", resp, "Failure responding to next results request") } return } -// ListResourceGroupLevelAlertsByRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AlertsClient) ListResourceGroupLevelAlertsByRegionComplete(ctx context.Context, resourceGroupName string) (result AlertListIterator, err error) { +// ListResourceGroupLevelByRegionComplete enumerates all values, automatically crossing page boundaries as required. +func (client AlertsClient) ListResourceGroupLevelByRegionComplete(ctx context.Context, resourceGroupName string) (result AlertListIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListResourceGroupLevelAlertsByRegion") + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListResourceGroupLevelByRegion") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -571,15 +571,15 @@ func (client AlertsClient) ListResourceGroupLevelAlertsByRegionComplete(ctx cont tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListResourceGroupLevelAlertsByRegion(ctx, resourceGroupName) + result.page, err = client.ListResourceGroupLevelByRegion(ctx, resourceGroupName) return } -// ListSubscriptionLevelAlertsByRegion list all the alerts that are associated with the subscription that are stored in -// a specific location -func (client AlertsClient) ListSubscriptionLevelAlertsByRegion(ctx context.Context) (result AlertListPage, err error) { +// ListSubscriptionLevelByRegion list all the alerts that are associated with the subscription that are stored in a +// specific location +func (client AlertsClient) ListSubscriptionLevelByRegion(ctx context.Context) (result AlertListPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListSubscriptionLevelAlertsByRegion") + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListSubscriptionLevelByRegion") defer func() { sc := -1 if result.al.Response.Response != nil { @@ -591,26 +591,26 @@ func (client AlertsClient) ListSubscriptionLevelAlertsByRegion(ctx context.Conte if err := validation.Validate([]validation.Validation{ {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AlertsClient", "ListSubscriptionLevelAlertsByRegion", err.Error()) + return result, validation.NewError("security.AlertsClient", "ListSubscriptionLevelByRegion", err.Error()) } - result.fn = client.listSubscriptionLevelAlertsByRegionNextResults - req, err := client.ListSubscriptionLevelAlertsByRegionPreparer(ctx) + result.fn = client.listSubscriptionLevelByRegionNextResults + req, err := client.ListSubscriptionLevelByRegionPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListSubscriptionLevelAlertsByRegion", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListSubscriptionLevelByRegion", nil, "Failure preparing request") return } - resp, err := client.ListSubscriptionLevelAlertsByRegionSender(req) + resp, err := client.ListSubscriptionLevelByRegionSender(req) if err != nil { result.al.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListSubscriptionLevelAlertsByRegion", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListSubscriptionLevelByRegion", resp, "Failure sending request") return } - result.al, err = client.ListSubscriptionLevelAlertsByRegionResponder(resp) + result.al, err = client.ListSubscriptionLevelByRegionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListSubscriptionLevelAlertsByRegion", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListSubscriptionLevelByRegion", resp, "Failure responding to request") return } if result.al.hasNextLink() && result.al.IsEmpty() { @@ -621,14 +621,14 @@ func (client AlertsClient) ListSubscriptionLevelAlertsByRegion(ctx context.Conte return } -// ListSubscriptionLevelAlertsByRegionPreparer prepares the ListSubscriptionLevelAlertsByRegion request. -func (client AlertsClient) ListSubscriptionLevelAlertsByRegionPreparer(ctx context.Context) (*http.Request, error) { +// ListSubscriptionLevelByRegionPreparer prepares the ListSubscriptionLevelByRegion request. +func (client AlertsClient) ListSubscriptionLevelByRegionPreparer(ctx context.Context) (*http.Request, error) { pathParameters := map[string]interface{}{ "ascLocation": autorest.Encode("path", client.AscLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -641,15 +641,15 @@ func (client AlertsClient) ListSubscriptionLevelAlertsByRegionPreparer(ctx conte return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListSubscriptionLevelAlertsByRegionSender sends the ListSubscriptionLevelAlertsByRegion request. The method will close the +// ListSubscriptionLevelByRegionSender sends the ListSubscriptionLevelByRegion request. The method will close the // http.Response Body if it receives an error. -func (client AlertsClient) ListSubscriptionLevelAlertsByRegionSender(req *http.Request) (*http.Response, error) { +func (client AlertsClient) ListSubscriptionLevelByRegionSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// ListSubscriptionLevelAlertsByRegionResponder handles the response to the ListSubscriptionLevelAlertsByRegion request. The method always +// ListSubscriptionLevelByRegionResponder handles the response to the ListSubscriptionLevelByRegion request. The method always // closes the http.Response Body. -func (client AlertsClient) ListSubscriptionLevelAlertsByRegionResponder(resp *http.Response) (result AlertList, err error) { +func (client AlertsClient) ListSubscriptionLevelByRegionResponder(resp *http.Response) (result AlertList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -659,31 +659,31 @@ func (client AlertsClient) ListSubscriptionLevelAlertsByRegionResponder(resp *ht return } -// listSubscriptionLevelAlertsByRegionNextResults retrieves the next set of results, if any. -func (client AlertsClient) listSubscriptionLevelAlertsByRegionNextResults(ctx context.Context, lastResults AlertList) (result AlertList, err error) { +// listSubscriptionLevelByRegionNextResults retrieves the next set of results, if any. +func (client AlertsClient) listSubscriptionLevelByRegionNextResults(ctx context.Context, lastResults AlertList) (result AlertList, err error) { req, err := lastResults.alertListPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "security.AlertsClient", "listSubscriptionLevelAlertsByRegionNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "security.AlertsClient", "listSubscriptionLevelByRegionNextResults", nil, "Failure preparing next results request") } if req == nil { return } - resp, err := client.ListSubscriptionLevelAlertsByRegionSender(req) + resp, err := client.ListSubscriptionLevelByRegionSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "security.AlertsClient", "listSubscriptionLevelAlertsByRegionNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "security.AlertsClient", "listSubscriptionLevelByRegionNextResults", resp, "Failure sending next results request") } - result, err = client.ListSubscriptionLevelAlertsByRegionResponder(resp) + result, err = client.ListSubscriptionLevelByRegionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "listSubscriptionLevelAlertsByRegionNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "listSubscriptionLevelByRegionNextResults", resp, "Failure responding to next results request") } return } -// ListSubscriptionLevelAlertsByRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AlertsClient) ListSubscriptionLevelAlertsByRegionComplete(ctx context.Context) (result AlertListIterator, err error) { +// ListSubscriptionLevelByRegionComplete enumerates all values, automatically crossing page boundaries as required. +func (client AlertsClient) ListSubscriptionLevelByRegionComplete(ctx context.Context) (result AlertListIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListSubscriptionLevelAlertsByRegion") + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListSubscriptionLevelByRegion") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -692,18 +692,101 @@ func (client AlertsClient) ListSubscriptionLevelAlertsByRegionComplete(ctx conte tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListSubscriptionLevelAlertsByRegion(ctx) + result.page, err = client.ListSubscriptionLevelByRegion(ctx) return } -// UpdateResourceGroupLevelAlertStateToDismiss update the alert's state +// Simulate simulate security alerts +// Parameters: +// alertSimulatorRequestBody - alert Simulator Request Properties +func (client AlertsClient) Simulate(ctx context.Context, alertSimulatorRequestBody AlertSimulatorRequestBody) (result AlertsSimulateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.Simulate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AlertsClient", "Simulate", err.Error()) + } + + req, err := client.SimulatePreparer(ctx, alertSimulatorRequestBody) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsClient", "Simulate", nil, "Failure preparing request") + return + } + + result, err = client.SimulateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsClient", "Simulate", nil, "Failure sending request") + return + } + + return +} + +// SimulatePreparer prepares the Simulate request. +func (client AlertsClient) SimulatePreparer(ctx context.Context, alertSimulatorRequestBody AlertSimulatorRequestBody) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "ascLocation": autorest.Encode("path", client.AscLocation), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate", pathParameters), + autorest.WithJSON(alertSimulatorRequestBody), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SimulateSender sends the Simulate request. The method will close the +// http.Response Body if it receives an error. +func (client AlertsClient) SimulateSender(req *http.Request) (future AlertsSimulateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// SimulateResponder handles the response to the Simulate request. The method always +// closes the http.Response Body. +func (client AlertsClient) SimulateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// UpdateResourceGroupLevelStateToActivate update the alert's state // Parameters: // alertName - name of the alert object // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. -func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismiss(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) { +func (client AlertsClient) UpdateResourceGroupLevelStateToActivate(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateResourceGroupLevelAlertStateToDismiss") + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateResourceGroupLevelStateToActivate") defer func() { sc := -1 if result.Response != nil { @@ -719,33 +802,33 @@ func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismiss(ctx conte Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AlertsClient", "UpdateResourceGroupLevelAlertStateToDismiss", err.Error()) + return result, validation.NewError("security.AlertsClient", "UpdateResourceGroupLevelStateToActivate", err.Error()) } - req, err := client.UpdateResourceGroupLevelAlertStateToDismissPreparer(ctx, alertName, resourceGroupName) + req, err := client.UpdateResourceGroupLevelStateToActivatePreparer(ctx, alertName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelAlertStateToDismiss", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelStateToActivate", nil, "Failure preparing request") return } - resp, err := client.UpdateResourceGroupLevelAlertStateToDismissSender(req) + resp, err := client.UpdateResourceGroupLevelStateToActivateSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelAlertStateToDismiss", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelStateToActivate", resp, "Failure sending request") return } - result, err = client.UpdateResourceGroupLevelAlertStateToDismissResponder(resp) + result, err = client.UpdateResourceGroupLevelStateToActivateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelAlertStateToDismiss", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelStateToActivate", resp, "Failure responding to request") return } return } -// UpdateResourceGroupLevelAlertStateToDismissPreparer prepares the UpdateResourceGroupLevelAlertStateToDismiss request. -func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismissPreparer(ctx context.Context, alertName string, resourceGroupName string) (*http.Request, error) { +// UpdateResourceGroupLevelStateToActivatePreparer prepares the UpdateResourceGroupLevelStateToActivate request. +func (client AlertsClient) UpdateResourceGroupLevelStateToActivatePreparer(ctx context.Context, alertName string, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), "ascLocation": autorest.Encode("path", client.AscLocation), @@ -753,7 +836,7 @@ func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismissPreparer(c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -761,20 +844,20 @@ func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismissPreparer(c preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// UpdateResourceGroupLevelAlertStateToDismissSender sends the UpdateResourceGroupLevelAlertStateToDismiss request. The method will close the +// UpdateResourceGroupLevelStateToActivateSender sends the UpdateResourceGroupLevelStateToActivate request. The method will close the // http.Response Body if it receives an error. -func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismissSender(req *http.Request) (*http.Response, error) { +func (client AlertsClient) UpdateResourceGroupLevelStateToActivateSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// UpdateResourceGroupLevelAlertStateToDismissResponder handles the response to the UpdateResourceGroupLevelAlertStateToDismiss request. The method always +// UpdateResourceGroupLevelStateToActivateResponder handles the response to the UpdateResourceGroupLevelStateToActivate request. The method always // closes the http.Response Body. -func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismissResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AlertsClient) UpdateResourceGroupLevelStateToActivateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), @@ -783,14 +866,14 @@ func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismissResponder( return } -// UpdateResourceGroupLevelAlertStateToReactivate update the alert's state +// UpdateResourceGroupLevelStateToDismiss update the alert's state // Parameters: // alertName - name of the alert object // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. -func (client AlertsClient) UpdateResourceGroupLevelAlertStateToReactivate(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) { +func (client AlertsClient) UpdateResourceGroupLevelStateToDismiss(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateResourceGroupLevelAlertStateToReactivate") + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateResourceGroupLevelStateToDismiss") defer func() { sc := -1 if result.Response != nil { @@ -806,33 +889,33 @@ func (client AlertsClient) UpdateResourceGroupLevelAlertStateToReactivate(ctx co Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AlertsClient", "UpdateResourceGroupLevelAlertStateToReactivate", err.Error()) + return result, validation.NewError("security.AlertsClient", "UpdateResourceGroupLevelStateToDismiss", err.Error()) } - req, err := client.UpdateResourceGroupLevelAlertStateToReactivatePreparer(ctx, alertName, resourceGroupName) + req, err := client.UpdateResourceGroupLevelStateToDismissPreparer(ctx, alertName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelAlertStateToReactivate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelStateToDismiss", nil, "Failure preparing request") return } - resp, err := client.UpdateResourceGroupLevelAlertStateToReactivateSender(req) + resp, err := client.UpdateResourceGroupLevelStateToDismissSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelAlertStateToReactivate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelStateToDismiss", resp, "Failure sending request") return } - result, err = client.UpdateResourceGroupLevelAlertStateToReactivateResponder(resp) + result, err = client.UpdateResourceGroupLevelStateToDismissResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelAlertStateToReactivate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelStateToDismiss", resp, "Failure responding to request") return } return } -// UpdateResourceGroupLevelAlertStateToReactivatePreparer prepares the UpdateResourceGroupLevelAlertStateToReactivate request. -func (client AlertsClient) UpdateResourceGroupLevelAlertStateToReactivatePreparer(ctx context.Context, alertName string, resourceGroupName string) (*http.Request, error) { +// UpdateResourceGroupLevelStateToDismissPreparer prepares the UpdateResourceGroupLevelStateToDismiss request. +func (client AlertsClient) UpdateResourceGroupLevelStateToDismissPreparer(ctx context.Context, alertName string, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), "ascLocation": autorest.Encode("path", client.AscLocation), @@ -840,7 +923,7 @@ func (client AlertsClient) UpdateResourceGroupLevelAlertStateToReactivatePrepare "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -848,20 +931,20 @@ func (client AlertsClient) UpdateResourceGroupLevelAlertStateToReactivatePrepare preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// UpdateResourceGroupLevelAlertStateToReactivateSender sends the UpdateResourceGroupLevelAlertStateToReactivate request. The method will close the +// UpdateResourceGroupLevelStateToDismissSender sends the UpdateResourceGroupLevelStateToDismiss request. The method will close the // http.Response Body if it receives an error. -func (client AlertsClient) UpdateResourceGroupLevelAlertStateToReactivateSender(req *http.Request) (*http.Response, error) { +func (client AlertsClient) UpdateResourceGroupLevelStateToDismissSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// UpdateResourceGroupLevelAlertStateToReactivateResponder handles the response to the UpdateResourceGroupLevelAlertStateToReactivate request. The method always +// UpdateResourceGroupLevelStateToDismissResponder handles the response to the UpdateResourceGroupLevelStateToDismiss request. The method always // closes the http.Response Body. -func (client AlertsClient) UpdateResourceGroupLevelAlertStateToReactivateResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AlertsClient) UpdateResourceGroupLevelStateToDismissResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), @@ -927,7 +1010,7 @@ func (client AlertsClient) UpdateResourceGroupLevelStateToResolvePreparer(ctx co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -957,12 +1040,12 @@ func (client AlertsClient) UpdateResourceGroupLevelStateToResolveResponder(resp return } -// UpdateSubscriptionLevelAlertStateToDismiss update the alert's state +// UpdateSubscriptionLevelStateToActivate update the alert's state // Parameters: // alertName - name of the alert object -func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismiss(ctx context.Context, alertName string) (result autorest.Response, err error) { +func (client AlertsClient) UpdateSubscriptionLevelStateToActivate(ctx context.Context, alertName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateSubscriptionLevelAlertStateToDismiss") + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateSubscriptionLevelStateToActivate") defer func() { sc := -1 if result.Response != nil { @@ -974,40 +1057,40 @@ func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismiss(ctx contex if err := validation.Validate([]validation.Validation{ {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AlertsClient", "UpdateSubscriptionLevelAlertStateToDismiss", err.Error()) + return result, validation.NewError("security.AlertsClient", "UpdateSubscriptionLevelStateToActivate", err.Error()) } - req, err := client.UpdateSubscriptionLevelAlertStateToDismissPreparer(ctx, alertName) + req, err := client.UpdateSubscriptionLevelStateToActivatePreparer(ctx, alertName) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelAlertStateToDismiss", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelStateToActivate", nil, "Failure preparing request") return } - resp, err := client.UpdateSubscriptionLevelAlertStateToDismissSender(req) + resp, err := client.UpdateSubscriptionLevelStateToActivateSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelAlertStateToDismiss", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelStateToActivate", resp, "Failure sending request") return } - result, err = client.UpdateSubscriptionLevelAlertStateToDismissResponder(resp) + result, err = client.UpdateSubscriptionLevelStateToActivateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelAlertStateToDismiss", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelStateToActivate", resp, "Failure responding to request") return } return } -// UpdateSubscriptionLevelAlertStateToDismissPreparer prepares the UpdateSubscriptionLevelAlertStateToDismiss request. -func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismissPreparer(ctx context.Context, alertName string) (*http.Request, error) { +// UpdateSubscriptionLevelStateToActivatePreparer prepares the UpdateSubscriptionLevelStateToActivate request. +func (client AlertsClient) UpdateSubscriptionLevelStateToActivatePreparer(ctx context.Context, alertName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), "ascLocation": autorest.Encode("path", client.AscLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1015,20 +1098,20 @@ func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismissPreparer(ct preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// UpdateSubscriptionLevelAlertStateToDismissSender sends the UpdateSubscriptionLevelAlertStateToDismiss request. The method will close the +// UpdateSubscriptionLevelStateToActivateSender sends the UpdateSubscriptionLevelStateToActivate request. The method will close the // http.Response Body if it receives an error. -func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismissSender(req *http.Request) (*http.Response, error) { +func (client AlertsClient) UpdateSubscriptionLevelStateToActivateSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// UpdateSubscriptionLevelAlertStateToDismissResponder handles the response to the UpdateSubscriptionLevelAlertStateToDismiss request. The method always +// UpdateSubscriptionLevelStateToActivateResponder handles the response to the UpdateSubscriptionLevelStateToActivate request. The method always // closes the http.Response Body. -func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismissResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AlertsClient) UpdateSubscriptionLevelStateToActivateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), @@ -1037,12 +1120,12 @@ func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismissResponder(r return } -// UpdateSubscriptionLevelAlertStateToReactivate update the alert's state +// UpdateSubscriptionLevelStateToDismiss update the alert's state // Parameters: // alertName - name of the alert object -func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivate(ctx context.Context, alertName string) (result autorest.Response, err error) { +func (client AlertsClient) UpdateSubscriptionLevelStateToDismiss(ctx context.Context, alertName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateSubscriptionLevelAlertStateToReactivate") + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateSubscriptionLevelStateToDismiss") defer func() { sc := -1 if result.Response != nil { @@ -1054,40 +1137,40 @@ func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivate(ctx con if err := validation.Validate([]validation.Validation{ {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AlertsClient", "UpdateSubscriptionLevelAlertStateToReactivate", err.Error()) + return result, validation.NewError("security.AlertsClient", "UpdateSubscriptionLevelStateToDismiss", err.Error()) } - req, err := client.UpdateSubscriptionLevelAlertStateToReactivatePreparer(ctx, alertName) + req, err := client.UpdateSubscriptionLevelStateToDismissPreparer(ctx, alertName) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelAlertStateToReactivate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelStateToDismiss", nil, "Failure preparing request") return } - resp, err := client.UpdateSubscriptionLevelAlertStateToReactivateSender(req) + resp, err := client.UpdateSubscriptionLevelStateToDismissSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelAlertStateToReactivate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelStateToDismiss", resp, "Failure sending request") return } - result, err = client.UpdateSubscriptionLevelAlertStateToReactivateResponder(resp) + result, err = client.UpdateSubscriptionLevelStateToDismissResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelAlertStateToReactivate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelStateToDismiss", resp, "Failure responding to request") return } return } -// UpdateSubscriptionLevelAlertStateToReactivatePreparer prepares the UpdateSubscriptionLevelAlertStateToReactivate request. -func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivatePreparer(ctx context.Context, alertName string) (*http.Request, error) { +// UpdateSubscriptionLevelStateToDismissPreparer prepares the UpdateSubscriptionLevelStateToDismiss request. +func (client AlertsClient) UpdateSubscriptionLevelStateToDismissPreparer(ctx context.Context, alertName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), "ascLocation": autorest.Encode("path", client.AscLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1095,20 +1178,20 @@ func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivatePreparer preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// UpdateSubscriptionLevelAlertStateToReactivateSender sends the UpdateSubscriptionLevelAlertStateToReactivate request. The method will close the +// UpdateSubscriptionLevelStateToDismissSender sends the UpdateSubscriptionLevelStateToDismiss request. The method will close the // http.Response Body if it receives an error. -func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivateSender(req *http.Request) (*http.Response, error) { +func (client AlertsClient) UpdateSubscriptionLevelStateToDismissSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// UpdateSubscriptionLevelAlertStateToReactivateResponder handles the response to the UpdateSubscriptionLevelAlertStateToReactivate request. The method always +// UpdateSubscriptionLevelStateToDismissResponder handles the response to the UpdateSubscriptionLevelStateToDismiss request. The method always // closes the http.Response Body. -func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivateResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AlertsClient) UpdateSubscriptionLevelStateToDismissResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), @@ -1167,7 +1250,7 @@ func (client AlertsClient) UpdateSubscriptionLevelStateToResolvePreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/enums.go index 80490b32ca5b..25b9c2e5e721 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/enums.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/enums.go @@ -59,6 +59,34 @@ func PossibleActionTypeValues() []ActionType { return []ActionType{ActionTypeAutomationAction, ActionTypeEventHub, ActionTypeLogicApp, ActionTypeWorkspace} } +// AdditionalWorkspaceDataType enumerates the values for additional workspace data type. +type AdditionalWorkspaceDataType string + +const ( + // Alerts ... + Alerts AdditionalWorkspaceDataType = "Alerts" + // RawEvents ... + RawEvents AdditionalWorkspaceDataType = "RawEvents" +) + +// PossibleAdditionalWorkspaceDataTypeValues returns an array of possible values for the AdditionalWorkspaceDataType const type. +func PossibleAdditionalWorkspaceDataTypeValues() []AdditionalWorkspaceDataType { + return []AdditionalWorkspaceDataType{Alerts, RawEvents} +} + +// AdditionalWorkspaceType enumerates the values for additional workspace type. +type AdditionalWorkspaceType string + +const ( + // Sentinel ... + Sentinel AdditionalWorkspaceType = "Sentinel" +) + +// PossibleAdditionalWorkspaceTypeValues returns an array of possible values for the AdditionalWorkspaceType const type. +func PossibleAdditionalWorkspaceTypeValues() []AdditionalWorkspaceType { + return []AdditionalWorkspaceType{Sentinel} +} + // AlertIntent enumerates the values for alert intent. type AlertIntent string @@ -293,25 +321,52 @@ func PossibleAutoProvisionValues() []AutoProvision { return []AutoProvision{AutoProvisionOff, AutoProvisionOn} } -// Category enumerates the values for category. -type Category string +// BundleType enumerates the values for bundle type. +type BundleType string + +const ( + // AppServices ... + AppServices BundleType = "AppServices" + // DNS ... + DNS BundleType = "DNS" + // KeyVaults ... + KeyVaults BundleType = "KeyVaults" + // KubernetesService ... + KubernetesService BundleType = "KubernetesService" + // ResourceManager ... + ResourceManager BundleType = "ResourceManager" + // SQLServers ... + SQLServers BundleType = "SqlServers" + // StorageAccounts ... + StorageAccounts BundleType = "StorageAccounts" + // VirtualMachines ... + VirtualMachines BundleType = "VirtualMachines" +) + +// PossibleBundleTypeValues returns an array of possible values for the BundleType const type. +func PossibleBundleTypeValues() []BundleType { + return []BundleType{AppServices, DNS, KeyVaults, KubernetesService, ResourceManager, SQLServers, StorageAccounts, VirtualMachines} +} + +// Categories enumerates the values for categories. +type Categories string const ( // Compute ... - Compute Category = "Compute" + Compute Categories = "Compute" // Data ... - Data Category = "Data" + Data Categories = "Data" // IdentityAndAccess ... - IdentityAndAccess Category = "IdentityAndAccess" + IdentityAndAccess Categories = "IdentityAndAccess" // IoT ... - IoT Category = "IoT" + IoT Categories = "IoT" // Networking ... - Networking Category = "Networking" + Networking Categories = "Networking" ) -// PossibleCategoryValues returns an array of possible values for the Category const type. -func PossibleCategoryValues() []Category { - return []Category{Compute, Data, IdentityAndAccess, IoT, Networking} +// PossibleCategoriesValues returns an array of possible values for the Categories const type. +func PossibleCategoriesValues() []Categories { + return []Categories{Compute, Data, IdentityAndAccess, IoT, Networking} } // ConfigurationStatus enumerates the values for configuration status. @@ -407,6 +462,25 @@ func PossibleControlTypeValues() []ControlType { return []ControlType{ControlTypeBuiltIn, ControlTypeCustom} } +// CreatedByType enumerates the values for created by type. +type CreatedByType string + +const ( + // Application ... + Application CreatedByType = "Application" + // Key ... + Key CreatedByType = "Key" + // ManagedIdentity ... + ManagedIdentity CreatedByType = "ManagedIdentity" + // User ... + User CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{Application, Key, ManagedIdentity, User} +} + // DataSource enumerates the values for data source. type DataSource string @@ -465,21 +539,42 @@ func PossibleDirectionValues() []Direction { return []Direction{Inbound, Outbound} } +// EndOfSupportStatus enumerates the values for end of support status. +type EndOfSupportStatus string + +const ( + // NoLongerSupported ... + NoLongerSupported EndOfSupportStatus = "noLongerSupported" + // None ... + None EndOfSupportStatus = "None" + // UpcomingNoLongerSupported ... + UpcomingNoLongerSupported EndOfSupportStatus = "upcomingNoLongerSupported" + // UpcomingVersionNoLongerSupported ... + UpcomingVersionNoLongerSupported EndOfSupportStatus = "upcomingVersionNoLongerSupported" + // VersionNoLongerSupported ... + VersionNoLongerSupported EndOfSupportStatus = "versionNoLongerSupported" +) + +// PossibleEndOfSupportStatusValues returns an array of possible values for the EndOfSupportStatus const type. +func PossibleEndOfSupportStatusValues() []EndOfSupportStatus { + return []EndOfSupportStatus{NoLongerSupported, None, UpcomingNoLongerSupported, UpcomingVersionNoLongerSupported, VersionNoLongerSupported} +} + // EnforcementMode enumerates the values for enforcement mode. type EnforcementMode string const ( - // Audit ... - Audit EnforcementMode = "Audit" - // Enforce ... - Enforce EnforcementMode = "Enforce" - // None ... - None EnforcementMode = "None" + // EnforcementModeAudit ... + EnforcementModeAudit EnforcementMode = "Audit" + // EnforcementModeEnforce ... + EnforcementModeEnforce EnforcementMode = "Enforce" + // EnforcementModeNone ... + EnforcementModeNone EnforcementMode = "None" ) // PossibleEnforcementModeValues returns an array of possible values for the EnforcementMode const type. func PossibleEnforcementModeValues() []EnforcementMode { - return []EnforcementMode{Audit, Enforce, None} + return []EnforcementMode{EnforcementModeAudit, EnforcementModeEnforce, EnforcementModeNone} } // EnforcementSupport enumerates the values for enforcement support. @@ -503,21 +598,29 @@ func PossibleEnforcementSupportValues() []EnforcementSupport { type EventSource string const ( - // Alerts ... - Alerts EventSource = "Alerts" - // Assessments ... - Assessments EventSource = "Assessments" - // SecureScoreControls ... - SecureScoreControls EventSource = "SecureScoreControls" - // SecureScores ... - SecureScores EventSource = "SecureScores" - // SubAssessments ... - SubAssessments EventSource = "SubAssessments" + // EventSourceAlerts ... + EventSourceAlerts EventSource = "Alerts" + // EventSourceAssessments ... + EventSourceAssessments EventSource = "Assessments" + // EventSourceRegulatoryComplianceAssessment ... + EventSourceRegulatoryComplianceAssessment EventSource = "RegulatoryComplianceAssessment" + // EventSourceRegulatoryComplianceAssessmentSnapshot ... + EventSourceRegulatoryComplianceAssessmentSnapshot EventSource = "RegulatoryComplianceAssessmentSnapshot" + // EventSourceSecureScoreControls ... + EventSourceSecureScoreControls EventSource = "SecureScoreControls" + // EventSourceSecureScoreControlsSnapshot ... + EventSourceSecureScoreControlsSnapshot EventSource = "SecureScoreControlsSnapshot" + // EventSourceSecureScores ... + EventSourceSecureScores EventSource = "SecureScores" + // EventSourceSecureScoresSnapshot ... + EventSourceSecureScoresSnapshot EventSource = "SecureScoresSnapshot" + // EventSourceSubAssessments ... + EventSourceSubAssessments EventSource = "SubAssessments" ) // PossibleEventSourceValues returns an array of possible values for the EventSource const type. func PossibleEventSourceValues() []EventSource { - return []EventSource{Alerts, Assessments, SecureScoreControls, SecureScores, SubAssessments} + return []EventSource{EventSourceAlerts, EventSourceAssessments, EventSourceRegulatoryComplianceAssessment, EventSourceRegulatoryComplianceAssessmentSnapshot, EventSourceSecureScoreControls, EventSourceSecureScoreControlsSnapshot, EventSourceSecureScores, EventSourceSecureScoresSnapshot, EventSourceSubAssessments} } // Exe enumerates the values for exe. @@ -586,13 +689,13 @@ func PossibleExpandEnumValues() []ExpandEnum { type ExportData string const ( - // RawEvents Agent raw events - RawEvents ExportData = "RawEvents" + // ExportDataRawEvents Agent raw events + ExportDataRawEvents ExportData = "RawEvents" ) // PossibleExportDataValues returns an array of possible values for the ExportData const type. func PossibleExportDataValues() []ExportData { - return []ExportData{RawEvents} + return []ExportData{ExportDataRawEvents} } // ExternalSecuritySolutionKind enumerates the values for external security solution kind. @@ -809,6 +912,21 @@ func PossibleKindEnum1Values() []KindEnum1 { return []KindEnum1{KindAAD, KindATA, KindCEF, KindExternalSecuritySolution} } +// KindEnum2 enumerates the values for kind enum 2. +type KindEnum2 string + +const ( + // KindAlertSimulatorRequestProperties ... + KindAlertSimulatorRequestProperties KindEnum2 = "AlertSimulatorRequestProperties" + // KindBundles ... + KindBundles KindEnum2 = "Bundles" +) + +// PossibleKindEnum2Values returns an array of possible values for the KindEnum2 const type. +func PossibleKindEnum2Values() []KindEnum2 { + return []KindEnum2{KindAlertSimulatorRequestProperties, KindBundles} +} + // MacSignificance enumerates the values for mac significance. type MacSignificance string @@ -856,27 +974,42 @@ func PossibleMsiValues() []Msi { return []Msi{MsiAudit, MsiEnforce, MsiNone} } +// OnboardingKind enumerates the values for onboarding kind. +type OnboardingKind string + +const ( + // Default ... + Default OnboardingKind = "Default" + // MigratedToAzure ... + MigratedToAzure OnboardingKind = "MigratedToAzure" +) + +// PossibleOnboardingKindValues returns an array of possible values for the OnboardingKind const type. +func PossibleOnboardingKindValues() []OnboardingKind { + return []OnboardingKind{Default, MigratedToAzure} +} + // Operator enumerates the values for operator. type Operator string const ( - // Contains ... + // Contains Applies only for non-decimal operands Contains Operator = "Contains" - // EndsWith ... + // EndsWith Applies only for non-decimal operands EndsWith Operator = "EndsWith" - // Equals ... + // Equals Applies for decimal and non-decimal operands Equals Operator = "Equals" - // GreaterThan ... + // GreaterThan Applies only for decimal operands GreaterThan Operator = "GreaterThan" - // GreaterThanOrEqualTo ... + // GreaterThanOrEqualTo Applies only for decimal operands GreaterThanOrEqualTo Operator = "GreaterThanOrEqualTo" - // LesserThan ... + // LesserThan Applies only for decimal operands LesserThan Operator = "LesserThan" - // LesserThanOrEqualTo ... + // LesserThanOrEqualTo Applies only for decimal operands LesserThanOrEqualTo Operator = "LesserThanOrEqualTo" - // NotEquals ... + // NotEquals Applies for decimal and non-decimal operands NotEquals Operator = "NotEquals" - // StartsWith ... + // StartsWith Applies only for non-decimal operands StartsWith Operator = "StartsWith" ) @@ -1336,6 +1469,8 @@ const ( RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange RuleTypeBasicCustomAlertRule = "AmqpC2DRejectedMessagesNotInAllowedRange" // RuleTypeAmqpD2CMessagesNotInAllowedRange ... RuleTypeAmqpD2CMessagesNotInAllowedRange RuleTypeBasicCustomAlertRule = "AmqpD2CMessagesNotInAllowedRange" + // RuleTypeConnectionFromIPNotAllowed ... + RuleTypeConnectionFromIPNotAllowed RuleTypeBasicCustomAlertRule = "ConnectionFromIpNotAllowed" // RuleTypeConnectionToIPNotAllowed ... RuleTypeConnectionToIPNotAllowed RuleTypeBasicCustomAlertRule = "ConnectionToIpNotAllowed" // RuleTypeCustomAlertRule ... @@ -1380,7 +1515,7 @@ const ( // PossibleRuleTypeBasicCustomAlertRuleValues returns an array of possible values for the RuleTypeBasicCustomAlertRule const type. func PossibleRuleTypeBasicCustomAlertRuleValues() []RuleTypeBasicCustomAlertRule { - return []RuleTypeBasicCustomAlertRule{RuleTypeActiveConnectionsNotInAllowedRange, RuleTypeAllowlistCustomAlertRule, RuleTypeAmqpC2DMessagesNotInAllowedRange, RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange, RuleTypeAmqpD2CMessagesNotInAllowedRange, RuleTypeConnectionToIPNotAllowed, RuleTypeCustomAlertRule, RuleTypeDenylistCustomAlertRule, RuleTypeDirectMethodInvokesNotInAllowedRange, RuleTypeFailedLocalLoginsNotInAllowedRange, RuleTypeFileUploadsNotInAllowedRange, RuleTypeHTTPC2DMessagesNotInAllowedRange, RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange, RuleTypeHTTPD2CMessagesNotInAllowedRange, RuleTypeListCustomAlertRule, RuleTypeLocalUserNotAllowed, RuleTypeMqttC2DMessagesNotInAllowedRange, RuleTypeMqttC2DRejectedMessagesNotInAllowedRange, RuleTypeMqttD2CMessagesNotInAllowedRange, RuleTypeProcessNotAllowed, RuleTypeQueuePurgesNotInAllowedRange, RuleTypeThresholdCustomAlertRule, RuleTypeTimeWindowCustomAlertRule, RuleTypeTwinUpdatesNotInAllowedRange, RuleTypeUnauthorizedOperationsNotInAllowedRange} + return []RuleTypeBasicCustomAlertRule{RuleTypeActiveConnectionsNotInAllowedRange, RuleTypeAllowlistCustomAlertRule, RuleTypeAmqpC2DMessagesNotInAllowedRange, RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange, RuleTypeAmqpD2CMessagesNotInAllowedRange, RuleTypeConnectionFromIPNotAllowed, RuleTypeConnectionToIPNotAllowed, RuleTypeCustomAlertRule, RuleTypeDenylistCustomAlertRule, RuleTypeDirectMethodInvokesNotInAllowedRange, RuleTypeFailedLocalLoginsNotInAllowedRange, RuleTypeFileUploadsNotInAllowedRange, RuleTypeHTTPC2DMessagesNotInAllowedRange, RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange, RuleTypeHTTPD2CMessagesNotInAllowedRange, RuleTypeListCustomAlertRule, RuleTypeLocalUserNotAllowed, RuleTypeMqttC2DMessagesNotInAllowedRange, RuleTypeMqttC2DRejectedMessagesNotInAllowedRange, RuleTypeMqttD2CMessagesNotInAllowedRange, RuleTypeProcessNotAllowed, RuleTypeQueuePurgesNotInAllowedRange, RuleTypeThresholdCustomAlertRule, RuleTypeTimeWindowCustomAlertRule, RuleTypeTwinUpdatesNotInAllowedRange, RuleTypeUnauthorizedOperationsNotInAllowedRange} } // ScanningFunctionality enumerates the values for scanning functionality. @@ -1466,6 +1601,21 @@ func PossibleSensorStatusValues() []SensorStatus { return []SensorStatus{Disconnected, Ok, Unavailable} } +// SensorType enumerates the values for sensor type. +type SensorType string + +const ( + // SensorTypeEnterprise ... + SensorTypeEnterprise SensorType = "Enterprise" + // SensorTypeOt ... + SensorTypeOt SensorType = "Ot" +) + +// PossibleSensorTypeValues returns an array of possible values for the SensorType const type. +func PossibleSensorTypeValues() []SensorType { + return []SensorType{SensorTypeEnterprise, SensorTypeOt} +} + // Severity enumerates the values for severity. type Severity string diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/ingestionsettings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/ingestionsettings.go new file mode 100644 index 000000000000..b5f7ce03a686 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/ingestionsettings.go @@ -0,0 +1,555 @@ +package security + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// IngestionSettingsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type IngestionSettingsClient struct { + BaseClient +} + +// NewIngestionSettingsClient creates an instance of the IngestionSettingsClient client. +func NewIngestionSettingsClient(subscriptionID string, ascLocation string) IngestionSettingsClient { + return NewIngestionSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewIngestionSettingsClientWithBaseURI creates an instance of the IngestionSettingsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewIngestionSettingsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IngestionSettingsClient { + return IngestionSettingsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Create create setting for ingesting security data and logs to correlate with resources associated with the +// subscription. +// Parameters: +// ingestionSettingName - name of the ingestion setting +// ingestionSetting - ingestion setting object +func (client IngestionSettingsClient) Create(ctx context.Context, ingestionSettingName string, ingestionSetting IngestionSetting) (result IngestionSetting, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IngestionSettingsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.IngestionSettingsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, ingestionSettingName, ingestionSetting) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IngestionSettingsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IngestionSettingsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IngestionSettingsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client IngestionSettingsClient) CreatePreparer(ctx context.Context, ingestionSettingName string, ingestionSetting IngestionSetting) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "ingestionSettingName": autorest.Encode("path", ingestionSettingName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-01-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}", pathParameters), + autorest.WithJSON(ingestionSetting), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client IngestionSettingsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client IngestionSettingsClient) CreateResponder(resp *http.Response) (result IngestionSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the ingestion settings for this subscription. +// Parameters: +// ingestionSettingName - name of the ingestion setting +func (client IngestionSettingsClient) Delete(ctx context.Context, ingestionSettingName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IngestionSettingsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.IngestionSettingsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, ingestionSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IngestionSettingsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.IngestionSettingsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IngestionSettingsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client IngestionSettingsClient) DeletePreparer(ctx context.Context, ingestionSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "ingestionSettingName": autorest.Encode("path", ingestionSettingName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-01-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client IngestionSettingsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client IngestionSettingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get settings for ingesting security data and logs to correlate with resources associated with the subscription. +// Parameters: +// ingestionSettingName - name of the ingestion setting +func (client IngestionSettingsClient) Get(ctx context.Context, ingestionSettingName string) (result IngestionSetting, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IngestionSettingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.IngestionSettingsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, ingestionSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IngestionSettingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IngestionSettingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IngestionSettingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client IngestionSettingsClient) GetPreparer(ctx context.Context, ingestionSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "ingestionSettingName": autorest.Encode("path", ingestionSettingName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-01-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client IngestionSettingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IngestionSettingsClient) GetResponder(resp *http.Response) (result IngestionSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List settings for ingesting security data and logs to correlate with resources associated with the subscription. +func (client IngestionSettingsClient) List(ctx context.Context) (result IngestionSettingListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IngestionSettingsClient.List") + defer func() { + sc := -1 + if result.isl.Response.Response != nil { + sc = result.isl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.IngestionSettingsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IngestionSettingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.isl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IngestionSettingsClient", "List", resp, "Failure sending request") + return + } + + result.isl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IngestionSettingsClient", "List", resp, "Failure responding to request") + return + } + if result.isl.hasNextLink() && result.isl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client IngestionSettingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-01-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client IngestionSettingsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client IngestionSettingsClient) ListResponder(resp *http.Response) (result IngestionSettingList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client IngestionSettingsClient) listNextResults(ctx context.Context, lastResults IngestionSettingList) (result IngestionSettingList, err error) { + req, err := lastResults.ingestionSettingListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.IngestionSettingsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.IngestionSettingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IngestionSettingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client IngestionSettingsClient) ListComplete(ctx context.Context) (result IngestionSettingListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IngestionSettingsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListConnectionStrings connection strings for ingesting security scan logs and data. +// Parameters: +// ingestionSettingName - name of the ingestion setting +func (client IngestionSettingsClient) ListConnectionStrings(ctx context.Context, ingestionSettingName string) (result ConnectionStrings, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IngestionSettingsClient.ListConnectionStrings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.IngestionSettingsClient", "ListConnectionStrings", err.Error()) + } + + req, err := client.ListConnectionStringsPreparer(ctx, ingestionSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IngestionSettingsClient", "ListConnectionStrings", nil, "Failure preparing request") + return + } + + resp, err := client.ListConnectionStringsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IngestionSettingsClient", "ListConnectionStrings", resp, "Failure sending request") + return + } + + result, err = client.ListConnectionStringsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IngestionSettingsClient", "ListConnectionStrings", resp, "Failure responding to request") + return + } + + return +} + +// ListConnectionStringsPreparer prepares the ListConnectionStrings request. +func (client IngestionSettingsClient) ListConnectionStringsPreparer(ctx context.Context, ingestionSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "ingestionSettingName": autorest.Encode("path", ingestionSettingName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-01-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listConnectionStrings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListConnectionStringsSender sends the ListConnectionStrings request. The method will close the +// http.Response Body if it receives an error. +func (client IngestionSettingsClient) ListConnectionStringsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListConnectionStringsResponder handles the response to the ListConnectionStrings request. The method always +// closes the http.Response Body. +func (client IngestionSettingsClient) ListConnectionStringsResponder(resp *http.Response) (result ConnectionStrings, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListTokens returns the token that is used for correlating ingested telemetry with the resources in the subscription. +// Parameters: +// ingestionSettingName - name of the ingestion setting +func (client IngestionSettingsClient) ListTokens(ctx context.Context, ingestionSettingName string) (result IngestionSettingToken, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IngestionSettingsClient.ListTokens") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.IngestionSettingsClient", "ListTokens", err.Error()) + } + + req, err := client.ListTokensPreparer(ctx, ingestionSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IngestionSettingsClient", "ListTokens", nil, "Failure preparing request") + return + } + + resp, err := client.ListTokensSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IngestionSettingsClient", "ListTokens", resp, "Failure sending request") + return + } + + result, err = client.ListTokensResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IngestionSettingsClient", "ListTokens", resp, "Failure responding to request") + return + } + + return +} + +// ListTokensPreparer prepares the ListTokens request. +func (client IngestionSettingsClient) ListTokensPreparer(ctx context.Context, ingestionSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "ingestionSettingName": autorest.Encode("path", ingestionSettingName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-01-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listTokens", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListTokensSender sends the ListTokens request. The method will close the +// http.Response Body if it receives an error. +func (client IngestionSettingsClient) ListTokensSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListTokensResponder handles the response to the ListTokens request. The method always +// closes the http.Response Body. +func (client IngestionSettingsClient) ListTokensResponder(resp *http.Response) (result IngestionSettingToken, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/iotalerts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/iotalerts.go index 63eb375e0aef..0db7982efdb0 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/iotalerts.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/iotalerts.go @@ -10,7 +10,6 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -33,11 +32,10 @@ func NewIotAlertsClientWithBaseURI(baseURI string, subscriptionID string, ascLoc // Get get IoT alert // Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// solutionName - the name of the IoT Security solution. +// scope - scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. +// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}) // iotAlertID - id of the alert -func (client IotAlertsClient) Get(ctx context.Context, resourceGroupName string, solutionName string, iotAlertID string) (result IotAlert, err error) { +func (client IotAlertsClient) Get(ctx context.Context, scope string, iotAlertID string) (result IotAlertModel, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertsClient.Get") defer func() { @@ -48,17 +46,7 @@ func (client IotAlertsClient) Get(ctx context.Context, resourceGroupName string, tracing.EndSpan(ctx, sc, err) }() } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.IotAlertsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, solutionName, iotAlertID) + req, err := client.GetPreparer(ctx, scope, iotAlertID) if err != nil { err = autorest.NewErrorWithError(err, "security.IotAlertsClient", "Get", nil, "Failure preparing request") return @@ -81,85 +69,7 @@ func (client IotAlertsClient) Get(ctx context.Context, resourceGroupName string, } // GetPreparer prepares the Get request. -func (client IotAlertsClient) GetPreparer(ctx context.Context, resourceGroupName string, solutionName string, iotAlertID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "iotAlertId": autorest.Encode("path", iotAlertID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "solutionName": autorest.Encode("path", solutionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlerts/{iotAlertId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client IotAlertsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client IotAlertsClient) GetResponder(resp *http.Response) (result IotAlert, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get1 get IoT alert -// Parameters: -// scope - scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. -// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}) -// iotAlertID - id of the alert -func (client IotAlertsClient) Get1(ctx context.Context, scope string, iotAlertID string) (result IotAlertModel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertsClient.Get1") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.Get1Preparer(ctx, scope, iotAlertID) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotAlertsClient", "Get1", nil, "Failure preparing request") - return - } - - resp, err := client.Get1Sender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IotAlertsClient", "Get1", resp, "Failure sending request") - return - } - - result, err = client.Get1Responder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotAlertsClient", "Get1", resp, "Failure responding to request") - return - } - - return -} - -// Get1Preparer prepares the Get1 request. -func (client IotAlertsClient) Get1Preparer(ctx context.Context, scope string, iotAlertID string) (*http.Request, error) { +func (client IotAlertsClient) GetPreparer(ctx context.Context, scope string, iotAlertID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "iotAlertId": autorest.Encode("path", iotAlertID), "scope": scope, @@ -178,15 +88,15 @@ func (client IotAlertsClient) Get1Preparer(ctx context.Context, scope string, io return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Get1Sender sends the Get1 request. The method will close the +// GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client IotAlertsClient) Get1Sender(req *http.Request) (*http.Response, error) { +func (client IotAlertsClient) GetSender(req *http.Request) (*http.Response, error) { return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } -// Get1Responder handles the response to the Get1 request. The method always +// GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client IotAlertsClient) Get1Responder(resp *http.Response) (result IotAlertModel, err error) { +func (client IotAlertsClient) GetResponder(resp *http.Response) (result IotAlertModel, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -198,38 +108,28 @@ func (client IotAlertsClient) Get1Responder(resp *http.Response) (result IotAler // List list IoT alerts // Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// solutionName - the name of the IoT Security solution. +// scope - scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. +// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}) // minStartTimeUtc - filter by minimum startTimeUtc (ISO 8601 format) // maxStartTimeUtc - filter by maximum startTimeUtc (ISO 8601 format) // alertType - filter by alert type +// deviceManagementType - get devices only from specific type, Managed or Unmanaged. // compromisedEntity - filter by compromised device // limit - limit the number of items returned in a single page // skipToken - skip token used for pagination -func (client IotAlertsClient) List(ctx context.Context, resourceGroupName string, solutionName string, minStartTimeUtc string, maxStartTimeUtc string, alertType string, compromisedEntity string, limit *int32, skipToken string) (result IotAlertListPage, err error) { +func (client IotAlertsClient) List(ctx context.Context, scope string, minStartTimeUtc string, maxStartTimeUtc string, alertType string, deviceManagementType ManagementState, compromisedEntity string, limit *int32, skipToken string) (result IotAlertListModelPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertsClient.List") defer func() { sc := -1 - if result.ial.Response.Response != nil { - sc = result.ial.Response.Response.StatusCode + if result.ialm.Response.Response != nil { + sc = result.ialm.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.IotAlertsClient", "List", err.Error()) - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, solutionName, minStartTimeUtc, maxStartTimeUtc, alertType, compromisedEntity, limit, skipToken) + req, err := client.ListPreparer(ctx, scope, minStartTimeUtc, maxStartTimeUtc, alertType, deviceManagementType, compromisedEntity, limit, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "security.IotAlertsClient", "List", nil, "Failure preparing request") return @@ -237,17 +137,17 @@ func (client IotAlertsClient) List(ctx context.Context, resourceGroupName string resp, err := client.ListSender(req) if err != nil { - result.ial.Response = autorest.Response{Response: resp} + result.ialm.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "security.IotAlertsClient", "List", resp, "Failure sending request") return } - result.ial, err = client.ListResponder(resp) + result.ialm, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "security.IotAlertsClient", "List", resp, "Failure responding to request") return } - if result.ial.hasNextLink() && result.ial.IsEmpty() { + if result.ialm.hasNextLink() && result.ialm.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -256,14 +156,12 @@ func (client IotAlertsClient) List(ctx context.Context, resourceGroupName string } // ListPreparer prepares the List request. -func (client IotAlertsClient) ListPreparer(ctx context.Context, resourceGroupName string, solutionName string, minStartTimeUtc string, maxStartTimeUtc string, alertType string, compromisedEntity string, limit *int32, skipToken string) (*http.Request, error) { +func (client IotAlertsClient) ListPreparer(ctx context.Context, scope string, minStartTimeUtc string, maxStartTimeUtc string, alertType string, deviceManagementType ManagementState, compromisedEntity string, limit *int32, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "solutionName": autorest.Encode("path", solutionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "scope": scope, } - const APIVersion = "2019-08-01" + const APIVersion = "2020-08-06-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -276,6 +174,9 @@ func (client IotAlertsClient) ListPreparer(ctx context.Context, resourceGroupNam if len(alertType) > 0 { queryParameters["alertType"] = autorest.Encode("query", alertType) } + if len(string(deviceManagementType)) > 0 { + queryParameters["deviceManagementType"] = autorest.Encode("query", deviceManagementType) + } if len(compromisedEntity) > 0 { queryParameters["compromisedEntity"] = autorest.Encode("query", compromisedEntity) } @@ -289,7 +190,7 @@ func (client IotAlertsClient) ListPreparer(ctx context.Context, resourceGroupNam preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlerts", pathParameters), + autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/iotAlerts", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -297,12 +198,12 @@ func (client IotAlertsClient) ListPreparer(ctx context.Context, resourceGroupNam // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client IotAlertsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client IotAlertsClient) ListResponder(resp *http.Response) (result IotAlertList, err error) { +func (client IotAlertsClient) ListResponder(resp *http.Response) (result IotAlertListModel, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -313,8 +214,8 @@ func (client IotAlertsClient) ListResponder(resp *http.Response) (result IotAler } // listNextResults retrieves the next set of results, if any. -func (client IotAlertsClient) listNextResults(ctx context.Context, lastResults IotAlertList) (result IotAlertList, err error) { - req, err := lastResults.iotAlertListPreparer(ctx) +func (client IotAlertsClient) listNextResults(ctx context.Context, lastResults IotAlertListModel) (result IotAlertListModel, err error) { + req, err := lastResults.iotAlertListModelPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "security.IotAlertsClient", "listNextResults", nil, "Failure preparing next results request") } @@ -334,7 +235,7 @@ func (client IotAlertsClient) listNextResults(ctx context.Context, lastResults I } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client IotAlertsClient) ListComplete(ctx context.Context, resourceGroupName string, solutionName string, minStartTimeUtc string, maxStartTimeUtc string, alertType string, compromisedEntity string, limit *int32, skipToken string) (result IotAlertListIterator, err error) { +func (client IotAlertsClient) ListComplete(ctx context.Context, scope string, minStartTimeUtc string, maxStartTimeUtc string, alertType string, deviceManagementType ManagementState, compromisedEntity string, limit *int32, skipToken string) (result IotAlertListModelIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertsClient.List") defer func() { @@ -345,150 +246,6 @@ func (client IotAlertsClient) ListComplete(ctx context.Context, resourceGroupNam tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, resourceGroupName, solutionName, minStartTimeUtc, maxStartTimeUtc, alertType, compromisedEntity, limit, skipToken) - return -} - -// List1 list IoT alerts -// Parameters: -// scope - scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. -// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}) -// minStartTimeUtc - filter by minimum startTimeUtc (ISO 8601 format) -// maxStartTimeUtc - filter by maximum startTimeUtc (ISO 8601 format) -// alertType - filter by alert type -// deviceManagementType - get devices only from specific type, Managed or Unmanaged. -// compromisedEntity - filter by compromised device -// limit - limit the number of items returned in a single page -// skipToken - skip token used for pagination -func (client IotAlertsClient) List1(ctx context.Context, scope string, minStartTimeUtc string, maxStartTimeUtc string, alertType string, deviceManagementType ManagementState, compromisedEntity string, limit *int32, skipToken string) (result IotAlertListModelPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertsClient.List1") - defer func() { - sc := -1 - if result.ialm.Response.Response != nil { - sc = result.ialm.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.list1NextResults - req, err := client.List1Preparer(ctx, scope, minStartTimeUtc, maxStartTimeUtc, alertType, deviceManagementType, compromisedEntity, limit, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotAlertsClient", "List1", nil, "Failure preparing request") - return - } - - resp, err := client.List1Sender(req) - if err != nil { - result.ialm.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IotAlertsClient", "List1", resp, "Failure sending request") - return - } - - result.ialm, err = client.List1Responder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotAlertsClient", "List1", resp, "Failure responding to request") - return - } - if result.ialm.hasNextLink() && result.ialm.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// List1Preparer prepares the List1 request. -func (client IotAlertsClient) List1Preparer(ctx context.Context, scope string, minStartTimeUtc string, maxStartTimeUtc string, alertType string, deviceManagementType ManagementState, compromisedEntity string, limit *int32, skipToken string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "scope": scope, - } - - const APIVersion = "2020-08-06-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(minStartTimeUtc) > 0 { - queryParameters["startTimeUtc>"] = autorest.Encode("query", minStartTimeUtc) - } - if len(maxStartTimeUtc) > 0 { - queryParameters["startTimeUtc<"] = autorest.Encode("query", maxStartTimeUtc) - } - if len(alertType) > 0 { - queryParameters["alertType"] = autorest.Encode("query", alertType) - } - if len(string(deviceManagementType)) > 0 { - queryParameters["deviceManagementType"] = autorest.Encode("query", deviceManagementType) - } - if len(compromisedEntity) > 0 { - queryParameters["compromisedEntity"] = autorest.Encode("query", compromisedEntity) - } - if limit != nil { - queryParameters["$limit"] = autorest.Encode("query", *limit) - } - if len(skipToken) > 0 { - queryParameters["$skipToken"] = autorest.Encode("query", skipToken) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/iotAlerts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// List1Sender sends the List1 request. The method will close the -// http.Response Body if it receives an error. -func (client IotAlertsClient) List1Sender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// List1Responder handles the response to the List1 request. The method always -// closes the http.Response Body. -func (client IotAlertsClient) List1Responder(resp *http.Response) (result IotAlertListModel, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// list1NextResults retrieves the next set of results, if any. -func (client IotAlertsClient) list1NextResults(ctx context.Context, lastResults IotAlertListModel) (result IotAlertListModel, err error) { - req, err := lastResults.iotAlertListModelPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "security.IotAlertsClient", "list1NextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.List1Sender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "security.IotAlertsClient", "list1NextResults", resp, "Failure sending next results request") - } - result, err = client.List1Responder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotAlertsClient", "list1NextResults", resp, "Failure responding to next results request") - } - return -} - -// List1Complete enumerates all values, automatically crossing page boundaries as required. -func (client IotAlertsClient) List1Complete(ctx context.Context, scope string, minStartTimeUtc string, maxStartTimeUtc string, alertType string, deviceManagementType ManagementState, compromisedEntity string, limit *int32, skipToken string) (result IotAlertListModelIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertsClient.List1") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List1(ctx, scope, minStartTimeUtc, maxStartTimeUtc, alertType, deviceManagementType, compromisedEntity, limit, skipToken) + result.page, err = client.List(ctx, scope, minStartTimeUtc, maxStartTimeUtc, alertType, deviceManagementType, compromisedEntity, limit, skipToken) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/iotalerttypes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/iotalerttypes.go index 5c736cd98d90..08f297dde0c6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/iotalerttypes.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/iotalerttypes.go @@ -33,11 +33,8 @@ func NewIotAlertTypesClientWithBaseURI(baseURI string, subscriptionID string, as // Get get IoT alert type // Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// solutionName - the name of the IoT Security solution. // iotAlertTypeName - name of the alert type -func (client IotAlertTypesClient) Get(ctx context.Context, resourceGroupName string, solutionName string, iotAlertTypeName string) (result IotAlertType, err error) { +func (client IotAlertTypesClient) Get(ctx context.Context, iotAlertTypeName string) (result IotAlertType, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertTypesClient.Get") defer func() { @@ -50,15 +47,11 @@ func (client IotAlertTypesClient) Get(ctx context.Context, resourceGroupName str } if err := validation.Validate([]validation.Validation{ {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { return result, validation.NewError("security.IotAlertTypesClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, solutionName, iotAlertTypeName) + req, err := client.GetPreparer(ctx, iotAlertTypeName) if err != nil { err = autorest.NewErrorWithError(err, "security.IotAlertTypesClient", "Get", nil, "Failure preparing request") return @@ -81,89 +74,7 @@ func (client IotAlertTypesClient) Get(ctx context.Context, resourceGroupName str } // GetPreparer prepares the Get request. -func (client IotAlertTypesClient) GetPreparer(ctx context.Context, resourceGroupName string, solutionName string, iotAlertTypeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "iotAlertTypeName": autorest.Encode("path", iotAlertTypeName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "solutionName": autorest.Encode("path", solutionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlertTypes/{iotAlertTypeName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client IotAlertTypesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client IotAlertTypesClient) GetResponder(resp *http.Response) (result IotAlertType, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get1 get IoT alert type -// Parameters: -// iotAlertTypeName - name of the alert type -func (client IotAlertTypesClient) Get1(ctx context.Context, iotAlertTypeName string) (result IotAlertType, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertTypesClient.Get1") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.IotAlertTypesClient", "Get1", err.Error()) - } - - req, err := client.Get1Preparer(ctx, iotAlertTypeName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotAlertTypesClient", "Get1", nil, "Failure preparing request") - return - } - - resp, err := client.Get1Sender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IotAlertTypesClient", "Get1", resp, "Failure sending request") - return - } - - result, err = client.Get1Responder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotAlertTypesClient", "Get1", resp, "Failure responding to request") - return - } - - return -} - -// Get1Preparer prepares the Get1 request. -func (client IotAlertTypesClient) Get1Preparer(ctx context.Context, iotAlertTypeName string) (*http.Request, error) { +func (client IotAlertTypesClient) GetPreparer(ctx context.Context, iotAlertTypeName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "iotAlertTypeName": autorest.Encode("path", iotAlertTypeName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -182,15 +93,15 @@ func (client IotAlertTypesClient) Get1Preparer(ctx context.Context, iotAlertType return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Get1Sender sends the Get1 request. The method will close the +// GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client IotAlertTypesClient) Get1Sender(req *http.Request) (*http.Response, error) { +func (client IotAlertTypesClient) GetSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// Get1Responder handles the response to the Get1 request. The method always +// GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client IotAlertTypesClient) Get1Responder(resp *http.Response) (result IotAlertType, err error) { +func (client IotAlertTypesClient) GetResponder(resp *http.Response) (result IotAlertType, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -201,11 +112,7 @@ func (client IotAlertTypesClient) Get1Responder(resp *http.Response) (result Iot } // List list IoT alert types -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// solutionName - the name of the IoT Security solution. -func (client IotAlertTypesClient) List(ctx context.Context, resourceGroupName string, solutionName string) (result IotAlertTypeList, err error) { +func (client IotAlertTypesClient) List(ctx context.Context) (result IotAlertTypeList, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertTypesClient.List") defer func() { @@ -218,15 +125,11 @@ func (client IotAlertTypesClient) List(ctx context.Context, resourceGroupName st } if err := validation.Validate([]validation.Validation{ {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { return result, validation.NewError("security.IotAlertTypesClient", "List", err.Error()) } - req, err := client.ListPreparer(ctx, resourceGroupName, solutionName) + req, err := client.ListPreparer(ctx) if err != nil { err = autorest.NewErrorWithError(err, "security.IotAlertTypesClient", "List", nil, "Failure preparing request") return @@ -249,14 +152,12 @@ func (client IotAlertTypesClient) List(ctx context.Context, resourceGroupName st } // ListPreparer prepares the List request. -func (client IotAlertTypesClient) ListPreparer(ctx context.Context, resourceGroupName string, solutionName string) (*http.Request, error) { +func (client IotAlertTypesClient) ListPreparer(ctx context.Context) (*http.Request, error) { pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "solutionName": autorest.Encode("path", solutionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-08-01" + const APIVersion = "2020-08-06-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -264,7 +165,7 @@ func (client IotAlertTypesClient) ListPreparer(ctx context.Context, resourceGrou preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlertTypes", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -286,80 +187,3 @@ func (client IotAlertTypesClient) ListResponder(resp *http.Response) (result Iot result.Response = autorest.Response{Response: resp} return } - -// List1 list IoT alert types -func (client IotAlertTypesClient) List1(ctx context.Context) (result IotAlertTypeList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertTypesClient.List1") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.IotAlertTypesClient", "List1", err.Error()) - } - - req, err := client.List1Preparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotAlertTypesClient", "List1", nil, "Failure preparing request") - return - } - - resp, err := client.List1Sender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IotAlertTypesClient", "List1", resp, "Failure sending request") - return - } - - result, err = client.List1Responder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotAlertTypesClient", "List1", resp, "Failure responding to request") - return - } - - return -} - -// List1Preparer prepares the List1 request. -func (client IotAlertTypesClient) List1Preparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-08-06-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// List1Sender sends the List1 request. The method will close the -// http.Response Body if it receives an error. -func (client IotAlertTypesClient) List1Sender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// List1Responder handles the response to the List1 request. The method always -// closes the http.Response Body. -func (client IotAlertTypesClient) List1Responder(resp *http.Response) (result IotAlertTypeList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/iotrecommendations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/iotrecommendations.go index 9a54ec23a6fa..d65c06b1cb94 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/iotrecommendations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/iotrecommendations.go @@ -10,7 +10,6 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -34,11 +33,10 @@ func NewIotRecommendationsClientWithBaseURI(baseURI string, subscriptionID strin // Get get IoT recommendation // Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// solutionName - the name of the IoT Security solution. +// scope - scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. +// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}) // iotRecommendationID - id of the recommendation -func (client IotRecommendationsClient) Get(ctx context.Context, resourceGroupName string, solutionName string, iotRecommendationID string) (result IotRecommendation, err error) { +func (client IotRecommendationsClient) Get(ctx context.Context, scope string, iotRecommendationID string) (result IotRecommendationModel, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationsClient.Get") defer func() { @@ -49,17 +47,7 @@ func (client IotRecommendationsClient) Get(ctx context.Context, resourceGroupNam tracing.EndSpan(ctx, sc, err) }() } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.IotRecommendationsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, solutionName, iotRecommendationID) + req, err := client.GetPreparer(ctx, scope, iotRecommendationID) if err != nil { err = autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "Get", nil, "Failure preparing request") return @@ -82,85 +70,7 @@ func (client IotRecommendationsClient) Get(ctx context.Context, resourceGroupNam } // GetPreparer prepares the Get request. -func (client IotRecommendationsClient) GetPreparer(ctx context.Context, resourceGroupName string, solutionName string, iotRecommendationID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "iotRecommendationId": autorest.Encode("path", iotRecommendationID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "solutionName": autorest.Encode("path", solutionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotRecommendations/{iotRecommendationId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client IotRecommendationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client IotRecommendationsClient) GetResponder(resp *http.Response) (result IotRecommendation, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get1 get IoT recommendation -// Parameters: -// scope - scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. -// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}) -// iotRecommendationID - id of the recommendation -func (client IotRecommendationsClient) Get1(ctx context.Context, scope string, iotRecommendationID string) (result IotRecommendationModel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationsClient.Get1") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.Get1Preparer(ctx, scope, iotRecommendationID) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "Get1", nil, "Failure preparing request") - return - } - - resp, err := client.Get1Sender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "Get1", resp, "Failure sending request") - return - } - - result, err = client.Get1Responder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "Get1", resp, "Failure responding to request") - return - } - - return -} - -// Get1Preparer prepares the Get1 request. -func (client IotRecommendationsClient) Get1Preparer(ctx context.Context, scope string, iotRecommendationID string) (*http.Request, error) { +func (client IotRecommendationsClient) GetPreparer(ctx context.Context, scope string, iotRecommendationID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "iotRecommendationId": autorest.Encode("path", iotRecommendationID), "scope": scope, @@ -179,15 +89,15 @@ func (client IotRecommendationsClient) Get1Preparer(ctx context.Context, scope s return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// Get1Sender sends the Get1 request. The method will close the +// GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client IotRecommendationsClient) Get1Sender(req *http.Request) (*http.Response, error) { +func (client IotRecommendationsClient) GetSender(req *http.Request) (*http.Response, error) { return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } -// Get1Responder handles the response to the Get1 request. The method always +// GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client IotRecommendationsClient) Get1Responder(resp *http.Response) (result IotRecommendationModel, err error) { +func (client IotRecommendationsClient) GetResponder(resp *http.Response) (result IotRecommendationModel, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -199,36 +109,25 @@ func (client IotRecommendationsClient) Get1Responder(resp *http.Response) (resul // List list IoT recommendations // Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// solutionName - the name of the IoT Security solution. +// scope - scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. +// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}) // recommendationType - filter by recommendation type // deviceID - filter by device id // limit - limit the number of items returned in a single page // skipToken - skip token used for pagination -func (client IotRecommendationsClient) List(ctx context.Context, resourceGroupName string, solutionName string, recommendationType string, deviceID string, limit *int32, skipToken string) (result IotRecommendationListPage, err error) { +func (client IotRecommendationsClient) List(ctx context.Context, scope string, recommendationType string, deviceID string, limit *int32, skipToken string) (result IotRecommendationListModelPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationsClient.List") defer func() { sc := -1 - if result.irl.Response.Response != nil { - sc = result.irl.Response.Response.StatusCode + if result.irlm.Response.Response != nil { + sc = result.irlm.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.IotRecommendationsClient", "List", err.Error()) - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, solutionName, recommendationType, deviceID, limit, skipToken) + req, err := client.ListPreparer(ctx, scope, recommendationType, deviceID, limit, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "List", nil, "Failure preparing request") return @@ -236,17 +135,17 @@ func (client IotRecommendationsClient) List(ctx context.Context, resourceGroupNa resp, err := client.ListSender(req) if err != nil { - result.irl.Response = autorest.Response{Response: resp} + result.irlm.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "List", resp, "Failure sending request") return } - result.irl, err = client.ListResponder(resp) + result.irlm, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "List", resp, "Failure responding to request") return } - if result.irl.hasNextLink() && result.irl.IsEmpty() { + if result.irlm.hasNextLink() && result.irlm.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -255,14 +154,12 @@ func (client IotRecommendationsClient) List(ctx context.Context, resourceGroupNa } // ListPreparer prepares the List request. -func (client IotRecommendationsClient) ListPreparer(ctx context.Context, resourceGroupName string, solutionName string, recommendationType string, deviceID string, limit *int32, skipToken string) (*http.Request, error) { +func (client IotRecommendationsClient) ListPreparer(ctx context.Context, scope string, recommendationType string, deviceID string, limit *int32, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "solutionName": autorest.Encode("path", solutionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "scope": scope, } - const APIVersion = "2019-08-01" + const APIVersion = "2020-08-06-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -282,7 +179,7 @@ func (client IotRecommendationsClient) ListPreparer(ctx context.Context, resourc preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotRecommendations", pathParameters), + autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/iotRecommendations", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -290,12 +187,12 @@ func (client IotRecommendationsClient) ListPreparer(ctx context.Context, resourc // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client IotRecommendationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client IotRecommendationsClient) ListResponder(resp *http.Response) (result IotRecommendationList, err error) { +func (client IotRecommendationsClient) ListResponder(resp *http.Response) (result IotRecommendationListModel, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -306,8 +203,8 @@ func (client IotRecommendationsClient) ListResponder(resp *http.Response) (resul } // listNextResults retrieves the next set of results, if any. -func (client IotRecommendationsClient) listNextResults(ctx context.Context, lastResults IotRecommendationList) (result IotRecommendationList, err error) { - req, err := lastResults.iotRecommendationListPreparer(ctx) +func (client IotRecommendationsClient) listNextResults(ctx context.Context, lastResults IotRecommendationListModel) (result IotRecommendationListModel, err error) { + req, err := lastResults.iotRecommendationListModelPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "listNextResults", nil, "Failure preparing next results request") } @@ -327,7 +224,7 @@ func (client IotRecommendationsClient) listNextResults(ctx context.Context, last } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client IotRecommendationsClient) ListComplete(ctx context.Context, resourceGroupName string, solutionName string, recommendationType string, deviceID string, limit *int32, skipToken string) (result IotRecommendationListIterator, err error) { +func (client IotRecommendationsClient) ListComplete(ctx context.Context, scope string, recommendationType string, deviceID string, limit *int32, skipToken string) (result IotRecommendationListModelIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationsClient.List") defer func() { @@ -338,138 +235,6 @@ func (client IotRecommendationsClient) ListComplete(ctx context.Context, resourc tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, resourceGroupName, solutionName, recommendationType, deviceID, limit, skipToken) - return -} - -// List1 list IoT recommendations -// Parameters: -// scope - scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. -// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}) -// recommendationType - filter by recommendation type -// deviceID - filter by device id -// limit - limit the number of items returned in a single page -// skipToken - skip token used for pagination -func (client IotRecommendationsClient) List1(ctx context.Context, scope string, recommendationType string, deviceID string, limit *int32, skipToken string) (result IotRecommendationListModelPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationsClient.List1") - defer func() { - sc := -1 - if result.irlm.Response.Response != nil { - sc = result.irlm.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.list1NextResults - req, err := client.List1Preparer(ctx, scope, recommendationType, deviceID, limit, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "List1", nil, "Failure preparing request") - return - } - - resp, err := client.List1Sender(req) - if err != nil { - result.irlm.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "List1", resp, "Failure sending request") - return - } - - result.irlm, err = client.List1Responder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "List1", resp, "Failure responding to request") - return - } - if result.irlm.hasNextLink() && result.irlm.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// List1Preparer prepares the List1 request. -func (client IotRecommendationsClient) List1Preparer(ctx context.Context, scope string, recommendationType string, deviceID string, limit *int32, skipToken string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "scope": scope, - } - - const APIVersion = "2020-08-06-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(recommendationType) > 0 { - queryParameters["recommendationType"] = autorest.Encode("query", recommendationType) - } - if len(deviceID) > 0 { - queryParameters["deviceId"] = autorest.Encode("query", deviceID) - } - if limit != nil { - queryParameters["$limit"] = autorest.Encode("query", *limit) - } - if len(skipToken) > 0 { - queryParameters["$skipToken"] = autorest.Encode("query", skipToken) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/iotRecommendations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// List1Sender sends the List1 request. The method will close the -// http.Response Body if it receives an error. -func (client IotRecommendationsClient) List1Sender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// List1Responder handles the response to the List1 request. The method always -// closes the http.Response Body. -func (client IotRecommendationsClient) List1Responder(resp *http.Response) (result IotRecommendationListModel, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// list1NextResults retrieves the next set of results, if any. -func (client IotRecommendationsClient) list1NextResults(ctx context.Context, lastResults IotRecommendationListModel) (result IotRecommendationListModel, err error) { - req, err := lastResults.iotRecommendationListModelPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "list1NextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.List1Sender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "list1NextResults", resp, "Failure sending next results request") - } - result, err = client.List1Responder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "list1NextResults", resp, "Failure responding to next results request") - } - return -} - -// List1Complete enumerates all values, automatically crossing page boundaries as required. -func (client IotRecommendationsClient) List1Complete(ctx context.Context, scope string, recommendationType string, deviceID string, limit *int32, skipToken string) (result IotRecommendationListModelIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationsClient.List1") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List1(ctx, scope, recommendationType, deviceID, limit, skipToken) + result.page, err = client.List(ctx, scope, recommendationType, deviceID, limit, skipToken) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/iotrecommendationtypes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/iotrecommendationtypes.go index f43cc065d725..23f77b0dfd7b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/iotrecommendationtypes.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/iotrecommendationtypes.go @@ -34,11 +34,8 @@ func NewIotRecommendationTypesClientWithBaseURI(baseURI string, subscriptionID s // Get get IoT recommendation type // Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// solutionName - the name of the IoT Security solution. // iotRecommendationTypeName - name of the recommendation type -func (client IotRecommendationTypesClient) Get(ctx context.Context, resourceGroupName string, solutionName string, iotRecommendationTypeName string) (result IotRecommendationType, err error) { +func (client IotRecommendationTypesClient) Get(ctx context.Context, iotRecommendationTypeName string) (result IotRecommendationType, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationTypesClient.Get") defer func() { @@ -51,15 +48,11 @@ func (client IotRecommendationTypesClient) Get(ctx context.Context, resourceGrou } if err := validation.Validate([]validation.Validation{ {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { return result, validation.NewError("security.IotRecommendationTypesClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, solutionName, iotRecommendationTypeName) + req, err := client.GetPreparer(ctx, iotRecommendationTypeName) if err != nil { err = autorest.NewErrorWithError(err, "security.IotRecommendationTypesClient", "Get", nil, "Failure preparing request") return @@ -82,15 +75,13 @@ func (client IotRecommendationTypesClient) Get(ctx context.Context, resourceGrou } // GetPreparer prepares the Get request. -func (client IotRecommendationTypesClient) GetPreparer(ctx context.Context, resourceGroupName string, solutionName string, iotRecommendationTypeName string) (*http.Request, error) { +func (client IotRecommendationTypesClient) GetPreparer(ctx context.Context, iotRecommendationTypeName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "iotRecommendationTypeName": autorest.Encode("path", iotRecommendationTypeName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "solutionName": autorest.Encode("path", solutionName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-08-01" + const APIVersion = "2020-08-06-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -98,7 +89,7 @@ func (client IotRecommendationTypesClient) GetPreparer(ctx context.Context, reso preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotRecommendationTypes/{iotRecommendationTypeName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes/{iotRecommendationTypeName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -121,92 +112,8 @@ func (client IotRecommendationTypesClient) GetResponder(resp *http.Response) (re return } -// Get1 get IoT recommendation type -// Parameters: -// iotRecommendationTypeName - name of the recommendation type -func (client IotRecommendationTypesClient) Get1(ctx context.Context, iotRecommendationTypeName string) (result IotRecommendationType, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationTypesClient.Get1") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.IotRecommendationTypesClient", "Get1", err.Error()) - } - - req, err := client.Get1Preparer(ctx, iotRecommendationTypeName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotRecommendationTypesClient", "Get1", nil, "Failure preparing request") - return - } - - resp, err := client.Get1Sender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IotRecommendationTypesClient", "Get1", resp, "Failure sending request") - return - } - - result, err = client.Get1Responder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotRecommendationTypesClient", "Get1", resp, "Failure responding to request") - return - } - - return -} - -// Get1Preparer prepares the Get1 request. -func (client IotRecommendationTypesClient) Get1Preparer(ctx context.Context, iotRecommendationTypeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "iotRecommendationTypeName": autorest.Encode("path", iotRecommendationTypeName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-08-06-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes/{iotRecommendationTypeName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// Get1Sender sends the Get1 request. The method will close the -// http.Response Body if it receives an error. -func (client IotRecommendationTypesClient) Get1Sender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// Get1Responder handles the response to the Get1 request. The method always -// closes the http.Response Body. -func (client IotRecommendationTypesClient) Get1Responder(resp *http.Response) (result IotRecommendationType, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - // List list IoT recommendation types -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// solutionName - the name of the IoT Security solution. -func (client IotRecommendationTypesClient) List(ctx context.Context, resourceGroupName string, solutionName string) (result IotRecommendationTypeList, err error) { +func (client IotRecommendationTypesClient) List(ctx context.Context) (result IotRecommendationTypeList, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationTypesClient.List") defer func() { @@ -219,15 +126,11 @@ func (client IotRecommendationTypesClient) List(ctx context.Context, resourceGro } if err := validation.Validate([]validation.Validation{ {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { return result, validation.NewError("security.IotRecommendationTypesClient", "List", err.Error()) } - req, err := client.ListPreparer(ctx, resourceGroupName, solutionName) + req, err := client.ListPreparer(ctx) if err != nil { err = autorest.NewErrorWithError(err, "security.IotRecommendationTypesClient", "List", nil, "Failure preparing request") return @@ -250,14 +153,12 @@ func (client IotRecommendationTypesClient) List(ctx context.Context, resourceGro } // ListPreparer prepares the List request. -func (client IotRecommendationTypesClient) ListPreparer(ctx context.Context, resourceGroupName string, solutionName string) (*http.Request, error) { +func (client IotRecommendationTypesClient) ListPreparer(ctx context.Context) (*http.Request, error) { pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "solutionName": autorest.Encode("path", solutionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-08-01" + const APIVersion = "2020-08-06-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -265,7 +166,7 @@ func (client IotRecommendationTypesClient) ListPreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotRecommendationTypes", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -287,80 +188,3 @@ func (client IotRecommendationTypesClient) ListResponder(resp *http.Response) (r result.Response = autorest.Response{Response: resp} return } - -// List1 list IoT recommendation types -func (client IotRecommendationTypesClient) List1(ctx context.Context) (result IotRecommendationTypeList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationTypesClient.List1") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.IotRecommendationTypesClient", "List1", err.Error()) - } - - req, err := client.List1Preparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotRecommendationTypesClient", "List1", nil, "Failure preparing request") - return - } - - resp, err := client.List1Sender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IotRecommendationTypesClient", "List1", resp, "Failure sending request") - return - } - - result, err = client.List1Responder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotRecommendationTypesClient", "List1", resp, "Failure responding to request") - return - } - - return -} - -// List1Preparer prepares the List1 request. -func (client IotRecommendationTypesClient) List1Preparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-08-06-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// List1Sender sends the List1 request. The method will close the -// http.Response Body if it receives an error. -func (client IotRecommendationTypesClient) List1Sender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// List1Responder handles the response to the List1 request. The method always -// closes the http.Response Body. -func (client IotRecommendationTypesClient) List1Responder(resp *http.Response) (result IotRecommendationTypeList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go index 572dc3a15492..453312504f18 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go @@ -106,6 +106,7 @@ func (client IotSecuritySolutionClient) CreateOrUpdatePreparer(ctx context.Conte iotSecuritySolutionData.ID = nil iotSecuritySolutionData.Name = nil iotSecuritySolutionData.Type = nil + iotSecuritySolutionData.SystemData = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/models.go index 420ba8ad3050..0d33397018d3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/models.go @@ -105,7 +105,7 @@ type ActiveConnectionsNotInAllowedRange struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -181,6 +181,11 @@ func (acniar ActiveConnectionsNotInAllowedRange) AsConnectionToIPNotAllowed() (* return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. func (acniar ActiveConnectionsNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false @@ -367,7 +372,7 @@ func (aacg *AdaptiveApplicationControlGroup) UnmarshalJSON(body []byte) error { // AdaptiveApplicationControlGroupData represents a machines group and set of rules to be allowed running // on a machine type AdaptiveApplicationControlGroupData struct { - // EnforcementMode - Possible values include: 'Audit', 'Enforce', 'None' + // EnforcementMode - Possible values include: 'EnforcementModeAudit', 'EnforcementModeEnforce', 'EnforcementModeNone' EnforcementMode EnforcementMode `json:"enforcementMode,omitempty"` ProtectionMode *ProtectionMode `json:"protectionMode,omitempty"` // ConfigurationStatus - READ-ONLY; Possible values include: 'ConfigurationStatus2Configured', 'ConfigurationStatus2NotConfigured', 'ConfigurationStatus2InProgress', 'ConfigurationStatus2Failed', 'ConfigurationStatus2NoStatus' @@ -798,6 +803,16 @@ func (ad AdditionalData) AsBasicAdditionalData() (BasicAdditionalData, bool) { return &ad, true } +// AdditionalWorkspacesProperties properties of the additional workspaces. +type AdditionalWorkspacesProperties struct { + // Workspace - Workspace resource id + Workspace *string `json:"workspace,omitempty"` + // Type - Workspace type. Possible values include: 'Sentinel' + Type AdditionalWorkspaceType `json:"type,omitempty"` + // DataTypes - List of data types sent to workspace + DataTypes *[]AdditionalWorkspaceDataType `json:"dataTypes,omitempty"` +} + // AdvancedThreatProtectionProperties the Advanced Threat Protection settings. type AdvancedThreatProtectionProperties struct { // IsEnabled - Indicates whether Advanced Threat Protection is enabled. @@ -1450,6 +1465,273 @@ func (ap *AlertProperties) UnmarshalJSON(body []byte) error { return nil } +// AlertSimulatorBundlesRequestProperties simulate alerts according to this bundles. +type AlertSimulatorBundlesRequestProperties struct { + // Bundles - Bundles list. + Bundles *[]BundleType `json:"bundles,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Kind - Possible values include: 'KindAlertSimulatorRequestProperties', 'KindBundles' + Kind KindEnum2 `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for AlertSimulatorBundlesRequestProperties. +func (asbrp AlertSimulatorBundlesRequestProperties) MarshalJSON() ([]byte, error) { + asbrp.Kind = KindBundles + objectMap := make(map[string]interface{}) + if asbrp.Bundles != nil { + objectMap["bundles"] = asbrp.Bundles + } + if asbrp.Kind != "" { + objectMap["kind"] = asbrp.Kind + } + for k, v := range asbrp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAlertSimulatorBundlesRequestProperties is the BasicAlertSimulatorRequestProperties implementation for AlertSimulatorBundlesRequestProperties. +func (asbrp AlertSimulatorBundlesRequestProperties) AsAlertSimulatorBundlesRequestProperties() (*AlertSimulatorBundlesRequestProperties, bool) { + return &asbrp, true +} + +// AsAlertSimulatorRequestProperties is the BasicAlertSimulatorRequestProperties implementation for AlertSimulatorBundlesRequestProperties. +func (asbrp AlertSimulatorBundlesRequestProperties) AsAlertSimulatorRequestProperties() (*AlertSimulatorRequestProperties, bool) { + return nil, false +} + +// AsBasicAlertSimulatorRequestProperties is the BasicAlertSimulatorRequestProperties implementation for AlertSimulatorBundlesRequestProperties. +func (asbrp AlertSimulatorBundlesRequestProperties) AsBasicAlertSimulatorRequestProperties() (BasicAlertSimulatorRequestProperties, bool) { + return &asbrp, true +} + +// UnmarshalJSON is the custom unmarshaler for AlertSimulatorBundlesRequestProperties struct. +func (asbrp *AlertSimulatorBundlesRequestProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "bundles": + if v != nil { + var bundles []BundleType + err = json.Unmarshal(*v, &bundles) + if err != nil { + return err + } + asbrp.Bundles = &bundles + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if asbrp.AdditionalProperties == nil { + asbrp.AdditionalProperties = make(map[string]interface{}) + } + asbrp.AdditionalProperties[k] = additionalProperties + } + case "kind": + if v != nil { + var kind KindEnum2 + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + asbrp.Kind = kind + } + } + } + + return nil +} + +// AlertSimulatorRequestBody alert Simulator request body. +type AlertSimulatorRequestBody struct { + // Properties - Alert Simulator request body data. + Properties BasicAlertSimulatorRequestProperties `json:"properties,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AlertSimulatorRequestBody struct. +func (asrb *AlertSimulatorRequestBody) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicAlertSimulatorRequestProperties(*v) + if err != nil { + return err + } + asrb.Properties = properties + } + } + } + + return nil +} + +// BasicAlertSimulatorRequestProperties describes properties of an alert simulation request +type BasicAlertSimulatorRequestProperties interface { + AsAlertSimulatorBundlesRequestProperties() (*AlertSimulatorBundlesRequestProperties, bool) + AsAlertSimulatorRequestProperties() (*AlertSimulatorRequestProperties, bool) +} + +// AlertSimulatorRequestProperties describes properties of an alert simulation request +type AlertSimulatorRequestProperties struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Kind - Possible values include: 'KindAlertSimulatorRequestProperties', 'KindBundles' + Kind KindEnum2 `json:"kind,omitempty"` +} + +func unmarshalBasicAlertSimulatorRequestProperties(body []byte) (BasicAlertSimulatorRequestProperties, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindBundles): + var asbrp AlertSimulatorBundlesRequestProperties + err := json.Unmarshal(body, &asbrp) + return asbrp, err + default: + var asrp AlertSimulatorRequestProperties + err := json.Unmarshal(body, &asrp) + return asrp, err + } +} +func unmarshalBasicAlertSimulatorRequestPropertiesArray(body []byte) ([]BasicAlertSimulatorRequestProperties, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + asrpArray := make([]BasicAlertSimulatorRequestProperties, len(rawMessages)) + + for index, rawMessage := range rawMessages { + asrp, err := unmarshalBasicAlertSimulatorRequestProperties(*rawMessage) + if err != nil { + return nil, err + } + asrpArray[index] = asrp + } + return asrpArray, nil +} + +// MarshalJSON is the custom marshaler for AlertSimulatorRequestProperties. +func (asrp AlertSimulatorRequestProperties) MarshalJSON() ([]byte, error) { + asrp.Kind = KindAlertSimulatorRequestProperties + objectMap := make(map[string]interface{}) + if asrp.Kind != "" { + objectMap["kind"] = asrp.Kind + } + for k, v := range asrp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAlertSimulatorBundlesRequestProperties is the BasicAlertSimulatorRequestProperties implementation for AlertSimulatorRequestProperties. +func (asrp AlertSimulatorRequestProperties) AsAlertSimulatorBundlesRequestProperties() (*AlertSimulatorBundlesRequestProperties, bool) { + return nil, false +} + +// AsAlertSimulatorRequestProperties is the BasicAlertSimulatorRequestProperties implementation for AlertSimulatorRequestProperties. +func (asrp AlertSimulatorRequestProperties) AsAlertSimulatorRequestProperties() (*AlertSimulatorRequestProperties, bool) { + return &asrp, true +} + +// AsBasicAlertSimulatorRequestProperties is the BasicAlertSimulatorRequestProperties implementation for AlertSimulatorRequestProperties. +func (asrp AlertSimulatorRequestProperties) AsBasicAlertSimulatorRequestProperties() (BasicAlertSimulatorRequestProperties, bool) { + return &asrp, true +} + +// UnmarshalJSON is the custom unmarshaler for AlertSimulatorRequestProperties struct. +func (asrp *AlertSimulatorRequestProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if asrp.AdditionalProperties == nil { + asrp.AdditionalProperties = make(map[string]interface{}) + } + asrp.AdditionalProperties[k] = additionalProperties + } + case "kind": + if v != nil { + var kind KindEnum2 + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + asrp.Kind = kind + } + } + } + + return nil +} + +// AlertsSimulateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AlertsSimulateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AlertsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AlertsSimulateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AlertsSimulateFuture.Result. +func (future *AlertsSimulateFuture) result(client AlertsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSimulateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("security.AlertsSimulateFuture") + return + } + ar.Response = future.Response() + return +} + // AlertsSuppressionRule describes the suppression rule type AlertsSuppressionRule struct { autorest.Response `json:"-"` @@ -1998,6 +2280,7 @@ func (acrp AllowedConnectionsResourceProperties) MarshalJSON() ([]byte, error) { // allowed. type BasicAllowlistCustomAlertRule interface { AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) + AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) AsProcessNotAllowed() (*ProcessNotAllowed, bool) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) @@ -2016,7 +2299,7 @@ type AllowlistCustomAlertRule struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -2032,6 +2315,10 @@ func unmarshalBasicAllowlistCustomAlertRule(body []byte) (BasicAllowlistCustomAl var ctina ConnectionToIPNotAllowed err := json.Unmarshal(body, &ctina) return ctina, err + case string(RuleTypeConnectionFromIPNotAllowed): + var cfina ConnectionFromIPNotAllowed + err := json.Unmarshal(body, &cfina) + return cfina, err case string(RuleTypeLocalUserNotAllowed): var luna LocalUserNotAllowed err := json.Unmarshal(body, &luna) @@ -2131,6 +2418,11 @@ func (acar AllowlistCustomAlertRule) AsConnectionToIPNotAllowed() (*ConnectionTo return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. func (acar AllowlistCustomAlertRule) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false @@ -2246,7 +2538,7 @@ type AmqpC2DMessagesNotInAllowedRange struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -2322,6 +2614,11 @@ func (acmniar AmqpC2DMessagesNotInAllowedRange) AsConnectionToIPNotAllowed() (*C return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. func (acmniar AmqpC2DMessagesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false @@ -2437,7 +2734,7 @@ type AmqpC2DRejectedMessagesNotInAllowedRange struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -2513,6 +2810,11 @@ func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsConnectionToIPNotAllo return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false @@ -2628,7 +2930,7 @@ type AmqpD2CMessagesNotInAllowedRange struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -2704,6 +3006,11 @@ func (admniar AmqpD2CMessagesNotInAllowedRange) AsConnectionToIPNotAllowed() (*C return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. func (admniar AmqpD2CMessagesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false @@ -3495,8 +3802,8 @@ type AssessmentMetadataProperties struct { // Description - Human readable description of the assessment Description *string `json:"description,omitempty"` // RemediationDescription - Human readable description of what you should do to mitigate this security issue - RemediationDescription *string `json:"remediationDescription,omitempty"` - Category *[]Category `json:"category,omitempty"` + RemediationDescription *string `json:"remediationDescription,omitempty"` + Categories *[]Categories `json:"categories,omitempty"` // Severity - The severity level of the assessment. Possible values include: 'SeverityLow', 'SeverityMedium', 'SeverityHigh' Severity Severity `json:"severity,omitempty"` // UserImpact - The user impact of the assessment. Possible values include: 'UserImpactLow', 'UserImpactModerate', 'UserImpactHigh' @@ -3523,8 +3830,8 @@ func (amp AssessmentMetadataProperties) MarshalJSON() ([]byte, error) { if amp.RemediationDescription != nil { objectMap["remediationDescription"] = amp.RemediationDescription } - if amp.Category != nil { - objectMap["category"] = amp.Category + if amp.Categories != nil { + objectMap["categories"] = amp.Categories } if amp.Severity != "" { objectMap["severity"] = amp.Severity @@ -4566,7 +4873,7 @@ type AutomationScope struct { // - security alerts and security assessments. To learn more about the supported security events data // models schemas - please visit https://aka.ms/ASCAutomationSchemas. type AutomationSource struct { - // EventSource - A valid event source type. Possible values include: 'Assessments', 'SubAssessments', 'Alerts', 'SecureScores', 'SecureScoreControls' + // EventSource - A valid event source type. Possible values include: 'EventSourceAssessments', 'EventSourceSubAssessments', 'EventSourceAlerts', 'EventSourceSecureScores', 'EventSourceSecureScoresSnapshot', 'EventSourceSecureScoreControls', 'EventSourceSecureScoreControlsSnapshot', 'EventSourceRegulatoryComplianceAssessment', 'EventSourceRegulatoryComplianceAssessmentSnapshot' EventSource EventSource `json:"eventSource,omitempty"` // RuleSets - A set of rules which evaluate upon event interception. A logical disjunction is applied between defined rule sets (logical 'or'). RuleSets *[]AutomationRuleSet `json:"ruleSets,omitempty"` @@ -5268,9 +5575,10 @@ func (csp *CefSolutionProperties) UnmarshalJSON(body []byte) error { return nil } -// CloudError error response structure. +// CloudError common error response for all Azure Resource Manager APIs to return error details for failed +// operations. (This also follows the OData error response format.). type CloudError struct { - // CloudErrorBody - Error data + // CloudErrorBody - The error object. *CloudErrorBody `json:"error,omitempty"` } @@ -5307,12 +5615,18 @@ func (ce *CloudError) UnmarshalJSON(body []byte) error { return nil } -// CloudErrorBody error details. +// CloudErrorBody the error detail. type CloudErrorBody struct { - // Code - READ-ONLY; An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + // Code - READ-ONLY; The error code. Code *string `json:"code,omitempty"` - // Message - READ-ONLY; A message describing the error, intended to be suitable for display in a user interface. + // Message - READ-ONLY; The error message. Message *string `json:"message,omitempty"` + // Target - READ-ONLY; The error target. + Target *string `json:"target,omitempty"` + // Details - READ-ONLY; The error details. + Details *[]CloudErrorBody `json:"details,omitempty"` + // AdditionalInfo - READ-ONLY; The error additional info. + AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` } // MarshalJSON is the custom marshaler for CloudErrorBody. @@ -5885,9 +6199,9 @@ type ConnectedWorkspace struct { ID *string `json:"id,omitempty"` } -// ConnectionToIPNotAllowed outbound connection to an ip that isn't allowed. Allow list consists of ipv4 or -// ipv6 range in CIDR notation. -type ConnectionToIPNotAllowed struct { +// ConnectionFromIPNotAllowed inbound connection from an ip that isn't allowed. Allow list consists of ipv4 +// or ipv6 range in CIDR notation. +type ConnectionFromIPNotAllowed struct { // AllowlistValues - The values to allow. The format of the values depends on the rule type. AllowlistValues *[]string `json:"allowlistValues,omitempty"` // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'ValueTypeIPCidr', 'ValueTypeString' @@ -5898,138 +6212,338 @@ type ConnectionToIPNotAllowed struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } -// MarshalJSON is the custom marshaler for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) MarshalJSON() ([]byte, error) { - ctina.RuleType = RuleTypeConnectionToIPNotAllowed +// MarshalJSON is the custom marshaler for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) MarshalJSON() ([]byte, error) { + cfina.RuleType = RuleTypeConnectionFromIPNotAllowed objectMap := make(map[string]interface{}) - if ctina.AllowlistValues != nil { - objectMap["allowlistValues"] = ctina.AllowlistValues + if cfina.AllowlistValues != nil { + objectMap["allowlistValues"] = cfina.AllowlistValues } - if ctina.IsEnabled != nil { - objectMap["isEnabled"] = ctina.IsEnabled + if cfina.IsEnabled != nil { + objectMap["isEnabled"] = cfina.IsEnabled } - if ctina.RuleType != "" { - objectMap["ruleType"] = ctina.RuleType + if cfina.RuleType != "" { + objectMap["ruleType"] = cfina.RuleType } return json.Marshal(objectMap) } -// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { return nil, false } -// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { return nil, false } -// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { return nil, false } -// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { return nil, false } -// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { return nil, false } -// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { - return &ctina, true +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return &cfina, true } -// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { return nil, false } -// AsListCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { return nil, false } -// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { - return &ctina, true +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return &cfina, true } -// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { - return &ctina, true +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false } -// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { - return nil, false +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return &cfina, true } -// AsProcessNotAllowed is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false } -// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { return nil, false } -// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { return nil, false } -// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { return nil, false } -// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { return nil, false } -// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { return nil, false } -// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { return nil, false } -// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { return nil, false } -// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { return nil, false } -// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { return nil, false } -// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { return nil, false } -// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. -func (ctina ConnectionToIPNotAllowed) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false +} + +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false +} + +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false +} + +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false +} + +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false +} + +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false +} + +// AsCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false +} + +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionFromIPNotAllowed. +func (cfina ConnectionFromIPNotAllowed) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &cfina, true +} + +// ConnectionStrings connection string for ingesting security data and logs +type ConnectionStrings struct { + autorest.Response `json:"-"` + // Value - Connection strings + Value *[]IngestionConnectionString `json:"value,omitempty"` +} + +// ConnectionToIPNotAllowed outbound connection to an ip that isn't allowed. Allow list consists of ipv4 or +// ipv6 range in CIDR notation. +type ConnectionToIPNotAllowed struct { + // AllowlistValues - The values to allow. The format of the values depends on the rule type. + AllowlistValues *[]string `json:"allowlistValues,omitempty"` + // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'ValueTypeIPCidr', 'ValueTypeString' + ValueType ValueType `json:"valueType,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) MarshalJSON() ([]byte, error) { + ctina.RuleType = RuleTypeConnectionToIPNotAllowed + objectMap := make(map[string]interface{}) + if ctina.AllowlistValues != nil { + objectMap["allowlistValues"] = ctina.AllowlistValues + } + if ctina.IsEnabled != nil { + objectMap["isEnabled"] = ctina.IsEnabled + } + if ctina.RuleType != "" { + objectMap["ruleType"] = ctina.RuleType + } + return json.Marshal(objectMap) +} + +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false +} + +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return nil, false +} + +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return &ctina, true +} + +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false +} + +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false +} + +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return &ctina, true +} + +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return &ctina, true +} + +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false +} + +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false +} + +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { return nil, false } @@ -6669,6 +7183,7 @@ type BasicCustomAlertRule interface { AsListCustomAlertRule() (*ListCustomAlertRule, bool) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) + AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) AsProcessNotAllowed() (*ProcessNotAllowed, bool) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) @@ -6698,7 +7213,7 @@ type CustomAlertRule struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -6734,6 +7249,10 @@ func unmarshalBasicCustomAlertRule(body []byte) (BasicCustomAlertRule, error) { var ctina ConnectionToIPNotAllowed err := json.Unmarshal(body, &ctina) return ctina, err + case string(RuleTypeConnectionFromIPNotAllowed): + var cfina ConnectionFromIPNotAllowed + err := json.Unmarshal(body, &cfina) + return cfina, err case string(RuleTypeLocalUserNotAllowed): var luna LocalUserNotAllowed err := json.Unmarshal(body, &luna) @@ -6894,6 +7413,11 @@ func (car CustomAlertRule) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllow return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for CustomAlertRule. func (car CustomAlertRule) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false @@ -7141,7 +7665,7 @@ type DenylistCustomAlertRule struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -7211,6 +7735,11 @@ func (dcar DenylistCustomAlertRule) AsConnectionToIPNotAllowed() (*ConnectionToI return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. func (dcar DenylistCustomAlertRule) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false @@ -7946,7 +8475,7 @@ type DirectMethodInvokesNotInAllowedRange struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -8022,6 +8551,11 @@ func (dminiar DirectMethodInvokesNotInAllowedRange) AsConnectionToIPNotAllowed() return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. func (dminiar DirectMethodInvokesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false @@ -8393,6 +8927,20 @@ type EffectiveNetworkSecurityGroups struct { NetworkSecurityGroups *[]string `json:"networkSecurityGroups,omitempty"` } +// ErrorAdditionalInfo the resource management error additional info. +type ErrorAdditionalInfo struct { + // Type - READ-ONLY; The additional info type. + Type *string `json:"type,omitempty"` + // Info - READ-ONLY; The additional info. + Info interface{} `json:"info,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorAdditionalInfo. +func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ETag entity tag is used for comparing two or more entities from the same requested resource. type ETag struct { // Etag - Entity tag is used for comparing two or more entities from the same requested resource. @@ -8822,7 +9370,7 @@ type FailedLocalLoginsNotInAllowedRange struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -8898,6 +9446,11 @@ func (fllniar FailedLocalLoginsNotInAllowedRange) AsConnectionToIPNotAllowed() ( return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. func (fllniar FailedLocalLoginsNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false @@ -9012,7 +9565,7 @@ type FileUploadsNotInAllowedRange struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -9088,6 +9641,11 @@ func (funiar FileUploadsNotInAllowedRange) AsConnectionToIPNotAllowed() (*Connec return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. func (funiar FileUploadsNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false @@ -9328,7 +9886,7 @@ type HTTPC2DMessagesNotInAllowedRange struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -9404,6 +9962,11 @@ func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsConnectionToIPNotAllowed() (*C return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false @@ -9519,7 +10082,7 @@ type HTTPC2DRejectedMessagesNotInAllowedRange struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -9595,6 +10158,11 @@ func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsConnectionToIPNotAllo return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false @@ -9710,7 +10278,7 @@ type HTTPD2CMessagesNotInAllowedRange struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -9786,6 +10354,11 @@ func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsConnectionToIPNotAllowed() (*C return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false @@ -10219,74 +10792,69 @@ type InformationType struct { Keywords *[]InformationProtectionKeyword `json:"keywords,omitempty"` } -// IotAlert ioT alert -type IotAlert struct { - autorest.Response `json:"-"` - // IotAlertProperties - Alert properties - *IotAlertProperties `json:"properties,omitempty"` +// IngestionConnectionString connection string for ingesting security data and logs +type IngestionConnectionString struct { + // Location - READ-ONLY; The region where ingested logs and data resides + Location *string `json:"location,omitempty"` + // Value - READ-ONLY; Connection string value + Value *string `json:"value,omitempty"` } -// MarshalJSON is the custom marshaler for IotAlert. -func (ia IotAlert) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for IngestionConnectionString. +func (ics IngestionConnectionString) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ia.IotAlertProperties != nil { - objectMap["properties"] = ia.IotAlertProperties - } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for IotAlert struct. -func (ia *IotAlert) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var iotAlertProperties IotAlertProperties - err = json.Unmarshal(*v, &iotAlertProperties) - if err != nil { - return err - } - ia.IotAlertProperties = &iotAlertProperties - } - } - } +// IngestionSetting configures how to correlate scan data and logs with resources associated with the +// subscription. +type IngestionSetting struct { + autorest.Response `json:"-"` + // Properties - Ingestion setting data + Properties interface{} `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} - return nil +// MarshalJSON is the custom marshaler for IngestionSetting. +func (is IngestionSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if is.Properties != nil { + objectMap["properties"] = is.Properties + } + return json.Marshal(objectMap) } -// IotAlertList list of IoT alerts -type IotAlertList struct { +// IngestionSettingList list of ingestion settings +type IngestionSettingList struct { autorest.Response `json:"-"` - // Value - READ-ONLY; List data - Value *[]IotAlert `json:"value,omitempty"` - // NextLink - READ-ONLY; When available, follow the URI to get the next page of data + // Value - READ-ONLY; List of ingestion settings + Value *[]IngestionSetting `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. NextLink *string `json:"nextLink,omitempty"` - // TotalCount - READ-ONLY; Total count of alerts that conforms with the given filter options (not affected by page size) - TotalCount *int32 `json:"totalCount,omitempty"` } -// MarshalJSON is the custom marshaler for IotAlertList. -func (ial IotAlertList) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for IngestionSettingList. +func (isl IngestionSettingList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) return json.Marshal(objectMap) } -// IotAlertListIterator provides access to a complete listing of IotAlert values. -type IotAlertListIterator struct { +// IngestionSettingListIterator provides access to a complete listing of IngestionSetting values. +type IngestionSettingListIterator struct { i int - page IotAlertListPage + page IngestionSettingListPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *IotAlertListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *IngestionSettingListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/IngestionSettingListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -10311,51 +10879,152 @@ func (iter *IotAlertListIterator) NextWithContext(ctx context.Context) (err erro // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *IotAlertListIterator) Next() error { +func (iter *IngestionSettingListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter IotAlertListIterator) NotDone() bool { +func (iter IngestionSettingListIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter IotAlertListIterator) Response() IotAlertList { +func (iter IngestionSettingListIterator) Response() IngestionSettingList { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter IotAlertListIterator) Value() IotAlert { +func (iter IngestionSettingListIterator) Value() IngestionSetting { if !iter.page.NotDone() { - return IotAlert{} + return IngestionSetting{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the IotAlertListIterator type. -func NewIotAlertListIterator(page IotAlertListPage) IotAlertListIterator { - return IotAlertListIterator{page: page} +// Creates a new instance of the IngestionSettingListIterator type. +func NewIngestionSettingListIterator(page IngestionSettingListPage) IngestionSettingListIterator { + return IngestionSettingListIterator{page: page} } -// IotAlertListModel list of IoT alerts -type IotAlertListModel struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; List data - Value *[]IotAlertModel `json:"value,omitempty"` - // NextLink - READ-ONLY; When available, follow the URI to get the next page of data - NextLink *string `json:"nextLink,omitempty"` +// IsEmpty returns true if the ListResult contains no values. +func (isl IngestionSettingList) IsEmpty() bool { + return isl.Value == nil || len(*isl.Value) == 0 } -// MarshalJSON is the custom marshaler for IotAlertListModel. -func (ialm IotAlertListModel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) +// hasNextLink returns true if the NextLink is not empty. +func (isl IngestionSettingList) hasNextLink() bool { + return isl.NextLink != nil && len(*isl.NextLink) != 0 } -// IotAlertListModelIterator provides access to a complete listing of IotAlertModel values. -type IotAlertListModelIterator struct { +// ingestionSettingListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (isl IngestionSettingList) ingestionSettingListPreparer(ctx context.Context) (*http.Request, error) { + if !isl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(isl.NextLink))) +} + +// IngestionSettingListPage contains a page of IngestionSetting values. +type IngestionSettingListPage struct { + fn func(context.Context, IngestionSettingList) (IngestionSettingList, error) + isl IngestionSettingList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *IngestionSettingListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IngestionSettingListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.isl) + if err != nil { + return err + } + page.isl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *IngestionSettingListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IngestionSettingListPage) NotDone() bool { + return !page.isl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IngestionSettingListPage) Response() IngestionSettingList { + return page.isl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IngestionSettingListPage) Values() []IngestionSetting { + if page.isl.IsEmpty() { + return nil + } + return *page.isl.Value +} + +// Creates a new instance of the IngestionSettingListPage type. +func NewIngestionSettingListPage(cur IngestionSettingList, getNextPage func(context.Context, IngestionSettingList) (IngestionSettingList, error)) IngestionSettingListPage { + return IngestionSettingListPage{ + fn: getNextPage, + isl: cur, + } +} + +// IngestionSettingToken configures how to correlate scan data and logs with resources associated with the +// subscription. +type IngestionSettingToken struct { + autorest.Response `json:"-"` + // Token - READ-ONLY; The token is used for correlating security data and logs with the resources in the subscription. + Token *string `json:"token,omitempty"` +} + +// MarshalJSON is the custom marshaler for IngestionSettingToken. +func (ist IngestionSettingToken) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// IotAlertListModel list of IoT alerts +type IotAlertListModel struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List data + Value *[]IotAlertModel `json:"value,omitempty"` + // NextLink - READ-ONLY; When available, follow the URI to get the next page of data + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for IotAlertListModel. +func (ialm IotAlertListModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// IotAlertListModelIterator provides access to a complete listing of IotAlertModel values. +type IotAlertListModelIterator struct { i int page IotAlertListModelPage } @@ -10504,98 +11173,17 @@ func NewIotAlertListModelPage(cur IotAlertListModel, getNextPage func(context.Co } } -// IsEmpty returns true if the ListResult contains no values. -func (ial IotAlertList) IsEmpty() bool { - return ial.Value == nil || len(*ial.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ial IotAlertList) hasNextLink() bool { - return ial.NextLink != nil && len(*ial.NextLink) != 0 -} - -// iotAlertListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ial IotAlertList) iotAlertListPreparer(ctx context.Context) (*http.Request, error) { - if !ial.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ial.NextLink))) -} - -// IotAlertListPage contains a page of IotAlert values. -type IotAlertListPage struct { - fn func(context.Context, IotAlertList) (IotAlertList, error) - ial IotAlertList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *IotAlertListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ial) - if err != nil { - return err - } - page.ial = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *IotAlertListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page IotAlertListPage) NotDone() bool { - return !page.ial.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page IotAlertListPage) Response() IotAlertList { - return page.ial -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page IotAlertListPage) Values() []IotAlert { - if page.ial.IsEmpty() { - return nil - } - return *page.ial.Value -} - -// Creates a new instance of the IotAlertListPage type. -func NewIotAlertListPage(cur IotAlertList, getNextPage func(context.Context, IotAlertList) (IotAlertList, error)) IotAlertListPage { - return IotAlertListPage{ - fn: getNextPage, - ial: cur, - } -} - // IotAlertModel ioT alert type IotAlertModel struct { autorest.Response `json:"-"` // IotAlertPropertiesModel - Alert properties *IotAlertPropertiesModel `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for IotAlertModel. @@ -10625,42 +11213,39 @@ func (iam *IotAlertModel) UnmarshalJSON(body []byte) error { } iam.IotAlertPropertiesModel = &iotAlertPropertiesModel } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + iam.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + iam.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + iam.Type = &typeVar + } } } return nil } -// IotAlertProperties ioT alert properties -type IotAlertProperties struct { - // SystemAlertID - READ-ONLY; Holds the product canonical identifier of the alert within the scope of a product - SystemAlertID *string `json:"systemAlertId,omitempty"` - // CompromisedEntity - READ-ONLY; Display name of the main entity being reported on - CompromisedEntity *string `json:"compromisedEntity,omitempty"` - // AlertType - READ-ONLY; The type name of the alert - AlertType *string `json:"alertType,omitempty"` - // StartTimeUtc - READ-ONLY; The impact start time of the alert (the time of the first event or activity included in the alert) - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - // EndTimeUtc - READ-ONLY; The impact end time of the alert (the time of the last event or activity included in the alert) - EndTimeUtc *string `json:"endTimeUtc,omitempty"` - // Entities - A list of entities related to the alert - Entities *[]interface{} `json:"entities,omitempty"` - // ExtendedProperties - A bag of fields which extends the alert information - ExtendedProperties interface{} `json:"extendedProperties,omitempty"` -} - -// MarshalJSON is the custom marshaler for IotAlertProperties. -func (iap IotAlertProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if iap.Entities != nil { - objectMap["entities"] = iap.Entities - } - if iap.ExtendedProperties != nil { - objectMap["extendedProperties"] = iap.ExtendedProperties - } - return json.Marshal(objectMap) -} - // IotAlertPropertiesModel ioT alert properties type IotAlertPropertiesModel struct { // SystemAlertID - READ-ONLY; Holds the product canonical identifier of the alert within the scope of a product @@ -10891,159 +11476,8 @@ type IotDefenderSettingsProperties struct { DeviceQuota *int32 `json:"deviceQuota,omitempty"` // SentinelWorkspaceResourceIds - Sentinel Workspace Resource Ids SentinelWorkspaceResourceIds *[]string `json:"sentinelWorkspaceResourceIds,omitempty"` -} - -// IotRecommendation ioT recommendation -type IotRecommendation struct { - autorest.Response `json:"-"` - // IotRecommendationProperties - Recommendation properties - *IotRecommendationProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for IotRecommendation. -func (ir IotRecommendation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ir.IotRecommendationProperties != nil { - objectMap["properties"] = ir.IotRecommendationProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for IotRecommendation struct. -func (ir *IotRecommendation) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var iotRecommendationProperties IotRecommendationProperties - err = json.Unmarshal(*v, &iotRecommendationProperties) - if err != nil { - return err - } - ir.IotRecommendationProperties = &iotRecommendationProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ir.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ir.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ir.Type = &typeVar - } - } - } - - return nil -} - -// IotRecommendationList list of IoT recommendations -type IotRecommendationList struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; List data - Value *[]IotRecommendation `json:"value,omitempty"` - // NextLink - READ-ONLY; When available, follow the URI to get the next page of data - NextLink *string `json:"nextLink,omitempty"` - // TotalCount - READ-ONLY; Total count of recommendations that conforms with the given filter options (not affected by page size) - TotalCount *int32 `json:"totalCount,omitempty"` -} - -// MarshalJSON is the custom marshaler for IotRecommendationList. -func (irl IotRecommendationList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// IotRecommendationListIterator provides access to a complete listing of IotRecommendation values. -type IotRecommendationListIterator struct { - i int - page IotRecommendationListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *IotRecommendationListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *IotRecommendationListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter IotRecommendationListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter IotRecommendationListIterator) Response() IotRecommendationList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter IotRecommendationListIterator) Value() IotRecommendation { - if !iter.page.NotDone() { - return IotRecommendation{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the IotRecommendationListIterator type. -func NewIotRecommendationListIterator(page IotRecommendationListPage) IotRecommendationListIterator { - return IotRecommendationListIterator{page: page} + // OnboardingKind - The kind of onboarding for the subscription. Possible values include: 'Default', 'MigratedToAzure' + OnboardingKind OnboardingKind `json:"onboardingKind,omitempty"` } // IotRecommendationListModel list of IoT recommendations @@ -11212,93 +11646,6 @@ func NewIotRecommendationListModelPage(cur IotRecommendationListModel, getNextPa } } -// IsEmpty returns true if the ListResult contains no values. -func (irl IotRecommendationList) IsEmpty() bool { - return irl.Value == nil || len(*irl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (irl IotRecommendationList) hasNextLink() bool { - return irl.NextLink != nil && len(*irl.NextLink) != 0 -} - -// iotRecommendationListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (irl IotRecommendationList) iotRecommendationListPreparer(ctx context.Context) (*http.Request, error) { - if !irl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(irl.NextLink))) -} - -// IotRecommendationListPage contains a page of IotRecommendation values. -type IotRecommendationListPage struct { - fn func(context.Context, IotRecommendationList) (IotRecommendationList, error) - irl IotRecommendationList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *IotRecommendationListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.irl) - if err != nil { - return err - } - page.irl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *IotRecommendationListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page IotRecommendationListPage) NotDone() bool { - return !page.irl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page IotRecommendationListPage) Response() IotRecommendationList { - return page.irl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page IotRecommendationListPage) Values() []IotRecommendation { - if page.irl.IsEmpty() { - return nil - } - return *page.irl.Value -} - -// Creates a new instance of the IotRecommendationListPage type. -func NewIotRecommendationListPage(cur IotRecommendationList, getNextPage func(context.Context, IotRecommendationList) (IotRecommendationList, error)) IotRecommendationListPage { - return IotRecommendationListPage{ - fn: getNextPage, - irl: cur, - } -} - // IotRecommendationModel ioT recommendation type IotRecommendationModel struct { autorest.Response `json:"-"` @@ -11372,27 +11719,6 @@ func (irm *IotRecommendationModel) UnmarshalJSON(body []byte) error { return nil } -// IotRecommendationProperties ioT recommendation properties -type IotRecommendationProperties struct { - // DeviceID - READ-ONLY; Identifier of the device being reported on - DeviceID *string `json:"deviceId,omitempty"` - // RecommendationType - READ-ONLY; The type name of the recommendation - RecommendationType *string `json:"recommendationType,omitempty"` - // DiscoveredTimeUtc - READ-ONLY; The discovery time of the recommendation - DiscoveredTimeUtc *string `json:"discoveredTimeUtc,omitempty"` - // RecommendationAdditionalData - A bag of fields which extends the recommendation information - RecommendationAdditionalData interface{} `json:"recommendationAdditionalData,omitempty"` -} - -// MarshalJSON is the custom marshaler for IotRecommendationProperties. -func (irp IotRecommendationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if irp.RecommendationAdditionalData != nil { - objectMap["recommendationAdditionalData"] = irp.RecommendationAdditionalData - } - return json.Marshal(objectMap) -} - // IotRecommendationPropertiesModel ioT recommendation properties type IotRecommendationPropertiesModel struct { // DeviceID - READ-ONLY; Identifier of the device being reported on @@ -11795,7 +12121,7 @@ type IoTSecurityAggregatedAlertProperties struct { // Description - READ-ONLY; Description of the suspected vulnerability and meaning. Description *string `json:"description,omitempty"` // Count - READ-ONLY; Number of alerts occurrences within the aggregated time window. - Count *int32 `json:"count,omitempty"` + Count *int64 `json:"count,omitempty"` // EffectedResourceType - READ-ONLY; Azure resource ID of the resource that received the alerts. EffectedResourceType *string `json:"effectedResourceType,omitempty"` // SystemSource - READ-ONLY; The type of the alerted resource (Azure, Non-Azure). @@ -11819,7 +12145,7 @@ type IoTSecurityAggregatedAlertPropertiesTopDevicesListItem struct { // DeviceID - READ-ONLY; Name of the device. DeviceID *string `json:"deviceId,omitempty"` // AlertsCount - READ-ONLY; Number of alerts raised for this device. - AlertsCount *int32 `json:"alertsCount,omitempty"` + AlertsCount *int64 `json:"alertsCount,omitempty"` // LastOccurrence - READ-ONLY; Most recent time this alert was raised for this device, on this day. LastOccurrence *string `json:"lastOccurrence,omitempty"` } @@ -12105,9 +12431,9 @@ type IoTSecurityAggregatedRecommendationProperties struct { // ReportedSeverity - READ-ONLY; Assessed recommendation severity. Possible values include: 'ReportedSeverityInformational', 'ReportedSeverityLow', 'ReportedSeverityMedium', 'ReportedSeverityHigh' ReportedSeverity ReportedSeverity `json:"reportedSeverity,omitempty"` // HealthyDevices - READ-ONLY; Number of healthy devices within the IoT Security solution. - HealthyDevices *int32 `json:"healthyDevices,omitempty"` + HealthyDevices *int64 `json:"healthyDevices,omitempty"` // UnhealthyDeviceCount - READ-ONLY; Number of unhealthy devices within the IoT Security solution. - UnhealthyDeviceCount *int32 `json:"unhealthyDeviceCount,omitempty"` + UnhealthyDeviceCount *int64 `json:"unhealthyDeviceCount,omitempty"` // LogAnalyticsQuery - READ-ONLY; Log analytics query for getting the list of affected devices/alerts. LogAnalyticsQuery *string `json:"logAnalyticsQuery,omitempty"` } @@ -12127,7 +12453,7 @@ type IoTSecurityAlertedDevice struct { // DeviceID - READ-ONLY; Device identifier. DeviceID *string `json:"deviceId,omitempty"` // AlertsCount - READ-ONLY; Number of alerts raised for this device. - AlertsCount *int32 `json:"alertsCount,omitempty"` + AlertsCount *int64 `json:"alertsCount,omitempty"` } // MarshalJSON is the custom marshaler for IoTSecurityAlertedDevice. @@ -12144,7 +12470,7 @@ type IoTSecurityDeviceAlert struct { // ReportedSeverity - READ-ONLY; Assessed Alert severity. Possible values include: 'ReportedSeverityInformational', 'ReportedSeverityLow', 'ReportedSeverityMedium', 'ReportedSeverityHigh' ReportedSeverity ReportedSeverity `json:"reportedSeverity,omitempty"` // AlertsCount - READ-ONLY; Number of alerts raised for this alert type. - AlertsCount *int32 `json:"alertsCount,omitempty"` + AlertsCount *int64 `json:"alertsCount,omitempty"` } // MarshalJSON is the custom marshaler for IoTSecurityDeviceAlert. @@ -12161,7 +12487,7 @@ type IoTSecurityDeviceRecommendation struct { // ReportedSeverity - READ-ONLY; Assessed recommendation severity. Possible values include: 'ReportedSeverityInformational', 'ReportedSeverityLow', 'ReportedSeverityMedium', 'ReportedSeverityHigh' ReportedSeverity ReportedSeverity `json:"reportedSeverity,omitempty"` // DevicesCount - READ-ONLY; Number of devices with this recommendation. - DevicesCount *int32 `json:"devicesCount,omitempty"` + DevicesCount *int64 `json:"devicesCount,omitempty"` } // MarshalJSON is the custom marshaler for IoTSecurityDeviceRecommendation. @@ -12266,7 +12592,7 @@ type IoTSecuritySolutionAnalyticsModelProperties struct { // Metrics - READ-ONLY; Security analytics of your IoT Security solution. Metrics *IoTSeverityMetrics `json:"metrics,omitempty"` // UnhealthyDeviceCount - READ-ONLY; Number of unhealthy devices within your IoT Security solution. - UnhealthyDeviceCount *int32 `json:"unhealthyDeviceCount,omitempty"` + UnhealthyDeviceCount *int64 `json:"unhealthyDeviceCount,omitempty"` // DevicesMetrics - READ-ONLY; List of device metrics by the aggregation date. DevicesMetrics *[]IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem `json:"devicesMetrics,omitempty"` // TopAlertedDevices - List of the 3 devices with the most alerts. @@ -12315,6 +12641,8 @@ type IoTSecuritySolutionModel struct { Location *string `json:"location,omitempty"` // IoTSecuritySolutionProperties - Security Solution data *IoTSecuritySolutionProperties `json:"properties,omitempty"` + // SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for IoTSecuritySolutionModel. @@ -12395,6 +12723,15 @@ func (itssm *IoTSecuritySolutionModel) UnmarshalJSON(body []byte) error { } itssm.IoTSecuritySolutionProperties = &ioTSecuritySolutionProperties } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + itssm.SystemData = &systemData + } } } @@ -12421,6 +12758,8 @@ type IoTSecuritySolutionProperties struct { RecommendationsConfiguration *[]RecommendationConfigurationProperties `json:"recommendationsConfiguration,omitempty"` // UnmaskedIPLoggingStatus - Unmasked IP address logging status. Possible values include: 'UnmaskedIPLoggingStatusDisabled', 'UnmaskedIPLoggingStatusEnabled' UnmaskedIPLoggingStatus UnmaskedIPLoggingStatus `json:"unmaskedIpLoggingStatus,omitempty"` + // AdditionalWorkspaces - List of additional workspaces + AdditionalWorkspaces *[]AdditionalWorkspacesProperties `json:"additionalWorkspaces,omitempty"` } // MarshalJSON is the custom marshaler for IoTSecuritySolutionProperties. @@ -12453,6 +12792,9 @@ func (itssp IoTSecuritySolutionProperties) MarshalJSON() ([]byte, error) { if itssp.UnmaskedIPLoggingStatus != "" { objectMap["unmaskedIpLoggingStatus"] = itssp.UnmaskedIPLoggingStatus } + if itssp.AdditionalWorkspaces != nil { + objectMap["additionalWorkspaces"] = itssp.AdditionalWorkspaces + } return json.Marshal(objectMap) } @@ -12647,6 +12989,8 @@ type IotSensorProperties struct { TiVersion *string `json:"tiVersion,omitempty"` // Zone - Zone of the IoT sensor Zone *string `json:"zone,omitempty"` + // SensorType - Type of sensor. Possible values include: 'SensorTypeOt', 'SensorTypeEnterprise' + SensorType SensorType `json:"sensorType,omitempty"` } // MarshalJSON is the custom marshaler for IotSensorProperties. @@ -12658,6 +13002,9 @@ func (isp IotSensorProperties) MarshalJSON() ([]byte, error) { if isp.Zone != nil { objectMap["zone"] = isp.Zone } + if isp.SensorType != "" { + objectMap["sensorType"] = isp.SensorType + } return json.Marshal(objectMap) } @@ -12750,11 +13097,11 @@ func (ism *IotSensorsModel) UnmarshalJSON(body []byte) error { // IoTSeverityMetrics ioT Security solution analytics severity metrics. type IoTSeverityMetrics struct { // High - Count of high severity alerts/recommendations. - High *int32 `json:"high,omitempty"` + High *int64 `json:"high,omitempty"` // Medium - Count of medium severity alerts/recommendations. - Medium *int32 `json:"medium,omitempty"` + Medium *int64 `json:"medium,omitempty"` // Low - Count of low severity alerts/recommendations. - Low *int32 `json:"low,omitempty"` + Low *int64 `json:"low,omitempty"` } // IotSiteProperties ioT site properties @@ -13266,6 +13613,7 @@ type BasicListCustomAlertRule interface { AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) + AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) AsProcessNotAllowed() (*ProcessNotAllowed, bool) AsListCustomAlertRule() (*ListCustomAlertRule, bool) @@ -13281,7 +13629,7 @@ type ListCustomAlertRule struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -13305,6 +13653,10 @@ func unmarshalBasicListCustomAlertRule(body []byte) (BasicListCustomAlertRule, e var ctina ConnectionToIPNotAllowed err := json.Unmarshal(body, &ctina) return ctina, err + case string(RuleTypeConnectionFromIPNotAllowed): + var cfina ConnectionFromIPNotAllowed + err := json.Unmarshal(body, &cfina) + return cfina, err case string(RuleTypeLocalUserNotAllowed): var luna LocalUserNotAllowed err := json.Unmarshal(body, &luna) @@ -13401,6 +13753,11 @@ func (lcar ListCustomAlertRule) AsConnectionToIPNotAllowed() (*ConnectionToIPNot return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for ListCustomAlertRule. func (lcar ListCustomAlertRule) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false @@ -13514,7 +13871,7 @@ type LocalUserNotAllowed struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -13584,6 +13941,11 @@ func (luna LocalUserNotAllowed) AsConnectionToIPNotAllowed() (*ConnectionToIPNot return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for LocalUserNotAllowed. func (luna LocalUserNotAllowed) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return &luna, true @@ -13773,7 +14135,7 @@ type MqttC2DMessagesNotInAllowedRange struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -13849,6 +14211,11 @@ func (mcmniar MqttC2DMessagesNotInAllowedRange) AsConnectionToIPNotAllowed() (*C return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. func (mcmniar MqttC2DMessagesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false @@ -13964,7 +14331,7 @@ type MqttC2DRejectedMessagesNotInAllowedRange struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -14040,6 +14407,11 @@ func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsConnectionToIPNotAllo return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false @@ -14155,7 +14527,7 @@ type MqttD2CMessagesNotInAllowedRange struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -14231,6 +14603,11 @@ func (mdmniar MqttD2CMessagesNotInAllowedRange) AsConnectionToIPNotAllowed() (*C return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. func (mdmniar MqttD2CMessagesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false @@ -15047,7 +15424,7 @@ type ProcessNotAllowed struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -15117,6 +15494,11 @@ func (pna ProcessNotAllowed) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAll return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for ProcessNotAllowed. func (pna ProcessNotAllowed) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false @@ -15292,7 +15674,7 @@ type QueuePurgesNotInAllowedRange struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -15368,6 +15750,11 @@ func (qpniar QueuePurgesNotInAllowedRange) AsConnectionToIPNotAllowed() (*Connec return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. func (qpniar QueuePurgesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false @@ -17786,6 +18173,43 @@ func (sva *ServerVulnerabilityAssessment) UnmarshalJSON(body []byte) error { return nil } +// ServerVulnerabilityAssessmentDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ServerVulnerabilityAssessmentDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServerVulnerabilityAssessmentClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServerVulnerabilityAssessmentDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ServerVulnerabilityAssessmentDeleteFuture.Result. +func (future *ServerVulnerabilityAssessmentDeleteFuture) result(client ServerVulnerabilityAssessmentClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ServerVulnerabilityAssessmentDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("security.ServerVulnerabilityAssessmentDeleteFuture") + return + } + ar.Response = future.Response() + return +} + // ServerVulnerabilityAssessmentProperties describes ServerVulnerabilityAssessment properties. type ServerVulnerabilityAssessmentProperties struct { // ProvisioningState - READ-ONLY; The provisioningState of the vulnerability assessment capability on the VM. Possible values include: 'ProvisioningState1Succeeded', 'ProvisioningState1Failed', 'ProvisioningState1Canceled', 'ProvisioningState1Provisioning', 'ProvisioningState1Deprovisioning' @@ -18177,6 +18601,268 @@ func (s Site) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// Software represents a software data +type Software struct { + autorest.Response `json:"-"` + // SoftwareProperties - Properties of the Software Inventory resource + *SoftwareProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Software. +func (s Software) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.SoftwareProperties != nil { + objectMap["properties"] = s.SoftwareProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Software struct. +func (s *Software) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var softwareProperties SoftwareProperties + err = json.Unmarshal(*v, &softwareProperties) + if err != nil { + return err + } + s.SoftwareProperties = &softwareProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + } + } + + return nil +} + +// SoftwareProperties software Inventory resource properties +type SoftwareProperties struct { + // DeviceID - Unique identifier for the virtual machine in the service. + DeviceID *string `json:"deviceId,omitempty"` + // OsPlatform - Platform of the operating system running on the device. + OsPlatform *string `json:"osPlatform,omitempty"` + // Vendor - Name of the software vendor. + Vendor *string `json:"vendor,omitempty"` + // SoftwareName - Name of the software product. + SoftwareName *string `json:"softwareName,omitempty"` + // Version - Version number of the software product. + Version *string `json:"version,omitempty"` + // EndOfSupportStatus - End of support status. Possible values include: 'None', 'NoLongerSupported', 'VersionNoLongerSupported', 'UpcomingNoLongerSupported', 'UpcomingVersionNoLongerSupported' + EndOfSupportStatus EndOfSupportStatus `json:"endOfSupportStatus,omitempty"` + // EndOfSupportDate - The end of support date in case the product is upcoming end of support. + EndOfSupportDate *string `json:"endOfSupportDate,omitempty"` + // NumberOfKnownVulnerabilities - Number of weaknesses. + NumberOfKnownVulnerabilities *int32 `json:"numberOfKnownVulnerabilities,omitempty"` + // FirstSeenAt - First time that the software was seen in the device. + FirstSeenAt *string `json:"firstSeenAt,omitempty"` +} + +// SoftwaresList represents the software inventory of the virtual machine. +type SoftwaresList struct { + autorest.Response `json:"-"` + Value *[]Software `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for SoftwaresList. +func (sl SoftwaresList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sl.Value != nil { + objectMap["value"] = sl.Value + } + return json.Marshal(objectMap) +} + +// SoftwaresListIterator provides access to a complete listing of Software values. +type SoftwaresListIterator struct { + i int + page SoftwaresListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SoftwaresListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SoftwaresListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SoftwaresListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SoftwaresListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SoftwaresListIterator) Response() SoftwaresList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SoftwaresListIterator) Value() Software { + if !iter.page.NotDone() { + return Software{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SoftwaresListIterator type. +func NewSoftwaresListIterator(page SoftwaresListPage) SoftwaresListIterator { + return SoftwaresListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sl SoftwaresList) IsEmpty() bool { + return sl.Value == nil || len(*sl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (sl SoftwaresList) hasNextLink() bool { + return sl.NextLink != nil && len(*sl.NextLink) != 0 +} + +// softwaresListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sl SoftwaresList) softwaresListPreparer(ctx context.Context) (*http.Request, error) { + if !sl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sl.NextLink))) +} + +// SoftwaresListPage contains a page of Software values. +type SoftwaresListPage struct { + fn func(context.Context, SoftwaresList) (SoftwaresList, error) + sl SoftwaresList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SoftwaresListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SoftwaresListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.sl) + if err != nil { + return err + } + page.sl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SoftwaresListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SoftwaresListPage) NotDone() bool { + return !page.sl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SoftwaresListPage) Response() SoftwaresList { + return page.sl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SoftwaresListPage) Values() []Software { + if page.sl.IsEmpty() { + return nil + } + return *page.sl.Value +} + +// Creates a new instance of the SoftwaresListPage type. +func NewSoftwaresListPage(cur SoftwaresList, getNextPage func(context.Context, SoftwaresList) (SoftwaresList, error)) SoftwaresListPage { + return SoftwaresListPage{ + fn: getNextPage, + sl: cur, + } +} + // Solution ... type Solution struct { autorest.Response `json:"-"` @@ -18986,6 +19672,22 @@ type SuppressionAlertsScope struct { AllOf *[]ScopeElement `json:"allOf,omitempty"` } +// SystemData metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // CreatedBy - The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + // CreatedByType - The type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + CreatedByType CreatedByType `json:"createdByType,omitempty"` + // CreatedAt - The timestamp of resource creation (UTC). + CreatedAt *date.Time `json:"createdAt,omitempty"` + // LastModifiedBy - The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` + // LastModifiedAt - The timestamp of resource last modification (UTC) + LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` +} + // Tags a list of key value pairs that describe the resource. type Tags struct { // Tags - A list of key value pairs that describe the resource. @@ -19366,7 +20068,7 @@ type ThresholdCustomAlertRule struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -19540,6 +20242,11 @@ func (tcar ThresholdCustomAlertRule) AsConnectionToIPNotAllowed() (*ConnectionTo return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. func (tcar ThresholdCustomAlertRule) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false @@ -19677,7 +20384,7 @@ type TimeWindowCustomAlertRule struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -19850,6 +20557,11 @@ func (twcar TimeWindowCustomAlertRule) AsConnectionToIPNotAllowed() (*Connection return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. func (twcar TimeWindowCustomAlertRule) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false @@ -20310,7 +21022,7 @@ type TwinUpdatesNotInAllowedRange struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -20386,6 +21098,11 @@ func (tuniar TwinUpdatesNotInAllowedRange) AsConnectionToIPNotAllowed() (*Connec return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. func (tuniar TwinUpdatesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false @@ -20500,7 +21217,7 @@ type UnauthorizedOperationsNotInAllowedRange struct { Description *string `json:"description,omitempty"` // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeConnectionFromIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } @@ -20576,6 +21293,11 @@ func (uoniar UnauthorizedOperationsNotInAllowedRange) AsConnectionToIPNotAllowed return nil, false } +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false +} + // AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. func (uoniar UnauthorizedOperationsNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/servervulnerabilityassessment.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/servervulnerabilityassessment.go index abcfc8710527..38b230997c03 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/servervulnerabilityassessment.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/servervulnerabilityassessment.go @@ -132,13 +132,13 @@ func (client ServerVulnerabilityAssessmentClient) CreateOrUpdateResponder(resp * // resourceNamespace - the Namespace of the resource. // resourceType - the type of the resource. // resourceName - name of the resource. -func (client ServerVulnerabilityAssessmentClient) Delete(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (result autorest.Response, err error) { +func (client ServerVulnerabilityAssessmentClient) Delete(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (result ServerVulnerabilityAssessmentDeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ServerVulnerabilityAssessmentClient.Delete") defer func() { sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -159,16 +159,9 @@ func (client ServerVulnerabilityAssessmentClient) Delete(ctx context.Context, re return } - resp, err := client.DeleteSender(req) + result, err = client.DeleteSender(req) if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "security.ServerVulnerabilityAssessmentClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.ServerVulnerabilityAssessmentClient", "Delete", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.ServerVulnerabilityAssessmentClient", "Delete", nil, "Failure sending request") return } @@ -201,8 +194,17 @@ func (client ServerVulnerabilityAssessmentClient) DeletePreparer(ctx context.Con // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client ServerVulnerabilityAssessmentClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client ServerVulnerabilityAssessmentClient) DeleteSender(req *http.Request) (future ServerVulnerabilityAssessmentDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return } // DeleteResponder handles the response to the Delete request. The method always @@ -210,7 +212,7 @@ func (client ServerVulnerabilityAssessmentClient) DeleteSender(req *http.Request func (client ServerVulnerabilityAssessmentClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/softwareinventories.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/softwareinventories.go new file mode 100644 index 000000000000..d7e3b70fd39a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/softwareinventories.go @@ -0,0 +1,378 @@ +package security + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SoftwareInventoriesClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type SoftwareInventoriesClient struct { + BaseClient +} + +// NewSoftwareInventoriesClient creates an instance of the SoftwareInventoriesClient client. +func NewSoftwareInventoriesClient(subscriptionID string, ascLocation string) SoftwareInventoriesClient { + return NewSoftwareInventoriesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewSoftwareInventoriesClientWithBaseURI creates an instance of the SoftwareInventoriesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewSoftwareInventoriesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SoftwareInventoriesClient { + return SoftwareInventoriesClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Get gets a single software data of the virtual machine. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// resourceNamespace - the namespace of the resource. +// resourceType - the type of the resource. +// resourceName - name of the resource. +// softwareName - name of the installed software. +func (client SoftwareInventoriesClient) Get(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, softwareName string) (result Software, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SoftwareInventoriesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.SoftwareInventoriesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SoftwareInventoriesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SoftwareInventoriesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SoftwareInventoriesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SoftwareInventoriesClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, softwareName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "resourceNamespace": autorest.Encode("path", resourceNamespace), + "resourceType": autorest.Encode("path", resourceType), + "softwareName": autorest.Encode("path", softwareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-05-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareInventoriesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SoftwareInventoriesClient) GetResponder(resp *http.Response) (result Software, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByExtendedResource gets the software inventory of the virtual machine. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// resourceNamespace - the namespace of the resource. +// resourceType - the type of the resource. +// resourceName - name of the resource. +func (client SoftwareInventoriesClient) ListByExtendedResource(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (result SoftwaresListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SoftwareInventoriesClient.ListByExtendedResource") + defer func() { + sc := -1 + if result.sl.Response.Response != nil { + sc = result.sl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.SoftwareInventoriesClient", "ListByExtendedResource", err.Error()) + } + + result.fn = client.listByExtendedResourceNextResults + req, err := client.ListByExtendedResourcePreparer(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SoftwareInventoriesClient", "ListByExtendedResource", nil, "Failure preparing request") + return + } + + resp, err := client.ListByExtendedResourceSender(req) + if err != nil { + result.sl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SoftwareInventoriesClient", "ListByExtendedResource", resp, "Failure sending request") + return + } + + result.sl, err = client.ListByExtendedResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SoftwareInventoriesClient", "ListByExtendedResource", resp, "Failure responding to request") + return + } + if result.sl.hasNextLink() && result.sl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByExtendedResourcePreparer prepares the ListByExtendedResource request. +func (client SoftwareInventoriesClient) ListByExtendedResourcePreparer(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "resourceNamespace": autorest.Encode("path", resourceNamespace), + "resourceType": autorest.Encode("path", resourceType), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-05-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByExtendedResourceSender sends the ListByExtendedResource request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareInventoriesClient) ListByExtendedResourceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByExtendedResourceResponder handles the response to the ListByExtendedResource request. The method always +// closes the http.Response Body. +func (client SoftwareInventoriesClient) ListByExtendedResourceResponder(resp *http.Response) (result SoftwaresList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByExtendedResourceNextResults retrieves the next set of results, if any. +func (client SoftwareInventoriesClient) listByExtendedResourceNextResults(ctx context.Context, lastResults SoftwaresList) (result SoftwaresList, err error) { + req, err := lastResults.softwaresListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.SoftwareInventoriesClient", "listByExtendedResourceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByExtendedResourceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.SoftwareInventoriesClient", "listByExtendedResourceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByExtendedResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SoftwareInventoriesClient", "listByExtendedResourceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByExtendedResourceComplete enumerates all values, automatically crossing page boundaries as required. +func (client SoftwareInventoriesClient) ListByExtendedResourceComplete(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (result SoftwaresListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SoftwareInventoriesClient.ListByExtendedResource") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByExtendedResource(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName) + return +} + +// ListBySubscription gets the software inventory of all virtual machines in the subscriptions. +func (client SoftwareInventoriesClient) ListBySubscription(ctx context.Context) (result SoftwaresListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SoftwareInventoriesClient.ListBySubscription") + defer func() { + sc := -1 + if result.sl.Response.Response != nil { + sc = result.sl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.SoftwareInventoriesClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SoftwareInventoriesClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.sl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SoftwareInventoriesClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.sl, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SoftwareInventoriesClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.sl.hasNextLink() && result.sl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client SoftwareInventoriesClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-05-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/softwareInventories", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareInventoriesClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client SoftwareInventoriesClient) ListBySubscriptionResponder(resp *http.Response) (result SoftwaresList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client SoftwareInventoriesClient) listBySubscriptionNextResults(ctx context.Context, lastResults SoftwaresList) (result SoftwaresList, err error) { + req, err := lastResults.softwaresListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.SoftwareInventoriesClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.SoftwareInventoriesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SoftwareInventoriesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client SoftwareInventoriesClient) ListBySubscriptionComplete(ctx context.Context) (result SoftwaresListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SoftwareInventoriesClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySubscription(ctx) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/version/version.go b/vendor/github.com/Azure/azure-sdk-for-go/version/version.go index aabf42a4d501..25ff8c0689b2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/version/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/version/version.go @@ -4,4 +4,4 @@ package version // Licensed under the MIT License. See License.txt in the project root for license information. // Number contains the semantic version of this SDK. -const Number = "v55.2.0" +const Number = "v55.3.0" diff --git a/vendor/modules.txt b/vendor/modules.txt index 471709059a05..72499bd55367 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -8,7 +8,7 @@ cloud.google.com/go/internal/trace cloud.google.com/go/internal/version # cloud.google.com/go/storage v1.10.0 cloud.google.com/go/storage -# github.com/Azure/azure-sdk-for-go v55.2.0+incompatible +# github.com/Azure/azure-sdk-for-go v55.3.0+incompatible ## explicit github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources github.com/Azure/azure-sdk-for-go/services/aad/mgmt/2017-04-01/aad From 2f75bab9790fe354898034607d49de7238679490 Mon Sep 17 00:00:00 2001 From: magodo Date: Fri, 18 Jun 2021 16:12:43 +0800 Subject: [PATCH 2/2] extend the `azurerm_security_center_server_vulnerability_assessment` delete timeout --- ...ecurity_center_server_vulnerability_assessment_resource.go | 3 +-- ...urity_center_server_vulnerability_assessment.html.markdown | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/azurerm/internal/services/securitycenter/security_center_server_vulnerability_assessment_resource.go b/azurerm/internal/services/securitycenter/security_center_server_vulnerability_assessment_resource.go index 27a3fb85fb46..c101372d3095 100644 --- a/azurerm/internal/services/securitycenter/security_center_server_vulnerability_assessment_resource.go +++ b/azurerm/internal/services/securitycenter/security_center_server_vulnerability_assessment_resource.go @@ -32,8 +32,7 @@ func resourceServerVulnerabilityAssessment() *pluginsdk.Resource { Timeouts: &pluginsdk.ResourceTimeout{ Create: pluginsdk.DefaultTimeout(5 * time.Minute), Read: pluginsdk.DefaultTimeout(5 * time.Minute), - Update: pluginsdk.DefaultTimeout(5 * time.Minute), - Delete: pluginsdk.DefaultTimeout(5 * time.Minute), + Delete: pluginsdk.DefaultTimeout(10 * time.Minute), }, Schema: map[string]*pluginsdk.Schema{ diff --git a/website/docs/r/azurerm_security_center_server_vulnerability_assessment.html.markdown b/website/docs/r/azurerm_security_center_server_vulnerability_assessment.html.markdown index a6f8a937c42b..9b5228c025fd 100644 --- a/website/docs/r/azurerm_security_center_server_vulnerability_assessment.html.markdown +++ b/website/docs/r/azurerm_security_center_server_vulnerability_assessment.html.markdown @@ -99,9 +99,9 @@ In addition to all arguments above, the following attributes are exported: The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions: -* `create` - (Defaults to 30 minutes) Used when creating the Advanced Threat Protection. +* `create` - (Defaults to 5 minutes) Used when creating the Advanced Threat Protection. * `read` - (Defaults to 5 minutes) Used when retrieving the Advanced Threat Protection. -* `delete` - (Defaults to 30 minutes) Used when deleting the Advanced Threat Protection. +* `delete` - (Defaults to 10 minutes) Used when deleting the Advanced Threat Protection. ## Import