diff --git a/services/preview/security/mgmt/v1.0/security/CHANGELOG.md b/services/preview/security/mgmt/v1.0/security/CHANGELOG.md index 52911e4cc5e4..8ec65f902c52 100644 --- a/services/preview/security/mgmt/v1.0/security/CHANGELOG.md +++ b/services/preview/security/mgmt/v1.0/security/CHANGELOG.md @@ -1,2 +1,1289 @@ -# Change History +# Unreleased +## Breaking Changes + +### Removed Constants + +1. EnforcementMode.Audit +1. EnforcementMode.Enforce +1. EventSource.Alerts +1. EventSource.Assessments +1. EventSource.SecureScoreControls +1. EventSource.SecureScores +1. EventSource.SubAssessments +1. SettingKind.SettingKindAlertSuppressionSetting +1. SettingKind.SettingKindDataExportSetting + +### Removed Funcs + +1. PossibleSettingKindValues() []SettingKind +1. SettingResource.MarshalJSON() ([]byte, error) + +### Struct Changes + +#### Removed Structs + +1. SettingResource + +#### Removed Struct Fields + +1. BaseClient.AscLocation + +### Signature Changes + +#### Const Types + +1. BinarySignature changed type from Type to Type1 +1. File changed type from Type to Type1 +1. FileHash changed type from Type to Type1 +1. KindAAD changed type from KindEnum to KindEnum1 +1. KindATA changed type from KindEnum to KindEnum1 +1. KindCEF changed type from KindEnum to KindEnum1 +1. KindExternalSecuritySolution changed type from KindEnum to KindEnum1 +1. None changed type from EnforcementMode to EndOfSupportStatus +1. ProductSignature changed type from Type to Type1 +1. PublisherSignature changed type from Type to Type1 +1. VersionAndAboveSignature changed type from Type to Type1 + +#### Funcs + +1. AdaptiveApplicationControlsClient.Delete + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AdaptiveApplicationControlsClient.DeletePreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AdaptiveApplicationControlsClient.Get + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AdaptiveApplicationControlsClient.GetPreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AdaptiveApplicationControlsClient.Put + - Params + - From: context.Context, string, AppWhitelistingPutGroupData + - To: context.Context, string, string, AppWhitelistingPutGroupData +1. AdaptiveApplicationControlsClient.PutPreparer + - Params + - From: context.Context, string, AppWhitelistingPutGroupData + - To: context.Context, string, string, AppWhitelistingPutGroupData +1. AlertsClient.GetResourceGroupLevelAlerts + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. AlertsClient.GetResourceGroupLevelAlertsPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. AlertsClient.GetSubscriptionLevelAlert + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AlertsClient.GetSubscriptionLevelAlertPreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AlertsClient.ListResourceGroupLevelAlertsByRegion + - Params + - From: context.Context, string, string, string, string + - To: context.Context, string, string, string, string, string +1. AlertsClient.ListResourceGroupLevelAlertsByRegionComplete + - Params + - From: context.Context, string, string, string, string + - To: context.Context, string, string, string, string, string +1. AlertsClient.ListResourceGroupLevelAlertsByRegionPreparer + - Params + - From: context.Context, string, string, string, string + - To: context.Context, string, string, string, string, string +1. AlertsClient.ListSubscriptionLevelAlertsByRegion + - Params + - From: context.Context, string, string, string + - To: context.Context, string, string, string, string +1. AlertsClient.ListSubscriptionLevelAlertsByRegionComplete + - Params + - From: context.Context, string, string, string + - To: context.Context, string, string, string, string +1. AlertsClient.ListSubscriptionLevelAlertsByRegionPreparer + - Params + - From: context.Context, string, string, string + - To: context.Context, string, string, string, string +1. AlertsClient.UpdateResourceGroupLevelAlertStateToDismiss + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. AlertsClient.UpdateResourceGroupLevelAlertStateToDismissPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. AlertsClient.UpdateResourceGroupLevelAlertStateToReactivate + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. AlertsClient.UpdateResourceGroupLevelAlertStateToReactivatePreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. AlertsClient.UpdateSubscriptionLevelAlertStateToDismiss + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AlertsClient.UpdateSubscriptionLevelAlertStateToDismissPreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AlertsClient.UpdateSubscriptionLevelAlertStateToReactivate + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AlertsClient.UpdateSubscriptionLevelAlertStateToReactivatePreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AllowedConnectionsClient.Get + - Params + - From: context.Context, string, ConnectionType + - To: context.Context, string, string, ConnectionType +1. AllowedConnectionsClient.GetPreparer + - Params + - From: context.Context, string, ConnectionType + - To: context.Context, string, string, ConnectionType +1. AllowedConnectionsClient.ListByHomeRegion + - Params + - From: context.Context + - To: context.Context, string +1. AllowedConnectionsClient.ListByHomeRegionComplete + - Params + - From: context.Context + - To: context.Context, string +1. AllowedConnectionsClient.ListByHomeRegionPreparer + - Params + - From: context.Context + - To: context.Context, string +1. ConnectorsClient.CreateOrUpdate + - Params + - From: context.Context, string, ConnectorSetting + - To: context.Context, string, string, Connector + - Returns + - From: ConnectorSetting, error + - To: Connector, error +1. ConnectorsClient.CreateOrUpdatePreparer + - Params + - From: context.Context, string, ConnectorSetting + - To: context.Context, string, string, Connector +1. ConnectorsClient.CreateOrUpdateResponder + - Returns + - From: ConnectorSetting, error + - To: Connector, error +1. ConnectorsClient.Delete + - Params + - From: context.Context, string + - To: context.Context, string, string +1. ConnectorsClient.DeletePreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. ConnectorsClient.Get + - Params + - From: context.Context, string + - To: context.Context, string, string + - Returns + - From: ConnectorSetting, error + - To: Connector, error +1. ConnectorsClient.GetPreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. ConnectorsClient.GetResponder + - Returns + - From: ConnectorSetting, error + - To: Connector, error +1. ConnectorsClient.List + - Returns + - From: ConnectorSettingListPage, error + - To: ConnectorsListPage, error +1. ConnectorsClient.ListComplete + - Returns + - From: ConnectorSettingListIterator, error + - To: ConnectorsListIterator, error +1. ConnectorsClient.ListResponder + - Returns + - From: ConnectorSettingList, error + - To: ConnectorsList, error +1. DiscoveredSecuritySolutionsClient.Get + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. DiscoveredSecuritySolutionsClient.GetPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. DiscoveredSecuritySolutionsClient.ListByHomeRegion + - Params + - From: context.Context + - To: context.Context, string +1. DiscoveredSecuritySolutionsClient.ListByHomeRegionComplete + - Params + - From: context.Context + - To: context.Context, string +1. DiscoveredSecuritySolutionsClient.ListByHomeRegionPreparer + - Params + - From: context.Context + - To: context.Context, string +1. ExternalSecuritySolutionsClient.Get + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. ExternalSecuritySolutionsClient.GetPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. ExternalSecuritySolutionsClient.ListByHomeRegion + - Params + - From: context.Context + - To: context.Context, string +1. ExternalSecuritySolutionsClient.ListByHomeRegionComplete + - Params + - From: context.Context + - To: context.Context, string +1. ExternalSecuritySolutionsClient.ListByHomeRegionPreparer + - Params + - From: context.Context + - To: context.Context, string +1. InformationProtectionPoliciesClient.CreateOrUpdate + - Params + - From: context.Context, string, string, InformationProtectionPolicy + - To: context.Context, string, InformationProtectionPolicyName, InformationProtectionPolicy +1. InformationProtectionPoliciesClient.CreateOrUpdatePreparer + - Params + - From: context.Context, string, string, InformationProtectionPolicy + - To: context.Context, string, InformationProtectionPolicyName, InformationProtectionPolicy +1. InformationProtectionPoliciesClient.Get + - Params + - From: context.Context, string, string + - To: context.Context, string, InformationProtectionPolicyName +1. InformationProtectionPoliciesClient.GetPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, InformationProtectionPolicyName +1. JitNetworkAccessPoliciesClient.CreateOrUpdate + - Params + - From: context.Context, string, string, JitNetworkAccessPolicy + - To: context.Context, string, string, string, JitNetworkAccessPolicy +1. JitNetworkAccessPoliciesClient.CreateOrUpdatePreparer + - Params + - From: context.Context, string, string, JitNetworkAccessPolicy + - To: context.Context, string, string, string, JitNetworkAccessPolicy +1. JitNetworkAccessPoliciesClient.Delete + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. JitNetworkAccessPoliciesClient.DeletePreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. JitNetworkAccessPoliciesClient.Get + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. JitNetworkAccessPoliciesClient.GetPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. JitNetworkAccessPoliciesClient.Initiate + - Params + - From: context.Context, string, string, JitNetworkAccessPolicyInitiateRequest + - To: context.Context, string, string, string, JitNetworkAccessPolicyInitiateRequest +1. JitNetworkAccessPoliciesClient.InitiatePreparer + - Params + - From: context.Context, string, string, JitNetworkAccessPolicyInitiateRequest + - To: context.Context, string, string, string, JitNetworkAccessPolicyInitiateRequest +1. JitNetworkAccessPoliciesClient.ListByRegion + - Params + - From: context.Context + - To: context.Context, string +1. JitNetworkAccessPoliciesClient.ListByRegionComplete + - Params + - From: context.Context + - To: context.Context, string +1. JitNetworkAccessPoliciesClient.ListByRegionPreparer + - Params + - From: context.Context + - To: context.Context, string +1. JitNetworkAccessPoliciesClient.ListByResourceGroupAndRegion + - Params + - From: context.Context, string + - To: context.Context, string, string +1. JitNetworkAccessPoliciesClient.ListByResourceGroupAndRegionComplete + - Params + - From: context.Context, string + - To: context.Context, string, string +1. JitNetworkAccessPoliciesClient.ListByResourceGroupAndRegionPreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. LocationsClient.Get + - Params + - From: context.Context + - To: context.Context, string +1. LocationsClient.GetPreparer + - Params + - From: context.Context + - To: context.Context, string +1. New + - Params + - From: string, string + - To: string +1. NewAdaptiveApplicationControlsClient + - Params + - From: string, string + - To: string +1. NewAdaptiveApplicationControlsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewAdaptiveNetworkHardeningsClient + - Params + - From: string, string + - To: string +1. NewAdaptiveNetworkHardeningsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewAdvancedThreatProtectionClient + - Params + - From: string, string + - To: string +1. NewAdvancedThreatProtectionClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewAlertsClient + - Params + - From: string, string + - To: string +1. NewAlertsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewAlertsSuppressionRulesClient + - Params + - From: string, string + - To: string +1. NewAlertsSuppressionRulesClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewAllowedConnectionsClient + - Params + - From: string, string + - To: string +1. NewAllowedConnectionsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewAutoProvisioningSettingsClient + - Params + - From: string, string + - To: string +1. NewAutoProvisioningSettingsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewAutomationsClient + - Params + - From: string, string + - To: string +1. NewAutomationsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewCompliancesClient + - Params + - From: string, string + - To: string +1. NewCompliancesClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewConnectorsClient + - Params + - From: string, string + - To: string +1. NewConnectorsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewContactsClient + - Params + - From: string, string + - To: string +1. NewContactsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewDeviceSecurityGroupsClient + - Params + - From: string, string + - To: string +1. NewDeviceSecurityGroupsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewDiscoveredSecuritySolutionsClient + - Params + - From: string, string + - To: string +1. NewDiscoveredSecuritySolutionsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewExternalSecuritySolutionsClient + - Params + - From: string, string + - To: string +1. NewExternalSecuritySolutionsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewInformationProtectionPoliciesClient + - Params + - From: string, string + - To: string +1. NewInformationProtectionPoliciesClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewJitNetworkAccessPoliciesClient + - Params + - From: string, string + - To: string +1. NewJitNetworkAccessPoliciesClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewLocationsClient + - Params + - From: string, string + - To: string +1. NewLocationsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewOperationsClient + - Params + - From: string, string + - To: string +1. NewOperationsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewPricingsClient + - Params + - From: string, string + - To: string +1. NewPricingsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewRegulatoryComplianceAssessmentsClient + - Params + - From: string, string + - To: string +1. NewRegulatoryComplianceAssessmentsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewRegulatoryComplianceControlsClient + - Params + - From: string, string + - To: string +1. NewRegulatoryComplianceControlsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewRegulatoryComplianceStandardsClient + - Params + - From: string, string + - To: string +1. NewRegulatoryComplianceStandardsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSQLVulnerabilityAssessmentBaselineRulesClient + - Params + - From: string, string + - To: string +1. NewSQLVulnerabilityAssessmentBaselineRulesClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSQLVulnerabilityAssessmentScanResultsClient + - Params + - From: string, string + - To: string +1. NewSQLVulnerabilityAssessmentScanResultsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSQLVulnerabilityAssessmentScansClient + - Params + - From: string, string + - To: string +1. NewSQLVulnerabilityAssessmentScansClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSecureScoreControlDefinitionsClient + - Params + - From: string, string + - To: string +1. NewSecureScoreControlDefinitionsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSecureScoreControlsClient + - Params + - From: string, string + - To: string +1. NewSecureScoreControlsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSecureScoresClient + - Params + - From: string, string + - To: string +1. NewSecureScoresClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSettingsClient + - Params + - From: string, string + - To: string +1. NewSettingsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSubAssessmentsClient + - Params + - From: string, string + - To: string +1. NewSubAssessmentsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewTasksClient + - Params + - From: string, string + - To: string +1. NewTasksClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewTopologyClient + - Params + - From: string, string + - To: string +1. NewTopologyClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewWorkspaceSettingsClient + - Params + - From: string, string + - To: string +1. NewWorkspaceSettingsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. SettingsClient.Get + - Returns + - From: Setting, error + - To: SettingModel, error +1. SettingsClient.GetResponder + - Returns + - From: Setting, error + - To: SettingModel, error +1. SettingsClient.Update + - Params + - From: context.Context, string, Setting + - To: context.Context, string, BasicSetting + - Returns + - From: Setting, error + - To: SettingModel, error +1. SettingsClient.UpdatePreparer + - Params + - From: context.Context, string, Setting + - To: context.Context, string, BasicSetting +1. SettingsClient.UpdateResponder + - Returns + - From: Setting, error + - To: SettingModel, error +1. SettingsListIterator.Value + - Returns + - From: Setting + - To: BasicSetting +1. SettingsListPage.Values + - Returns + - From: []Setting + - To: []BasicSetting +1. TasksClient.GetResourceGroupLevelTask + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. TasksClient.GetResourceGroupLevelTaskPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. TasksClient.GetSubscriptionLevelTask + - Params + - From: context.Context, string + - To: context.Context, string, string +1. TasksClient.GetSubscriptionLevelTaskPreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. TasksClient.ListByHomeRegion + - Params + - From: context.Context, string + - To: context.Context, string, string +1. TasksClient.ListByHomeRegionComplete + - Params + - From: context.Context, string + - To: context.Context, string, string +1. TasksClient.ListByHomeRegionPreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. TasksClient.ListByResourceGroup + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. TasksClient.ListByResourceGroupComplete + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. TasksClient.ListByResourceGroupPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. TasksClient.UpdateResourceGroupLevelTaskState + - Params + - From: context.Context, string, string, string + - To: context.Context, string, string, string, TaskUpdateActionType +1. TasksClient.UpdateResourceGroupLevelTaskStatePreparer + - Params + - From: context.Context, string, string, string + - To: context.Context, string, string, string, TaskUpdateActionType +1. TasksClient.UpdateSubscriptionLevelTaskState + - Params + - From: context.Context, string, string + - To: context.Context, string, string, TaskUpdateActionType +1. TasksClient.UpdateSubscriptionLevelTaskStatePreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, TaskUpdateActionType +1. TopologyClient.Get + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. TopologyClient.GetPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. TopologyClient.ListByHomeRegion + - Params + - From: context.Context + - To: context.Context, string +1. TopologyClient.ListByHomeRegionComplete + - Params + - From: context.Context + - To: context.Context, string +1. TopologyClient.ListByHomeRegionPreparer + - Params + - From: context.Context + - To: context.Context, string + +#### Struct Fields + +1. AadExternalSecuritySolution.Kind changed type from KindEnum to KindEnum1 +1. AtaExternalSecuritySolution.Kind changed type from KindEnum to KindEnum1 +1. CefExternalSecuritySolution.Kind changed type from KindEnum to KindEnum1 +1. DataExportSetting.Kind changed type from SettingKind to KindEnum +1. ExternalSecuritySolution.Kind changed type from KindEnum to KindEnum1 +1. PathRecommendation.Type changed type from Type to Type1 +1. Setting.Kind changed type from SettingKind to KindEnum +1. SettingsList.Value changed type from *[]Setting to *[]BasicSetting + +## Additive Changes + +### New Constants + +1. CloudName.AWS +1. CloudName.Azure +1. CloudName.GCP +1. CloudName.Github +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. EnvironmentType.EnvironmentTypeAwsAccount +1. EnvironmentType.EnvironmentTypeEnvironmentData +1. EnvironmentType.EnvironmentTypeGcpProject +1. EnvironmentType.EnvironmentTypeGithubScope +1. EventSource.EventSourceAlerts +1. EventSource.EventSourceAssessments +1. EventSource.EventSourceAssessmentsSnapshot +1. EventSource.EventSourceRegulatoryComplianceAssessment +1. EventSource.EventSourceRegulatoryComplianceAssessmentSnapshot +1. EventSource.EventSourceSecureScoreControls +1. EventSource.EventSourceSecureScoreControlsSnapshot +1. EventSource.EventSourceSecureScores +1. EventSource.EventSourceSecureScoresSnapshot +1. EventSource.EventSourceSubAssessments +1. EventSource.EventSourceSubAssessmentsSnapshot +1. InformationProtectionPolicyName.InformationProtectionPolicyNameCustom +1. InformationProtectionPolicyName.InformationProtectionPolicyNameEffective +1. KindEnum.KindDataExportSetting +1. KindEnum.KindSetting +1. OfferingType.OfferingTypeCloudOffering +1. OfferingType.OfferingTypeCspmMonitorAws +1. OfferingType.OfferingTypeCspmMonitorGcp +1. OfferingType.OfferingTypeCspmMonitorGithub +1. OfferingType.OfferingTypeDefenderForContainersAws +1. OfferingType.OfferingTypeDefenderForContainersGcp +1. OfferingType.OfferingTypeDefenderForServersAws +1. OfferingType.OfferingTypeDefenderForServersGcp +1. OfferingType.OfferingTypeInformationProtectionAws +1. OrganizationMembershipType.OrganizationMembershipTypeAwsOrganizationalData +1. OrganizationMembershipType.OrganizationMembershipTypeMember +1. OrganizationMembershipType.OrganizationMembershipTypeOrganization +1. OrganizationMembershipTypeBasicGcpOrganizationalData.OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeGcpOrganizationalData +1. OrganizationMembershipTypeBasicGcpOrganizationalData.OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeMember +1. OrganizationMembershipTypeBasicGcpOrganizationalData.OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeOrganization +1. SeverityEnum.SeverityEnumHigh +1. SeverityEnum.SeverityEnumLow +1. SeverityEnum.SeverityEnumMedium +1. SubPlan.P1 +1. SubPlan.P2 +1. SupportedCloudEnum.SupportedCloudEnumAWS +1. SupportedCloudEnum.SupportedCloudEnumGCP +1. TaskUpdateActionType.Activate +1. TaskUpdateActionType.Close +1. TaskUpdateActionType.Dismiss +1. TaskUpdateActionType.Resolve +1. TaskUpdateActionType.Start +1. Type.Qualys +1. Type.TVM + +### New Funcs + +1. *AWSEnvironmentData.UnmarshalJSON([]byte) error +1. *Connector.UnmarshalJSON([]byte) error +1. *ConnectorProperties.UnmarshalJSON([]byte) error +1. *ConnectorsListIterator.Next() error +1. *ConnectorsListIterator.NextWithContext(context.Context) error +1. *ConnectorsListPage.Next() error +1. *ConnectorsListPage.NextWithContext(context.Context) error +1. *CustomAssessmentAutomation.UnmarshalJSON([]byte) error +1. *CustomAssessmentAutomationRequest.UnmarshalJSON([]byte) error +1. *CustomAssessmentAutomationsListResultIterator.Next() error +1. *CustomAssessmentAutomationsListResultIterator.NextWithContext(context.Context) error +1. *CustomAssessmentAutomationsListResultPage.Next() error +1. *CustomAssessmentAutomationsListResultPage.NextWithContext(context.Context) error +1. *CustomEntityStoreAssignment.UnmarshalJSON([]byte) error +1. *CustomEntityStoreAssignmentRequest.UnmarshalJSON([]byte) error +1. *CustomEntityStoreAssignmentsListResultIterator.Next() error +1. *CustomEntityStoreAssignmentsListResultIterator.NextWithContext(context.Context) error +1. *CustomEntityStoreAssignmentsListResultPage.Next() error +1. *CustomEntityStoreAssignmentsListResultPage.NextWithContext(context.Context) error +1. *GcpProjectEnvironmentData.UnmarshalJSON([]byte) error +1. *IngestionSettingListIterator.Next() error +1. *IngestionSettingListIterator.NextWithContext(context.Context) error +1. *IngestionSettingListPage.Next() error +1. *IngestionSettingListPage.NextWithContext(context.Context) error +1. *MdeOnboardingData.UnmarshalJSON([]byte) error +1. *SettingModel.UnmarshalJSON([]byte) error +1. *SettingsList.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. AWSEnvironmentData.AsAWSEnvironmentData() (*AWSEnvironmentData, bool) +1. AWSEnvironmentData.AsBasicEnvironmentData() (BasicEnvironmentData, bool) +1. AWSEnvironmentData.AsEnvironmentData() (*EnvironmentData, bool) +1. AWSEnvironmentData.AsGcpProjectEnvironmentData() (*GcpProjectEnvironmentData, bool) +1. AWSEnvironmentData.AsGithubScopeEnvironmentData() (*GithubScopeEnvironmentData, bool) +1. AWSEnvironmentData.MarshalJSON() ([]byte, error) +1. AwsOrganizationalData.AsAwsOrganizationalData() (*AwsOrganizationalData, bool) +1. AwsOrganizationalData.AsAwsOrganizationalDataMaster() (*AwsOrganizationalDataMaster, bool) +1. AwsOrganizationalData.AsAwsOrganizationalDataMember() (*AwsOrganizationalDataMember, bool) +1. AwsOrganizationalData.AsBasicAwsOrganizationalData() (BasicAwsOrganizationalData, bool) +1. AwsOrganizationalData.MarshalJSON() ([]byte, error) +1. AwsOrganizationalDataMaster.AsAwsOrganizationalData() (*AwsOrganizationalData, bool) +1. AwsOrganizationalDataMaster.AsAwsOrganizationalDataMaster() (*AwsOrganizationalDataMaster, bool) +1. AwsOrganizationalDataMaster.AsAwsOrganizationalDataMember() (*AwsOrganizationalDataMember, bool) +1. AwsOrganizationalDataMaster.AsBasicAwsOrganizationalData() (BasicAwsOrganizationalData, bool) +1. AwsOrganizationalDataMaster.MarshalJSON() ([]byte, error) +1. AwsOrganizationalDataMember.AsAwsOrganizationalData() (*AwsOrganizationalData, bool) +1. AwsOrganizationalDataMember.AsAwsOrganizationalDataMaster() (*AwsOrganizationalDataMaster, bool) +1. AwsOrganizationalDataMember.AsAwsOrganizationalDataMember() (*AwsOrganizationalDataMember, bool) +1. AwsOrganizationalDataMember.AsBasicAwsOrganizationalData() (BasicAwsOrganizationalData, bool) +1. AwsOrganizationalDataMember.MarshalJSON() ([]byte, error) +1. CloudOffering.AsBasicCloudOffering() (BasicCloudOffering, bool) +1. CloudOffering.AsCloudOffering() (*CloudOffering, bool) +1. CloudOffering.AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) +1. CloudOffering.AsCspmMonitorGcpOffering() (*CspmMonitorGcpOffering, bool) +1. CloudOffering.AsCspmMonitorGithubOffering() (*CspmMonitorGithubOffering, bool) +1. CloudOffering.AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) +1. CloudOffering.AsDefenderForContainersGcpOffering() (*DefenderForContainersGcpOffering, bool) +1. CloudOffering.AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) +1. CloudOffering.AsDefenderForServersGcpOffering() (*DefenderForServersGcpOffering, bool) +1. CloudOffering.AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) +1. CloudOffering.MarshalJSON() ([]byte, error) +1. Connector.MarshalJSON() ([]byte, error) +1. ConnectorsClient.ListByResourceGroup(context.Context, string) (ConnectorsListPage, error) +1. ConnectorsClient.ListByResourceGroupComplete(context.Context, string) (ConnectorsListIterator, error) +1. ConnectorsClient.ListByResourceGroupPreparer(context.Context, string) (*http.Request, error) +1. ConnectorsClient.ListByResourceGroupResponder(*http.Response) (ConnectorsList, error) +1. ConnectorsClient.ListByResourceGroupSender(*http.Request) (*http.Response, error) +1. ConnectorsClient.Update(context.Context, string, string, Connector) (Connector, error) +1. ConnectorsClient.UpdatePreparer(context.Context, string, string, Connector) (*http.Request, error) +1. ConnectorsClient.UpdateResponder(*http.Response) (Connector, error) +1. ConnectorsClient.UpdateSender(*http.Request) (*http.Response, error) +1. ConnectorsGroupClient.CreateOrUpdate(context.Context, string, ConnectorSetting) (ConnectorSetting, error) +1. ConnectorsGroupClient.CreateOrUpdatePreparer(context.Context, string, ConnectorSetting) (*http.Request, error) +1. ConnectorsGroupClient.CreateOrUpdateResponder(*http.Response) (ConnectorSetting, error) +1. ConnectorsGroupClient.CreateOrUpdateSender(*http.Request) (*http.Response, error) +1. ConnectorsGroupClient.Delete(context.Context, string) (autorest.Response, error) +1. ConnectorsGroupClient.DeletePreparer(context.Context, string) (*http.Request, error) +1. ConnectorsGroupClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. ConnectorsGroupClient.DeleteSender(*http.Request) (*http.Response, error) +1. ConnectorsGroupClient.Get(context.Context, string) (ConnectorSetting, error) +1. ConnectorsGroupClient.GetPreparer(context.Context, string) (*http.Request, error) +1. ConnectorsGroupClient.GetResponder(*http.Response) (ConnectorSetting, error) +1. ConnectorsGroupClient.GetSender(*http.Request) (*http.Response, error) +1. ConnectorsGroupClient.List(context.Context) (ConnectorSettingListPage, error) +1. ConnectorsGroupClient.ListComplete(context.Context) (ConnectorSettingListIterator, error) +1. ConnectorsGroupClient.ListPreparer(context.Context) (*http.Request, error) +1. ConnectorsGroupClient.ListResponder(*http.Response) (ConnectorSettingList, error) +1. ConnectorsGroupClient.ListSender(*http.Request) (*http.Response, error) +1. ConnectorsList.IsEmpty() bool +1. ConnectorsList.MarshalJSON() ([]byte, error) +1. ConnectorsListIterator.NotDone() bool +1. ConnectorsListIterator.Response() ConnectorsList +1. ConnectorsListIterator.Value() Connector +1. ConnectorsListPage.NotDone() bool +1. ConnectorsListPage.Response() ConnectorsList +1. ConnectorsListPage.Values() []Connector +1. CspmMonitorAwsOffering.AsBasicCloudOffering() (BasicCloudOffering, bool) +1. CspmMonitorAwsOffering.AsCloudOffering() (*CloudOffering, bool) +1. CspmMonitorAwsOffering.AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) +1. CspmMonitorAwsOffering.AsCspmMonitorGcpOffering() (*CspmMonitorGcpOffering, bool) +1. CspmMonitorAwsOffering.AsCspmMonitorGithubOffering() (*CspmMonitorGithubOffering, bool) +1. CspmMonitorAwsOffering.AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) +1. CspmMonitorAwsOffering.AsDefenderForContainersGcpOffering() (*DefenderForContainersGcpOffering, bool) +1. CspmMonitorAwsOffering.AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) +1. CspmMonitorAwsOffering.AsDefenderForServersGcpOffering() (*DefenderForServersGcpOffering, bool) +1. CspmMonitorAwsOffering.AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) +1. CspmMonitorAwsOffering.MarshalJSON() ([]byte, error) +1. CspmMonitorGcpOffering.AsBasicCloudOffering() (BasicCloudOffering, bool) +1. CspmMonitorGcpOffering.AsCloudOffering() (*CloudOffering, bool) +1. CspmMonitorGcpOffering.AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) +1. CspmMonitorGcpOffering.AsCspmMonitorGcpOffering() (*CspmMonitorGcpOffering, bool) +1. CspmMonitorGcpOffering.AsCspmMonitorGithubOffering() (*CspmMonitorGithubOffering, bool) +1. CspmMonitorGcpOffering.AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) +1. CspmMonitorGcpOffering.AsDefenderForContainersGcpOffering() (*DefenderForContainersGcpOffering, bool) +1. CspmMonitorGcpOffering.AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) +1. CspmMonitorGcpOffering.AsDefenderForServersGcpOffering() (*DefenderForServersGcpOffering, bool) +1. CspmMonitorGcpOffering.AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) +1. CspmMonitorGcpOffering.MarshalJSON() ([]byte, error) +1. CspmMonitorGithubOffering.AsBasicCloudOffering() (BasicCloudOffering, bool) +1. CspmMonitorGithubOffering.AsCloudOffering() (*CloudOffering, bool) +1. CspmMonitorGithubOffering.AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) +1. CspmMonitorGithubOffering.AsCspmMonitorGcpOffering() (*CspmMonitorGcpOffering, bool) +1. CspmMonitorGithubOffering.AsCspmMonitorGithubOffering() (*CspmMonitorGithubOffering, bool) +1. CspmMonitorGithubOffering.AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) +1. CspmMonitorGithubOffering.AsDefenderForContainersGcpOffering() (*DefenderForContainersGcpOffering, bool) +1. CspmMonitorGithubOffering.AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) +1. CspmMonitorGithubOffering.AsDefenderForServersGcpOffering() (*DefenderForServersGcpOffering, bool) +1. CspmMonitorGithubOffering.AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) +1. CspmMonitorGithubOffering.MarshalJSON() ([]byte, error) +1. CustomAssessmentAutomation.MarshalJSON() ([]byte, error) +1. CustomAssessmentAutomationRequest.MarshalJSON() ([]byte, error) +1. CustomAssessmentAutomationsClient.Create(context.Context, string, string, CustomAssessmentAutomationRequest) (CustomAssessmentAutomation, error) +1. CustomAssessmentAutomationsClient.CreatePreparer(context.Context, string, string, CustomAssessmentAutomationRequest) (*http.Request, error) +1. CustomAssessmentAutomationsClient.CreateResponder(*http.Response) (CustomAssessmentAutomation, error) +1. CustomAssessmentAutomationsClient.CreateSender(*http.Request) (*http.Response, error) +1. CustomAssessmentAutomationsClient.Delete(context.Context, string, string) (autorest.Response, error) +1. CustomAssessmentAutomationsClient.DeletePreparer(context.Context, string, string) (*http.Request, error) +1. CustomAssessmentAutomationsClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. CustomAssessmentAutomationsClient.DeleteSender(*http.Request) (*http.Response, error) +1. CustomAssessmentAutomationsClient.Get(context.Context, string, string) (CustomAssessmentAutomation, error) +1. CustomAssessmentAutomationsClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. CustomAssessmentAutomationsClient.GetResponder(*http.Response) (CustomAssessmentAutomation, error) +1. CustomAssessmentAutomationsClient.GetSender(*http.Request) (*http.Response, error) +1. CustomAssessmentAutomationsClient.ListByResourceGroup(context.Context, string) (CustomAssessmentAutomationsListResultPage, error) +1. CustomAssessmentAutomationsClient.ListByResourceGroupComplete(context.Context, string) (CustomAssessmentAutomationsListResultIterator, error) +1. CustomAssessmentAutomationsClient.ListByResourceGroupPreparer(context.Context, string) (*http.Request, error) +1. CustomAssessmentAutomationsClient.ListByResourceGroupResponder(*http.Response) (CustomAssessmentAutomationsListResult, error) +1. CustomAssessmentAutomationsClient.ListByResourceGroupSender(*http.Request) (*http.Response, error) +1. CustomAssessmentAutomationsClient.ListBySubscription(context.Context) (CustomAssessmentAutomationsListResultPage, error) +1. CustomAssessmentAutomationsClient.ListBySubscriptionComplete(context.Context) (CustomAssessmentAutomationsListResultIterator, error) +1. CustomAssessmentAutomationsClient.ListBySubscriptionPreparer(context.Context) (*http.Request, error) +1. CustomAssessmentAutomationsClient.ListBySubscriptionResponder(*http.Response) (CustomAssessmentAutomationsListResult, error) +1. CustomAssessmentAutomationsClient.ListBySubscriptionSender(*http.Request) (*http.Response, error) +1. CustomAssessmentAutomationsListResult.IsEmpty() bool +1. CustomAssessmentAutomationsListResult.MarshalJSON() ([]byte, error) +1. CustomAssessmentAutomationsListResultIterator.NotDone() bool +1. CustomAssessmentAutomationsListResultIterator.Response() CustomAssessmentAutomationsListResult +1. CustomAssessmentAutomationsListResultIterator.Value() CustomAssessmentAutomation +1. CustomAssessmentAutomationsListResultPage.NotDone() bool +1. CustomAssessmentAutomationsListResultPage.Response() CustomAssessmentAutomationsListResult +1. CustomAssessmentAutomationsListResultPage.Values() []CustomAssessmentAutomation +1. CustomEntityStoreAssignment.MarshalJSON() ([]byte, error) +1. CustomEntityStoreAssignmentRequest.MarshalJSON() ([]byte, error) +1. CustomEntityStoreAssignmentsClient.Create(context.Context, string, string, CustomEntityStoreAssignmentRequest) (CustomEntityStoreAssignment, error) +1. CustomEntityStoreAssignmentsClient.CreatePreparer(context.Context, string, string, CustomEntityStoreAssignmentRequest) (*http.Request, error) +1. CustomEntityStoreAssignmentsClient.CreateResponder(*http.Response) (CustomEntityStoreAssignment, error) +1. CustomEntityStoreAssignmentsClient.CreateSender(*http.Request) (*http.Response, error) +1. CustomEntityStoreAssignmentsClient.Delete(context.Context, string, string) (autorest.Response, error) +1. CustomEntityStoreAssignmentsClient.DeletePreparer(context.Context, string, string) (*http.Request, error) +1. CustomEntityStoreAssignmentsClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. CustomEntityStoreAssignmentsClient.DeleteSender(*http.Request) (*http.Response, error) +1. CustomEntityStoreAssignmentsClient.Get(context.Context, string, string) (CustomEntityStoreAssignment, error) +1. CustomEntityStoreAssignmentsClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. CustomEntityStoreAssignmentsClient.GetResponder(*http.Response) (CustomEntityStoreAssignment, error) +1. CustomEntityStoreAssignmentsClient.GetSender(*http.Request) (*http.Response, error) +1. CustomEntityStoreAssignmentsClient.ListByResourceGroup(context.Context, string) (CustomEntityStoreAssignmentsListResultPage, error) +1. CustomEntityStoreAssignmentsClient.ListByResourceGroupComplete(context.Context, string) (CustomEntityStoreAssignmentsListResultIterator, error) +1. CustomEntityStoreAssignmentsClient.ListByResourceGroupPreparer(context.Context, string) (*http.Request, error) +1. CustomEntityStoreAssignmentsClient.ListByResourceGroupResponder(*http.Response) (CustomEntityStoreAssignmentsListResult, error) +1. CustomEntityStoreAssignmentsClient.ListByResourceGroupSender(*http.Request) (*http.Response, error) +1. CustomEntityStoreAssignmentsClient.ListBySubscription(context.Context) (CustomEntityStoreAssignmentsListResultPage, error) +1. CustomEntityStoreAssignmentsClient.ListBySubscriptionComplete(context.Context) (CustomEntityStoreAssignmentsListResultIterator, error) +1. CustomEntityStoreAssignmentsClient.ListBySubscriptionPreparer(context.Context) (*http.Request, error) +1. CustomEntityStoreAssignmentsClient.ListBySubscriptionResponder(*http.Response) (CustomEntityStoreAssignmentsListResult, error) +1. CustomEntityStoreAssignmentsClient.ListBySubscriptionSender(*http.Request) (*http.Response, error) +1. CustomEntityStoreAssignmentsListResult.IsEmpty() bool +1. CustomEntityStoreAssignmentsListResult.MarshalJSON() ([]byte, error) +1. CustomEntityStoreAssignmentsListResultIterator.NotDone() bool +1. CustomEntityStoreAssignmentsListResultIterator.Response() CustomEntityStoreAssignmentsListResult +1. CustomEntityStoreAssignmentsListResultIterator.Value() CustomEntityStoreAssignment +1. CustomEntityStoreAssignmentsListResultPage.NotDone() bool +1. CustomEntityStoreAssignmentsListResultPage.Response() CustomEntityStoreAssignmentsListResult +1. CustomEntityStoreAssignmentsListResultPage.Values() []CustomEntityStoreAssignment +1. DataExportSetting.AsBasicSetting() (BasicSetting, bool) +1. DataExportSetting.AsDataExportSetting() (*DataExportSetting, bool) +1. DataExportSetting.AsSetting() (*Setting, bool) +1. DefenderForContainersAwsOffering.AsBasicCloudOffering() (BasicCloudOffering, bool) +1. DefenderForContainersAwsOffering.AsCloudOffering() (*CloudOffering, bool) +1. DefenderForContainersAwsOffering.AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) +1. DefenderForContainersAwsOffering.AsCspmMonitorGcpOffering() (*CspmMonitorGcpOffering, bool) +1. DefenderForContainersAwsOffering.AsCspmMonitorGithubOffering() (*CspmMonitorGithubOffering, bool) +1. DefenderForContainersAwsOffering.AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) +1. DefenderForContainersAwsOffering.AsDefenderForContainersGcpOffering() (*DefenderForContainersGcpOffering, bool) +1. DefenderForContainersAwsOffering.AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) +1. DefenderForContainersAwsOffering.AsDefenderForServersGcpOffering() (*DefenderForServersGcpOffering, bool) +1. DefenderForContainersAwsOffering.AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) +1. DefenderForContainersAwsOffering.MarshalJSON() ([]byte, error) +1. DefenderForContainersGcpOffering.AsBasicCloudOffering() (BasicCloudOffering, bool) +1. DefenderForContainersGcpOffering.AsCloudOffering() (*CloudOffering, bool) +1. DefenderForContainersGcpOffering.AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) +1. DefenderForContainersGcpOffering.AsCspmMonitorGcpOffering() (*CspmMonitorGcpOffering, bool) +1. DefenderForContainersGcpOffering.AsCspmMonitorGithubOffering() (*CspmMonitorGithubOffering, bool) +1. DefenderForContainersGcpOffering.AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) +1. DefenderForContainersGcpOffering.AsDefenderForContainersGcpOffering() (*DefenderForContainersGcpOffering, bool) +1. DefenderForContainersGcpOffering.AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) +1. DefenderForContainersGcpOffering.AsDefenderForServersGcpOffering() (*DefenderForServersGcpOffering, bool) +1. DefenderForContainersGcpOffering.AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) +1. DefenderForContainersGcpOffering.MarshalJSON() ([]byte, error) +1. DefenderForServersAwsOffering.AsBasicCloudOffering() (BasicCloudOffering, bool) +1. DefenderForServersAwsOffering.AsCloudOffering() (*CloudOffering, bool) +1. DefenderForServersAwsOffering.AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) +1. DefenderForServersAwsOffering.AsCspmMonitorGcpOffering() (*CspmMonitorGcpOffering, bool) +1. DefenderForServersAwsOffering.AsCspmMonitorGithubOffering() (*CspmMonitorGithubOffering, bool) +1. DefenderForServersAwsOffering.AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) +1. DefenderForServersAwsOffering.AsDefenderForContainersGcpOffering() (*DefenderForContainersGcpOffering, bool) +1. DefenderForServersAwsOffering.AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) +1. DefenderForServersAwsOffering.AsDefenderForServersGcpOffering() (*DefenderForServersGcpOffering, bool) +1. DefenderForServersAwsOffering.AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) +1. DefenderForServersAwsOffering.MarshalJSON() ([]byte, error) +1. DefenderForServersGcpOffering.AsBasicCloudOffering() (BasicCloudOffering, bool) +1. DefenderForServersGcpOffering.AsCloudOffering() (*CloudOffering, bool) +1. DefenderForServersGcpOffering.AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) +1. DefenderForServersGcpOffering.AsCspmMonitorGcpOffering() (*CspmMonitorGcpOffering, bool) +1. DefenderForServersGcpOffering.AsCspmMonitorGithubOffering() (*CspmMonitorGithubOffering, bool) +1. DefenderForServersGcpOffering.AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) +1. DefenderForServersGcpOffering.AsDefenderForContainersGcpOffering() (*DefenderForContainersGcpOffering, bool) +1. DefenderForServersGcpOffering.AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) +1. DefenderForServersGcpOffering.AsDefenderForServersGcpOffering() (*DefenderForServersGcpOffering, bool) +1. DefenderForServersGcpOffering.AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) +1. DefenderForServersGcpOffering.MarshalJSON() ([]byte, error) +1. EnvironmentData.AsAWSEnvironmentData() (*AWSEnvironmentData, bool) +1. EnvironmentData.AsBasicEnvironmentData() (BasicEnvironmentData, bool) +1. EnvironmentData.AsEnvironmentData() (*EnvironmentData, bool) +1. EnvironmentData.AsGcpProjectEnvironmentData() (*GcpProjectEnvironmentData, bool) +1. EnvironmentData.AsGithubScopeEnvironmentData() (*GithubScopeEnvironmentData, bool) +1. EnvironmentData.MarshalJSON() ([]byte, error) +1. ErrorAdditionalInfo.MarshalJSON() ([]byte, error) +1. GcpOrganizationalData.AsBasicGcpOrganizationalData() (BasicGcpOrganizationalData, bool) +1. GcpOrganizationalData.AsGcpOrganizationalData() (*GcpOrganizationalData, bool) +1. GcpOrganizationalData.AsGcpOrganizationalDataMember() (*GcpOrganizationalDataMember, bool) +1. GcpOrganizationalData.AsGcpOrganizationalDataOrganization() (*GcpOrganizationalDataOrganization, bool) +1. GcpOrganizationalData.MarshalJSON() ([]byte, error) +1. GcpOrganizationalDataMember.AsBasicGcpOrganizationalData() (BasicGcpOrganizationalData, bool) +1. GcpOrganizationalDataMember.AsGcpOrganizationalData() (*GcpOrganizationalData, bool) +1. GcpOrganizationalDataMember.AsGcpOrganizationalDataMember() (*GcpOrganizationalDataMember, bool) +1. GcpOrganizationalDataMember.AsGcpOrganizationalDataOrganization() (*GcpOrganizationalDataOrganization, bool) +1. GcpOrganizationalDataMember.MarshalJSON() ([]byte, error) +1. GcpOrganizationalDataOrganization.AsBasicGcpOrganizationalData() (BasicGcpOrganizationalData, bool) +1. GcpOrganizationalDataOrganization.AsGcpOrganizationalData() (*GcpOrganizationalData, bool) +1. GcpOrganizationalDataOrganization.AsGcpOrganizationalDataMember() (*GcpOrganizationalDataMember, bool) +1. GcpOrganizationalDataOrganization.AsGcpOrganizationalDataOrganization() (*GcpOrganizationalDataOrganization, bool) +1. GcpOrganizationalDataOrganization.MarshalJSON() ([]byte, error) +1. GcpProjectDetails.MarshalJSON() ([]byte, error) +1. GcpProjectEnvironmentData.AsAWSEnvironmentData() (*AWSEnvironmentData, bool) +1. GcpProjectEnvironmentData.AsBasicEnvironmentData() (BasicEnvironmentData, bool) +1. GcpProjectEnvironmentData.AsEnvironmentData() (*EnvironmentData, bool) +1. GcpProjectEnvironmentData.AsGcpProjectEnvironmentData() (*GcpProjectEnvironmentData, bool) +1. GcpProjectEnvironmentData.AsGithubScopeEnvironmentData() (*GithubScopeEnvironmentData, bool) +1. GcpProjectEnvironmentData.MarshalJSON() ([]byte, error) +1. GithubScopeEnvironmentData.AsAWSEnvironmentData() (*AWSEnvironmentData, bool) +1. GithubScopeEnvironmentData.AsBasicEnvironmentData() (BasicEnvironmentData, bool) +1. GithubScopeEnvironmentData.AsEnvironmentData() (*EnvironmentData, bool) +1. GithubScopeEnvironmentData.AsGcpProjectEnvironmentData() (*GcpProjectEnvironmentData, bool) +1. GithubScopeEnvironmentData.AsGithubScopeEnvironmentData() (*GithubScopeEnvironmentData, bool) +1. GithubScopeEnvironmentData.MarshalJSON() ([]byte, error) +1. InformationProtectionAwsOffering.AsBasicCloudOffering() (BasicCloudOffering, bool) +1. InformationProtectionAwsOffering.AsCloudOffering() (*CloudOffering, bool) +1. InformationProtectionAwsOffering.AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) +1. InformationProtectionAwsOffering.AsCspmMonitorGcpOffering() (*CspmMonitorGcpOffering, bool) +1. InformationProtectionAwsOffering.AsCspmMonitorGithubOffering() (*CspmMonitorGithubOffering, bool) +1. InformationProtectionAwsOffering.AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) +1. InformationProtectionAwsOffering.AsDefenderForContainersGcpOffering() (*DefenderForContainersGcpOffering, bool) +1. InformationProtectionAwsOffering.AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) +1. InformationProtectionAwsOffering.AsDefenderForServersGcpOffering() (*DefenderForServersGcpOffering, bool) +1. InformationProtectionAwsOffering.AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) +1. InformationProtectionAwsOffering.MarshalJSON() ([]byte, error) +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. MdeOnboardingData.MarshalJSON() ([]byte, error) +1. MdeOnboardingsClient.Get(context.Context) (MdeOnboardingData, error) +1. MdeOnboardingsClient.GetPreparer(context.Context) (*http.Request, error) +1. MdeOnboardingsClient.GetResponder(*http.Response) (MdeOnboardingData, error) +1. MdeOnboardingsClient.GetSender(*http.Request) (*http.Response, error) +1. MdeOnboardingsClient.List(context.Context) (MdeOnboardingDataList, error) +1. MdeOnboardingsClient.ListPreparer(context.Context) (*http.Request, error) +1. MdeOnboardingsClient.ListResponder(*http.Response) (MdeOnboardingDataList, error) +1. MdeOnboardingsClient.ListSender(*http.Request) (*http.Response, error) +1. NewConnectorsGroupClient(string) ConnectorsGroupClient +1. NewConnectorsGroupClientWithBaseURI(string, string) ConnectorsGroupClient +1. NewConnectorsListIterator(ConnectorsListPage) ConnectorsListIterator +1. NewConnectorsListPage(ConnectorsList, func(context.Context, ConnectorsList) (ConnectorsList, error)) ConnectorsListPage +1. NewCustomAssessmentAutomationsClient(string) CustomAssessmentAutomationsClient +1. NewCustomAssessmentAutomationsClientWithBaseURI(string, string) CustomAssessmentAutomationsClient +1. NewCustomAssessmentAutomationsListResultIterator(CustomAssessmentAutomationsListResultPage) CustomAssessmentAutomationsListResultIterator +1. NewCustomAssessmentAutomationsListResultPage(CustomAssessmentAutomationsListResult, func(context.Context, CustomAssessmentAutomationsListResult) (CustomAssessmentAutomationsListResult, error)) CustomAssessmentAutomationsListResultPage +1. NewCustomEntityStoreAssignmentsClient(string) CustomEntityStoreAssignmentsClient +1. NewCustomEntityStoreAssignmentsClientWithBaseURI(string, string) CustomEntityStoreAssignmentsClient +1. NewCustomEntityStoreAssignmentsListResultIterator(CustomEntityStoreAssignmentsListResultPage) CustomEntityStoreAssignmentsListResultIterator +1. NewCustomEntityStoreAssignmentsListResultPage(CustomEntityStoreAssignmentsListResult, func(context.Context, CustomEntityStoreAssignmentsListResult) (CustomEntityStoreAssignmentsListResult, error)) CustomEntityStoreAssignmentsListResultPage +1. NewIngestionSettingListIterator(IngestionSettingListPage) IngestionSettingListIterator +1. NewIngestionSettingListPage(IngestionSettingList, func(context.Context, IngestionSettingList) (IngestionSettingList, error)) IngestionSettingListPage +1. NewIngestionSettingsClient(string) IngestionSettingsClient +1. NewIngestionSettingsClientWithBaseURI(string, string) IngestionSettingsClient +1. NewMdeOnboardingsClient(string) MdeOnboardingsClient +1. NewMdeOnboardingsClientWithBaseURI(string, string) MdeOnboardingsClient +1. NewSoftwareInventoriesClient(string) SoftwareInventoriesClient +1. NewSoftwareInventoriesClientWithBaseURI(string, string) SoftwareInventoriesClient +1. NewSoftwaresListIterator(SoftwaresListPage) SoftwaresListIterator +1. NewSoftwaresListPage(SoftwaresList, func(context.Context, SoftwaresList) (SoftwaresList, error)) SoftwaresListPage +1. PossibleCloudNameValues() []CloudName +1. PossibleCreatedByTypeValues() []CreatedByType +1. PossibleEndOfSupportStatusValues() []EndOfSupportStatus +1. PossibleEnvironmentTypeValues() []EnvironmentType +1. PossibleInformationProtectionPolicyNameValues() []InformationProtectionPolicyName +1. PossibleKindEnum1Values() []KindEnum1 +1. PossibleOfferingTypeValues() []OfferingType +1. PossibleOrganizationMembershipTypeBasicGcpOrganizationalDataValues() []OrganizationMembershipTypeBasicGcpOrganizationalData +1. PossibleOrganizationMembershipTypeValues() []OrganizationMembershipType +1. PossibleSeverityEnumValues() []SeverityEnum +1. PossibleSubPlanValues() []SubPlan +1. PossibleSupportedCloudEnumValues() []SupportedCloudEnum +1. PossibleTaskUpdateActionTypeValues() []TaskUpdateActionType +1. PossibleType1Values() []Type1 +1. Setting.AsBasicSetting() (BasicSetting, bool) +1. Setting.AsDataExportSetting() (*DataExportSetting, bool) +1. Setting.AsSetting() (*Setting, 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 + +### Struct Changes + +#### New Structs + +1. AWSEnvironmentData +1. AwsOrganizationalData +1. AwsOrganizationalDataMaster +1. AwsOrganizationalDataMember +1. CloudOffering +1. ConnectionStrings +1. Connector +1. ConnectorProperties +1. ConnectorsGroupClient +1. ConnectorsList +1. ConnectorsListIterator +1. ConnectorsListPage +1. CspmMonitorAwsOffering +1. CspmMonitorAwsOfferingNativeCloudConnection +1. CspmMonitorGcpOffering +1. CspmMonitorGcpOfferingNativeCloudConnection +1. CspmMonitorGithubOffering +1. CustomAssessmentAutomation +1. CustomAssessmentAutomationProperties +1. CustomAssessmentAutomationRequest +1. CustomAssessmentAutomationRequestProperties +1. CustomAssessmentAutomationsClient +1. CustomAssessmentAutomationsListResult +1. CustomAssessmentAutomationsListResultIterator +1. CustomAssessmentAutomationsListResultPage +1. CustomEntityStoreAssignment +1. CustomEntityStoreAssignmentProperties +1. CustomEntityStoreAssignmentRequest +1. CustomEntityStoreAssignmentRequestProperties +1. CustomEntityStoreAssignmentsClient +1. CustomEntityStoreAssignmentsListResult +1. CustomEntityStoreAssignmentsListResultIterator +1. CustomEntityStoreAssignmentsListResultPage +1. DefenderForContainersAwsOffering +1. DefenderForContainersAwsOfferingCloudWatchToKinesis +1. DefenderForContainersAwsOfferingKinesisToS3 +1. DefenderForContainersAwsOfferingKubernetesScubaReader +1. DefenderForContainersAwsOfferingKubernetesService +1. DefenderForContainersGcpOffering +1. DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection +1. DefenderForContainersGcpOfferingNativeCloudConnection +1. DefenderForServersAwsOffering +1. DefenderForServersAwsOfferingArcAutoProvisioning +1. DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata +1. DefenderForServersAwsOfferingDefenderForServers +1. DefenderForServersAwsOfferingMdeAutoProvisioning +1. DefenderForServersAwsOfferingSubPlan +1. DefenderForServersAwsOfferingVaAutoProvisioning +1. DefenderForServersAwsOfferingVaAutoProvisioningConfiguration +1. DefenderForServersGcpOffering +1. DefenderForServersGcpOfferingArcAutoProvisioning +1. DefenderForServersGcpOfferingArcAutoProvisioningConfiguration +1. DefenderForServersGcpOfferingDefenderForServers +1. DefenderForServersGcpOfferingMdeAutoProvisioning +1. DefenderForServersGcpOfferingSubPlan +1. DefenderForServersGcpOfferingVaAutoProvisioning +1. DefenderForServersGcpOfferingVaAutoProvisioningConfiguration +1. EnvironmentData +1. ErrorAdditionalInfo +1. GcpOrganizationalData +1. GcpOrganizationalDataMember +1. GcpOrganizationalDataOrganization +1. GcpProjectDetails +1. GcpProjectEnvironmentData +1. GithubScopeEnvironmentData +1. InformationProtectionAwsOffering +1. InformationProtectionAwsOfferingInformationProtection +1. IngestionConnectionString +1. IngestionSetting +1. IngestionSettingList +1. IngestionSettingListIterator +1. IngestionSettingListPage +1. IngestionSettingToken +1. IngestionSettingsClient +1. MdeOnboardingData +1. MdeOnboardingDataList +1. MdeOnboardingDataProperties +1. MdeOnboardingsClient +1. SettingModel +1. Software +1. SoftwareInventoriesClient +1. SoftwareProperties +1. SoftwaresList +1. SoftwaresListIterator +1. SoftwaresListPage +1. SystemData + +#### New Struct Fields + +1. CloudErrorBody.AdditionalInfo +1. CloudErrorBody.Details +1. CloudErrorBody.Target diff --git a/services/preview/security/mgmt/v1.0/security/_meta.json b/services/preview/security/mgmt/v1.0/security/_meta.json index 617478795b32..6d275d6c1742 100644 --- a/services/preview/security/mgmt/v1.0/security/_meta.json +++ b/services/preview/security/mgmt/v1.0/security/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "1fcd59731c6317078adb20e3cb954e073ab2de40", "readme": "/_/azure-rest-api-specs/specification/security/resource-manager/readme.md", "tag": "package-composite-v1", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/security/mgmt/v1.0/security/adaptiveapplicationcontrols.go b/services/preview/security/mgmt/v1.0/security/adaptiveapplicationcontrols.go index 104e40be78d8..77207c193667 100644 --- a/services/preview/security/mgmt/v1.0/security/adaptiveapplicationcontrols.go +++ b/services/preview/security/mgmt/v1.0/security/adaptiveapplicationcontrols.go @@ -21,21 +21,23 @@ type AdaptiveApplicationControlsClient struct { } // NewAdaptiveApplicationControlsClient creates an instance of the AdaptiveApplicationControlsClient client. -func NewAdaptiveApplicationControlsClient(subscriptionID string, ascLocation string) AdaptiveApplicationControlsClient { - return NewAdaptiveApplicationControlsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAdaptiveApplicationControlsClient(subscriptionID string) AdaptiveApplicationControlsClient { + return NewAdaptiveApplicationControlsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAdaptiveApplicationControlsClientWithBaseURI creates an instance of the AdaptiveApplicationControlsClient 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 NewAdaptiveApplicationControlsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AdaptiveApplicationControlsClient { - return AdaptiveApplicationControlsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAdaptiveApplicationControlsClientWithBaseURI(baseURI string, subscriptionID string) AdaptiveApplicationControlsClient { + return AdaptiveApplicationControlsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Delete delete an application control VM/server group // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // groupName - name of an application control VM/server group -func (client AdaptiveApplicationControlsClient) Delete(ctx context.Context, groupName string) (result autorest.Response, err error) { +func (client AdaptiveApplicationControlsClient) Delete(ctx context.Context, ascLocation string, groupName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveApplicationControlsClient.Delete") defer func() { @@ -52,7 +54,7 @@ func (client AdaptiveApplicationControlsClient) Delete(ctx context.Context, grou return result, validation.NewError("security.AdaptiveApplicationControlsClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, groupName) + req, err := client.DeletePreparer(ctx, ascLocation, groupName) if err != nil { err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Delete", nil, "Failure preparing request") return @@ -75,9 +77,9 @@ func (client AdaptiveApplicationControlsClient) Delete(ctx context.Context, grou } // DeletePreparer prepares the Delete request. -func (client AdaptiveApplicationControlsClient) DeletePreparer(ctx context.Context, groupName string) (*http.Request, error) { +func (client AdaptiveApplicationControlsClient) DeletePreparer(ctx context.Context, ascLocation string, groupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "groupName": autorest.Encode("path", groupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -114,8 +116,10 @@ func (client AdaptiveApplicationControlsClient) DeleteResponder(resp *http.Respo // Get gets an application control VM/server group. // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // groupName - name of an application control VM/server group -func (client AdaptiveApplicationControlsClient) Get(ctx context.Context, groupName string) (result AppWhitelistingGroup, err error) { +func (client AdaptiveApplicationControlsClient) Get(ctx context.Context, ascLocation string, groupName string) (result AppWhitelistingGroup, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveApplicationControlsClient.Get") defer func() { @@ -132,7 +136,7 @@ func (client AdaptiveApplicationControlsClient) Get(ctx context.Context, groupNa return result, validation.NewError("security.AdaptiveApplicationControlsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, groupName) + req, err := client.GetPreparer(ctx, ascLocation, groupName) if err != nil { err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Get", nil, "Failure preparing request") return @@ -155,9 +159,9 @@ func (client AdaptiveApplicationControlsClient) Get(ctx context.Context, groupNa } // GetPreparer prepares the Get request. -func (client AdaptiveApplicationControlsClient) GetPreparer(ctx context.Context, groupName string) (*http.Request, error) { +func (client AdaptiveApplicationControlsClient) GetPreparer(ctx context.Context, ascLocation string, groupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "groupName": autorest.Encode("path", groupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -281,9 +285,11 @@ func (client AdaptiveApplicationControlsClient) ListResponder(resp *http.Respons // Put update an application control VM/server group // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // groupName - name of an application control VM/server group // body - the updated VM/server group data -func (client AdaptiveApplicationControlsClient) Put(ctx context.Context, groupName string, body AppWhitelistingPutGroupData) (result AppWhitelistingGroup, err error) { +func (client AdaptiveApplicationControlsClient) Put(ctx context.Context, ascLocation string, groupName string, body AppWhitelistingPutGroupData) (result AppWhitelistingGroup, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveApplicationControlsClient.Put") defer func() { @@ -300,7 +306,7 @@ func (client AdaptiveApplicationControlsClient) Put(ctx context.Context, groupNa return result, validation.NewError("security.AdaptiveApplicationControlsClient", "Put", err.Error()) } - req, err := client.PutPreparer(ctx, groupName, body) + req, err := client.PutPreparer(ctx, ascLocation, groupName, body) if err != nil { err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Put", nil, "Failure preparing request") return @@ -323,9 +329,9 @@ func (client AdaptiveApplicationControlsClient) Put(ctx context.Context, groupNa } // PutPreparer prepares the Put request. -func (client AdaptiveApplicationControlsClient) PutPreparer(ctx context.Context, groupName string, body AppWhitelistingPutGroupData) (*http.Request, error) { +func (client AdaptiveApplicationControlsClient) PutPreparer(ctx context.Context, ascLocation string, groupName string, body AppWhitelistingPutGroupData) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "groupName": autorest.Encode("path", groupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } diff --git a/services/preview/security/mgmt/v1.0/security/adaptivenetworkhardenings.go b/services/preview/security/mgmt/v1.0/security/adaptivenetworkhardenings.go index 8ba5351c1e7b..58e967ea0c5c 100644 --- a/services/preview/security/mgmt/v1.0/security/adaptivenetworkhardenings.go +++ b/services/preview/security/mgmt/v1.0/security/adaptivenetworkhardenings.go @@ -21,15 +21,15 @@ type AdaptiveNetworkHardeningsClient struct { } // NewAdaptiveNetworkHardeningsClient creates an instance of the AdaptiveNetworkHardeningsClient client. -func NewAdaptiveNetworkHardeningsClient(subscriptionID string, ascLocation string) AdaptiveNetworkHardeningsClient { - return NewAdaptiveNetworkHardeningsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAdaptiveNetworkHardeningsClient(subscriptionID string) AdaptiveNetworkHardeningsClient { + return NewAdaptiveNetworkHardeningsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAdaptiveNetworkHardeningsClientWithBaseURI creates an instance of the AdaptiveNetworkHardeningsClient 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 NewAdaptiveNetworkHardeningsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AdaptiveNetworkHardeningsClient { - return AdaptiveNetworkHardeningsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAdaptiveNetworkHardeningsClientWithBaseURI(baseURI string, subscriptionID string) AdaptiveNetworkHardeningsClient { + return AdaptiveNetworkHardeningsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Enforce enforces the given rules on the NSG(s) listed in the request diff --git a/services/preview/security/mgmt/v1.0/security/advancedthreatprotection.go b/services/preview/security/mgmt/v1.0/security/advancedthreatprotection.go index 0e6c537e4376..2c2131dd6167 100644 --- a/services/preview/security/mgmt/v1.0/security/advancedthreatprotection.go +++ b/services/preview/security/mgmt/v1.0/security/advancedthreatprotection.go @@ -20,15 +20,15 @@ type AdvancedThreatProtectionClient struct { } // NewAdvancedThreatProtectionClient creates an instance of the AdvancedThreatProtectionClient client. -func NewAdvancedThreatProtectionClient(subscriptionID string, ascLocation string) AdvancedThreatProtectionClient { - return NewAdvancedThreatProtectionClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAdvancedThreatProtectionClient(subscriptionID string) AdvancedThreatProtectionClient { + return NewAdvancedThreatProtectionClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAdvancedThreatProtectionClientWithBaseURI creates an instance of the AdvancedThreatProtectionClient 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 NewAdvancedThreatProtectionClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AdvancedThreatProtectionClient { - return AdvancedThreatProtectionClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAdvancedThreatProtectionClientWithBaseURI(baseURI string, subscriptionID string) AdvancedThreatProtectionClient { + return AdvancedThreatProtectionClient{NewWithBaseURI(baseURI, subscriptionID)} } // Create creates or updates the Advanced Threat Protection settings on a specified resource. diff --git a/services/preview/security/mgmt/v1.0/security/alerts.go b/services/preview/security/mgmt/v1.0/security/alerts.go index ae564bcae08a..bd4d6b5e5f4f 100644 --- a/services/preview/security/mgmt/v1.0/security/alerts.go +++ b/services/preview/security/mgmt/v1.0/security/alerts.go @@ -21,22 +21,24 @@ type AlertsClient struct { } // NewAlertsClient creates an instance of the AlertsClient client. -func NewAlertsClient(subscriptionID string, ascLocation string) AlertsClient { - return NewAlertsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAlertsClient(subscriptionID string) AlertsClient { + return NewAlertsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAlertsClientWithBaseURI creates an instance of the AlertsClient 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 NewAlertsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AlertsClient { - return AlertsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAlertsClientWithBaseURI(baseURI string, subscriptionID string) AlertsClient { + return AlertsClient{NewWithBaseURI(baseURI, subscriptionID)} } // GetResourceGroupLevelAlerts get an alert that is associated a resource group or a resource in a resource group // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // 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) GetResourceGroupLevelAlerts(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (result Alert, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.GetResourceGroupLevelAlerts") defer func() { @@ -57,7 +59,7 @@ func (client AlertsClient) GetResourceGroupLevelAlerts(ctx context.Context, aler return result, validation.NewError("security.AlertsClient", "GetResourceGroupLevelAlerts", err.Error()) } - req, err := client.GetResourceGroupLevelAlertsPreparer(ctx, alertName, resourceGroupName) + req, err := client.GetResourceGroupLevelAlertsPreparer(ctx, ascLocation, alertName, resourceGroupName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetResourceGroupLevelAlerts", nil, "Failure preparing request") return @@ -80,10 +82,10 @@ func (client AlertsClient) GetResourceGroupLevelAlerts(ctx context.Context, aler } // GetResourceGroupLevelAlertsPreparer prepares the GetResourceGroupLevelAlerts request. -func (client AlertsClient) GetResourceGroupLevelAlertsPreparer(ctx context.Context, alertName string, resourceGroupName string) (*http.Request, error) { +func (client AlertsClient) GetResourceGroupLevelAlertsPreparer(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -121,8 +123,10 @@ func (client AlertsClient) GetResourceGroupLevelAlertsResponder(resp *http.Respo // GetSubscriptionLevelAlert get an alert that is associated with a subscription // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // alertName - name of the alert object -func (client AlertsClient) GetSubscriptionLevelAlert(ctx context.Context, alertName string) (result Alert, err error) { +func (client AlertsClient) GetSubscriptionLevelAlert(ctx context.Context, ascLocation string, alertName string) (result Alert, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.GetSubscriptionLevelAlert") defer func() { @@ -139,7 +143,7 @@ func (client AlertsClient) GetSubscriptionLevelAlert(ctx context.Context, alertN return result, validation.NewError("security.AlertsClient", "GetSubscriptionLevelAlert", err.Error()) } - req, err := client.GetSubscriptionLevelAlertPreparer(ctx, alertName) + req, err := client.GetSubscriptionLevelAlertPreparer(ctx, ascLocation, alertName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetSubscriptionLevelAlert", nil, "Failure preparing request") return @@ -162,10 +166,10 @@ func (client AlertsClient) GetSubscriptionLevelAlert(ctx context.Context, alertN } // GetSubscriptionLevelAlertPreparer prepares the GetSubscriptionLevelAlert request. -func (client AlertsClient) GetSubscriptionLevelAlertPreparer(ctx context.Context, alertName string) (*http.Request, error) { +func (client AlertsClient) GetSubscriptionLevelAlertPreparer(ctx context.Context, ascLocation string, alertName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -474,12 +478,14 @@ func (client AlertsClient) ListByResourceGroupComplete(ctx context.Context, reso // ListResourceGroupLevelAlertsByRegion list all the alerts that are associated with the resource group that are stored // in a specific location // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. // filter - oData filter. Optional. // selectParameter - oData select. Optional. // expand - oData expand. Optional. -func (client AlertsClient) ListResourceGroupLevelAlertsByRegion(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (result AlertListPage, err error) { +func (client AlertsClient) ListResourceGroupLevelAlertsByRegion(ctx context.Context, ascLocation string, resourceGroupName string, filter string, selectParameter string, expand string) (result AlertListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListResourceGroupLevelAlertsByRegion") defer func() { @@ -501,7 +507,7 @@ func (client AlertsClient) ListResourceGroupLevelAlertsByRegion(ctx context.Cont } result.fn = client.listResourceGroupLevelAlertsByRegionNextResults - req, err := client.ListResourceGroupLevelAlertsByRegionPreparer(ctx, resourceGroupName, filter, selectParameter, expand) + req, err := client.ListResourceGroupLevelAlertsByRegionPreparer(ctx, ascLocation, resourceGroupName, filter, selectParameter, expand) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListResourceGroupLevelAlertsByRegion", nil, "Failure preparing request") return @@ -528,9 +534,9 @@ func (client AlertsClient) ListResourceGroupLevelAlertsByRegion(ctx context.Cont } // ListResourceGroupLevelAlertsByRegionPreparer prepares the ListResourceGroupLevelAlertsByRegion request. -func (client AlertsClient) ListResourceGroupLevelAlertsByRegionPreparer(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (*http.Request, error) { +func (client AlertsClient) ListResourceGroupLevelAlertsByRegionPreparer(ctx context.Context, ascLocation string, resourceGroupName string, filter string, selectParameter string, expand string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -597,7 +603,7 @@ func (client AlertsClient) listResourceGroupLevelAlertsByRegionNextResults(ctx c } // ListResourceGroupLevelAlertsByRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AlertsClient) ListResourceGroupLevelAlertsByRegionComplete(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (result AlertListIterator, err error) { +func (client AlertsClient) ListResourceGroupLevelAlertsByRegionComplete(ctx context.Context, ascLocation string, resourceGroupName string, filter string, selectParameter string, expand string) (result AlertListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListResourceGroupLevelAlertsByRegion") defer func() { @@ -608,17 +614,19 @@ func (client AlertsClient) ListResourceGroupLevelAlertsByRegionComplete(ctx cont tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListResourceGroupLevelAlertsByRegion(ctx, resourceGroupName, filter, selectParameter, expand) + result.page, err = client.ListResourceGroupLevelAlertsByRegion(ctx, ascLocation, resourceGroupName, filter, selectParameter, expand) return } // ListSubscriptionLevelAlertsByRegion list all the alerts that are associated with the subscription that are stored in // a specific location // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // filter - oData filter. Optional. // selectParameter - oData select. Optional. // expand - oData expand. Optional. -func (client AlertsClient) ListSubscriptionLevelAlertsByRegion(ctx context.Context, filter string, selectParameter string, expand string) (result AlertListPage, err error) { +func (client AlertsClient) ListSubscriptionLevelAlertsByRegion(ctx context.Context, ascLocation string, filter string, selectParameter string, expand string) (result AlertListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListSubscriptionLevelAlertsByRegion") defer func() { @@ -636,7 +644,7 @@ func (client AlertsClient) ListSubscriptionLevelAlertsByRegion(ctx context.Conte } result.fn = client.listSubscriptionLevelAlertsByRegionNextResults - req, err := client.ListSubscriptionLevelAlertsByRegionPreparer(ctx, filter, selectParameter, expand) + req, err := client.ListSubscriptionLevelAlertsByRegionPreparer(ctx, ascLocation, filter, selectParameter, expand) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListSubscriptionLevelAlertsByRegion", nil, "Failure preparing request") return @@ -663,9 +671,9 @@ func (client AlertsClient) ListSubscriptionLevelAlertsByRegion(ctx context.Conte } // ListSubscriptionLevelAlertsByRegionPreparer prepares the ListSubscriptionLevelAlertsByRegion request. -func (client AlertsClient) ListSubscriptionLevelAlertsByRegionPreparer(ctx context.Context, filter string, selectParameter string, expand string) (*http.Request, error) { +func (client AlertsClient) ListSubscriptionLevelAlertsByRegionPreparer(ctx context.Context, ascLocation string, filter string, selectParameter string, expand string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -731,7 +739,7 @@ func (client AlertsClient) listSubscriptionLevelAlertsByRegionNextResults(ctx co } // ListSubscriptionLevelAlertsByRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AlertsClient) ListSubscriptionLevelAlertsByRegionComplete(ctx context.Context, filter string, selectParameter string, expand string) (result AlertListIterator, err error) { +func (client AlertsClient) ListSubscriptionLevelAlertsByRegionComplete(ctx context.Context, ascLocation string, filter string, selectParameter string, expand string) (result AlertListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListSubscriptionLevelAlertsByRegion") defer func() { @@ -742,16 +750,18 @@ func (client AlertsClient) ListSubscriptionLevelAlertsByRegionComplete(ctx conte tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListSubscriptionLevelAlertsByRegion(ctx, filter, selectParameter, expand) + result.page, err = client.ListSubscriptionLevelAlertsByRegion(ctx, ascLocation, filter, selectParameter, expand) return } // UpdateResourceGroupLevelAlertStateToDismiss update the alert's state // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // 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) UpdateResourceGroupLevelAlertStateToDismiss(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateResourceGroupLevelAlertStateToDismiss") defer func() { @@ -772,7 +782,7 @@ func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismiss(ctx conte return result, validation.NewError("security.AlertsClient", "UpdateResourceGroupLevelAlertStateToDismiss", err.Error()) } - req, err := client.UpdateResourceGroupLevelAlertStateToDismissPreparer(ctx, alertName, resourceGroupName) + req, err := client.UpdateResourceGroupLevelAlertStateToDismissPreparer(ctx, ascLocation, alertName, resourceGroupName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelAlertStateToDismiss", nil, "Failure preparing request") return @@ -795,10 +805,10 @@ func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismiss(ctx conte } // UpdateResourceGroupLevelAlertStateToDismissPreparer prepares the UpdateResourceGroupLevelAlertStateToDismiss request. -func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismissPreparer(ctx context.Context, alertName string, resourceGroupName string) (*http.Request, error) { +func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismissPreparer(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -835,10 +845,12 @@ func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismissResponder( // UpdateResourceGroupLevelAlertStateToReactivate update the alert's state // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // 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) UpdateResourceGroupLevelAlertStateToReactivate(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateResourceGroupLevelAlertStateToReactivate") defer func() { @@ -859,7 +871,7 @@ func (client AlertsClient) UpdateResourceGroupLevelAlertStateToReactivate(ctx co return result, validation.NewError("security.AlertsClient", "UpdateResourceGroupLevelAlertStateToReactivate", err.Error()) } - req, err := client.UpdateResourceGroupLevelAlertStateToReactivatePreparer(ctx, alertName, resourceGroupName) + req, err := client.UpdateResourceGroupLevelAlertStateToReactivatePreparer(ctx, ascLocation, alertName, resourceGroupName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelAlertStateToReactivate", nil, "Failure preparing request") return @@ -882,10 +894,10 @@ func (client AlertsClient) UpdateResourceGroupLevelAlertStateToReactivate(ctx co } // UpdateResourceGroupLevelAlertStateToReactivatePreparer prepares the UpdateResourceGroupLevelAlertStateToReactivate request. -func (client AlertsClient) UpdateResourceGroupLevelAlertStateToReactivatePreparer(ctx context.Context, alertName string, resourceGroupName string) (*http.Request, error) { +func (client AlertsClient) UpdateResourceGroupLevelAlertStateToReactivatePreparer(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -922,8 +934,10 @@ func (client AlertsClient) UpdateResourceGroupLevelAlertStateToReactivateRespond // UpdateSubscriptionLevelAlertStateToDismiss update the alert's state // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // alertName - name of the alert object -func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismiss(ctx context.Context, alertName string) (result autorest.Response, err error) { +func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismiss(ctx context.Context, ascLocation string, alertName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateSubscriptionLevelAlertStateToDismiss") defer func() { @@ -940,7 +954,7 @@ func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismiss(ctx contex return result, validation.NewError("security.AlertsClient", "UpdateSubscriptionLevelAlertStateToDismiss", err.Error()) } - req, err := client.UpdateSubscriptionLevelAlertStateToDismissPreparer(ctx, alertName) + req, err := client.UpdateSubscriptionLevelAlertStateToDismissPreparer(ctx, ascLocation, alertName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelAlertStateToDismiss", nil, "Failure preparing request") return @@ -963,10 +977,10 @@ func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismiss(ctx contex } // UpdateSubscriptionLevelAlertStateToDismissPreparer prepares the UpdateSubscriptionLevelAlertStateToDismiss request. -func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismissPreparer(ctx context.Context, alertName string) (*http.Request, error) { +func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismissPreparer(ctx context.Context, ascLocation string, alertName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -1002,8 +1016,10 @@ func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismissResponder(r // UpdateSubscriptionLevelAlertStateToReactivate update the alert's state // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // alertName - name of the alert object -func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivate(ctx context.Context, alertName string) (result autorest.Response, err error) { +func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivate(ctx context.Context, ascLocation string, alertName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateSubscriptionLevelAlertStateToReactivate") defer func() { @@ -1020,7 +1036,7 @@ func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivate(ctx con return result, validation.NewError("security.AlertsClient", "UpdateSubscriptionLevelAlertStateToReactivate", err.Error()) } - req, err := client.UpdateSubscriptionLevelAlertStateToReactivatePreparer(ctx, alertName) + req, err := client.UpdateSubscriptionLevelAlertStateToReactivatePreparer(ctx, ascLocation, alertName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelAlertStateToReactivate", nil, "Failure preparing request") return @@ -1043,10 +1059,10 @@ func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivate(ctx con } // UpdateSubscriptionLevelAlertStateToReactivatePreparer prepares the UpdateSubscriptionLevelAlertStateToReactivate request. -func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivatePreparer(ctx context.Context, alertName string) (*http.Request, error) { +func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivatePreparer(ctx context.Context, ascLocation string, alertName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } diff --git a/services/preview/security/mgmt/v1.0/security/alertssuppressionrules.go b/services/preview/security/mgmt/v1.0/security/alertssuppressionrules.go index 6b7c70e4f188..4ff181fc65c9 100644 --- a/services/preview/security/mgmt/v1.0/security/alertssuppressionrules.go +++ b/services/preview/security/mgmt/v1.0/security/alertssuppressionrules.go @@ -21,15 +21,15 @@ type AlertsSuppressionRulesClient struct { } // NewAlertsSuppressionRulesClient creates an instance of the AlertsSuppressionRulesClient client. -func NewAlertsSuppressionRulesClient(subscriptionID string, ascLocation string) AlertsSuppressionRulesClient { - return NewAlertsSuppressionRulesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAlertsSuppressionRulesClient(subscriptionID string) AlertsSuppressionRulesClient { + return NewAlertsSuppressionRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAlertsSuppressionRulesClientWithBaseURI creates an instance of the AlertsSuppressionRulesClient 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 NewAlertsSuppressionRulesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AlertsSuppressionRulesClient { - return AlertsSuppressionRulesClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAlertsSuppressionRulesClientWithBaseURI(baseURI string, subscriptionID string) AlertsSuppressionRulesClient { + return AlertsSuppressionRulesClient{NewWithBaseURI(baseURI, subscriptionID)} } // Delete delete dismiss alert rule for this subscription. diff --git a/services/preview/security/mgmt/v1.0/security/allowedconnections.go b/services/preview/security/mgmt/v1.0/security/allowedconnections.go index c735ef352802..98e01ff8d5fc 100644 --- a/services/preview/security/mgmt/v1.0/security/allowedconnections.go +++ b/services/preview/security/mgmt/v1.0/security/allowedconnections.go @@ -21,15 +21,15 @@ type AllowedConnectionsClient struct { } // NewAllowedConnectionsClient creates an instance of the AllowedConnectionsClient client. -func NewAllowedConnectionsClient(subscriptionID string, ascLocation string) AllowedConnectionsClient { - return NewAllowedConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAllowedConnectionsClient(subscriptionID string) AllowedConnectionsClient { + return NewAllowedConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAllowedConnectionsClientWithBaseURI creates an instance of the AllowedConnectionsClient 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 NewAllowedConnectionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AllowedConnectionsClient { - return AllowedConnectionsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAllowedConnectionsClientWithBaseURI(baseURI string, subscriptionID string) AllowedConnectionsClient { + return AllowedConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets the list of all possible traffic between resources for the subscription and location, based on connection @@ -37,8 +37,10 @@ func NewAllowedConnectionsClientWithBaseURI(baseURI string, subscriptionID strin // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // connectionType - the type of allowed connections (Internal, External) -func (client AllowedConnectionsClient) Get(ctx context.Context, resourceGroupName string, connectionType ConnectionType) (result AllowedConnectionsResource, err error) { +func (client AllowedConnectionsClient) Get(ctx context.Context, resourceGroupName string, ascLocation string, connectionType ConnectionType) (result AllowedConnectionsResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AllowedConnectionsClient.Get") defer func() { @@ -59,7 +61,7 @@ func (client AllowedConnectionsClient) Get(ctx context.Context, resourceGroupNam return result, validation.NewError("security.AllowedConnectionsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, connectionType) + req, err := client.GetPreparer(ctx, resourceGroupName, ascLocation, connectionType) if err != nil { err = autorest.NewErrorWithError(err, "security.AllowedConnectionsClient", "Get", nil, "Failure preparing request") return @@ -82,9 +84,9 @@ func (client AllowedConnectionsClient) Get(ctx context.Context, resourceGroupNam } // GetPreparer prepares the Get request. -func (client AllowedConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, connectionType ConnectionType) (*http.Request, error) { +func (client AllowedConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, ascLocation string, connectionType ConnectionType) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "connectionType": autorest.Encode("path", connectionType), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -241,7 +243,10 @@ func (client AllowedConnectionsClient) ListComplete(ctx context.Context) (result } // ListByHomeRegion gets the list of all possible traffic between resources for the subscription and location. -func (client AllowedConnectionsClient) ListByHomeRegion(ctx context.Context) (result AllowedConnectionsListPage, err error) { +// Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations +func (client AllowedConnectionsClient) ListByHomeRegion(ctx context.Context, ascLocation string) (result AllowedConnectionsListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AllowedConnectionsClient.ListByHomeRegion") defer func() { @@ -259,7 +264,7 @@ func (client AllowedConnectionsClient) ListByHomeRegion(ctx context.Context) (re } result.fn = client.listByHomeRegionNextResults - req, err := client.ListByHomeRegionPreparer(ctx) + req, err := client.ListByHomeRegionPreparer(ctx, ascLocation) if err != nil { err = autorest.NewErrorWithError(err, "security.AllowedConnectionsClient", "ListByHomeRegion", nil, "Failure preparing request") return @@ -286,9 +291,9 @@ func (client AllowedConnectionsClient) ListByHomeRegion(ctx context.Context) (re } // ListByHomeRegionPreparer prepares the ListByHomeRegion request. -func (client AllowedConnectionsClient) ListByHomeRegionPreparer(ctx context.Context) (*http.Request, error) { +func (client AllowedConnectionsClient) ListByHomeRegionPreparer(ctx context.Context, ascLocation string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -345,7 +350,7 @@ func (client AllowedConnectionsClient) listByHomeRegionNextResults(ctx context.C } // ListByHomeRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AllowedConnectionsClient) ListByHomeRegionComplete(ctx context.Context) (result AllowedConnectionsListIterator, err error) { +func (client AllowedConnectionsClient) ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result AllowedConnectionsListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AllowedConnectionsClient.ListByHomeRegion") defer func() { @@ -356,6 +361,6 @@ func (client AllowedConnectionsClient) ListByHomeRegionComplete(ctx context.Cont tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByHomeRegion(ctx) + result.page, err = client.ListByHomeRegion(ctx, ascLocation) return } diff --git a/services/preview/security/mgmt/v1.0/security/automations.go b/services/preview/security/mgmt/v1.0/security/automations.go index e7011a9534d3..1a586996bcaf 100644 --- a/services/preview/security/mgmt/v1.0/security/automations.go +++ b/services/preview/security/mgmt/v1.0/security/automations.go @@ -21,14 +21,14 @@ type AutomationsClient struct { } // NewAutomationsClient creates an instance of the AutomationsClient client. -func NewAutomationsClient(subscriptionID string, ascLocation string) AutomationsClient { - return NewAutomationsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAutomationsClient(subscriptionID string) AutomationsClient { + return NewAutomationsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAutomationsClientWithBaseURI creates an instance of the AutomationsClient 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 NewAutomationsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AutomationsClient { - return AutomationsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAutomationsClientWithBaseURI(baseURI string, subscriptionID string) AutomationsClient { + return AutomationsClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate creates or updates a security automation. If a security automation is already created and a diff --git a/services/preview/security/mgmt/v1.0/security/autoprovisioningsettings.go b/services/preview/security/mgmt/v1.0/security/autoprovisioningsettings.go index 0fed155d0347..5abc636c42ab 100644 --- a/services/preview/security/mgmt/v1.0/security/autoprovisioningsettings.go +++ b/services/preview/security/mgmt/v1.0/security/autoprovisioningsettings.go @@ -21,15 +21,15 @@ type AutoProvisioningSettingsClient struct { } // NewAutoProvisioningSettingsClient creates an instance of the AutoProvisioningSettingsClient client. -func NewAutoProvisioningSettingsClient(subscriptionID string, ascLocation string) AutoProvisioningSettingsClient { - return NewAutoProvisioningSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAutoProvisioningSettingsClient(subscriptionID string) AutoProvisioningSettingsClient { + return NewAutoProvisioningSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAutoProvisioningSettingsClientWithBaseURI creates an instance of the AutoProvisioningSettingsClient 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 NewAutoProvisioningSettingsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AutoProvisioningSettingsClient { - return AutoProvisioningSettingsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAutoProvisioningSettingsClientWithBaseURI(baseURI string, subscriptionID string) AutoProvisioningSettingsClient { + return AutoProvisioningSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Create details of a specific setting diff --git a/services/preview/security/mgmt/v1.0/security/client.go b/services/preview/security/mgmt/v1.0/security/client.go index 586d9c1a0478..8d050f3fc301 100644 --- a/services/preview/security/mgmt/v1.0/security/client.go +++ b/services/preview/security/mgmt/v1.0/security/client.go @@ -23,21 +23,19 @@ type BaseClient struct { autorest.Client BaseURI string SubscriptionID string - AscLocation string } // New creates an instance of the BaseClient client. -func New(subscriptionID string, ascLocation string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) } // NewWithBaseURI creates an instance of the BaseClient 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 NewWithBaseURI(baseURI string, subscriptionID string, ascLocation string) BaseClient { +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return BaseClient{ Client: autorest.NewClientWithUserAgent(UserAgent()), BaseURI: baseURI, SubscriptionID: subscriptionID, - AscLocation: ascLocation, } } diff --git a/services/preview/security/mgmt/v1.0/security/compliances.go b/services/preview/security/mgmt/v1.0/security/compliances.go index 742bf3ad09b1..b5e7ad8314a3 100644 --- a/services/preview/security/mgmt/v1.0/security/compliances.go +++ b/services/preview/security/mgmt/v1.0/security/compliances.go @@ -20,14 +20,14 @@ type CompliancesClient struct { } // NewCompliancesClient creates an instance of the CompliancesClient client. -func NewCompliancesClient(subscriptionID string, ascLocation string) CompliancesClient { - return NewCompliancesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewCompliancesClient(subscriptionID string) CompliancesClient { + return NewCompliancesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewCompliancesClientWithBaseURI creates an instance of the CompliancesClient 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 NewCompliancesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) CompliancesClient { - return CompliancesClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewCompliancesClientWithBaseURI(baseURI string, subscriptionID string) CompliancesClient { + return CompliancesClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get details of a specific Compliance. diff --git a/services/preview/security/mgmt/v1.0/security/connectors.go b/services/preview/security/mgmt/v1.0/security/connectors.go index 0dd69473fe13..98516b4e7994 100644 --- a/services/preview/security/mgmt/v1.0/security/connectors.go +++ b/services/preview/security/mgmt/v1.0/security/connectors.go @@ -21,22 +21,24 @@ type ConnectorsClient struct { } // NewConnectorsClient creates an instance of the ConnectorsClient client. -func NewConnectorsClient(subscriptionID string, ascLocation string) ConnectorsClient { - return NewConnectorsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewConnectorsClient(subscriptionID string) ConnectorsClient { + return NewConnectorsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewConnectorsClientWithBaseURI creates an instance of the ConnectorsClient 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 NewConnectorsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) ConnectorsClient { - return ConnectorsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewConnectorsClientWithBaseURI(baseURI string, subscriptionID string) ConnectorsClient { + return ConnectorsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, -// use either account credentials or role-based authentication. For GCP, use account organization credentials. +// CreateOrUpdate creates or updates a security connector. If a security connector is already created and a subsequent +// request is issued for the same security connector id, then it will be updated. // Parameters: -// connectorName - name of the cloud account connector -// connectorSetting - settings for the cloud account connector -func (client ConnectorsClient) CreateOrUpdate(ctx context.Context, connectorName string, connectorSetting ConnectorSetting) (result ConnectorSetting, err error) { +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// securityConnectorName - the security connector name. +// securityConnector - the security connector resource +func (client ConnectorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector Connector) (result Connector, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsClient.CreateOrUpdate") defer func() { @@ -49,11 +51,15 @@ func (client ConnectorsClient) CreateOrUpdate(ctx context.Context, connectorName } 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 { + 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.ConnectorsClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, connectorName, connectorSetting) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, securityConnectorName, securityConnector) if err != nil { err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -76,23 +82,25 @@ func (client ConnectorsClient) CreateOrUpdate(ctx context.Context, connectorName } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ConnectorsClient) CreateOrUpdatePreparer(ctx context.Context, connectorName string, connectorSetting ConnectorSetting) (*http.Request, error) { +func (client ConnectorsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector Connector) (*http.Request, error) { pathParameters := map[string]interface{}{ - "connectorName": autorest.Encode("path", connectorName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "securityConnectorName": autorest.Encode("path", securityConnectorName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01-preview" + const APIVersion = "2021-12-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + securityConnector.SystemData = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}", pathParameters), - autorest.WithJSON(connectorSetting), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}", pathParameters), + autorest.WithJSON(securityConnector), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -105,20 +113,22 @@ func (client ConnectorsClient) CreateOrUpdateSender(req *http.Request) (*http.Re // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client ConnectorsClient) CreateOrUpdateResponder(resp *http.Response) (result ConnectorSetting, err error) { +func (client ConnectorsClient) CreateOrUpdateResponder(resp *http.Response) (result Connector, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// Delete delete a cloud account connector from a subscription +// Delete deletes a security connector. // Parameters: -// connectorName - name of the cloud account connector -func (client ConnectorsClient) Delete(ctx context.Context, connectorName string) (result autorest.Response, err error) { +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// securityConnectorName - the security connector name. +func (client ConnectorsClient) Delete(ctx context.Context, resourceGroupName string, securityConnectorName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsClient.Delete") defer func() { @@ -131,11 +141,15 @@ func (client ConnectorsClient) Delete(ctx context.Context, connectorName string) } 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 { + 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.ConnectorsClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, connectorName) + req, err := client.DeletePreparer(ctx, resourceGroupName, securityConnectorName) if err != nil { err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "Delete", nil, "Failure preparing request") return @@ -158,13 +172,14 @@ func (client ConnectorsClient) Delete(ctx context.Context, connectorName string) } // DeletePreparer prepares the Delete request. -func (client ConnectorsClient) DeletePreparer(ctx context.Context, connectorName string) (*http.Request, error) { +func (client ConnectorsClient) DeletePreparer(ctx context.Context, resourceGroupName string, securityConnectorName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "connectorName": autorest.Encode("path", connectorName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "securityConnectorName": autorest.Encode("path", securityConnectorName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01-preview" + const APIVersion = "2021-12-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -172,7 +187,7 @@ func (client ConnectorsClient) DeletePreparer(ctx context.Context, connectorName preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -194,10 +209,12 @@ func (client ConnectorsClient) DeleteResponder(resp *http.Response) (result auto return } -// Get details of a specific cloud account connector +// Get retrieves details of a specific security connector // Parameters: -// connectorName - name of the cloud account connector -func (client ConnectorsClient) Get(ctx context.Context, connectorName string) (result ConnectorSetting, err error) { +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// securityConnectorName - the security connector name. +func (client ConnectorsClient) Get(ctx context.Context, resourceGroupName string, securityConnectorName string) (result Connector, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsClient.Get") defer func() { @@ -210,11 +227,15 @@ func (client ConnectorsClient) Get(ctx context.Context, connectorName string) (r } 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 { + 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.ConnectorsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, connectorName) + req, err := client.GetPreparer(ctx, resourceGroupName, securityConnectorName) if err != nil { err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "Get", nil, "Failure preparing request") return @@ -237,13 +258,14 @@ func (client ConnectorsClient) Get(ctx context.Context, connectorName string) (r } // GetPreparer prepares the Get request. -func (client ConnectorsClient) GetPreparer(ctx context.Context, connectorName string) (*http.Request, error) { +func (client ConnectorsClient) GetPreparer(ctx context.Context, resourceGroupName string, securityConnectorName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "connectorName": autorest.Encode("path", connectorName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "securityConnectorName": autorest.Encode("path", securityConnectorName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01-preview" + const APIVersion = "2021-12-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -251,7 +273,7 @@ func (client ConnectorsClient) GetPreparer(ctx context.Context, connectorName st preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -264,7 +286,7 @@ func (client ConnectorsClient) GetSender(req *http.Request) (*http.Response, err // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client ConnectorsClient) GetResponder(resp *http.Response) (result ConnectorSetting, err error) { +func (client ConnectorsClient) GetResponder(resp *http.Response) (result Connector, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -274,14 +296,15 @@ func (client ConnectorsClient) GetResponder(resp *http.Response) (result Connect return } -// List cloud accounts connectors of a subscription -func (client ConnectorsClient) List(ctx context.Context) (result ConnectorSettingListPage, err error) { +// List lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to +// get the next page of security connectors for the specified subscription. +func (client ConnectorsClient) List(ctx context.Context) (result ConnectorsListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsClient.List") defer func() { sc := -1 - if result.csl.Response.Response != nil { - sc = result.csl.Response.Response.StatusCode + if result.cl.Response.Response != nil { + sc = result.cl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -301,17 +324,17 @@ func (client ConnectorsClient) List(ctx context.Context) (result ConnectorSettin resp, err := client.ListSender(req) if err != nil { - result.csl.Response = autorest.Response{Response: resp} + result.cl.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "List", resp, "Failure sending request") return } - result.csl, err = client.ListResponder(resp) + result.cl, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "List", resp, "Failure responding to request") return } - if result.csl.hasNextLink() && result.csl.IsEmpty() { + if result.cl.hasNextLink() && result.cl.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -325,7 +348,7 @@ func (client ConnectorsClient) ListPreparer(ctx context.Context) (*http.Request, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01-preview" + const APIVersion = "2021-12-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -333,7 +356,7 @@ func (client ConnectorsClient) ListPreparer(ctx context.Context) (*http.Request, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityConnectors", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -346,7 +369,7 @@ func (client ConnectorsClient) ListSender(req *http.Request) (*http.Response, er // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client ConnectorsClient) ListResponder(resp *http.Response) (result ConnectorSettingList, err error) { +func (client ConnectorsClient) ListResponder(resp *http.Response) (result ConnectorsList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -357,8 +380,8 @@ func (client ConnectorsClient) ListResponder(resp *http.Response) (result Connec } // listNextResults retrieves the next set of results, if any. -func (client ConnectorsClient) listNextResults(ctx context.Context, lastResults ConnectorSettingList) (result ConnectorSettingList, err error) { - req, err := lastResults.connectorSettingListPreparer(ctx) +func (client ConnectorsClient) listNextResults(ctx context.Context, lastResults ConnectorsList) (result ConnectorsList, err error) { + req, err := lastResults.connectorsListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "security.ConnectorsClient", "listNextResults", nil, "Failure preparing next results request") } @@ -378,7 +401,7 @@ func (client ConnectorsClient) listNextResults(ctx context.Context, lastResults } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ConnectorsClient) ListComplete(ctx context.Context) (result ConnectorSettingListIterator, err error) { +func (client ConnectorsClient) ListComplete(ctx context.Context) (result ConnectorsListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsClient.List") defer func() { @@ -392,3 +415,222 @@ func (client ConnectorsClient) ListComplete(ctx context.Context) (result Connect result.page, err = client.List(ctx) return } + +// ListByResourceGroup lists all the security connectors in the specified resource group. Use the 'nextLink' property +// in the response to get the next page of security connectors for the specified resource group. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +func (client ConnectorsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ConnectorsListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.cl.Response.Response != nil { + sc = result.cl.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.ConnectorsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.cl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.cl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.cl.hasNextLink() && result.cl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ConnectorsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-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/Microsoft.Security/securityConnectors", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectorsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client ConnectorsClient) ListByResourceGroupResponder(resp *http.Response) (result ConnectorsList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client ConnectorsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ConnectorsList) (result ConnectorsList, err error) { + req, err := lastResults.connectorsListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.ConnectorsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.ConnectorsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ConnectorsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ConnectorsListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsClient.ListByResourceGroup") + 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.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// Update updates a security connector +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// securityConnectorName - the security connector name. +// securityConnector - the security connector resource +func (client ConnectorsClient) Update(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector Connector) (result Connector, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsClient.Update") + 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.ConnectorsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, securityConnectorName, securityConnector) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ConnectorsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector Connector) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "securityConnectorName": autorest.Encode("path", securityConnectorName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + securityConnector.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}", pathParameters), + autorest.WithJSON(securityConnector), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectorsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ConnectorsClient) UpdateResponder(resp *http.Response) (result Connector, 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/services/preview/security/mgmt/v1.0/security/connectorsgroup.go b/services/preview/security/mgmt/v1.0/security/connectorsgroup.go new file mode 100644 index 000000000000..945b763e3943 --- /dev/null +++ b/services/preview/security/mgmt/v1.0/security/connectorsgroup.go @@ -0,0 +1,394 @@ +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" +) + +// ConnectorsGroupClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type ConnectorsGroupClient struct { + BaseClient +} + +// NewConnectorsGroupClient creates an instance of the ConnectorsGroupClient client. +func NewConnectorsGroupClient(subscriptionID string) ConnectorsGroupClient { + return NewConnectorsGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewConnectorsGroupClientWithBaseURI creates an instance of the ConnectorsGroupClient 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 NewConnectorsGroupClientWithBaseURI(baseURI string, subscriptionID string) ConnectorsGroupClient { + return ConnectorsGroupClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, +// use either account credentials or role-based authentication. For GCP, use account organization credentials. +// Parameters: +// connectorName - name of the cloud account connector +// connectorSetting - settings for the cloud account connector +func (client ConnectorsGroupClient) CreateOrUpdate(ctx context.Context, connectorName string, connectorSetting ConnectorSetting) (result ConnectorSetting, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsGroupClient.CreateOrUpdate") + 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.ConnectorsGroupClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, connectorName, connectorSetting) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ConnectorsGroupClient) CreateOrUpdatePreparer(ctx context.Context, connectorName string, connectorSetting ConnectorSetting) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "connectorName": autorest.Encode("path", connectorName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01-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/connectors/{connectorName}", pathParameters), + autorest.WithJSON(connectorSetting), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectorsGroupClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ConnectorsGroupClient) CreateOrUpdateResponder(resp *http.Response) (result ConnectorSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a cloud account connector from a subscription +// Parameters: +// connectorName - name of the cloud account connector +func (client ConnectorsGroupClient) Delete(ctx context.Context, connectorName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsGroupClient.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.ConnectorsGroupClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, connectorName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ConnectorsGroupClient) DeletePreparer(ctx context.Context, connectorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "connectorName": autorest.Encode("path", connectorName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}", 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 ConnectorsGroupClient) 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 ConnectorsGroupClient) 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 details of a specific cloud account connector +// Parameters: +// connectorName - name of the cloud account connector +func (client ConnectorsGroupClient) Get(ctx context.Context, connectorName string) (result ConnectorSetting, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsGroupClient.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.ConnectorsGroupClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, connectorName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "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.ConnectorsGroupClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ConnectorsGroupClient) GetPreparer(ctx context.Context, connectorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "connectorName": autorest.Encode("path", connectorName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-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/connectors/{connectorName}", 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 ConnectorsGroupClient) 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 ConnectorsGroupClient) GetResponder(resp *http.Response) (result ConnectorSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List cloud accounts connectors of a subscription +func (client ConnectorsGroupClient) List(ctx context.Context) (result ConnectorSettingListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsGroupClient.List") + defer func() { + sc := -1 + if result.csl.Response.Response != nil { + sc = result.csl.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.ConnectorsGroupClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.csl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "List", resp, "Failure sending request") + return + } + + result.csl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "List", resp, "Failure responding to request") + return + } + if result.csl.hasNextLink() && result.csl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ConnectorsGroupClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-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/connectors", 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 ConnectorsGroupClient) 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 ConnectorsGroupClient) ListResponder(resp *http.Response) (result ConnectorSettingList, 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 ConnectorsGroupClient) listNextResults(ctx context.Context, lastResults ConnectorSettingList) (result ConnectorSettingList, err error) { + req, err := lastResults.connectorSettingListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "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.ConnectorsGroupClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ConnectorsGroupClient) ListComplete(ctx context.Context) (result ConnectorSettingListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsGroupClient.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 +} diff --git a/services/preview/security/mgmt/v1.0/security/contacts.go b/services/preview/security/mgmt/v1.0/security/contacts.go index ccadbb870f93..6a36aef82c4f 100644 --- a/services/preview/security/mgmt/v1.0/security/contacts.go +++ b/services/preview/security/mgmt/v1.0/security/contacts.go @@ -21,14 +21,14 @@ type ContactsClient struct { } // NewContactsClient creates an instance of the ContactsClient client. -func NewContactsClient(subscriptionID string, ascLocation string) ContactsClient { - return NewContactsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewContactsClient(subscriptionID string) ContactsClient { + return NewContactsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewContactsClientWithBaseURI creates an instance of the ContactsClient 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 NewContactsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) ContactsClient { - return ContactsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewContactsClientWithBaseURI(baseURI string, subscriptionID string) ContactsClient { + return ContactsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Create security contact configurations for the subscription diff --git a/services/preview/security/mgmt/v1.0/security/customassessmentautomations.go b/services/preview/security/mgmt/v1.0/security/customassessmentautomations.go new file mode 100644 index 000000000000..178c8ec50cfb --- /dev/null +++ b/services/preview/security/mgmt/v1.0/security/customassessmentautomations.go @@ -0,0 +1,543 @@ +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" +) + +// CustomAssessmentAutomationsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type CustomAssessmentAutomationsClient struct { + BaseClient +} + +// NewCustomAssessmentAutomationsClient creates an instance of the CustomAssessmentAutomationsClient client. +func NewCustomAssessmentAutomationsClient(subscriptionID string) CustomAssessmentAutomationsClient { + return NewCustomAssessmentAutomationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCustomAssessmentAutomationsClientWithBaseURI creates an instance of the CustomAssessmentAutomationsClient 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 NewCustomAssessmentAutomationsClientWithBaseURI(baseURI string, subscriptionID string) CustomAssessmentAutomationsClient { + return CustomAssessmentAutomationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates or updates a custom assessment automation for the provided subscription. Please note that providing +// an existing custom assessment automation will replace the existing record. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// customAssessmentAutomationName - name of the Custom Assessment Automation. +// customAssessmentAutomationBody - custom Assessment Automation body +func (client CustomAssessmentAutomationsClient) Create(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string, customAssessmentAutomationBody CustomAssessmentAutomationRequest) (result CustomAssessmentAutomation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsClient.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}}}, + {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.CustomAssessmentAutomationsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, customAssessmentAutomationName, customAssessmentAutomationBody) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "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.CustomAssessmentAutomationsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client CustomAssessmentAutomationsClient) CreatePreparer(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string, customAssessmentAutomationBody CustomAssessmentAutomationRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customAssessmentAutomationName": autorest.Encode("path", customAssessmentAutomationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-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}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}", pathParameters), + autorest.WithJSON(customAssessmentAutomationBody), + 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 CustomAssessmentAutomationsClient) 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 CustomAssessmentAutomationsClient) CreateResponder(resp *http.Response) (result CustomAssessmentAutomation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a custom assessment automation by name for a provided subscription +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// customAssessmentAutomationName - name of the Custom Assessment Automation. +func (client CustomAssessmentAutomationsClient) Delete(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsClient.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}}}, + {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.CustomAssessmentAutomationsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, customAssessmentAutomationName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CustomAssessmentAutomationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customAssessmentAutomationName": autorest.Encode("path", customAssessmentAutomationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}", 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 CustomAssessmentAutomationsClient) 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 CustomAssessmentAutomationsClient) 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 gets a single custom assessment automation by name for the provided subscription and resource group. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// customAssessmentAutomationName - name of the Custom Assessment Automation. +func (client CustomAssessmentAutomationsClient) Get(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string) (result CustomAssessmentAutomation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsClient.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.CustomAssessmentAutomationsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, customAssessmentAutomationName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "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.CustomAssessmentAutomationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client CustomAssessmentAutomationsClient) GetPreparer(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customAssessmentAutomationName": autorest.Encode("path", customAssessmentAutomationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-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/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}", 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 CustomAssessmentAutomationsClient) 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 CustomAssessmentAutomationsClient) GetResponder(resp *http.Response) (result CustomAssessmentAutomation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup list custom assessment automations by provided subscription and resource group +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +func (client CustomAssessmentAutomationsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result CustomAssessmentAutomationsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.caalr.Response.Response != nil { + sc = result.caalr.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.CustomAssessmentAutomationsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.caalr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.caalr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.caalr.hasNextLink() && result.caalr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client CustomAssessmentAutomationsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-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/Microsoft.Security/customAssessmentAutomations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client CustomAssessmentAutomationsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client CustomAssessmentAutomationsClient) ListByResourceGroupResponder(resp *http.Response) (result CustomAssessmentAutomationsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client CustomAssessmentAutomationsClient) listByResourceGroupNextResults(ctx context.Context, lastResults CustomAssessmentAutomationsListResult) (result CustomAssessmentAutomationsListResult, err error) { + req, err := lastResults.customAssessmentAutomationsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client CustomAssessmentAutomationsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result CustomAssessmentAutomationsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsClient.ListByResourceGroup") + 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.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListBySubscription list custom assessment automations by provided subscription +func (client CustomAssessmentAutomationsClient) ListBySubscription(ctx context.Context) (result CustomAssessmentAutomationsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsClient.ListBySubscription") + defer func() { + sc := -1 + if result.caalr.Response.Response != nil { + sc = result.caalr.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.CustomAssessmentAutomationsClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.caalr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.caalr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.caalr.hasNextLink() && result.caalr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client CustomAssessmentAutomationsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-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/customAssessmentAutomations", 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 CustomAssessmentAutomationsClient) 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 CustomAssessmentAutomationsClient) ListBySubscriptionResponder(resp *http.Response) (result CustomAssessmentAutomationsListResult, 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 CustomAssessmentAutomationsClient) listBySubscriptionNextResults(ctx context.Context, lastResults CustomAssessmentAutomationsListResult) (result CustomAssessmentAutomationsListResult, err error) { + req, err := lastResults.customAssessmentAutomationsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "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.CustomAssessmentAutomationsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client CustomAssessmentAutomationsClient) ListBySubscriptionComplete(ctx context.Context) (result CustomAssessmentAutomationsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsClient.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/services/preview/security/mgmt/v1.0/security/customentitystoreassignments.go b/services/preview/security/mgmt/v1.0/security/customentitystoreassignments.go new file mode 100644 index 000000000000..615aa495c152 --- /dev/null +++ b/services/preview/security/mgmt/v1.0/security/customentitystoreassignments.go @@ -0,0 +1,542 @@ +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" +) + +// CustomEntityStoreAssignmentsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type CustomEntityStoreAssignmentsClient struct { + BaseClient +} + +// NewCustomEntityStoreAssignmentsClient creates an instance of the CustomEntityStoreAssignmentsClient client. +func NewCustomEntityStoreAssignmentsClient(subscriptionID string) CustomEntityStoreAssignmentsClient { + return NewCustomEntityStoreAssignmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCustomEntityStoreAssignmentsClientWithBaseURI creates an instance of the CustomEntityStoreAssignmentsClient +// 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 NewCustomEntityStoreAssignmentsClientWithBaseURI(baseURI string, subscriptionID string) CustomEntityStoreAssignmentsClient { + return CustomEntityStoreAssignmentsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a custom entity store assignment for the provided subscription, if not already exists. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// customEntityStoreAssignmentName - name of the custom entity store assignment. Generated name is GUID. +// customEntityStoreAssignmentRequestBody - custom entity store assignment body +func (client CustomEntityStoreAssignmentsClient) Create(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string, customEntityStoreAssignmentRequestBody CustomEntityStoreAssignmentRequest) (result CustomEntityStoreAssignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsClient.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}}}, + {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.CustomEntityStoreAssignmentsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, customEntityStoreAssignmentName, customEntityStoreAssignmentRequestBody) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "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.CustomEntityStoreAssignmentsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client CustomEntityStoreAssignmentsClient) CreatePreparer(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string, customEntityStoreAssignmentRequestBody CustomEntityStoreAssignmentRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customEntityStoreAssignmentName": autorest.Encode("path", customEntityStoreAssignmentName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-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}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}", pathParameters), + autorest.WithJSON(customEntityStoreAssignmentRequestBody), + 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 CustomEntityStoreAssignmentsClient) 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 CustomEntityStoreAssignmentsClient) CreateResponder(resp *http.Response) (result CustomEntityStoreAssignment, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a custom entity store assignment by name for a provided subscription +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// customEntityStoreAssignmentName - name of the custom entity store assignment. Generated name is GUID. +func (client CustomEntityStoreAssignmentsClient) Delete(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsClient.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}}}, + {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.CustomEntityStoreAssignmentsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, customEntityStoreAssignmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CustomEntityStoreAssignmentsClient) DeletePreparer(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customEntityStoreAssignmentName": autorest.Encode("path", customEntityStoreAssignmentName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}", 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 CustomEntityStoreAssignmentsClient) 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 CustomEntityStoreAssignmentsClient) 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 gets a single custom entity store assignment by name for the provided subscription and resource group. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// customEntityStoreAssignmentName - name of the custom entity store assignment. Generated name is GUID. +func (client CustomEntityStoreAssignmentsClient) Get(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string) (result CustomEntityStoreAssignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsClient.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.CustomEntityStoreAssignmentsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, customEntityStoreAssignmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "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.CustomEntityStoreAssignmentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client CustomEntityStoreAssignmentsClient) GetPreparer(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customEntityStoreAssignmentName": autorest.Encode("path", customEntityStoreAssignmentName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-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/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}", 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 CustomEntityStoreAssignmentsClient) 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 CustomEntityStoreAssignmentsClient) GetResponder(resp *http.Response) (result CustomEntityStoreAssignment, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup list custom entity store assignments by a provided subscription and resource group +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +func (client CustomEntityStoreAssignmentsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result CustomEntityStoreAssignmentsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.cesalr.Response.Response != nil { + sc = result.cesalr.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.CustomEntityStoreAssignmentsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.cesalr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.cesalr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.cesalr.hasNextLink() && result.cesalr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client CustomEntityStoreAssignmentsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-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/Microsoft.Security/customEntityStoreAssignments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client CustomEntityStoreAssignmentsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client CustomEntityStoreAssignmentsClient) ListByResourceGroupResponder(resp *http.Response) (result CustomEntityStoreAssignmentsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client CustomEntityStoreAssignmentsClient) listByResourceGroupNextResults(ctx context.Context, lastResults CustomEntityStoreAssignmentsListResult) (result CustomEntityStoreAssignmentsListResult, err error) { + req, err := lastResults.customEntityStoreAssignmentsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client CustomEntityStoreAssignmentsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result CustomEntityStoreAssignmentsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsClient.ListByResourceGroup") + 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.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListBySubscription list custom entity store assignments by provided subscription +func (client CustomEntityStoreAssignmentsClient) ListBySubscription(ctx context.Context) (result CustomEntityStoreAssignmentsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsClient.ListBySubscription") + defer func() { + sc := -1 + if result.cesalr.Response.Response != nil { + sc = result.cesalr.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.CustomEntityStoreAssignmentsClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.cesalr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.cesalr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.cesalr.hasNextLink() && result.cesalr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client CustomEntityStoreAssignmentsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-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/customEntityStoreAssignments", 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 CustomEntityStoreAssignmentsClient) 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 CustomEntityStoreAssignmentsClient) ListBySubscriptionResponder(resp *http.Response) (result CustomEntityStoreAssignmentsListResult, 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 CustomEntityStoreAssignmentsClient) listBySubscriptionNextResults(ctx context.Context, lastResults CustomEntityStoreAssignmentsListResult) (result CustomEntityStoreAssignmentsListResult, err error) { + req, err := lastResults.customEntityStoreAssignmentsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "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.CustomEntityStoreAssignmentsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client CustomEntityStoreAssignmentsClient) ListBySubscriptionComplete(ctx context.Context) (result CustomEntityStoreAssignmentsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsClient.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/services/preview/security/mgmt/v1.0/security/devicesecuritygroups.go b/services/preview/security/mgmt/v1.0/security/devicesecuritygroups.go index e38e86a95e18..6152531ffd85 100644 --- a/services/preview/security/mgmt/v1.0/security/devicesecuritygroups.go +++ b/services/preview/security/mgmt/v1.0/security/devicesecuritygroups.go @@ -20,15 +20,15 @@ type DeviceSecurityGroupsClient struct { } // NewDeviceSecurityGroupsClient creates an instance of the DeviceSecurityGroupsClient client. -func NewDeviceSecurityGroupsClient(subscriptionID string, ascLocation string) DeviceSecurityGroupsClient { - return NewDeviceSecurityGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewDeviceSecurityGroupsClient(subscriptionID string) DeviceSecurityGroupsClient { + return NewDeviceSecurityGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewDeviceSecurityGroupsClientWithBaseURI creates an instance of the DeviceSecurityGroupsClient 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 NewDeviceSecurityGroupsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) DeviceSecurityGroupsClient { - return DeviceSecurityGroupsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewDeviceSecurityGroupsClientWithBaseURI(baseURI string, subscriptionID string) DeviceSecurityGroupsClient { + return DeviceSecurityGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate use this method to creates or updates the device security group on a specified IoT Hub resource. diff --git a/services/preview/security/mgmt/v1.0/security/discoveredsecuritysolutions.go b/services/preview/security/mgmt/v1.0/security/discoveredsecuritysolutions.go index 6b6d3d945f58..8bcfe2739b40 100644 --- a/services/preview/security/mgmt/v1.0/security/discoveredsecuritysolutions.go +++ b/services/preview/security/mgmt/v1.0/security/discoveredsecuritysolutions.go @@ -21,23 +21,25 @@ type DiscoveredSecuritySolutionsClient struct { } // NewDiscoveredSecuritySolutionsClient creates an instance of the DiscoveredSecuritySolutionsClient client. -func NewDiscoveredSecuritySolutionsClient(subscriptionID string, ascLocation string) DiscoveredSecuritySolutionsClient { - return NewDiscoveredSecuritySolutionsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewDiscoveredSecuritySolutionsClient(subscriptionID string) DiscoveredSecuritySolutionsClient { + return NewDiscoveredSecuritySolutionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewDiscoveredSecuritySolutionsClientWithBaseURI creates an instance of the DiscoveredSecuritySolutionsClient 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 NewDiscoveredSecuritySolutionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) DiscoveredSecuritySolutionsClient { - return DiscoveredSecuritySolutionsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewDiscoveredSecuritySolutionsClientWithBaseURI(baseURI string, subscriptionID string) DiscoveredSecuritySolutionsClient { + return DiscoveredSecuritySolutionsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets a specific discovered Security Solution. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // discoveredSecuritySolutionName - name of a discovered security solution. -func (client DiscoveredSecuritySolutionsClient) Get(ctx context.Context, resourceGroupName string, discoveredSecuritySolutionName string) (result DiscoveredSecuritySolution, err error) { +func (client DiscoveredSecuritySolutionsClient) Get(ctx context.Context, resourceGroupName string, ascLocation string, discoveredSecuritySolutionName string) (result DiscoveredSecuritySolution, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionsClient.Get") defer func() { @@ -58,7 +60,7 @@ func (client DiscoveredSecuritySolutionsClient) Get(ctx context.Context, resourc return result, validation.NewError("security.DiscoveredSecuritySolutionsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, discoveredSecuritySolutionName) + req, err := client.GetPreparer(ctx, resourceGroupName, ascLocation, discoveredSecuritySolutionName) if err != nil { err = autorest.NewErrorWithError(err, "security.DiscoveredSecuritySolutionsClient", "Get", nil, "Failure preparing request") return @@ -81,9 +83,9 @@ func (client DiscoveredSecuritySolutionsClient) Get(ctx context.Context, resourc } // GetPreparer prepares the Get request. -func (client DiscoveredSecuritySolutionsClient) GetPreparer(ctx context.Context, resourceGroupName string, discoveredSecuritySolutionName string) (*http.Request, error) { +func (client DiscoveredSecuritySolutionsClient) GetPreparer(ctx context.Context, resourceGroupName string, ascLocation string, discoveredSecuritySolutionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "discoveredSecuritySolutionName": autorest.Encode("path", discoveredSecuritySolutionName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -240,7 +242,10 @@ func (client DiscoveredSecuritySolutionsClient) ListComplete(ctx context.Context } // ListByHomeRegion gets a list of discovered Security Solutions for the subscription and location. -func (client DiscoveredSecuritySolutionsClient) ListByHomeRegion(ctx context.Context) (result DiscoveredSecuritySolutionListPage, err error) { +// Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations +func (client DiscoveredSecuritySolutionsClient) ListByHomeRegion(ctx context.Context, ascLocation string) (result DiscoveredSecuritySolutionListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionsClient.ListByHomeRegion") defer func() { @@ -258,7 +263,7 @@ func (client DiscoveredSecuritySolutionsClient) ListByHomeRegion(ctx context.Con } result.fn = client.listByHomeRegionNextResults - req, err := client.ListByHomeRegionPreparer(ctx) + req, err := client.ListByHomeRegionPreparer(ctx, ascLocation) if err != nil { err = autorest.NewErrorWithError(err, "security.DiscoveredSecuritySolutionsClient", "ListByHomeRegion", nil, "Failure preparing request") return @@ -285,9 +290,9 @@ func (client DiscoveredSecuritySolutionsClient) ListByHomeRegion(ctx context.Con } // ListByHomeRegionPreparer prepares the ListByHomeRegion request. -func (client DiscoveredSecuritySolutionsClient) ListByHomeRegionPreparer(ctx context.Context) (*http.Request, error) { +func (client DiscoveredSecuritySolutionsClient) ListByHomeRegionPreparer(ctx context.Context, ascLocation string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -344,7 +349,7 @@ func (client DiscoveredSecuritySolutionsClient) listByHomeRegionNextResults(ctx } // ListByHomeRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiscoveredSecuritySolutionsClient) ListByHomeRegionComplete(ctx context.Context) (result DiscoveredSecuritySolutionListIterator, err error) { +func (client DiscoveredSecuritySolutionsClient) ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result DiscoveredSecuritySolutionListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionsClient.ListByHomeRegion") defer func() { @@ -355,6 +360,6 @@ func (client DiscoveredSecuritySolutionsClient) ListByHomeRegionComplete(ctx con tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByHomeRegion(ctx) + result.page, err = client.ListByHomeRegion(ctx, ascLocation) return } diff --git a/services/preview/security/mgmt/v1.0/security/enums.go b/services/preview/security/mgmt/v1.0/security/enums.go index ed5a06ace25a..43c6456e06b4 100644 --- a/services/preview/security/mgmt/v1.0/security/enums.go +++ b/services/preview/security/mgmt/v1.0/security/enums.go @@ -161,6 +161,25 @@ func PossibleAutoProvisionValues() []AutoProvision { return []AutoProvision{AutoProvisionOff, AutoProvisionOn} } +// CloudName enumerates the values for cloud name. +type CloudName string + +const ( + // AWS ... + AWS CloudName = "AWS" + // Azure ... + Azure CloudName = "Azure" + // GCP ... + GCP CloudName = "GCP" + // Github ... + Github CloudName = "Github" +) + +// PossibleCloudNameValues returns an array of possible values for the CloudName const type. +func PossibleCloudNameValues() []CloudName { + return []CloudName{AWS, Azure, GCP, Github} +} + // ConfigurationStatus enumerates the values for configuration status. type ConfigurationStatus string @@ -243,9 +262,9 @@ func PossibleConnectionTypeValues() []ConnectionType { type ControlType string const ( - // BuiltIn Azure Security Center managed assessments + // BuiltIn Microsoft Defender for Cloud managed assessments BuiltIn ControlType = "BuiltIn" - // Custom Non Azure Security Center managed assessments + // Custom Non Microsoft Defender for Cloud managed assessments Custom ControlType = "Custom" ) @@ -254,6 +273,25 @@ func PossibleControlTypeValues() []ControlType { return []ControlType{BuiltIn, Custom} } +// 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} +} + // Direction enumerates the values for direction. type Direction string @@ -269,21 +307,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} } // EnforcementMode1 enumerates the values for enforcement mode 1. @@ -320,25 +379,56 @@ func PossibleEnforcementSupportValues() []EnforcementSupport { return []EnforcementSupport{NotSupported, Supported, Unknown} } +// EnvironmentType enumerates the values for environment type. +type EnvironmentType string + +const ( + // EnvironmentTypeAwsAccount ... + EnvironmentTypeAwsAccount EnvironmentType = "AwsAccount" + // EnvironmentTypeEnvironmentData ... + EnvironmentTypeEnvironmentData EnvironmentType = "EnvironmentData" + // EnvironmentTypeGcpProject ... + EnvironmentTypeGcpProject EnvironmentType = "GcpProject" + // EnvironmentTypeGithubScope ... + EnvironmentTypeGithubScope EnvironmentType = "GithubScope" +) + +// PossibleEnvironmentTypeValues returns an array of possible values for the EnvironmentType const type. +func PossibleEnvironmentTypeValues() []EnvironmentType { + return []EnvironmentType{EnvironmentTypeAwsAccount, EnvironmentTypeEnvironmentData, EnvironmentTypeGcpProject, EnvironmentTypeGithubScope} +} + // EventSource enumerates the values for event source. 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" + // EventSourceAssessmentsSnapshot ... + EventSourceAssessmentsSnapshot EventSource = "AssessmentsSnapshot" + // 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" + // EventSourceSubAssessmentsSnapshot ... + EventSourceSubAssessmentsSnapshot EventSource = "SubAssessmentsSnapshot" ) // 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, EventSourceAssessmentsSnapshot, EventSourceRegulatoryComplianceAssessment, EventSourceRegulatoryComplianceAssessmentSnapshot, EventSourceSecureScoreControls, EventSourceSecureScoreControlsSnapshot, EventSourceSecureScores, EventSourceSecureScoresSnapshot, EventSourceSubAssessments, EventSourceSubAssessmentsSnapshot} } // Exe enumerates the values for exe. @@ -464,6 +554,21 @@ func PossibleHybridComputeProvisioningStateValues() []HybridComputeProvisioningS return []HybridComputeProvisioningState{HybridComputeProvisioningStateExpired, HybridComputeProvisioningStateInvalid, HybridComputeProvisioningStateValid} } +// InformationProtectionPolicyName enumerates the values for information protection policy name. +type InformationProtectionPolicyName string + +const ( + // InformationProtectionPolicyNameCustom ... + InformationProtectionPolicyNameCustom InformationProtectionPolicyName = "custom" + // InformationProtectionPolicyNameEffective ... + InformationProtectionPolicyNameEffective InformationProtectionPolicyName = "effective" +) + +// PossibleInformationProtectionPolicyNameValues returns an array of possible values for the InformationProtectionPolicyName const type. +func PossibleInformationProtectionPolicyNameValues() []InformationProtectionPolicyName { + return []InformationProtectionPolicyName{InformationProtectionPolicyNameCustom, InformationProtectionPolicyNameEffective} +} + // Issue enumerates the values for issue. type Issue string @@ -490,20 +595,35 @@ func PossibleIssueValues() []Issue { // KindEnum enumerates the values for kind enum. type KindEnum string +const ( + // KindDataExportSetting ... + KindDataExportSetting KindEnum = "DataExportSetting" + // KindSetting ... + KindSetting KindEnum = "Setting" +) + +// PossibleKindEnumValues returns an array of possible values for the KindEnum const type. +func PossibleKindEnumValues() []KindEnum { + return []KindEnum{KindDataExportSetting, KindSetting} +} + +// KindEnum1 enumerates the values for kind enum 1. +type KindEnum1 string + const ( // KindAAD ... - KindAAD KindEnum = "AAD" + KindAAD KindEnum1 = "AAD" // KindATA ... - KindATA KindEnum = "ATA" + KindATA KindEnum1 = "ATA" // KindCEF ... - KindCEF KindEnum = "CEF" + KindCEF KindEnum1 = "CEF" // KindExternalSecuritySolution ... - KindExternalSecuritySolution KindEnum = "ExternalSecuritySolution" + KindExternalSecuritySolution KindEnum1 = "ExternalSecuritySolution" ) -// PossibleKindEnumValues returns an array of possible values for the KindEnum const type. -func PossibleKindEnumValues() []KindEnum { - return []KindEnum{KindAAD, KindATA, KindCEF, KindExternalSecuritySolution} +// PossibleKindEnum1Values returns an array of possible values for the KindEnum1 const type. +func PossibleKindEnum1Values() []KindEnum1 { + return []KindEnum1{KindAAD, KindATA, KindCEF, KindExternalSecuritySolution} } // Msi enumerates the values for msi. @@ -523,27 +643,56 @@ func PossibleMsiValues() []Msi { return []Msi{MsiAudit, MsiEnforce, MsiNone} } +// OfferingType enumerates the values for offering type. +type OfferingType string + +const ( + // OfferingTypeCloudOffering ... + OfferingTypeCloudOffering OfferingType = "cloudOffering" + // OfferingTypeCspmMonitorAws ... + OfferingTypeCspmMonitorAws OfferingType = "CspmMonitorAws" + // OfferingTypeCspmMonitorGcp ... + OfferingTypeCspmMonitorGcp OfferingType = "CspmMonitorGcp" + // OfferingTypeCspmMonitorGithub ... + OfferingTypeCspmMonitorGithub OfferingType = "CspmMonitorGithub" + // OfferingTypeDefenderForContainersAws ... + OfferingTypeDefenderForContainersAws OfferingType = "DefenderForContainersAws" + // OfferingTypeDefenderForContainersGcp ... + OfferingTypeDefenderForContainersGcp OfferingType = "DefenderForContainersGcp" + // OfferingTypeDefenderForServersAws ... + OfferingTypeDefenderForServersAws OfferingType = "DefenderForServersAws" + // OfferingTypeDefenderForServersGcp ... + OfferingTypeDefenderForServersGcp OfferingType = "DefenderForServersGcp" + // OfferingTypeInformationProtectionAws ... + OfferingTypeInformationProtectionAws OfferingType = "InformationProtectionAws" +) + +// PossibleOfferingTypeValues returns an array of possible values for the OfferingType const type. +func PossibleOfferingTypeValues() []OfferingType { + return []OfferingType{OfferingTypeCloudOffering, OfferingTypeCspmMonitorAws, OfferingTypeCspmMonitorGcp, OfferingTypeCspmMonitorGithub, OfferingTypeDefenderForContainersAws, OfferingTypeDefenderForContainersGcp, OfferingTypeDefenderForServersAws, OfferingTypeDefenderForServersGcp, OfferingTypeInformationProtectionAws} +} + // 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" ) @@ -552,6 +701,41 @@ func PossibleOperatorValues() []Operator { return []Operator{Contains, EndsWith, Equals, GreaterThan, GreaterThanOrEqualTo, LesserThan, LesserThanOrEqualTo, NotEquals, StartsWith} } +// OrganizationMembershipType enumerates the values for organization membership type. +type OrganizationMembershipType string + +const ( + // OrganizationMembershipTypeAwsOrganizationalData ... + OrganizationMembershipTypeAwsOrganizationalData OrganizationMembershipType = "AwsOrganizationalData" + // OrganizationMembershipTypeMember ... + OrganizationMembershipTypeMember OrganizationMembershipType = "Member" + // OrganizationMembershipTypeOrganization ... + OrganizationMembershipTypeOrganization OrganizationMembershipType = "Organization" +) + +// PossibleOrganizationMembershipTypeValues returns an array of possible values for the OrganizationMembershipType const type. +func PossibleOrganizationMembershipTypeValues() []OrganizationMembershipType { + return []OrganizationMembershipType{OrganizationMembershipTypeAwsOrganizationalData, OrganizationMembershipTypeMember, OrganizationMembershipTypeOrganization} +} + +// OrganizationMembershipTypeBasicGcpOrganizationalData enumerates the values for organization membership type +// basic gcp organizational data. +type OrganizationMembershipTypeBasicGcpOrganizationalData string + +const ( + // OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeGcpOrganizationalData ... + OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeGcpOrganizationalData OrganizationMembershipTypeBasicGcpOrganizationalData = "GcpOrganizationalData" + // OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeMember ... + OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeMember OrganizationMembershipTypeBasicGcpOrganizationalData = "Member" + // OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeOrganization ... + OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeOrganization OrganizationMembershipTypeBasicGcpOrganizationalData = "Organization" +) + +// PossibleOrganizationMembershipTypeBasicGcpOrganizationalDataValues returns an array of possible values for the OrganizationMembershipTypeBasicGcpOrganizationalData const type. +func PossibleOrganizationMembershipTypeBasicGcpOrganizationalDataValues() []OrganizationMembershipTypeBasicGcpOrganizationalData { + return []OrganizationMembershipTypeBasicGcpOrganizationalData{OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeGcpOrganizationalData, OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeMember, OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeOrganization} +} + // PermissionProperty enumerates the values for permission property. type PermissionProperty string @@ -576,9 +760,9 @@ func PossiblePermissionPropertyValues() []PermissionProperty { type PricingTier string const ( - // Free Get free Azure security center experience with basic security features + // Free Get free Microsoft Defender for Cloud experience with basic security features Free PricingTier = "Free" - // Standard Get the standard Azure security center experience with advanced security features + // Standard Get the standard Microsoft Defender for Cloud experience with advanced security features Standard PricingTier = "Standard" ) @@ -902,21 +1086,6 @@ func PossibleScriptValues() []Script { return []Script{ScriptAudit, ScriptEnforce, ScriptNone} } -// SettingKind enumerates the values for setting kind. -type SettingKind string - -const ( - // SettingKindAlertSuppressionSetting ... - SettingKindAlertSuppressionSetting SettingKind = "AlertSuppressionSetting" - // SettingKindDataExportSetting ... - SettingKindDataExportSetting SettingKind = "DataExportSetting" -) - -// PossibleSettingKindValues returns an array of possible values for the SettingKind const type. -func PossibleSettingKindValues() []SettingKind { - return []SettingKind{SettingKindAlertSuppressionSetting, SettingKindDataExportSetting} -} - // Severity enumerates the values for severity. type Severity string @@ -934,6 +1103,23 @@ func PossibleSeverityValues() []Severity { return []Severity{SeverityHigh, SeverityLow, SeverityMedium} } +// SeverityEnum enumerates the values for severity enum. +type SeverityEnum string + +const ( + // SeverityEnumHigh ... + SeverityEnumHigh SeverityEnum = "High" + // SeverityEnumLow ... + SeverityEnumLow SeverityEnum = "Low" + // SeverityEnumMedium ... + SeverityEnumMedium SeverityEnum = "Medium" +) + +// PossibleSeverityEnumValues returns an array of possible values for the SeverityEnum const type. +func PossibleSeverityEnumValues() []SeverityEnum { + return []SeverityEnum{SeverityEnumHigh, SeverityEnumLow, SeverityEnumMedium} +} + // Source enumerates the values for source. type Source string @@ -1043,6 +1229,57 @@ func PossibleSubAssessmentStatusCodeValues() []SubAssessmentStatusCode { return []SubAssessmentStatusCode{Healthy, NotApplicable, Unhealthy} } +// SubPlan enumerates the values for sub plan. +type SubPlan string + +const ( + // P1 ... + P1 SubPlan = "P1" + // P2 ... + P2 SubPlan = "P2" +) + +// PossibleSubPlanValues returns an array of possible values for the SubPlan const type. +func PossibleSubPlanValues() []SubPlan { + return []SubPlan{P1, P2} +} + +// SupportedCloudEnum enumerates the values for supported cloud enum. +type SupportedCloudEnum string + +const ( + // SupportedCloudEnumAWS ... + SupportedCloudEnumAWS SupportedCloudEnum = "AWS" + // SupportedCloudEnumGCP ... + SupportedCloudEnumGCP SupportedCloudEnum = "GCP" +) + +// PossibleSupportedCloudEnumValues returns an array of possible values for the SupportedCloudEnum const type. +func PossibleSupportedCloudEnumValues() []SupportedCloudEnum { + return []SupportedCloudEnum{SupportedCloudEnumAWS, SupportedCloudEnumGCP} +} + +// TaskUpdateActionType enumerates the values for task update action type. +type TaskUpdateActionType string + +const ( + // Activate ... + Activate TaskUpdateActionType = "Activate" + // Close ... + Close TaskUpdateActionType = "Close" + // Dismiss ... + Dismiss TaskUpdateActionType = "Dismiss" + // Resolve ... + Resolve TaskUpdateActionType = "Resolve" + // Start ... + Start TaskUpdateActionType = "Start" +) + +// PossibleTaskUpdateActionTypeValues returns an array of possible values for the TaskUpdateActionType const type. +func PossibleTaskUpdateActionTypeValues() []TaskUpdateActionType { + return []TaskUpdateActionType{Activate, Close, Dismiss, Resolve, Start} +} + // TransportProtocol enumerates the values for transport protocol. type TransportProtocol string @@ -1061,24 +1298,39 @@ func PossibleTransportProtocolValues() []TransportProtocol { // Type enumerates the values for type. type Type string +const ( + // Qualys ... + Qualys Type = "Qualys" + // TVM ... + TVM Type = "TVM" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{Qualys, TVM} +} + +// Type1 enumerates the values for type 1. +type Type1 string + const ( // BinarySignature ... - BinarySignature Type = "BinarySignature" + BinarySignature Type1 = "BinarySignature" // File ... - File Type = "File" + File Type1 = "File" // FileHash ... - FileHash Type = "FileHash" + FileHash Type1 = "FileHash" // ProductSignature ... - ProductSignature Type = "ProductSignature" + ProductSignature Type1 = "ProductSignature" // PublisherSignature ... - PublisherSignature Type = "PublisherSignature" + PublisherSignature Type1 = "PublisherSignature" // VersionAndAboveSignature ... - VersionAndAboveSignature Type = "VersionAndAboveSignature" + VersionAndAboveSignature Type1 = "VersionAndAboveSignature" ) -// PossibleTypeValues returns an array of possible values for the Type const type. -func PossibleTypeValues() []Type { - return []Type{BinarySignature, File, FileHash, ProductSignature, PublisherSignature, VersionAndAboveSignature} +// PossibleType1Values returns an array of possible values for the Type1 const type. +func PossibleType1Values() []Type1 { + return []Type1{BinarySignature, File, FileHash, ProductSignature, PublisherSignature, VersionAndAboveSignature} } // ValueType enumerates the values for value type. diff --git a/services/preview/security/mgmt/v1.0/security/externalsecuritysolutions.go b/services/preview/security/mgmt/v1.0/security/externalsecuritysolutions.go index b068eb3e7320..c1c0fe127645 100644 --- a/services/preview/security/mgmt/v1.0/security/externalsecuritysolutions.go +++ b/services/preview/security/mgmt/v1.0/security/externalsecuritysolutions.go @@ -21,23 +21,25 @@ type ExternalSecuritySolutionsClient struct { } // NewExternalSecuritySolutionsClient creates an instance of the ExternalSecuritySolutionsClient client. -func NewExternalSecuritySolutionsClient(subscriptionID string, ascLocation string) ExternalSecuritySolutionsClient { - return NewExternalSecuritySolutionsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewExternalSecuritySolutionsClient(subscriptionID string) ExternalSecuritySolutionsClient { + return NewExternalSecuritySolutionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewExternalSecuritySolutionsClientWithBaseURI creates an instance of the ExternalSecuritySolutionsClient 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 NewExternalSecuritySolutionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) ExternalSecuritySolutionsClient { - return ExternalSecuritySolutionsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewExternalSecuritySolutionsClientWithBaseURI(baseURI string, subscriptionID string) ExternalSecuritySolutionsClient { + return ExternalSecuritySolutionsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets a specific external Security Solution. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // externalSecuritySolutionsName - name of an external security solution. -func (client ExternalSecuritySolutionsClient) Get(ctx context.Context, resourceGroupName string, externalSecuritySolutionsName string) (result ExternalSecuritySolutionModel, err error) { +func (client ExternalSecuritySolutionsClient) Get(ctx context.Context, resourceGroupName string, ascLocation string, externalSecuritySolutionsName string) (result ExternalSecuritySolutionModel, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionsClient.Get") defer func() { @@ -58,7 +60,7 @@ func (client ExternalSecuritySolutionsClient) Get(ctx context.Context, resourceG return result, validation.NewError("security.ExternalSecuritySolutionsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, externalSecuritySolutionsName) + req, err := client.GetPreparer(ctx, resourceGroupName, ascLocation, externalSecuritySolutionsName) if err != nil { err = autorest.NewErrorWithError(err, "security.ExternalSecuritySolutionsClient", "Get", nil, "Failure preparing request") return @@ -81,9 +83,9 @@ func (client ExternalSecuritySolutionsClient) Get(ctx context.Context, resourceG } // GetPreparer prepares the Get request. -func (client ExternalSecuritySolutionsClient) GetPreparer(ctx context.Context, resourceGroupName string, externalSecuritySolutionsName string) (*http.Request, error) { +func (client ExternalSecuritySolutionsClient) GetPreparer(ctx context.Context, resourceGroupName string, ascLocation string, externalSecuritySolutionsName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "externalSecuritySolutionsName": autorest.Encode("path", externalSecuritySolutionsName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -240,7 +242,10 @@ func (client ExternalSecuritySolutionsClient) ListComplete(ctx context.Context) } // ListByHomeRegion gets a list of external Security Solutions for the subscription and location. -func (client ExternalSecuritySolutionsClient) ListByHomeRegion(ctx context.Context) (result ExternalSecuritySolutionListPage, err error) { +// Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations +func (client ExternalSecuritySolutionsClient) ListByHomeRegion(ctx context.Context, ascLocation string) (result ExternalSecuritySolutionListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionsClient.ListByHomeRegion") defer func() { @@ -258,7 +263,7 @@ func (client ExternalSecuritySolutionsClient) ListByHomeRegion(ctx context.Conte } result.fn = client.listByHomeRegionNextResults - req, err := client.ListByHomeRegionPreparer(ctx) + req, err := client.ListByHomeRegionPreparer(ctx, ascLocation) if err != nil { err = autorest.NewErrorWithError(err, "security.ExternalSecuritySolutionsClient", "ListByHomeRegion", nil, "Failure preparing request") return @@ -285,9 +290,9 @@ func (client ExternalSecuritySolutionsClient) ListByHomeRegion(ctx context.Conte } // ListByHomeRegionPreparer prepares the ListByHomeRegion request. -func (client ExternalSecuritySolutionsClient) ListByHomeRegionPreparer(ctx context.Context) (*http.Request, error) { +func (client ExternalSecuritySolutionsClient) ListByHomeRegionPreparer(ctx context.Context, ascLocation string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -344,7 +349,7 @@ func (client ExternalSecuritySolutionsClient) listByHomeRegionNextResults(ctx co } // ListByHomeRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExternalSecuritySolutionsClient) ListByHomeRegionComplete(ctx context.Context) (result ExternalSecuritySolutionListIterator, err error) { +func (client ExternalSecuritySolutionsClient) ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result ExternalSecuritySolutionListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionsClient.ListByHomeRegion") defer func() { @@ -355,6 +360,6 @@ func (client ExternalSecuritySolutionsClient) ListByHomeRegionComplete(ctx conte tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByHomeRegion(ctx) + result.page, err = client.ListByHomeRegion(ctx, ascLocation) return } diff --git a/services/preview/security/mgmt/v1.0/security/informationprotectionpolicies.go b/services/preview/security/mgmt/v1.0/security/informationprotectionpolicies.go index ab62d290cbd9..f2e2cc818b8a 100644 --- a/services/preview/security/mgmt/v1.0/security/informationprotectionpolicies.go +++ b/services/preview/security/mgmt/v1.0/security/informationprotectionpolicies.go @@ -20,15 +20,15 @@ type InformationProtectionPoliciesClient struct { } // NewInformationProtectionPoliciesClient creates an instance of the InformationProtectionPoliciesClient client. -func NewInformationProtectionPoliciesClient(subscriptionID string, ascLocation string) InformationProtectionPoliciesClient { - return NewInformationProtectionPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewInformationProtectionPoliciesClient(subscriptionID string) InformationProtectionPoliciesClient { + return NewInformationProtectionPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewInformationProtectionPoliciesClientWithBaseURI creates an instance of the InformationProtectionPoliciesClient // 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 NewInformationProtectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) InformationProtectionPoliciesClient { - return InformationProtectionPoliciesClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewInformationProtectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) InformationProtectionPoliciesClient { + return InformationProtectionPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate details of the information protection policy. @@ -37,7 +37,7 @@ func NewInformationProtectionPoliciesClientWithBaseURI(baseURI string, subscript // management group (/providers/Microsoft.Management/managementGroups/mgName). // informationProtectionPolicyName - name of the information protection policy. // informationProtectionPolicy - information protection policy. -func (client InformationProtectionPoliciesClient) CreateOrUpdate(ctx context.Context, scope string, informationProtectionPolicyName string, informationProtectionPolicy InformationProtectionPolicy) (result InformationProtectionPolicy, err error) { +func (client InformationProtectionPoliciesClient) CreateOrUpdate(ctx context.Context, scope string, informationProtectionPolicyName InformationProtectionPolicyName, informationProtectionPolicy InformationProtectionPolicy) (result InformationProtectionPolicy, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/InformationProtectionPoliciesClient.CreateOrUpdate") defer func() { @@ -71,7 +71,7 @@ func (client InformationProtectionPoliciesClient) CreateOrUpdate(ctx context.Con } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client InformationProtectionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, scope string, informationProtectionPolicyName string, informationProtectionPolicy InformationProtectionPolicy) (*http.Request, error) { +func (client InformationProtectionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, scope string, informationProtectionPolicyName InformationProtectionPolicyName, informationProtectionPolicy InformationProtectionPolicy) (*http.Request, error) { pathParameters := map[string]interface{}{ "informationProtectionPolicyName": autorest.Encode("path", informationProtectionPolicyName), "scope": scope, @@ -115,7 +115,7 @@ func (client InformationProtectionPoliciesClient) CreateOrUpdateResponder(resp * // scope - scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or // management group (/providers/Microsoft.Management/managementGroups/mgName). // informationProtectionPolicyName - name of the information protection policy. -func (client InformationProtectionPoliciesClient) Get(ctx context.Context, scope string, informationProtectionPolicyName string) (result InformationProtectionPolicy, err error) { +func (client InformationProtectionPoliciesClient) Get(ctx context.Context, scope string, informationProtectionPolicyName InformationProtectionPolicyName) (result InformationProtectionPolicy, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/InformationProtectionPoliciesClient.Get") defer func() { @@ -149,7 +149,7 @@ func (client InformationProtectionPoliciesClient) Get(ctx context.Context, scope } // GetPreparer prepares the Get request. -func (client InformationProtectionPoliciesClient) GetPreparer(ctx context.Context, scope string, informationProtectionPolicyName string) (*http.Request, error) { +func (client InformationProtectionPoliciesClient) GetPreparer(ctx context.Context, scope string, informationProtectionPolicyName InformationProtectionPolicyName) (*http.Request, error) { pathParameters := map[string]interface{}{ "informationProtectionPolicyName": autorest.Encode("path", informationProtectionPolicyName), "scope": scope, diff --git a/services/preview/security/mgmt/v1.0/security/ingestionsettings.go b/services/preview/security/mgmt/v1.0/security/ingestionsettings.go new file mode 100644 index 000000000000..894afa66e205 --- /dev/null +++ b/services/preview/security/mgmt/v1.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) IngestionSettingsClient { + return NewIngestionSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// 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) IngestionSettingsClient { + return IngestionSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// 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/services/preview/security/mgmt/v1.0/security/jitnetworkaccesspolicies.go b/services/preview/security/mgmt/v1.0/security/jitnetworkaccesspolicies.go index 9c9e93748cac..4110298de2b1 100644 --- a/services/preview/security/mgmt/v1.0/security/jitnetworkaccesspolicies.go +++ b/services/preview/security/mgmt/v1.0/security/jitnetworkaccesspolicies.go @@ -21,23 +21,25 @@ type JitNetworkAccessPoliciesClient struct { } // NewJitNetworkAccessPoliciesClient creates an instance of the JitNetworkAccessPoliciesClient client. -func NewJitNetworkAccessPoliciesClient(subscriptionID string, ascLocation string) JitNetworkAccessPoliciesClient { - return NewJitNetworkAccessPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewJitNetworkAccessPoliciesClient(subscriptionID string) JitNetworkAccessPoliciesClient { + return NewJitNetworkAccessPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewJitNetworkAccessPoliciesClientWithBaseURI creates an instance of the JitNetworkAccessPoliciesClient 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 NewJitNetworkAccessPoliciesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) JitNetworkAccessPoliciesClient { - return JitNetworkAccessPoliciesClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewJitNetworkAccessPoliciesClientWithBaseURI(baseURI string, subscriptionID string) JitNetworkAccessPoliciesClient { + return JitNetworkAccessPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate create a policy for protecting resources using Just-in-Time access control // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // jitNetworkAccessPolicyName - name of a Just-in-Time access configuration policy. -func (client JitNetworkAccessPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicy) (result JitNetworkAccessPolicy, err error) { +func (client JitNetworkAccessPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicy) (result JitNetworkAccessPolicy, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.CreateOrUpdate") defer func() { @@ -61,7 +63,7 @@ func (client JitNetworkAccessPoliciesClient) CreateOrUpdate(ctx context.Context, return result, validation.NewError("security.JitNetworkAccessPoliciesClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, jitNetworkAccessPolicyName, body) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body) if err != nil { err = autorest.NewErrorWithError(err, "security.JitNetworkAccessPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -84,9 +86,9 @@ func (client JitNetworkAccessPoliciesClient) CreateOrUpdate(ctx context.Context, } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client JitNetworkAccessPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicy) (*http.Request, error) { +func (client JitNetworkAccessPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicy) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "jitNetworkAccessPolicyName": autorest.Encode("path", jitNetworkAccessPolicyName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -133,8 +135,10 @@ func (client JitNetworkAccessPoliciesClient) CreateOrUpdateResponder(resp *http. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // jitNetworkAccessPolicyName - name of a Just-in-Time access configuration policy. -func (client JitNetworkAccessPoliciesClient) Delete(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string) (result autorest.Response, err error) { +func (client JitNetworkAccessPoliciesClient) Delete(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.Delete") defer func() { @@ -155,7 +159,7 @@ func (client JitNetworkAccessPoliciesClient) Delete(ctx context.Context, resourc return result, validation.NewError("security.JitNetworkAccessPoliciesClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, jitNetworkAccessPolicyName) + req, err := client.DeletePreparer(ctx, resourceGroupName, ascLocation, jitNetworkAccessPolicyName) if err != nil { err = autorest.NewErrorWithError(err, "security.JitNetworkAccessPoliciesClient", "Delete", nil, "Failure preparing request") return @@ -178,9 +182,9 @@ func (client JitNetworkAccessPoliciesClient) Delete(ctx context.Context, resourc } // DeletePreparer prepares the Delete request. -func (client JitNetworkAccessPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string) (*http.Request, error) { +func (client JitNetworkAccessPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "jitNetworkAccessPolicyName": autorest.Encode("path", jitNetworkAccessPolicyName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -220,8 +224,10 @@ func (client JitNetworkAccessPoliciesClient) DeleteResponder(resp *http.Response // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // jitNetworkAccessPolicyName - name of a Just-in-Time access configuration policy. -func (client JitNetworkAccessPoliciesClient) Get(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string) (result JitNetworkAccessPolicy, err error) { +func (client JitNetworkAccessPoliciesClient) Get(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string) (result JitNetworkAccessPolicy, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.Get") defer func() { @@ -242,7 +248,7 @@ func (client JitNetworkAccessPoliciesClient) Get(ctx context.Context, resourceGr return result, validation.NewError("security.JitNetworkAccessPoliciesClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, jitNetworkAccessPolicyName) + req, err := client.GetPreparer(ctx, resourceGroupName, ascLocation, jitNetworkAccessPolicyName) if err != nil { err = autorest.NewErrorWithError(err, "security.JitNetworkAccessPoliciesClient", "Get", nil, "Failure preparing request") return @@ -265,9 +271,9 @@ func (client JitNetworkAccessPoliciesClient) Get(ctx context.Context, resourceGr } // GetPreparer prepares the Get request. -func (client JitNetworkAccessPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string) (*http.Request, error) { +func (client JitNetworkAccessPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "jitNetworkAccessPolicyName": autorest.Encode("path", jitNetworkAccessPolicyName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -308,8 +314,10 @@ func (client JitNetworkAccessPoliciesClient) GetResponder(resp *http.Response) ( // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // jitNetworkAccessPolicyName - name of a Just-in-Time access configuration policy. -func (client JitNetworkAccessPoliciesClient) Initiate(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicyInitiateRequest) (result JitNetworkAccessRequest, err error) { +func (client JitNetworkAccessPoliciesClient) Initiate(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicyInitiateRequest) (result JitNetworkAccessRequest, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.Initiate") defer func() { @@ -332,7 +340,7 @@ func (client JitNetworkAccessPoliciesClient) Initiate(ctx context.Context, resou return result, validation.NewError("security.JitNetworkAccessPoliciesClient", "Initiate", err.Error()) } - req, err := client.InitiatePreparer(ctx, resourceGroupName, jitNetworkAccessPolicyName, body) + req, err := client.InitiatePreparer(ctx, resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body) if err != nil { err = autorest.NewErrorWithError(err, "security.JitNetworkAccessPoliciesClient", "Initiate", nil, "Failure preparing request") return @@ -355,9 +363,9 @@ func (client JitNetworkAccessPoliciesClient) Initiate(ctx context.Context, resou } // InitiatePreparer prepares the Initiate request. -func (client JitNetworkAccessPoliciesClient) InitiatePreparer(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicyInitiateRequest) (*http.Request, error) { +func (client JitNetworkAccessPoliciesClient) InitiatePreparer(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicyInitiateRequest) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "jitNetworkAccessPolicyInitiateType": autorest.Encode("path", "initiate"), "jitNetworkAccessPolicyName": autorest.Encode("path", jitNetworkAccessPolicyName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -517,7 +525,10 @@ func (client JitNetworkAccessPoliciesClient) ListComplete(ctx context.Context) ( } // ListByRegion policies for protecting resources using Just-in-Time access control for the subscription, location -func (client JitNetworkAccessPoliciesClient) ListByRegion(ctx context.Context) (result JitNetworkAccessPoliciesListPage, err error) { +// Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations +func (client JitNetworkAccessPoliciesClient) ListByRegion(ctx context.Context, ascLocation string) (result JitNetworkAccessPoliciesListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.ListByRegion") defer func() { @@ -535,7 +546,7 @@ func (client JitNetworkAccessPoliciesClient) ListByRegion(ctx context.Context) ( } result.fn = client.listByRegionNextResults - req, err := client.ListByRegionPreparer(ctx) + req, err := client.ListByRegionPreparer(ctx, ascLocation) if err != nil { err = autorest.NewErrorWithError(err, "security.JitNetworkAccessPoliciesClient", "ListByRegion", nil, "Failure preparing request") return @@ -562,9 +573,9 @@ func (client JitNetworkAccessPoliciesClient) ListByRegion(ctx context.Context) ( } // ListByRegionPreparer prepares the ListByRegion request. -func (client JitNetworkAccessPoliciesClient) ListByRegionPreparer(ctx context.Context) (*http.Request, error) { +func (client JitNetworkAccessPoliciesClient) ListByRegionPreparer(ctx context.Context, ascLocation string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -621,7 +632,7 @@ func (client JitNetworkAccessPoliciesClient) listByRegionNextResults(ctx context } // ListByRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client JitNetworkAccessPoliciesClient) ListByRegionComplete(ctx context.Context) (result JitNetworkAccessPoliciesListIterator, err error) { +func (client JitNetworkAccessPoliciesClient) ListByRegionComplete(ctx context.Context, ascLocation string) (result JitNetworkAccessPoliciesListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.ListByRegion") defer func() { @@ -632,7 +643,7 @@ func (client JitNetworkAccessPoliciesClient) ListByRegionComplete(ctx context.Co tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByRegion(ctx) + result.page, err = client.ListByRegion(ctx, ascLocation) return } @@ -769,7 +780,9 @@ func (client JitNetworkAccessPoliciesClient) ListByResourceGroupComplete(ctx con // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. -func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegion(ctx context.Context, resourceGroupName string) (result JitNetworkAccessPoliciesListPage, err error) { +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations +func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegion(ctx context.Context, resourceGroupName string, ascLocation string) (result JitNetworkAccessPoliciesListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.ListByResourceGroupAndRegion") defer func() { @@ -791,7 +804,7 @@ func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegion(ctx co } result.fn = client.listByResourceGroupAndRegionNextResults - req, err := client.ListByResourceGroupAndRegionPreparer(ctx, resourceGroupName) + req, err := client.ListByResourceGroupAndRegionPreparer(ctx, resourceGroupName, ascLocation) if err != nil { err = autorest.NewErrorWithError(err, "security.JitNetworkAccessPoliciesClient", "ListByResourceGroupAndRegion", nil, "Failure preparing request") return @@ -818,9 +831,9 @@ func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegion(ctx co } // ListByResourceGroupAndRegionPreparer prepares the ListByResourceGroupAndRegion request. -func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegionPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { +func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegionPreparer(ctx context.Context, resourceGroupName string, ascLocation string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -878,7 +891,7 @@ func (client JitNetworkAccessPoliciesClient) listByResourceGroupAndRegionNextRes } // ListByResourceGroupAndRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegionComplete(ctx context.Context, resourceGroupName string) (result JitNetworkAccessPoliciesListIterator, err error) { +func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegionComplete(ctx context.Context, resourceGroupName string, ascLocation string) (result JitNetworkAccessPoliciesListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.ListByResourceGroupAndRegion") defer func() { @@ -889,6 +902,6 @@ func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegionComplet tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByResourceGroupAndRegion(ctx, resourceGroupName) + result.page, err = client.ListByResourceGroupAndRegion(ctx, resourceGroupName, ascLocation) return } diff --git a/services/preview/security/mgmt/v1.0/security/locations.go b/services/preview/security/mgmt/v1.0/security/locations.go index a8b208f811fc..f6381e9bb043 100644 --- a/services/preview/security/mgmt/v1.0/security/locations.go +++ b/services/preview/security/mgmt/v1.0/security/locations.go @@ -21,18 +21,21 @@ type LocationsClient struct { } // NewLocationsClient creates an instance of the LocationsClient client. -func NewLocationsClient(subscriptionID string, ascLocation string) LocationsClient { - return NewLocationsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewLocationsClient(subscriptionID string) LocationsClient { + return NewLocationsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewLocationsClientWithBaseURI creates an instance of the LocationsClient 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 NewLocationsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) LocationsClient { - return LocationsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewLocationsClientWithBaseURI(baseURI string, subscriptionID string) LocationsClient { + return LocationsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get details of a specific location -func (client LocationsClient) Get(ctx context.Context) (result AscLocation, err error) { +// Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations +func (client LocationsClient) Get(ctx context.Context, ascLocation string) (result AscLocation, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LocationsClient.Get") defer func() { @@ -49,7 +52,7 @@ func (client LocationsClient) Get(ctx context.Context) (result AscLocation, err return result, validation.NewError("security.LocationsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx) + req, err := client.GetPreparer(ctx, ascLocation) if err != nil { err = autorest.NewErrorWithError(err, "security.LocationsClient", "Get", nil, "Failure preparing request") return @@ -72,9 +75,9 @@ func (client LocationsClient) Get(ctx context.Context) (result AscLocation, err } // GetPreparer prepares the Get request. -func (client LocationsClient) GetPreparer(ctx context.Context) (*http.Request, error) { +func (client LocationsClient) GetPreparer(ctx context.Context, ascLocation string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } diff --git a/services/preview/security/mgmt/v3.0/security/iotalerttypes.go b/services/preview/security/mgmt/v1.0/security/mdeonboardings.go similarity index 58% rename from services/preview/security/mgmt/v3.0/security/iotalerttypes.go rename to services/preview/security/mgmt/v1.0/security/mdeonboardings.go index 08f297dde0c6..9b52e014e356 100644 --- a/services/preview/security/mgmt/v3.0/security/iotalerttypes.go +++ b/services/preview/security/mgmt/v1.0/security/mdeonboardings.go @@ -15,28 +15,26 @@ import ( "net/http" ) -// IotAlertTypesClient is the API spec for Microsoft.Security (Azure Security Center) resource provider -type IotAlertTypesClient struct { +// MdeOnboardingsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type MdeOnboardingsClient struct { BaseClient } -// NewIotAlertTypesClient creates an instance of the IotAlertTypesClient client. -func NewIotAlertTypesClient(subscriptionID string, ascLocation string) IotAlertTypesClient { - return NewIotAlertTypesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +// NewMdeOnboardingsClient creates an instance of the MdeOnboardingsClient client. +func NewMdeOnboardingsClient(subscriptionID string) MdeOnboardingsClient { + return NewMdeOnboardingsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewIotAlertTypesClientWithBaseURI creates an instance of the IotAlertTypesClient client using a custom endpoint. +// NewMdeOnboardingsClientWithBaseURI creates an instance of the MdeOnboardingsClient 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 NewIotAlertTypesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotAlertTypesClient { - return IotAlertTypesClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewMdeOnboardingsClientWithBaseURI(baseURI string, subscriptionID string) MdeOnboardingsClient { + return MdeOnboardingsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get get IoT alert type -// Parameters: -// iotAlertTypeName - name of the alert type -func (client IotAlertTypesClient) Get(ctx context.Context, iotAlertTypeName string) (result IotAlertType, err error) { +// Get the default configuration or data needed to onboard the machine to MDE +func (client MdeOnboardingsClient) Get(ctx context.Context) (result MdeOnboardingData, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertTypesClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/MdeOnboardingsClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -48,25 +46,25 @@ func (client IotAlertTypesClient) Get(ctx context.Context, iotAlertTypeName stri 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", "Get", err.Error()) + return result, validation.NewError("security.MdeOnboardingsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, iotAlertTypeName) + req, err := client.GetPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "security.IotAlertTypesClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.MdeOnboardingsClient", "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.IotAlertTypesClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.MdeOnboardingsClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.IotAlertTypesClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.MdeOnboardingsClient", "Get", resp, "Failure responding to request") return } @@ -74,13 +72,12 @@ func (client IotAlertTypesClient) Get(ctx context.Context, iotAlertTypeName stri } // GetPreparer prepares the Get request. -func (client IotAlertTypesClient) GetPreparer(ctx context.Context, iotAlertTypeName string) (*http.Request, error) { +func (client MdeOnboardingsClient) GetPreparer(ctx context.Context) (*http.Request, error) { pathParameters := map[string]interface{}{ - "iotAlertTypeName": autorest.Encode("path", iotAlertTypeName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-08-06-preview" + const APIVersion = "2021-10-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -88,20 +85,20 @@ func (client IotAlertTypesClient) GetPreparer(ctx context.Context, iotAlertTypeN preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes/{iotAlertTypeName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings/default", 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) { +func (client MdeOnboardingsClient) 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) { +func (client MdeOnboardingsClient) GetResponder(resp *http.Response) (result MdeOnboardingData, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -111,10 +108,10 @@ func (client IotAlertTypesClient) GetResponder(resp *http.Response) (result IotA return } -// List list IoT alert types -func (client IotAlertTypesClient) List(ctx context.Context) (result IotAlertTypeList, err error) { +// List the configuration or data needed to onboard the machine to MDE +func (client MdeOnboardingsClient) List(ctx context.Context) (result MdeOnboardingDataList, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertTypesClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/MdeOnboardingsClient.List") defer func() { sc := -1 if result.Response.Response != nil { @@ -126,25 +123,25 @@ func (client IotAlertTypesClient) List(ctx context.Context) (result IotAlertType 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", "List", err.Error()) + return result, validation.NewError("security.MdeOnboardingsClient", "List", err.Error()) } req, err := client.ListPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "security.IotAlertTypesClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.MdeOnboardingsClient", "List", nil, "Failure preparing request") return } resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IotAlertTypesClient", "List", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.MdeOnboardingsClient", "List", resp, "Failure sending request") return } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.IotAlertTypesClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.MdeOnboardingsClient", "List", resp, "Failure responding to request") return } @@ -152,12 +149,12 @@ func (client IotAlertTypesClient) List(ctx context.Context) (result IotAlertType } // ListPreparer prepares the List request. -func (client IotAlertTypesClient) ListPreparer(ctx context.Context) (*http.Request, error) { +func (client MdeOnboardingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-08-06-preview" + const APIVersion = "2021-10-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -165,20 +162,20 @@ func (client IotAlertTypesClient) ListPreparer(ctx context.Context) (*http.Reque preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings", 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 IotAlertTypesClient) ListSender(req *http.Request) (*http.Response, error) { +func (client MdeOnboardingsClient) 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 IotAlertTypesClient) ListResponder(resp *http.Response) (result IotAlertTypeList, err error) { +func (client MdeOnboardingsClient) ListResponder(resp *http.Response) (result MdeOnboardingDataList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/services/preview/security/mgmt/v1.0/security/models.go b/services/preview/security/mgmt/v1.0/security/models.go index ddd586e71223..62e9e9a7276c 100644 --- a/services/preview/security/mgmt/v1.0/security/models.go +++ b/services/preview/security/mgmt/v1.0/security/models.go @@ -40,7 +40,7 @@ type AadExternalSecuritySolution struct { // Location - READ-ONLY; Location where the resource is stored Location *string `json:"location,omitempty"` // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' - Kind KindEnum `json:"kind,omitempty"` + Kind KindEnum1 `json:"kind,omitempty"` } // MarshalJSON is the custom marshaler for AadExternalSecuritySolution. @@ -2548,10 +2548,10 @@ func (awg *AppWhitelistingGroup) UnmarshalJSON(body []byte) error { return nil } -// AppWhitelistingGroupData represents a VM/server group and set of rules that are Recommended by Azure -// Security Center to be allowed +// AppWhitelistingGroupData represents a VM/server group and set of rules that are Recommended by Microsoft +// Defender for Cloud to be allowed type AppWhitelistingGroupData 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 - Possible values include: 'ConfigurationStatus2Configured', 'ConfigurationStatus2NotConfigured', 'ConfigurationStatus2InProgress', 'ConfigurationStatus2Failed', 'ConfigurationStatus2NoStatus' @@ -2566,7 +2566,7 @@ type AppWhitelistingGroupData struct { } // AppWhitelistingGroups represents a list of VM/server groups and set of rules that are Recommended by -// Azure Security Center to be allowed +// Microsoft Defender for Cloud to be allowed type AppWhitelistingGroups struct { autorest.Response `json:"-"` Value *[]AppWhitelistingGroup `json:"value,omitempty"` @@ -2788,7 +2788,7 @@ type AtaExternalSecuritySolution struct { // Location - READ-ONLY; Location where the resource is stored Location *string `json:"location,omitempty"` // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' - Kind KindEnum `json:"kind,omitempty"` + Kind KindEnum1 `json:"kind,omitempty"` } // MarshalJSON is the custom marshaler for AtaExternalSecuritySolution. @@ -3245,7 +3245,7 @@ func (aa AutomationAction) AsBasicAutomationAction() (BasicAutomationAction, boo } // AutomationActionEventHub the target Event Hub to which event data will be exported. To learn more about -// Security Center continuous export capabilities, visit https://aka.ms/ASCExportLearnMore +// Microsoft Defender for Cloud continuous export capabilities, visit https://aka.ms/ASCExportLearnMore type AutomationActionEventHub struct { // EventHubResourceID - The target Event Hub Azure Resource ID. EventHubResourceID *string `json:"eventHubResourceId,omitempty"` @@ -3298,8 +3298,9 @@ func (aaeh AutomationActionEventHub) AsBasicAutomationAction() (BasicAutomationA return &aaeh, true } -// AutomationActionLogicApp the logic app action that should be triggered. To learn more about Security -// Center's Workflow Automation capabilities, visit https://aka.ms/ASCWorkflowAutomationLearnMore +// AutomationActionLogicApp the logic app action that should be triggered. To learn more about Microsoft +// Defender for Cloud's Workflow Automation capabilities, visit +// https://aka.ms/ASCWorkflowAutomationLearnMore type AutomationActionLogicApp struct { // LogicAppResourceID - The triggered Logic App Azure Resource ID. This can also reside on other subscriptions, given that you have permissions to trigger the Logic App LogicAppResourceID *string `json:"logicAppResourceId,omitempty"` @@ -3354,8 +3355,8 @@ func (aala AutomationActionLogicApp) AsBasicAutomationAction() (BasicAutomationA // alerts data will reside in the 'SecurityAlert' table and the assessments data will reside in the // 'SecurityRecommendation' table (under the 'Security'/'SecurityCenterFree' solutions). Note that in order // to view the data in the workspace, the Security Center Log Analytics free/standard solution needs to be -// enabled on that workspace. To learn more about Security Center continuous export capabilities, visit -// https://aka.ms/ASCExportLearnMore +// enabled on that workspace. To learn more about Microsoft Defender for Cloud continuous export +// capabilities, visit https://aka.ms/ASCExportLearnMore type AutomationActionWorkspace struct { // WorkspaceResourceID - The fully qualified Log Analytics Workspace Azure Resource ID. WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"` @@ -3662,7 +3663,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', 'EventSourceAssessmentsSnapshot', 'EventSourceSubAssessments', 'EventSourceSubAssessmentsSnapshot', '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"` @@ -4060,6 +4061,253 @@ func (acadp AwsCredsAuthenticationDetailsProperties) AsBasicAuthenticationDetail return &acadp, true } +// AWSEnvironmentData the aws connector environment data +type AWSEnvironmentData struct { + // OrganizationalData - The AWS account's organizational data + OrganizationalData BasicAwsOrganizationalData `json:"organizationalData,omitempty"` + // EnvironmentType - Possible values include: 'EnvironmentTypeEnvironmentData', 'EnvironmentTypeAwsAccount', 'EnvironmentTypeGcpProject', 'EnvironmentTypeGithubScope' + EnvironmentType EnvironmentType `json:"environmentType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AWSEnvironmentData. +func (aed AWSEnvironmentData) MarshalJSON() ([]byte, error) { + aed.EnvironmentType = EnvironmentTypeAwsAccount + objectMap := make(map[string]interface{}) + objectMap["organizationalData"] = aed.OrganizationalData + if aed.EnvironmentType != "" { + objectMap["environmentType"] = aed.EnvironmentType + } + return json.Marshal(objectMap) +} + +// AsAWSEnvironmentData is the BasicEnvironmentData implementation for AWSEnvironmentData. +func (aed AWSEnvironmentData) AsAWSEnvironmentData() (*AWSEnvironmentData, bool) { + return &aed, true +} + +// AsGcpProjectEnvironmentData is the BasicEnvironmentData implementation for AWSEnvironmentData. +func (aed AWSEnvironmentData) AsGcpProjectEnvironmentData() (*GcpProjectEnvironmentData, bool) { + return nil, false +} + +// AsGithubScopeEnvironmentData is the BasicEnvironmentData implementation for AWSEnvironmentData. +func (aed AWSEnvironmentData) AsGithubScopeEnvironmentData() (*GithubScopeEnvironmentData, bool) { + return nil, false +} + +// AsEnvironmentData is the BasicEnvironmentData implementation for AWSEnvironmentData. +func (aed AWSEnvironmentData) AsEnvironmentData() (*EnvironmentData, bool) { + return nil, false +} + +// AsBasicEnvironmentData is the BasicEnvironmentData implementation for AWSEnvironmentData. +func (aed AWSEnvironmentData) AsBasicEnvironmentData() (BasicEnvironmentData, bool) { + return &aed, true +} + +// UnmarshalJSON is the custom unmarshaler for AWSEnvironmentData struct. +func (aed *AWSEnvironmentData) 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 "organizationalData": + if v != nil { + organizationalData, err := unmarshalBasicAwsOrganizationalData(*v) + if err != nil { + return err + } + aed.OrganizationalData = organizationalData + } + case "environmentType": + if v != nil { + var environmentType EnvironmentType + err = json.Unmarshal(*v, &environmentType) + if err != nil { + return err + } + aed.EnvironmentType = environmentType + } + } + } + + return nil +} + +// BasicAwsOrganizationalData the awsOrganization data +type BasicAwsOrganizationalData interface { + AsAwsOrganizationalDataMaster() (*AwsOrganizationalDataMaster, bool) + AsAwsOrganizationalDataMember() (*AwsOrganizationalDataMember, bool) + AsAwsOrganizationalData() (*AwsOrganizationalData, bool) +} + +// AwsOrganizationalData the awsOrganization data +type AwsOrganizationalData struct { + // OrganizationMembershipType - Possible values include: 'OrganizationMembershipTypeAwsOrganizationalData', 'OrganizationMembershipTypeOrganization', 'OrganizationMembershipTypeMember' + OrganizationMembershipType OrganizationMembershipType `json:"organizationMembershipType,omitempty"` +} + +func unmarshalBasicAwsOrganizationalData(body []byte) (BasicAwsOrganizationalData, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["organizationMembershipType"] { + case string(OrganizationMembershipTypeOrganization): + var aodm AwsOrganizationalDataMaster + err := json.Unmarshal(body, &aodm) + return aodm, err + case string(OrganizationMembershipTypeMember): + var aodm AwsOrganizationalDataMember + err := json.Unmarshal(body, &aodm) + return aodm, err + default: + var aod AwsOrganizationalData + err := json.Unmarshal(body, &aod) + return aod, err + } +} +func unmarshalBasicAwsOrganizationalDataArray(body []byte) ([]BasicAwsOrganizationalData, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + aodArray := make([]BasicAwsOrganizationalData, len(rawMessages)) + + for index, rawMessage := range rawMessages { + aod, err := unmarshalBasicAwsOrganizationalData(*rawMessage) + if err != nil { + return nil, err + } + aodArray[index] = aod + } + return aodArray, nil +} + +// MarshalJSON is the custom marshaler for AwsOrganizationalData. +func (aod AwsOrganizationalData) MarshalJSON() ([]byte, error) { + aod.OrganizationMembershipType = OrganizationMembershipTypeAwsOrganizationalData + objectMap := make(map[string]interface{}) + if aod.OrganizationMembershipType != "" { + objectMap["organizationMembershipType"] = aod.OrganizationMembershipType + } + return json.Marshal(objectMap) +} + +// AsAwsOrganizationalDataMaster is the BasicAwsOrganizationalData implementation for AwsOrganizationalData. +func (aod AwsOrganizationalData) AsAwsOrganizationalDataMaster() (*AwsOrganizationalDataMaster, bool) { + return nil, false +} + +// AsAwsOrganizationalDataMember is the BasicAwsOrganizationalData implementation for AwsOrganizationalData. +func (aod AwsOrganizationalData) AsAwsOrganizationalDataMember() (*AwsOrganizationalDataMember, bool) { + return nil, false +} + +// AsAwsOrganizationalData is the BasicAwsOrganizationalData implementation for AwsOrganizationalData. +func (aod AwsOrganizationalData) AsAwsOrganizationalData() (*AwsOrganizationalData, bool) { + return &aod, true +} + +// AsBasicAwsOrganizationalData is the BasicAwsOrganizationalData implementation for AwsOrganizationalData. +func (aod AwsOrganizationalData) AsBasicAwsOrganizationalData() (BasicAwsOrganizationalData, bool) { + return &aod, true +} + +// AwsOrganizationalDataMaster the awsOrganization data for the master account +type AwsOrganizationalDataMaster struct { + // StacksetName - If the multi cloud account is of membership type organization, this will be the name of the onboarding stackset + StacksetName *string `json:"stacksetName,omitempty"` + // ExcludedAccountIds - If the multi cloud account is of membership type organization, list of accounts excluded from offering + ExcludedAccountIds *[]string `json:"excludedAccountIds,omitempty"` + // OrganizationMembershipType - Possible values include: 'OrganizationMembershipTypeAwsOrganizationalData', 'OrganizationMembershipTypeOrganization', 'OrganizationMembershipTypeMember' + OrganizationMembershipType OrganizationMembershipType `json:"organizationMembershipType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AwsOrganizationalDataMaster. +func (aodm AwsOrganizationalDataMaster) MarshalJSON() ([]byte, error) { + aodm.OrganizationMembershipType = OrganizationMembershipTypeOrganization + objectMap := make(map[string]interface{}) + if aodm.StacksetName != nil { + objectMap["stacksetName"] = aodm.StacksetName + } + if aodm.ExcludedAccountIds != nil { + objectMap["excludedAccountIds"] = aodm.ExcludedAccountIds + } + if aodm.OrganizationMembershipType != "" { + objectMap["organizationMembershipType"] = aodm.OrganizationMembershipType + } + return json.Marshal(objectMap) +} + +// AsAwsOrganizationalDataMaster is the BasicAwsOrganizationalData implementation for AwsOrganizationalDataMaster. +func (aodm AwsOrganizationalDataMaster) AsAwsOrganizationalDataMaster() (*AwsOrganizationalDataMaster, bool) { + return &aodm, true +} + +// AsAwsOrganizationalDataMember is the BasicAwsOrganizationalData implementation for AwsOrganizationalDataMaster. +func (aodm AwsOrganizationalDataMaster) AsAwsOrganizationalDataMember() (*AwsOrganizationalDataMember, bool) { + return nil, false +} + +// AsAwsOrganizationalData is the BasicAwsOrganizationalData implementation for AwsOrganizationalDataMaster. +func (aodm AwsOrganizationalDataMaster) AsAwsOrganizationalData() (*AwsOrganizationalData, bool) { + return nil, false +} + +// AsBasicAwsOrganizationalData is the BasicAwsOrganizationalData implementation for AwsOrganizationalDataMaster. +func (aodm AwsOrganizationalDataMaster) AsBasicAwsOrganizationalData() (BasicAwsOrganizationalData, bool) { + return &aodm, true +} + +// AwsOrganizationalDataMember the awsOrganization data for the member account +type AwsOrganizationalDataMember struct { + // ParentHierarchyID - If the multi cloud account is not of membership type organization, this will be the ID of the account's parent + ParentHierarchyID *string `json:"parentHierarchyId,omitempty"` + // OrganizationMembershipType - Possible values include: 'OrganizationMembershipTypeAwsOrganizationalData', 'OrganizationMembershipTypeOrganization', 'OrganizationMembershipTypeMember' + OrganizationMembershipType OrganizationMembershipType `json:"organizationMembershipType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AwsOrganizationalDataMember. +func (aodm AwsOrganizationalDataMember) MarshalJSON() ([]byte, error) { + aodm.OrganizationMembershipType = OrganizationMembershipTypeMember + objectMap := make(map[string]interface{}) + if aodm.ParentHierarchyID != nil { + objectMap["parentHierarchyId"] = aodm.ParentHierarchyID + } + if aodm.OrganizationMembershipType != "" { + objectMap["organizationMembershipType"] = aodm.OrganizationMembershipType + } + return json.Marshal(objectMap) +} + +// AsAwsOrganizationalDataMaster is the BasicAwsOrganizationalData implementation for AwsOrganizationalDataMember. +func (aodm AwsOrganizationalDataMember) AsAwsOrganizationalDataMaster() (*AwsOrganizationalDataMaster, bool) { + return nil, false +} + +// AsAwsOrganizationalDataMember is the BasicAwsOrganizationalData implementation for AwsOrganizationalDataMember. +func (aodm AwsOrganizationalDataMember) AsAwsOrganizationalDataMember() (*AwsOrganizationalDataMember, bool) { + return &aodm, true +} + +// AsAwsOrganizationalData is the BasicAwsOrganizationalData implementation for AwsOrganizationalDataMember. +func (aodm AwsOrganizationalDataMember) AsAwsOrganizationalData() (*AwsOrganizationalData, bool) { + return nil, false +} + +// AsBasicAwsOrganizationalData is the BasicAwsOrganizationalData implementation for AwsOrganizationalDataMember. +func (aodm AwsOrganizationalDataMember) AsBasicAwsOrganizationalData() (BasicAwsOrganizationalData, bool) { + return &aodm, true +} + // AzureResourceDetails details of the Azure resource that was assessed type AzureResourceDetails struct { // ID - READ-ONLY; Azure resource Id of the assessed resource @@ -4165,7 +4413,7 @@ type CefExternalSecuritySolution struct { // Location - READ-ONLY; Location where the resource is stored Location *string `json:"location,omitempty"` // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' - Kind KindEnum `json:"kind,omitempty"` + Kind KindEnum1 `json:"kind,omitempty"` } // MarshalJSON is the custom marshaler for CefExternalSecuritySolution. @@ -4326,9 +4574,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"` } @@ -4365,12 +4614,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. @@ -4379,6 +4634,152 @@ func (ceb CloudErrorBody) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// BasicCloudOffering the security offering details +type BasicCloudOffering interface { + AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) + AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) + AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) + AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) + AsCspmMonitorGcpOffering() (*CspmMonitorGcpOffering, bool) + AsDefenderForServersGcpOffering() (*DefenderForServersGcpOffering, bool) + AsDefenderForContainersGcpOffering() (*DefenderForContainersGcpOffering, bool) + AsCspmMonitorGithubOffering() (*CspmMonitorGithubOffering, bool) + AsCloudOffering() (*CloudOffering, bool) +} + +// CloudOffering the security offering details +type CloudOffering struct { + // Description - READ-ONLY; The offering description. + Description *string `json:"description,omitempty"` + // OfferingType - Possible values include: 'OfferingTypeCloudOffering', 'OfferingTypeCspmMonitorAws', 'OfferingTypeDefenderForContainersAws', 'OfferingTypeDefenderForServersAws', 'OfferingTypeInformationProtectionAws', 'OfferingTypeCspmMonitorGcp', 'OfferingTypeDefenderForServersGcp', 'OfferingTypeDefenderForContainersGcp', 'OfferingTypeCspmMonitorGithub' + OfferingType OfferingType `json:"offeringType,omitempty"` +} + +func unmarshalBasicCloudOffering(body []byte) (BasicCloudOffering, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["offeringType"] { + case string(OfferingTypeCspmMonitorAws): + var cmao CspmMonitorAwsOffering + err := json.Unmarshal(body, &cmao) + return cmao, err + case string(OfferingTypeDefenderForContainersAws): + var dfcao DefenderForContainersAwsOffering + err := json.Unmarshal(body, &dfcao) + return dfcao, err + case string(OfferingTypeDefenderForServersAws): + var dfsao DefenderForServersAwsOffering + err := json.Unmarshal(body, &dfsao) + return dfsao, err + case string(OfferingTypeInformationProtectionAws): + var ipao InformationProtectionAwsOffering + err := json.Unmarshal(body, &ipao) + return ipao, err + case string(OfferingTypeCspmMonitorGcp): + var cmgo CspmMonitorGcpOffering + err := json.Unmarshal(body, &cmgo) + return cmgo, err + case string(OfferingTypeDefenderForServersGcp): + var dfsgo DefenderForServersGcpOffering + err := json.Unmarshal(body, &dfsgo) + return dfsgo, err + case string(OfferingTypeDefenderForContainersGcp): + var dfcgo DefenderForContainersGcpOffering + err := json.Unmarshal(body, &dfcgo) + return dfcgo, err + case string(OfferingTypeCspmMonitorGithub): + var cmgo CspmMonitorGithubOffering + err := json.Unmarshal(body, &cmgo) + return cmgo, err + default: + var co CloudOffering + err := json.Unmarshal(body, &co) + return co, err + } +} +func unmarshalBasicCloudOfferingArray(body []byte) ([]BasicCloudOffering, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + coArray := make([]BasicCloudOffering, len(rawMessages)) + + for index, rawMessage := range rawMessages { + co, err := unmarshalBasicCloudOffering(*rawMessage) + if err != nil { + return nil, err + } + coArray[index] = co + } + return coArray, nil +} + +// MarshalJSON is the custom marshaler for CloudOffering. +func (co CloudOffering) MarshalJSON() ([]byte, error) { + co.OfferingType = OfferingTypeCloudOffering + objectMap := make(map[string]interface{}) + if co.OfferingType != "" { + objectMap["offeringType"] = co.OfferingType + } + return json.Marshal(objectMap) +} + +// AsCspmMonitorAwsOffering is the BasicCloudOffering implementation for CloudOffering. +func (co CloudOffering) AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) { + return nil, false +} + +// AsDefenderForContainersAwsOffering is the BasicCloudOffering implementation for CloudOffering. +func (co CloudOffering) AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) { + return nil, false +} + +// AsDefenderForServersAwsOffering is the BasicCloudOffering implementation for CloudOffering. +func (co CloudOffering) AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) { + return nil, false +} + +// AsInformationProtectionAwsOffering is the BasicCloudOffering implementation for CloudOffering. +func (co CloudOffering) AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) { + return nil, false +} + +// AsCspmMonitorGcpOffering is the BasicCloudOffering implementation for CloudOffering. +func (co CloudOffering) AsCspmMonitorGcpOffering() (*CspmMonitorGcpOffering, bool) { + return nil, false +} + +// AsDefenderForServersGcpOffering is the BasicCloudOffering implementation for CloudOffering. +func (co CloudOffering) AsDefenderForServersGcpOffering() (*DefenderForServersGcpOffering, bool) { + return nil, false +} + +// AsDefenderForContainersGcpOffering is the BasicCloudOffering implementation for CloudOffering. +func (co CloudOffering) AsDefenderForContainersGcpOffering() (*DefenderForContainersGcpOffering, bool) { + return nil, false +} + +// AsCspmMonitorGithubOffering is the BasicCloudOffering implementation for CloudOffering. +func (co CloudOffering) AsCspmMonitorGithubOffering() (*CspmMonitorGithubOffering, bool) { + return nil, false +} + +// AsCloudOffering is the BasicCloudOffering implementation for CloudOffering. +func (co CloudOffering) AsCloudOffering() (*CloudOffering, bool) { + return &co, true +} + +// AsBasicCloudOffering is the BasicCloudOffering implementation for CloudOffering. +func (co CloudOffering) AsBasicCloudOffering() (BasicCloudOffering, bool) { + return &co, true +} + // Compliance compliance of a scope type Compliance struct { autorest.Response `json:"-"` @@ -4690,6 +5091,13 @@ type ConnectedWorkspace struct { ID *string `json:"id,omitempty"` } +// 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 { @@ -4873,30 +5281,52 @@ func (ctina ConnectionToIPNotAllowed) AsBasicCustomAlertRule() (BasicCustomAlert return &ctina, true } -// ConnectorSetting the connector setting -type ConnectorSetting struct { +// Connector the security connector resource. +type Connector struct { autorest.Response `json:"-"` - // ConnectorSettingProperties - Connector setting data - *ConnectorSettingProperties `json:"properties,omitempty"` + // SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty"` + // ConnectorProperties - Security connector data + *ConnectorProperties `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"` + // Location - Location where the resource is stored + Location *string `json:"location,omitempty"` + // Kind - Kind of the resource + Kind *string `json:"kind,omitempty"` + // Etag - Entity tag is used for comparing two or more entities from the same requested resource. + Etag *string `json:"etag,omitempty"` + // Tags - A list of key value pairs that describe the resource. + Tags map[string]*string `json:"tags"` } -// MarshalJSON is the custom marshaler for ConnectorSetting. -func (cs ConnectorSetting) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for Connector. +func (c Connector) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if cs.ConnectorSettingProperties != nil { - objectMap["properties"] = cs.ConnectorSettingProperties + if c.ConnectorProperties != nil { + objectMap["properties"] = c.ConnectorProperties + } + if c.Location != nil { + objectMap["location"] = c.Location + } + if c.Kind != nil { + objectMap["kind"] = c.Kind + } + if c.Etag != nil { + objectMap["etag"] = c.Etag + } + if c.Tags != nil { + objectMap["tags"] = c.Tags } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ConnectorSetting struct. -func (cs *ConnectorSetting) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for Connector struct. +func (c *Connector) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -4904,14 +5334,23 @@ func (cs *ConnectorSetting) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + c.SystemData = &systemData + } case "properties": if v != nil { - var connectorSettingProperties ConnectorSettingProperties - err = json.Unmarshal(*v, &connectorSettingProperties) + var connectorProperties ConnectorProperties + err = json.Unmarshal(*v, &connectorProperties) if err != nil { return err } - cs.ConnectorSettingProperties = &connectorSettingProperties + c.ConnectorProperties = &connectorProperties } case "id": if v != nil { @@ -4920,7 +5359,7 @@ func (cs *ConnectorSetting) UnmarshalJSON(body []byte) error { if err != nil { return err } - cs.ID = &ID + c.ID = &ID } case "name": if v != nil { @@ -4929,7 +5368,7 @@ func (cs *ConnectorSetting) UnmarshalJSON(body []byte) error { if err != nil { return err } - cs.Name = &name + c.Name = &name } case "type": if v != nil { @@ -4938,39 +5377,209 @@ func (cs *ConnectorSetting) UnmarshalJSON(body []byte) error { if err != nil { return err } - cs.Type = &typeVar + c.Type = &typeVar } - } - } - - return nil -} - -// ConnectorSettingList for a subscription, list of all cloud account connectors and their settings -type ConnectorSettingList struct { - autorest.Response `json:"-"` - // Value - List of all the cloud account connector settings - Value *[]ConnectorSetting `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ConnectorSettingList. -func (csl ConnectorSettingList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if csl.Value != nil { - objectMap["value"] = csl.Value - } - return json.Marshal(objectMap) -} - -// ConnectorSettingListIterator provides access to a complete listing of ConnectorSetting values. -type ConnectorSettingListIterator struct { - i int - page ConnectorSettingListPage -} - -// NextWithContext advances to the next value. If there was an error making + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + c.Location = &location + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + c.Kind = &kind + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + c.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + c.Tags = tags + } + } + } + + return nil +} + +// ConnectorProperties a set of properties that defines the security connector configuration. +type ConnectorProperties struct { + // HierarchyIdentifier - The multi cloud resource identifier (account id in case of AWS connector, project number in case of GCP connector). + HierarchyIdentifier *string `json:"hierarchyIdentifier,omitempty"` + // EnvironmentName - The multi cloud resource's cloud name. Possible values include: 'Azure', 'AWS', 'GCP', 'Github' + EnvironmentName CloudName `json:"environmentName,omitempty"` + // Offerings - A collection of offerings for the security connector. + Offerings *[]BasicCloudOffering `json:"offerings,omitempty"` + // EnvironmentData - The security connector environment data. + EnvironmentData BasicEnvironmentData `json:"environmentData,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ConnectorProperties struct. +func (cp *ConnectorProperties) 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 "hierarchyIdentifier": + if v != nil { + var hierarchyIdentifier string + err = json.Unmarshal(*v, &hierarchyIdentifier) + if err != nil { + return err + } + cp.HierarchyIdentifier = &hierarchyIdentifier + } + case "environmentName": + if v != nil { + var environmentName CloudName + err = json.Unmarshal(*v, &environmentName) + if err != nil { + return err + } + cp.EnvironmentName = environmentName + } + case "offerings": + if v != nil { + offerings, err := unmarshalBasicCloudOfferingArray(*v) + if err != nil { + return err + } + cp.Offerings = &offerings + } + case "environmentData": + if v != nil { + environmentData, err := unmarshalBasicEnvironmentData(*v) + if err != nil { + return err + } + cp.EnvironmentData = environmentData + } + } + } + + return nil +} + +// ConnectorSetting the connector setting +type ConnectorSetting struct { + autorest.Response `json:"-"` + // ConnectorSettingProperties - Connector setting data + *ConnectorSettingProperties `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 ConnectorSetting. +func (cs ConnectorSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cs.ConnectorSettingProperties != nil { + objectMap["properties"] = cs.ConnectorSettingProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ConnectorSetting struct. +func (cs *ConnectorSetting) 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 connectorSettingProperties ConnectorSettingProperties + err = json.Unmarshal(*v, &connectorSettingProperties) + if err != nil { + return err + } + cs.ConnectorSettingProperties = &connectorSettingProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cs.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cs.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cs.Type = &typeVar + } + } + } + + return nil +} + +// ConnectorSettingList for a subscription, list of all cloud account connectors and their settings +type ConnectorSettingList struct { + autorest.Response `json:"-"` + // Value - List of all the cloud account connector settings + Value *[]ConnectorSetting `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectorSettingList. +func (csl ConnectorSettingList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csl.Value != nil { + objectMap["value"] = csl.Value + } + return json.Marshal(objectMap) +} + +// ConnectorSettingListIterator provides access to a complete listing of ConnectorSetting values. +type ConnectorSettingListIterator struct { + i int + page ConnectorSettingListPage +} + +// 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 *ConnectorSettingListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { @@ -5154,98 +5763,266 @@ func (csp *ConnectorSettingProperties) UnmarshalJSON(body []byte) error { return nil } -// Contact contact details for security issues -type Contact struct { - autorest.Response `json:"-"` - // ContactProperties - Security contact data - *ContactProperties `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 Contact. -func (c Contact) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.ContactProperties != nil { - objectMap["properties"] = c.ContactProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Contact struct. -func (c *Contact) 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 contactProperties ContactProperties - err = json.Unmarshal(*v, &contactProperties) - if err != nil { - return err - } - c.ContactProperties = &contactProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - c.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - c.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - c.Type = &typeVar - } - } - } - - return nil -} - -// ContactList list of security contacts response -type ContactList struct { +// ConnectorsList list of security connectors response. +type ConnectorsList struct { autorest.Response `json:"-"` - // Value - READ-ONLY; List of security contacts - Value *[]Contact `json:"value,omitempty"` + // Value - The list of security connectors under the given scope. + Value *[]Connector `json:"value,omitempty"` // NextLink - READ-ONLY; The URI to fetch the next page. NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for ContactList. -func (cl ContactList) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ConnectorsList. +func (cl ConnectorsList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if cl.Value != nil { + objectMap["value"] = cl.Value + } return json.Marshal(objectMap) } -// ContactListIterator provides access to a complete listing of Contact values. -type ContactListIterator struct { +// ConnectorsListIterator provides access to a complete listing of Connector values. +type ConnectorsListIterator struct { i int - page ContactListPage + page ConnectorsListPage +} + +// 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 *ConnectorsListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsListIterator.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 *ConnectorsListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ConnectorsListIterator) 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 ConnectorsListIterator) Response() ConnectorsList { + 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 ConnectorsListIterator) Value() Connector { + if !iter.page.NotDone() { + return Connector{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ConnectorsListIterator type. +func NewConnectorsListIterator(page ConnectorsListPage) ConnectorsListIterator { + return ConnectorsListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cl ConnectorsList) IsEmpty() bool { + return cl.Value == nil || len(*cl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (cl ConnectorsList) hasNextLink() bool { + return cl.NextLink != nil && len(*cl.NextLink) != 0 +} + +// connectorsListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cl ConnectorsList) connectorsListPreparer(ctx context.Context) (*http.Request, error) { + if !cl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cl.NextLink))) +} + +// ConnectorsListPage contains a page of Connector values. +type ConnectorsListPage struct { + fn func(context.Context, ConnectorsList) (ConnectorsList, error) + cl ConnectorsList +} + +// 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 *ConnectorsListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsListPage.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.cl) + if err != nil { + return err + } + page.cl = 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 *ConnectorsListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ConnectorsListPage) NotDone() bool { + return !page.cl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ConnectorsListPage) Response() ConnectorsList { + return page.cl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ConnectorsListPage) Values() []Connector { + if page.cl.IsEmpty() { + return nil + } + return *page.cl.Value +} + +// Creates a new instance of the ConnectorsListPage type. +func NewConnectorsListPage(cur ConnectorsList, getNextPage func(context.Context, ConnectorsList) (ConnectorsList, error)) ConnectorsListPage { + return ConnectorsListPage{ + fn: getNextPage, + cl: cur, + } +} + +// Contact contact details for security issues +type Contact struct { + autorest.Response `json:"-"` + // ContactProperties - Security contact data + *ContactProperties `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 Contact. +func (c Contact) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.ContactProperties != nil { + objectMap["properties"] = c.ContactProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Contact struct. +func (c *Contact) 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 contactProperties ContactProperties + err = json.Unmarshal(*v, &contactProperties) + if err != nil { + return err + } + c.ContactProperties = &contactProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + } + } + + return nil +} + +// ContactList list of security contacts response +type ContactList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of security contacts + Value *[]Contact `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContactList. +func (cl ContactList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ContactListIterator provides access to a complete listing of Contact values. +type ContactListIterator struct { + i int + page ContactListPage } // NextWithContext advances to the next value. If there was an error making @@ -5462,54 +6239,282 @@ func (crvp ContainerRegistryVulnerabilityProperties) AsBasicAdditionalData() (Ba return &crvp, true } -// BasicCustomAlertRule a custom alert rule. -type BasicCustomAlertRule interface { - AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) - AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) - AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) - AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) - AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) - AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) - AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) - AsListCustomAlertRule() (*ListCustomAlertRule, bool) - AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) - AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) - AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) - AsProcessNotAllowed() (*ProcessNotAllowed, bool) - AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) - AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) - AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) - AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) - AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) - AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) - AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) - AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) - AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) - AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) - AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) - AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) - AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) - AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) - AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) - AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) - AsCustomAlertRule() (*CustomAlertRule, bool) -} - -// CustomAlertRule a custom alert rule. -type CustomAlertRule struct { - // DisplayName - READ-ONLY; The display name of the custom alert. - DisplayName *string `json:"displayName,omitempty"` - // Description - READ-ONLY; The description of the custom alert. +// CspmMonitorAwsOffering the CSPM monitoring for AWS offering +type CspmMonitorAwsOffering struct { + // NativeCloudConnection - The native cloud connection configuration + NativeCloudConnection *CspmMonitorAwsOfferingNativeCloudConnection `json:"nativeCloudConnection,omitempty"` + // Description - READ-ONLY; The offering description. 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 RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` + // OfferingType - Possible values include: 'OfferingTypeCloudOffering', 'OfferingTypeCspmMonitorAws', 'OfferingTypeDefenderForContainersAws', 'OfferingTypeDefenderForServersAws', 'OfferingTypeInformationProtectionAws', 'OfferingTypeCspmMonitorGcp', 'OfferingTypeDefenderForServersGcp', 'OfferingTypeDefenderForContainersGcp', 'OfferingTypeCspmMonitorGithub' + OfferingType OfferingType `json:"offeringType,omitempty"` } -func unmarshalBasicCustomAlertRule(body []byte) (BasicCustomAlertRule, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) +// MarshalJSON is the custom marshaler for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) MarshalJSON() ([]byte, error) { + cmao.OfferingType = OfferingTypeCspmMonitorAws + objectMap := make(map[string]interface{}) + if cmao.NativeCloudConnection != nil { + objectMap["nativeCloudConnection"] = cmao.NativeCloudConnection + } + if cmao.OfferingType != "" { + objectMap["offeringType"] = cmao.OfferingType + } + return json.Marshal(objectMap) +} + +// AsCspmMonitorAwsOffering is the BasicCloudOffering implementation for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) { + return &cmao, true +} + +// AsDefenderForContainersAwsOffering is the BasicCloudOffering implementation for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) { + return nil, false +} + +// AsDefenderForServersAwsOffering is the BasicCloudOffering implementation for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) { + return nil, false +} + +// AsInformationProtectionAwsOffering is the BasicCloudOffering implementation for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) { + return nil, false +} + +// AsCspmMonitorGcpOffering is the BasicCloudOffering implementation for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) AsCspmMonitorGcpOffering() (*CspmMonitorGcpOffering, bool) { + return nil, false +} + +// AsDefenderForServersGcpOffering is the BasicCloudOffering implementation for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) AsDefenderForServersGcpOffering() (*DefenderForServersGcpOffering, bool) { + return nil, false +} + +// AsDefenderForContainersGcpOffering is the BasicCloudOffering implementation for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) AsDefenderForContainersGcpOffering() (*DefenderForContainersGcpOffering, bool) { + return nil, false +} + +// AsCspmMonitorGithubOffering is the BasicCloudOffering implementation for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) AsCspmMonitorGithubOffering() (*CspmMonitorGithubOffering, bool) { + return nil, false +} + +// AsCloudOffering is the BasicCloudOffering implementation for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) AsCloudOffering() (*CloudOffering, bool) { + return nil, false +} + +// AsBasicCloudOffering is the BasicCloudOffering implementation for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) AsBasicCloudOffering() (BasicCloudOffering, bool) { + return &cmao, true +} + +// CspmMonitorAwsOfferingNativeCloudConnection the native cloud connection configuration +type CspmMonitorAwsOfferingNativeCloudConnection struct { + // CloudRoleArn - The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` +} + +// CspmMonitorGcpOffering the CSPM monitoring for GCP offering +type CspmMonitorGcpOffering struct { + // NativeCloudConnection - The native cloud connection configuration + NativeCloudConnection *CspmMonitorGcpOfferingNativeCloudConnection `json:"nativeCloudConnection,omitempty"` + // Description - READ-ONLY; The offering description. + Description *string `json:"description,omitempty"` + // OfferingType - Possible values include: 'OfferingTypeCloudOffering', 'OfferingTypeCspmMonitorAws', 'OfferingTypeDefenderForContainersAws', 'OfferingTypeDefenderForServersAws', 'OfferingTypeInformationProtectionAws', 'OfferingTypeCspmMonitorGcp', 'OfferingTypeDefenderForServersGcp', 'OfferingTypeDefenderForContainersGcp', 'OfferingTypeCspmMonitorGithub' + OfferingType OfferingType `json:"offeringType,omitempty"` +} + +// MarshalJSON is the custom marshaler for CspmMonitorGcpOffering. +func (cmgo CspmMonitorGcpOffering) MarshalJSON() ([]byte, error) { + cmgo.OfferingType = OfferingTypeCspmMonitorGcp + objectMap := make(map[string]interface{}) + if cmgo.NativeCloudConnection != nil { + objectMap["nativeCloudConnection"] = cmgo.NativeCloudConnection + } + if cmgo.OfferingType != "" { + objectMap["offeringType"] = cmgo.OfferingType + } + return json.Marshal(objectMap) +} + +// AsCspmMonitorAwsOffering is the BasicCloudOffering implementation for CspmMonitorGcpOffering. +func (cmgo CspmMonitorGcpOffering) AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) { + return nil, false +} + +// AsDefenderForContainersAwsOffering is the BasicCloudOffering implementation for CspmMonitorGcpOffering. +func (cmgo CspmMonitorGcpOffering) AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) { + return nil, false +} + +// AsDefenderForServersAwsOffering is the BasicCloudOffering implementation for CspmMonitorGcpOffering. +func (cmgo CspmMonitorGcpOffering) AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) { + return nil, false +} + +// AsInformationProtectionAwsOffering is the BasicCloudOffering implementation for CspmMonitorGcpOffering. +func (cmgo CspmMonitorGcpOffering) AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) { + return nil, false +} + +// AsCspmMonitorGcpOffering is the BasicCloudOffering implementation for CspmMonitorGcpOffering. +func (cmgo CspmMonitorGcpOffering) AsCspmMonitorGcpOffering() (*CspmMonitorGcpOffering, bool) { + return &cmgo, true +} + +// AsDefenderForServersGcpOffering is the BasicCloudOffering implementation for CspmMonitorGcpOffering. +func (cmgo CspmMonitorGcpOffering) AsDefenderForServersGcpOffering() (*DefenderForServersGcpOffering, bool) { + return nil, false +} + +// AsDefenderForContainersGcpOffering is the BasicCloudOffering implementation for CspmMonitorGcpOffering. +func (cmgo CspmMonitorGcpOffering) AsDefenderForContainersGcpOffering() (*DefenderForContainersGcpOffering, bool) { + return nil, false +} + +// AsCspmMonitorGithubOffering is the BasicCloudOffering implementation for CspmMonitorGcpOffering. +func (cmgo CspmMonitorGcpOffering) AsCspmMonitorGithubOffering() (*CspmMonitorGithubOffering, bool) { + return nil, false +} + +// AsCloudOffering is the BasicCloudOffering implementation for CspmMonitorGcpOffering. +func (cmgo CspmMonitorGcpOffering) AsCloudOffering() (*CloudOffering, bool) { + return nil, false +} + +// AsBasicCloudOffering is the BasicCloudOffering implementation for CspmMonitorGcpOffering. +func (cmgo CspmMonitorGcpOffering) AsBasicCloudOffering() (BasicCloudOffering, bool) { + return &cmgo, true +} + +// CspmMonitorGcpOfferingNativeCloudConnection the native cloud connection configuration +type CspmMonitorGcpOfferingNativeCloudConnection struct { + // WorkloadIdentityProviderID - The GCP workload identity provider id for the offering + WorkloadIdentityProviderID *string `json:"workloadIdentityProviderId,omitempty"` + // ServiceAccountEmailAddress - The service account email address in GCP for this offering + ServiceAccountEmailAddress *string `json:"serviceAccountEmailAddress,omitempty"` +} + +// CspmMonitorGithubOffering the CSPM monitoring for github offering +type CspmMonitorGithubOffering struct { + // Description - READ-ONLY; The offering description. + Description *string `json:"description,omitempty"` + // OfferingType - Possible values include: 'OfferingTypeCloudOffering', 'OfferingTypeCspmMonitorAws', 'OfferingTypeDefenderForContainersAws', 'OfferingTypeDefenderForServersAws', 'OfferingTypeInformationProtectionAws', 'OfferingTypeCspmMonitorGcp', 'OfferingTypeDefenderForServersGcp', 'OfferingTypeDefenderForContainersGcp', 'OfferingTypeCspmMonitorGithub' + OfferingType OfferingType `json:"offeringType,omitempty"` +} + +// MarshalJSON is the custom marshaler for CspmMonitorGithubOffering. +func (cmgo CspmMonitorGithubOffering) MarshalJSON() ([]byte, error) { + cmgo.OfferingType = OfferingTypeCspmMonitorGithub + objectMap := make(map[string]interface{}) + if cmgo.OfferingType != "" { + objectMap["offeringType"] = cmgo.OfferingType + } + return json.Marshal(objectMap) +} + +// AsCspmMonitorAwsOffering is the BasicCloudOffering implementation for CspmMonitorGithubOffering. +func (cmgo CspmMonitorGithubOffering) AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) { + return nil, false +} + +// AsDefenderForContainersAwsOffering is the BasicCloudOffering implementation for CspmMonitorGithubOffering. +func (cmgo CspmMonitorGithubOffering) AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) { + return nil, false +} + +// AsDefenderForServersAwsOffering is the BasicCloudOffering implementation for CspmMonitorGithubOffering. +func (cmgo CspmMonitorGithubOffering) AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) { + return nil, false +} + +// AsInformationProtectionAwsOffering is the BasicCloudOffering implementation for CspmMonitorGithubOffering. +func (cmgo CspmMonitorGithubOffering) AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) { + return nil, false +} + +// AsCspmMonitorGcpOffering is the BasicCloudOffering implementation for CspmMonitorGithubOffering. +func (cmgo CspmMonitorGithubOffering) AsCspmMonitorGcpOffering() (*CspmMonitorGcpOffering, bool) { + return nil, false +} + +// AsDefenderForServersGcpOffering is the BasicCloudOffering implementation for CspmMonitorGithubOffering. +func (cmgo CspmMonitorGithubOffering) AsDefenderForServersGcpOffering() (*DefenderForServersGcpOffering, bool) { + return nil, false +} + +// AsDefenderForContainersGcpOffering is the BasicCloudOffering implementation for CspmMonitorGithubOffering. +func (cmgo CspmMonitorGithubOffering) AsDefenderForContainersGcpOffering() (*DefenderForContainersGcpOffering, bool) { + return nil, false +} + +// AsCspmMonitorGithubOffering is the BasicCloudOffering implementation for CspmMonitorGithubOffering. +func (cmgo CspmMonitorGithubOffering) AsCspmMonitorGithubOffering() (*CspmMonitorGithubOffering, bool) { + return &cmgo, true +} + +// AsCloudOffering is the BasicCloudOffering implementation for CspmMonitorGithubOffering. +func (cmgo CspmMonitorGithubOffering) AsCloudOffering() (*CloudOffering, bool) { + return nil, false +} + +// AsBasicCloudOffering is the BasicCloudOffering implementation for CspmMonitorGithubOffering. +func (cmgo CspmMonitorGithubOffering) AsBasicCloudOffering() (BasicCloudOffering, bool) { + return &cmgo, true +} + +// BasicCustomAlertRule a custom alert rule. +type BasicCustomAlertRule interface { + AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) + AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) + AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) + AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) + AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) + AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) + AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) + AsListCustomAlertRule() (*ListCustomAlertRule, bool) + AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) + AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) + AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) + AsProcessNotAllowed() (*ProcessNotAllowed, bool) + AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) + AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) + AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) + AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) + AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) + AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) + AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) + AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) + AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) + AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) + AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) + AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) + AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) + AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) + AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) + AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) + AsCustomAlertRule() (*CustomAlertRule, bool) +} + +// CustomAlertRule a custom alert rule. +type CustomAlertRule struct { + // 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', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` +} + +func unmarshalBasicCustomAlertRule(body []byte) (BasicCustomAlertRule, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) if err != nil { return nil, err } @@ -5799,38 +6804,13 @@ func (car CustomAlertRule) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) return &car, true } -// CVE CVE details -type CVE struct { - // Title - READ-ONLY; CVE title - Title *string `json:"title,omitempty"` - // Link - READ-ONLY; Link url - Link *string `json:"link,omitempty"` -} - -// MarshalJSON is the custom marshaler for CVE. -func (c CVE) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// CVSS CVSS details -type CVSS struct { - // Base - READ-ONLY; CVSS base - Base *float64 `json:"base,omitempty"` -} - -// MarshalJSON is the custom marshaler for CVSS. -func (c CVSS) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// DataExportSetting represents a data export setting -type DataExportSetting struct { - // DataExportSettingProperties - Data export setting data - *DataExportSettingProperties `json:"properties,omitempty"` - // Kind - the kind of the settings string (DataExportSetting). Possible values include: 'SettingKindDataExportSetting', 'SettingKindAlertSuppressionSetting' - Kind SettingKind `json:"kind,omitempty"` +// CustomAssessmentAutomation custom Assessment Automation +type CustomAssessmentAutomation struct { + autorest.Response `json:"-"` + // SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty"` + // CustomAssessmentAutomationProperties - describes Custom Assessment Automation properties. + *CustomAssessmentAutomationProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name @@ -5839,20 +6819,17 @@ type DataExportSetting struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for DataExportSetting. -func (desVar DataExportSetting) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for CustomAssessmentAutomation. +func (caa CustomAssessmentAutomation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if desVar.DataExportSettingProperties != nil { - objectMap["properties"] = desVar.DataExportSettingProperties - } - if desVar.Kind != "" { - objectMap["kind"] = desVar.Kind + if caa.CustomAssessmentAutomationProperties != nil { + objectMap["properties"] = caa.CustomAssessmentAutomationProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for DataExportSetting struct. -func (desVar *DataExportSetting) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for CustomAssessmentAutomation struct. +func (caa *CustomAssessmentAutomation) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -5860,23 +6837,23 @@ func (desVar *DataExportSetting) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "properties": + case "systemData": if v != nil { - var dataExportSettingProperties DataExportSettingProperties - err = json.Unmarshal(*v, &dataExportSettingProperties) + var systemData SystemData + err = json.Unmarshal(*v, &systemData) if err != nil { return err } - desVar.DataExportSettingProperties = &dataExportSettingProperties + caa.SystemData = &systemData } - case "kind": + case "properties": if v != nil { - var kind SettingKind - err = json.Unmarshal(*v, &kind) + var customAssessmentAutomationProperties CustomAssessmentAutomationProperties + err = json.Unmarshal(*v, &customAssessmentAutomationProperties) if err != nil { return err } - desVar.Kind = kind + caa.CustomAssessmentAutomationProperties = &customAssessmentAutomationProperties } case "id": if v != nil { @@ -5885,7 +6862,7 @@ func (desVar *DataExportSetting) UnmarshalJSON(body []byte) error { if err != nil { return err } - desVar.ID = &ID + caa.ID = &ID } case "name": if v != nil { @@ -5894,7 +6871,7 @@ func (desVar *DataExportSetting) UnmarshalJSON(body []byte) error { if err != nil { return err } - desVar.Name = &name + caa.Name = &name } case "type": if v != nil { @@ -5903,7 +6880,7 @@ func (desVar *DataExportSetting) UnmarshalJSON(body []byte) error { if err != nil { return err } - desVar.Type = &typeVar + caa.Type = &typeVar } } } @@ -5911,219 +6888,47 @@ func (desVar *DataExportSetting) UnmarshalJSON(body []byte) error { return nil } -// DataExportSettingProperties the data export setting properties -type DataExportSettingProperties struct { - // Enabled - Is the data export setting is enabled - Enabled *bool `json:"enabled,omitempty"` -} - -// DenylistCustomAlertRule a custom alert rule that checks if a value (depends on the custom alert type) is -// denied. -type DenylistCustomAlertRule struct { - // DenylistValues - The values to deny. The format of the values depends on the rule type. - DenylistValues *[]string `json:"denylistValues,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. +// CustomAssessmentAutomationProperties describes the Custom Assessment Automation properties +type CustomAssessmentAutomationProperties struct { + // CompressedQuery - GZip encoded KQL query representing the assessment automation results required. + CompressedQuery *string `json:"compressedQuery,omitempty"` + // SupportedCloud - Relevant cloud for the custom assessment automation. Possible values include: 'SupportedCloudEnumAWS', 'SupportedCloudEnumGCP' + SupportedCloud SupportedCloudEnum `json:"supportedCloud,omitempty"` + // Severity - The severity to relate to the assessments generated by this assessment automation. Possible values include: 'SeverityEnumHigh', 'SeverityEnumMedium', 'SeverityEnumLow' + Severity SeverityEnum `json:"severity,omitempty"` + // DisplayName - The display name of the assessments generated by this assessment automation. DisplayName *string `json:"displayName,omitempty"` - // Description - READ-ONLY; The description of the custom alert. + // Description - The description to relate to the assessments generated by this assessment automation. 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 RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` + // RemediationDescription - The remediation description to relate to the assessments generated by this assessment automation. + RemediationDescription *string `json:"remediationDescription,omitempty"` + // AssessmentKey - The assessment metadata key used when an assessment is generated for this assessment automation. + AssessmentKey *string `json:"assessmentKey,omitempty"` } -// MarshalJSON is the custom marshaler for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) MarshalJSON() ([]byte, error) { - dcar.RuleType = RuleTypeDenylistCustomAlertRule +// CustomAssessmentAutomationRequest custom Assessment Automation request +type CustomAssessmentAutomationRequest struct { + // CustomAssessmentAutomationRequestProperties - describes Custom Assessment Automation request properties. + *CustomAssessmentAutomationRequestProperties `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 CustomAssessmentAutomationRequest. +func (caar CustomAssessmentAutomationRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dcar.DenylistValues != nil { - objectMap["denylistValues"] = dcar.DenylistValues - } - if dcar.IsEnabled != nil { - objectMap["isEnabled"] = dcar.IsEnabled - } - if dcar.RuleType != "" { - objectMap["ruleType"] = dcar.RuleType + if caar.CustomAssessmentAutomationRequestProperties != nil { + objectMap["properties"] = caar.CustomAssessmentAutomationRequestProperties } return json.Marshal(objectMap) } -// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { - return nil, false -} - -// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { - return nil, false -} - -// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { - return nil, false -} - -// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { - return nil, false -} - -// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { - return nil, false -} - -// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { - return nil, false -} - -// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { - return &dcar, true -} - -// AsListCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { - return nil, false -} - -// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { - return &dcar, true -} - -// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { - return nil, false -} - -// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { - return nil, false -} - -// AsProcessNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { - return nil, false -} - -// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { - return nil, false -} - -// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { - return nil, false -} - -// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { - return nil, false -} - -// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { - return nil, false -} - -// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { - return nil, false -} - -// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { - return nil, false -} - -// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { - return nil, false -} - -// AsCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsCustomAlertRule() (*CustomAlertRule, bool) { - return nil, false -} - -// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { - return &dcar, true -} - -// DeviceSecurityGroup the device security group resource -type DeviceSecurityGroup struct { - autorest.Response `json:"-"` - // DeviceSecurityGroupProperties - Device Security group data - *DeviceSecurityGroupProperties `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 DeviceSecurityGroup. -func (dsg DeviceSecurityGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dsg.DeviceSecurityGroupProperties != nil { - objectMap["properties"] = dsg.DeviceSecurityGroupProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DeviceSecurityGroup struct. -func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for CustomAssessmentAutomationRequest struct. +func (caar *CustomAssessmentAutomationRequest) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -6133,12 +6938,12 @@ func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var deviceSecurityGroupProperties DeviceSecurityGroupProperties - err = json.Unmarshal(*v, &deviceSecurityGroupProperties) + var customAssessmentAutomationRequestProperties CustomAssessmentAutomationRequestProperties + err = json.Unmarshal(*v, &customAssessmentAutomationRequestProperties) if err != nil { return err } - dsg.DeviceSecurityGroupProperties = &deviceSecurityGroupProperties + caar.CustomAssessmentAutomationRequestProperties = &customAssessmentAutomationRequestProperties } case "id": if v != nil { @@ -6147,7 +6952,7 @@ func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { if err != nil { return err } - dsg.ID = &ID + caar.ID = &ID } case "name": if v != nil { @@ -6156,7 +6961,7 @@ func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { if err != nil { return err } - dsg.Name = &name + caar.Name = &name } case "type": if v != nil { @@ -6165,7 +6970,7 @@ func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { if err != nil { return err } - dsg.Type = &typeVar + caar.Type = &typeVar } } } @@ -6173,35 +6978,52 @@ func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { return nil } -// DeviceSecurityGroupList list of device security groups -type DeviceSecurityGroupList struct { +// CustomAssessmentAutomationRequestProperties describes the Custom Assessment Automation properties +type CustomAssessmentAutomationRequestProperties struct { + // CompressedQuery - Base 64 encoded KQL query representing the assessment automation results required. + CompressedQuery *string `json:"compressedQuery,omitempty"` + // SupportedCloud - Relevant cloud for the custom assessment automation. Possible values include: 'SupportedCloudEnumAWS', 'SupportedCloudEnumGCP' + SupportedCloud SupportedCloudEnum `json:"supportedCloud,omitempty"` + // Severity - The severity to relate to the assessments generated by this assessment automation. Possible values include: 'SeverityEnumHigh', 'SeverityEnumMedium', 'SeverityEnumLow' + Severity SeverityEnum `json:"severity,omitempty"` + // DisplayName - The display name of the assessments generated by this assessment automation. + DisplayName *string `json:"displayName,omitempty"` + // Description - The description to relate to the assessments generated by this assessment automation. + Description *string `json:"description,omitempty"` + // RemediationDescription - The remediation description to relate to the assessments generated by this assessment automation. + RemediationDescription *string `json:"remediationDescription,omitempty"` +} + +// CustomAssessmentAutomationsListResult a list of Custom Assessment Automations +type CustomAssessmentAutomationsListResult struct { autorest.Response `json:"-"` - // Value - List of device security group objects - Value *[]DeviceSecurityGroup `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. + // Value - READ-ONLY; Collection of Custom Assessment Automations + Value *[]CustomAssessmentAutomation `json:"value,omitempty"` + // NextLink - The link used to get the next page of operations. NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for DeviceSecurityGroupList. -func (dsgl DeviceSecurityGroupList) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for CustomAssessmentAutomationsListResult. +func (caalr CustomAssessmentAutomationsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dsgl.Value != nil { - objectMap["value"] = dsgl.Value + if caalr.NextLink != nil { + objectMap["nextLink"] = caalr.NextLink } return json.Marshal(objectMap) } -// DeviceSecurityGroupListIterator provides access to a complete listing of DeviceSecurityGroup values. -type DeviceSecurityGroupListIterator struct { +// CustomAssessmentAutomationsListResultIterator provides access to a complete listing of +// CustomAssessmentAutomation values. +type CustomAssessmentAutomationsListResultIterator struct { i int - page DeviceSecurityGroupListPage + page CustomAssessmentAutomationsListResultPage } // 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 *DeviceSecurityGroupListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *CustomAssessmentAutomationsListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -6226,67 +7048,67 @@ func (iter *DeviceSecurityGroupListIterator) NextWithContext(ctx context.Context // 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 *DeviceSecurityGroupListIterator) Next() error { +func (iter *CustomAssessmentAutomationsListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DeviceSecurityGroupListIterator) NotDone() bool { +func (iter CustomAssessmentAutomationsListResultIterator) 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 DeviceSecurityGroupListIterator) Response() DeviceSecurityGroupList { +func (iter CustomAssessmentAutomationsListResultIterator) Response() CustomAssessmentAutomationsListResult { 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 DeviceSecurityGroupListIterator) Value() DeviceSecurityGroup { +func (iter CustomAssessmentAutomationsListResultIterator) Value() CustomAssessmentAutomation { if !iter.page.NotDone() { - return DeviceSecurityGroup{} + return CustomAssessmentAutomation{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the DeviceSecurityGroupListIterator type. -func NewDeviceSecurityGroupListIterator(page DeviceSecurityGroupListPage) DeviceSecurityGroupListIterator { - return DeviceSecurityGroupListIterator{page: page} +// Creates a new instance of the CustomAssessmentAutomationsListResultIterator type. +func NewCustomAssessmentAutomationsListResultIterator(page CustomAssessmentAutomationsListResultPage) CustomAssessmentAutomationsListResultIterator { + return CustomAssessmentAutomationsListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (dsgl DeviceSecurityGroupList) IsEmpty() bool { - return dsgl.Value == nil || len(*dsgl.Value) == 0 +func (caalr CustomAssessmentAutomationsListResult) IsEmpty() bool { + return caalr.Value == nil || len(*caalr.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (dsgl DeviceSecurityGroupList) hasNextLink() bool { - return dsgl.NextLink != nil && len(*dsgl.NextLink) != 0 +func (caalr CustomAssessmentAutomationsListResult) hasNextLink() bool { + return caalr.NextLink != nil && len(*caalr.NextLink) != 0 } -// deviceSecurityGroupListPreparer prepares a request to retrieve the next set of results. +// customAssessmentAutomationsListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (dsgl DeviceSecurityGroupList) deviceSecurityGroupListPreparer(ctx context.Context) (*http.Request, error) { - if !dsgl.hasNextLink() { +func (caalr CustomAssessmentAutomationsListResult) customAssessmentAutomationsListResultPreparer(ctx context.Context) (*http.Request, error) { + if !caalr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(dsgl.NextLink))) + autorest.WithBaseURL(to.String(caalr.NextLink))) } -// DeviceSecurityGroupListPage contains a page of DeviceSecurityGroup values. -type DeviceSecurityGroupListPage struct { - fn func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error) - dsgl DeviceSecurityGroupList +// CustomAssessmentAutomationsListResultPage contains a page of CustomAssessmentAutomation values. +type CustomAssessmentAutomationsListResultPage struct { + fn func(context.Context, CustomAssessmentAutomationsListResult) (CustomAssessmentAutomationsListResult, error) + caalr CustomAssessmentAutomationsListResult } // 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 *DeviceSecurityGroupListPage) NextWithContext(ctx context.Context) (err error) { +func (page *CustomAssessmentAutomationsListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -6296,11 +7118,11 @@ func (page *DeviceSecurityGroupListPage) NextWithContext(ctx context.Context) (e }() } for { - next, err := page.fn(ctx, page.dsgl) + next, err := page.fn(ctx, page.caalr) if err != nil { return err } - page.dsgl = next + page.caalr = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -6311,50 +7133,62 @@ func (page *DeviceSecurityGroupListPage) NextWithContext(ctx context.Context) (e // 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 *DeviceSecurityGroupListPage) Next() error { +func (page *CustomAssessmentAutomationsListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DeviceSecurityGroupListPage) NotDone() bool { - return !page.dsgl.IsEmpty() +func (page CustomAssessmentAutomationsListResultPage) NotDone() bool { + return !page.caalr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page DeviceSecurityGroupListPage) Response() DeviceSecurityGroupList { - return page.dsgl +func (page CustomAssessmentAutomationsListResultPage) Response() CustomAssessmentAutomationsListResult { + return page.caalr } // Values returns the slice of values for the current page or nil if there are no values. -func (page DeviceSecurityGroupListPage) Values() []DeviceSecurityGroup { - if page.dsgl.IsEmpty() { +func (page CustomAssessmentAutomationsListResultPage) Values() []CustomAssessmentAutomation { + if page.caalr.IsEmpty() { return nil } - return *page.dsgl.Value + return *page.caalr.Value } -// Creates a new instance of the DeviceSecurityGroupListPage type. -func NewDeviceSecurityGroupListPage(cur DeviceSecurityGroupList, getNextPage func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error)) DeviceSecurityGroupListPage { - return DeviceSecurityGroupListPage{ - fn: getNextPage, - dsgl: cur, +// Creates a new instance of the CustomAssessmentAutomationsListResultPage type. +func NewCustomAssessmentAutomationsListResultPage(cur CustomAssessmentAutomationsListResult, getNextPage func(context.Context, CustomAssessmentAutomationsListResult) (CustomAssessmentAutomationsListResult, error)) CustomAssessmentAutomationsListResultPage { + return CustomAssessmentAutomationsListResultPage{ + fn: getNextPage, + caalr: cur, } } -// DeviceSecurityGroupProperties describes properties of a security group. -type DeviceSecurityGroupProperties struct { - // ThresholdRules - The list of custom alert threshold rules. - ThresholdRules *[]BasicThresholdCustomAlertRule `json:"thresholdRules,omitempty"` - // TimeWindowRules - The list of custom alert time-window rules. - TimeWindowRules *[]BasicTimeWindowCustomAlertRule `json:"timeWindowRules,omitempty"` - // AllowlistRules - The allow-list custom alert rules. - AllowlistRules *[]BasicAllowlistCustomAlertRule `json:"allowlistRules,omitempty"` - // DenylistRules - The deny-list custom alert rules. - DenylistRules *[]DenylistCustomAlertRule `json:"denylistRules,omitempty"` +// CustomEntityStoreAssignment custom entity store assignment +type CustomEntityStoreAssignment struct { + autorest.Response `json:"-"` + // SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty"` + // CustomEntityStoreAssignmentProperties - describes custom entity store assignment properties. + *CustomEntityStoreAssignmentProperties `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"` } -// UnmarshalJSON is the custom unmarshaler for DeviceSecurityGroupProperties struct. -func (dsgp *DeviceSecurityGroupProperties) UnmarshalJSON(body []byte) error { +// MarshalJSON is the custom marshaler for CustomEntityStoreAssignment. +func (cesa CustomEntityStoreAssignment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cesa.CustomEntityStoreAssignmentProperties != nil { + objectMap["properties"] = cesa.CustomEntityStoreAssignmentProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CustomEntityStoreAssignment struct. +func (cesa *CustomEntityStoreAssignment) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -6362,38 +7196,50 @@ func (dsgp *DeviceSecurityGroupProperties) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "thresholdRules": + case "systemData": if v != nil { - thresholdRules, err := unmarshalBasicThresholdCustomAlertRuleArray(*v) + var systemData SystemData + err = json.Unmarshal(*v, &systemData) if err != nil { return err } - dsgp.ThresholdRules = &thresholdRules + cesa.SystemData = &systemData } - case "timeWindowRules": + case "properties": if v != nil { - timeWindowRules, err := unmarshalBasicTimeWindowCustomAlertRuleArray(*v) + var customEntityStoreAssignmentProperties CustomEntityStoreAssignmentProperties + err = json.Unmarshal(*v, &customEntityStoreAssignmentProperties) if err != nil { return err } - dsgp.TimeWindowRules = &timeWindowRules + cesa.CustomEntityStoreAssignmentProperties = &customEntityStoreAssignmentProperties } - case "allowlistRules": + case "id": if v != nil { - allowlistRules, err := unmarshalBasicAllowlistCustomAlertRuleArray(*v) + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - dsgp.AllowlistRules = &allowlistRules + cesa.ID = &ID } - case "denylistRules": + case "name": if v != nil { - var denylistRules []DenylistCustomAlertRule - err = json.Unmarshal(*v, &denylistRules) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - dsgp.DenylistRules = &denylistRules + cesa.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cesa.Type = &typeVar } } } @@ -6401,221 +7247,298 @@ func (dsgp *DeviceSecurityGroupProperties) UnmarshalJSON(body []byte) error { return nil } -// DirectMethodInvokesNotInAllowedRange number of direct method invokes is not in allowed range. -type DirectMethodInvokesNotInAllowedRange struct { - // TimeWindowSize - The time window size in iso8601 format. - TimeWindowSize *string `json:"timeWindowSize,omitempty"` - // MinThreshold - The minimum threshold. - MinThreshold *int32 `json:"minThreshold,omitempty"` - // MaxThreshold - The maximum threshold. - MaxThreshold *int32 `json:"maxThreshold,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', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` +// CustomEntityStoreAssignmentProperties describes the custom entity store assignment properties +type CustomEntityStoreAssignmentProperties struct { + // Principal - The principal assigned with entity store. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId] + Principal *string `json:"principal,omitempty"` + // EntityStoreDatabaseLink - The link to entity store database. + EntityStoreDatabaseLink *string `json:"entityStoreDatabaseLink,omitempty"` } -// MarshalJSON is the custom marshaler for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) MarshalJSON() ([]byte, error) { - dminiar.RuleType = RuleTypeDirectMethodInvokesNotInAllowedRange +// CustomEntityStoreAssignmentRequest describes the custom entity store assignment request +type CustomEntityStoreAssignmentRequest struct { + *CustomEntityStoreAssignmentRequestProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CustomEntityStoreAssignmentRequest. +func (cesar CustomEntityStoreAssignmentRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dminiar.TimeWindowSize != nil { - objectMap["timeWindowSize"] = dminiar.TimeWindowSize - } - if dminiar.MinThreshold != nil { - objectMap["minThreshold"] = dminiar.MinThreshold - } - if dminiar.MaxThreshold != nil { - objectMap["maxThreshold"] = dminiar.MaxThreshold - } - if dminiar.IsEnabled != nil { - objectMap["isEnabled"] = dminiar.IsEnabled - } - if dminiar.RuleType != "" { - objectMap["ruleType"] = dminiar.RuleType + if cesar.CustomEntityStoreAssignmentRequestProperties != nil { + objectMap["properties"] = cesar.CustomEntityStoreAssignmentRequestProperties } return json.Marshal(objectMap) } -// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { - return nil, false -} - -// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { - return &dminiar, true -} +// UnmarshalJSON is the custom unmarshaler for CustomEntityStoreAssignmentRequest struct. +func (cesar *CustomEntityStoreAssignmentRequest) 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 customEntityStoreAssignmentRequestProperties CustomEntityStoreAssignmentRequestProperties + err = json.Unmarshal(*v, &customEntityStoreAssignmentRequestProperties) + if err != nil { + return err + } + cesar.CustomEntityStoreAssignmentRequestProperties = &customEntityStoreAssignmentRequestProperties + } + } + } -// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { - return nil, false + return nil } -// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { - return &dminiar, true +// CustomEntityStoreAssignmentRequestProperties describes properties of custom entity store assignment +// request +type CustomEntityStoreAssignmentRequestProperties struct { + // Principal - The principal assigned with entity store. If not provided, will use caller principal. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId] + Principal *string `json:"principal,omitempty"` } -// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { - return nil, false +// CustomEntityStoreAssignmentsListResult a list of custom entity store assignments +type CustomEntityStoreAssignmentsListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Collection of custom entity store assignments + Value *[]CustomEntityStoreAssignment `json:"value,omitempty"` + // NextLink - The link used to get the next page of operations. + NextLink *string `json:"nextLink,omitempty"` } -// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { - return nil, false +// MarshalJSON is the custom marshaler for CustomEntityStoreAssignmentsListResult. +func (cesalr CustomEntityStoreAssignmentsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cesalr.NextLink != nil { + objectMap["nextLink"] = cesalr.NextLink + } + return json.Marshal(objectMap) } -// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { - return nil, false +// CustomEntityStoreAssignmentsListResultIterator provides access to a complete listing of +// CustomEntityStoreAssignment values. +type CustomEntityStoreAssignmentsListResultIterator struct { + i int + page CustomEntityStoreAssignmentsListResultPage } -// AsListCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { - return nil, false +// 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 *CustomEntityStoreAssignmentsListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsListResultIterator.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 } -// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { - return nil, false +// 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 *CustomEntityStoreAssignmentsListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) } -// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { - return nil, false +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CustomEntityStoreAssignmentsListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { - return nil, false +// Response returns the raw server response from the last page request. +func (iter CustomEntityStoreAssignmentsListResultIterator) Response() CustomEntityStoreAssignmentsListResult { + return iter.page.Response() } -// AsProcessNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { - return nil, false +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CustomEntityStoreAssignmentsListResultIterator) Value() CustomEntityStoreAssignment { + if !iter.page.NotDone() { + return CustomEntityStoreAssignment{} + } + return iter.page.Values()[iter.i] } -// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { - return nil, false +// Creates a new instance of the CustomEntityStoreAssignmentsListResultIterator type. +func NewCustomEntityStoreAssignmentsListResultIterator(page CustomEntityStoreAssignmentsListResultPage) CustomEntityStoreAssignmentsListResultIterator { + return CustomEntityStoreAssignmentsListResultIterator{page: page} } -// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { - return nil, false +// IsEmpty returns true if the ListResult contains no values. +func (cesalr CustomEntityStoreAssignmentsListResult) IsEmpty() bool { + return cesalr.Value == nil || len(*cesalr.Value) == 0 } -// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { - return nil, false +// hasNextLink returns true if the NextLink is not empty. +func (cesalr CustomEntityStoreAssignmentsListResult) hasNextLink() bool { + return cesalr.NextLink != nil && len(*cesalr.NextLink) != 0 } -// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { - return nil, false +// customEntityStoreAssignmentsListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cesalr CustomEntityStoreAssignmentsListResult) customEntityStoreAssignmentsListResultPreparer(ctx context.Context) (*http.Request, error) { + if !cesalr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cesalr.NextLink))) } -// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { - return nil, false +// CustomEntityStoreAssignmentsListResultPage contains a page of CustomEntityStoreAssignment values. +type CustomEntityStoreAssignmentsListResultPage struct { + fn func(context.Context, CustomEntityStoreAssignmentsListResult) (CustomEntityStoreAssignmentsListResult, error) + cesalr CustomEntityStoreAssignmentsListResult } -// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { - return nil, false +// 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 *CustomEntityStoreAssignmentsListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsListResultPage.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.cesalr) + if err != nil { + return err + } + page.cesalr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil } -// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { - return nil, false +// 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 *CustomEntityStoreAssignmentsListResultPage) Next() error { + return page.NextWithContext(context.Background()) } -// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { - return nil, false +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CustomEntityStoreAssignmentsListResultPage) NotDone() bool { + return !page.cesalr.IsEmpty() } -// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { - return nil, false +// Response returns the raw server response from the last page request. +func (page CustomEntityStoreAssignmentsListResultPage) Response() CustomEntityStoreAssignmentsListResult { + return page.cesalr } -// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { - return nil, false +// Values returns the slice of values for the current page or nil if there are no values. +func (page CustomEntityStoreAssignmentsListResultPage) Values() []CustomEntityStoreAssignment { + if page.cesalr.IsEmpty() { + return nil + } + return *page.cesalr.Value } -// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { - return &dminiar, true +// Creates a new instance of the CustomEntityStoreAssignmentsListResultPage type. +func NewCustomEntityStoreAssignmentsListResultPage(cur CustomEntityStoreAssignmentsListResult, getNextPage func(context.Context, CustomEntityStoreAssignmentsListResult) (CustomEntityStoreAssignmentsListResult, error)) CustomEntityStoreAssignmentsListResultPage { + return CustomEntityStoreAssignmentsListResultPage{ + fn: getNextPage, + cesalr: cur, + } } -// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { - return nil, false +// CVE CVE details +type CVE struct { + // Title - READ-ONLY; CVE title + Title *string `json:"title,omitempty"` + // Link - READ-ONLY; Link url + Link *string `json:"link,omitempty"` } -// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { - return nil, false +// MarshalJSON is the custom marshaler for CVE. +func (c CVE) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) } -// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { - return nil, false +// CVSS CVSS details +type CVSS struct { + // Base - READ-ONLY; CVSS base + Base *float64 `json:"base,omitempty"` } -// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { - return nil, false +// MarshalJSON is the custom marshaler for CVSS. +func (c CVSS) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) } -// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { - return nil, false -} - -// AsCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { - return nil, false -} - -// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { - return &dminiar, true -} - -// DiscoveredSecuritySolution ... -type DiscoveredSecuritySolution struct { - autorest.Response `json:"-"` +// DataExportSetting represents a data export setting +type DataExportSetting struct { + // DataExportSettingProperties - Data export setting data + *DataExportSettingProperties `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"` - // Location - READ-ONLY; Location where the resource is stored - Location *string `json:"location,omitempty"` - *DiscoveredSecuritySolutionProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindSetting', 'KindDataExportSetting' + Kind KindEnum `json:"kind,omitempty"` } -// MarshalJSON is the custom marshaler for DiscoveredSecuritySolution. -func (dss DiscoveredSecuritySolution) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for DataExportSetting. +func (desVar DataExportSetting) MarshalJSON() ([]byte, error) { + desVar.Kind = KindDataExportSetting objectMap := make(map[string]interface{}) - if dss.DiscoveredSecuritySolutionProperties != nil { - objectMap["properties"] = dss.DiscoveredSecuritySolutionProperties + if desVar.DataExportSettingProperties != nil { + objectMap["properties"] = desVar.DataExportSettingProperties + } + if desVar.Kind != "" { + objectMap["kind"] = desVar.Kind } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for DiscoveredSecuritySolution struct. -func (dss *DiscoveredSecuritySolution) UnmarshalJSON(body []byte) error { +// AsDataExportSetting is the BasicSetting implementation for DataExportSetting. +func (desVar DataExportSetting) AsDataExportSetting() (*DataExportSetting, bool) { + return &desVar, true +} + +// AsSetting is the BasicSetting implementation for DataExportSetting. +func (desVar DataExportSetting) AsSetting() (*Setting, bool) { + return nil, false +} + +// AsBasicSetting is the BasicSetting implementation for DataExportSetting. +func (desVar DataExportSetting) AsBasicSetting() (BasicSetting, bool) { + return &desVar, true +} + +// UnmarshalJSON is the custom unmarshaler for DataExportSetting struct. +func (desVar *DataExportSetting) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -6623,50 +7546,50 @@ func (dss *DiscoveredSecuritySolution) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "id": + case "properties": if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) + var dataExportSettingProperties DataExportSettingProperties + err = json.Unmarshal(*v, &dataExportSettingProperties) if err != nil { return err } - dss.ID = &ID + desVar.DataExportSettingProperties = &dataExportSettingProperties } - case "name": + case "kind": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var kind KindEnum + err = json.Unmarshal(*v, &kind) if err != nil { return err } - dss.Name = &name + desVar.Kind = kind } - case "type": + case "id": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - dss.Type = &typeVar + desVar.ID = &ID } - case "location": + case "name": if v != nil { - var location string - err = json.Unmarshal(*v, &location) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - dss.Location = &location + desVar.Name = &name } - case "properties": + case "type": if v != nil { - var discoveredSecuritySolutionProperties DiscoveredSecuritySolutionProperties - err = json.Unmarshal(*v, &discoveredSecuritySolutionProperties) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - dss.DiscoveredSecuritySolutionProperties = &discoveredSecuritySolutionProperties + desVar.Type = &typeVar } } } @@ -6674,617 +7597,538 @@ func (dss *DiscoveredSecuritySolution) UnmarshalJSON(body []byte) error { return nil } -// DiscoveredSecuritySolutionList ... -type DiscoveredSecuritySolutionList struct { - autorest.Response `json:"-"` - Value *[]DiscoveredSecuritySolution `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` +// DataExportSettingProperties the data export setting properties +type DataExportSettingProperties struct { + // Enabled - Is the data export setting is enabled + Enabled *bool `json:"enabled,omitempty"` } -// MarshalJSON is the custom marshaler for DiscoveredSecuritySolutionList. -func (dssl DiscoveredSecuritySolutionList) MarshalJSON() ([]byte, error) { +// DefenderForContainersAwsOffering the Defender for Containers AWS offering +type DefenderForContainersAwsOffering struct { + // KubernetesService - The kubernetes service connection configuration + KubernetesService *DefenderForContainersAwsOfferingKubernetesService `json:"kubernetesService,omitempty"` + // KubernetesScubaReader - The kubernetes to scuba connection configuration + KubernetesScubaReader *DefenderForContainersAwsOfferingKubernetesScubaReader `json:"kubernetesScubaReader,omitempty"` + // CloudWatchToKinesis - The cloudwatch to kinesis connection configuration + CloudWatchToKinesis *DefenderForContainersAwsOfferingCloudWatchToKinesis `json:"cloudWatchToKinesis,omitempty"` + // KinesisToS3 - The kinesis to s3 connection configuration + KinesisToS3 *DefenderForContainersAwsOfferingKinesisToS3 `json:"kinesisToS3,omitempty"` + // Description - READ-ONLY; The offering description. + Description *string `json:"description,omitempty"` + // OfferingType - Possible values include: 'OfferingTypeCloudOffering', 'OfferingTypeCspmMonitorAws', 'OfferingTypeDefenderForContainersAws', 'OfferingTypeDefenderForServersAws', 'OfferingTypeInformationProtectionAws', 'OfferingTypeCspmMonitorGcp', 'OfferingTypeDefenderForServersGcp', 'OfferingTypeDefenderForContainersGcp', 'OfferingTypeCspmMonitorGithub' + OfferingType OfferingType `json:"offeringType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) MarshalJSON() ([]byte, error) { + dfcao.OfferingType = OfferingTypeDefenderForContainersAws objectMap := make(map[string]interface{}) - if dssl.Value != nil { - objectMap["value"] = dssl.Value + if dfcao.KubernetesService != nil { + objectMap["kubernetesService"] = dfcao.KubernetesService + } + if dfcao.KubernetesScubaReader != nil { + objectMap["kubernetesScubaReader"] = dfcao.KubernetesScubaReader + } + if dfcao.CloudWatchToKinesis != nil { + objectMap["cloudWatchToKinesis"] = dfcao.CloudWatchToKinesis + } + if dfcao.KinesisToS3 != nil { + objectMap["kinesisToS3"] = dfcao.KinesisToS3 + } + if dfcao.OfferingType != "" { + objectMap["offeringType"] = dfcao.OfferingType } return json.Marshal(objectMap) } -// DiscoveredSecuritySolutionListIterator provides access to a complete listing of -// DiscoveredSecuritySolution values. -type DiscoveredSecuritySolutionListIterator struct { - i int - page DiscoveredSecuritySolutionListPage +// AsCspmMonitorAwsOffering is the BasicCloudOffering implementation for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) { + return nil, false } -// 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 *DiscoveredSecuritySolutionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionListIterator.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 +// AsDefenderForContainersAwsOffering is the BasicCloudOffering implementation for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) { + return &dfcao, true } -// 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 *DiscoveredSecuritySolutionListIterator) Next() error { - return iter.NextWithContext(context.Background()) +// AsDefenderForServersAwsOffering is the BasicCloudOffering implementation for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) { + return nil, false } -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DiscoveredSecuritySolutionListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) +// AsInformationProtectionAwsOffering is the BasicCloudOffering implementation for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (iter DiscoveredSecuritySolutionListIterator) Response() DiscoveredSecuritySolutionList { - return iter.page.Response() +// AsCspmMonitorGcpOffering is the BasicCloudOffering implementation for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) AsCspmMonitorGcpOffering() (*CspmMonitorGcpOffering, bool) { + return nil, false } -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter DiscoveredSecuritySolutionListIterator) Value() DiscoveredSecuritySolution { - if !iter.page.NotDone() { - return DiscoveredSecuritySolution{} - } - return iter.page.Values()[iter.i] +// AsDefenderForServersGcpOffering is the BasicCloudOffering implementation for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) AsDefenderForServersGcpOffering() (*DefenderForServersGcpOffering, bool) { + return nil, false } -// Creates a new instance of the DiscoveredSecuritySolutionListIterator type. -func NewDiscoveredSecuritySolutionListIterator(page DiscoveredSecuritySolutionListPage) DiscoveredSecuritySolutionListIterator { - return DiscoveredSecuritySolutionListIterator{page: page} +// AsDefenderForContainersGcpOffering is the BasicCloudOffering implementation for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) AsDefenderForContainersGcpOffering() (*DefenderForContainersGcpOffering, bool) { + return nil, false } -// IsEmpty returns true if the ListResult contains no values. -func (dssl DiscoveredSecuritySolutionList) IsEmpty() bool { - return dssl.Value == nil || len(*dssl.Value) == 0 +// AsCspmMonitorGithubOffering is the BasicCloudOffering implementation for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) AsCspmMonitorGithubOffering() (*CspmMonitorGithubOffering, bool) { + return nil, false } -// hasNextLink returns true if the NextLink is not empty. -func (dssl DiscoveredSecuritySolutionList) hasNextLink() bool { - return dssl.NextLink != nil && len(*dssl.NextLink) != 0 +// AsCloudOffering is the BasicCloudOffering implementation for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) AsCloudOffering() (*CloudOffering, bool) { + return nil, false } -// discoveredSecuritySolutionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dssl DiscoveredSecuritySolutionList) discoveredSecuritySolutionListPreparer(ctx context.Context) (*http.Request, error) { - if !dssl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dssl.NextLink))) +// AsBasicCloudOffering is the BasicCloudOffering implementation for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) AsBasicCloudOffering() (BasicCloudOffering, bool) { + return &dfcao, true } -// DiscoveredSecuritySolutionListPage contains a page of DiscoveredSecuritySolution values. -type DiscoveredSecuritySolutionListPage struct { - fn func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error) - dssl DiscoveredSecuritySolutionList +// DefenderForContainersAwsOfferingCloudWatchToKinesis the cloudwatch to kinesis connection configuration +type DefenderForContainersAwsOfferingCloudWatchToKinesis struct { + // CloudRoleArn - The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` } -// 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 *DiscoveredSecuritySolutionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionListPage.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.dssl) - if err != nil { - return err - } - page.dssl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil +// DefenderForContainersAwsOfferingKinesisToS3 the kinesis to s3 connection configuration +type DefenderForContainersAwsOfferingKinesisToS3 struct { + // CloudRoleArn - The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` } -// 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 *DiscoveredSecuritySolutionListPage) Next() error { - return page.NextWithContext(context.Background()) +// DefenderForContainersAwsOfferingKubernetesScubaReader the kubernetes to scuba connection configuration +type DefenderForContainersAwsOfferingKubernetesScubaReader struct { + // CloudRoleArn - The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DiscoveredSecuritySolutionListPage) NotDone() bool { - return !page.dssl.IsEmpty() +// DefenderForContainersAwsOfferingKubernetesService the kubernetes service connection configuration +type DefenderForContainersAwsOfferingKubernetesService struct { + // CloudRoleArn - The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` } -// Response returns the raw server response from the last page request. -func (page DiscoveredSecuritySolutionListPage) Response() DiscoveredSecuritySolutionList { - return page.dssl +// DefenderForContainersGcpOffering the containers GCP offering +type DefenderForContainersGcpOffering struct { + // NativeCloudConnection - The native cloud connection configuration + NativeCloudConnection *DefenderForContainersGcpOfferingNativeCloudConnection `json:"nativeCloudConnection,omitempty"` + // DataPipelineNativeCloudConnection - The native cloud connection configuration + DataPipelineNativeCloudConnection *DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection `json:"dataPipelineNativeCloudConnection,omitempty"` + // AuditLogsAutoProvisioningFlag - Is audit logs data collection enabled + AuditLogsAutoProvisioningFlag *bool `json:"auditLogsAutoProvisioningFlag,omitempty"` + // DefenderAgentAutoProvisioningFlag - Is Microsoft Defender for Cloud Kubernetes agent auto provisioning enabled + DefenderAgentAutoProvisioningFlag *bool `json:"defenderAgentAutoProvisioningFlag,omitempty"` + // PolicyAgentAutoProvisioningFlag - Is Policy Kubernetes agent auto provisioning enabled + PolicyAgentAutoProvisioningFlag *bool `json:"policyAgentAutoProvisioningFlag,omitempty"` + // Description - READ-ONLY; The offering description. + Description *string `json:"description,omitempty"` + // OfferingType - Possible values include: 'OfferingTypeCloudOffering', 'OfferingTypeCspmMonitorAws', 'OfferingTypeDefenderForContainersAws', 'OfferingTypeDefenderForServersAws', 'OfferingTypeInformationProtectionAws', 'OfferingTypeCspmMonitorGcp', 'OfferingTypeDefenderForServersGcp', 'OfferingTypeDefenderForContainersGcp', 'OfferingTypeCspmMonitorGithub' + OfferingType OfferingType `json:"offeringType,omitempty"` } -// Values returns the slice of values for the current page or nil if there are no values. -func (page DiscoveredSecuritySolutionListPage) Values() []DiscoveredSecuritySolution { - if page.dssl.IsEmpty() { - return nil +// MarshalJSON is the custom marshaler for DefenderForContainersGcpOffering. +func (dfcgo DefenderForContainersGcpOffering) MarshalJSON() ([]byte, error) { + dfcgo.OfferingType = OfferingTypeDefenderForContainersGcp + objectMap := make(map[string]interface{}) + if dfcgo.NativeCloudConnection != nil { + objectMap["nativeCloudConnection"] = dfcgo.NativeCloudConnection } - return *page.dssl.Value + if dfcgo.DataPipelineNativeCloudConnection != nil { + objectMap["dataPipelineNativeCloudConnection"] = dfcgo.DataPipelineNativeCloudConnection + } + if dfcgo.AuditLogsAutoProvisioningFlag != nil { + objectMap["auditLogsAutoProvisioningFlag"] = dfcgo.AuditLogsAutoProvisioningFlag + } + if dfcgo.DefenderAgentAutoProvisioningFlag != nil { + objectMap["defenderAgentAutoProvisioningFlag"] = dfcgo.DefenderAgentAutoProvisioningFlag + } + if dfcgo.PolicyAgentAutoProvisioningFlag != nil { + objectMap["policyAgentAutoProvisioningFlag"] = dfcgo.PolicyAgentAutoProvisioningFlag + } + if dfcgo.OfferingType != "" { + objectMap["offeringType"] = dfcgo.OfferingType + } + return json.Marshal(objectMap) } -// Creates a new instance of the DiscoveredSecuritySolutionListPage type. -func NewDiscoveredSecuritySolutionListPage(cur DiscoveredSecuritySolutionList, getNextPage func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error)) DiscoveredSecuritySolutionListPage { - return DiscoveredSecuritySolutionListPage{ - fn: getNextPage, - dssl: cur, - } +// AsCspmMonitorAwsOffering is the BasicCloudOffering implementation for DefenderForContainersGcpOffering. +func (dfcgo DefenderForContainersGcpOffering) AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) { + return nil, false } -// DiscoveredSecuritySolutionProperties ... -type DiscoveredSecuritySolutionProperties struct { - // SecurityFamily - The security family of the discovered solution. Possible values include: 'Waf', 'Ngfw', 'SaasWaf', 'Va' - SecurityFamily Family `json:"securityFamily,omitempty"` - // Offer - The security solutions' image offer - Offer *string `json:"offer,omitempty"` - // Publisher - The security solutions' image publisher - Publisher *string `json:"publisher,omitempty"` - // Sku - The security solutions' image sku - Sku *string `json:"sku,omitempty"` +// AsDefenderForContainersAwsOffering is the BasicCloudOffering implementation for DefenderForContainersGcpOffering. +func (dfcgo DefenderForContainersGcpOffering) AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) { + return nil, false } -// EffectiveNetworkSecurityGroups describes the Network Security Groups effective on a network interface -type EffectiveNetworkSecurityGroups struct { - // NetworkInterface - The Azure resource ID of the network interface - NetworkInterface *string `json:"networkInterface,omitempty"` - // NetworkSecurityGroups - The Network Security Groups effective on the network interface - NetworkSecurityGroups *[]string `json:"networkSecurityGroups,omitempty"` +// AsDefenderForServersAwsOffering is the BasicCloudOffering implementation for DefenderForContainersGcpOffering. +func (dfcgo DefenderForContainersGcpOffering) AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) { + return nil, false } -// 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. - Etag *string `json:"etag,omitempty"` +// AsInformationProtectionAwsOffering is the BasicCloudOffering implementation for DefenderForContainersGcpOffering. +func (dfcgo DefenderForContainersGcpOffering) AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) { + return nil, false } -// BasicExternalSecuritySolution represents a security solution external to Azure Security Center which sends -// information to an OMS workspace and whose data is displayed by Azure Security Center. -type BasicExternalSecuritySolution interface { - AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) - AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) - AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) - AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) +// AsCspmMonitorGcpOffering is the BasicCloudOffering implementation for DefenderForContainersGcpOffering. +func (dfcgo DefenderForContainersGcpOffering) AsCspmMonitorGcpOffering() (*CspmMonitorGcpOffering, bool) { + return nil, false } -// ExternalSecuritySolution represents a security solution external to Azure Security Center which sends -// information to an OMS workspace and whose data is displayed by Azure Security Center. -type ExternalSecuritySolution struct { - autorest.Response `json:"-"` - // 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"` - // Location - READ-ONLY; Location where the resource is stored - Location *string `json:"location,omitempty"` - // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' - Kind KindEnum `json:"kind,omitempty"` +// AsDefenderForServersGcpOffering is the BasicCloudOffering implementation for DefenderForContainersGcpOffering. +func (dfcgo DefenderForContainersGcpOffering) AsDefenderForServersGcpOffering() (*DefenderForServersGcpOffering, bool) { + return nil, false } -func unmarshalBasicExternalSecuritySolution(body []byte) (BasicExternalSecuritySolution, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } +// AsDefenderForContainersGcpOffering is the BasicCloudOffering implementation for DefenderForContainersGcpOffering. +func (dfcgo DefenderForContainersGcpOffering) AsDefenderForContainersGcpOffering() (*DefenderForContainersGcpOffering, bool) { + return &dfcgo, true +} - switch m["kind"] { - case string(KindCEF): - var cess CefExternalSecuritySolution - err := json.Unmarshal(body, &cess) - return cess, err - case string(KindATA): - var aess AtaExternalSecuritySolution - err := json.Unmarshal(body, &aess) - return aess, err - case string(KindAAD): - var aess AadExternalSecuritySolution - err := json.Unmarshal(body, &aess) - return aess, err - default: - var ess ExternalSecuritySolution - err := json.Unmarshal(body, &ess) - return ess, err - } +// AsCspmMonitorGithubOffering is the BasicCloudOffering implementation for DefenderForContainersGcpOffering. +func (dfcgo DefenderForContainersGcpOffering) AsCspmMonitorGithubOffering() (*CspmMonitorGithubOffering, bool) { + return nil, false } -func unmarshalBasicExternalSecuritySolutionArray(body []byte) ([]BasicExternalSecuritySolution, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - essArray := make([]BasicExternalSecuritySolution, len(rawMessages)) +// AsCloudOffering is the BasicCloudOffering implementation for DefenderForContainersGcpOffering. +func (dfcgo DefenderForContainersGcpOffering) AsCloudOffering() (*CloudOffering, bool) { + return nil, false +} - for index, rawMessage := range rawMessages { - ess, err := unmarshalBasicExternalSecuritySolution(*rawMessage) - if err != nil { - return nil, err - } - essArray[index] = ess - } - return essArray, nil +// AsBasicCloudOffering is the BasicCloudOffering implementation for DefenderForContainersGcpOffering. +func (dfcgo DefenderForContainersGcpOffering) AsBasicCloudOffering() (BasicCloudOffering, bool) { + return &dfcgo, true } -// MarshalJSON is the custom marshaler for ExternalSecuritySolution. -func (ess ExternalSecuritySolution) MarshalJSON() ([]byte, error) { - ess.Kind = KindExternalSecuritySolution +// DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection the native cloud connection +// configuration +type DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection struct { + // ServiceAccountEmailAddress - The data collection service account email address in GCP for this offering + ServiceAccountEmailAddress *string `json:"serviceAccountEmailAddress,omitempty"` + // WorkloadIdentityProviderID - The data collection GCP workload identity provider id for this offering + WorkloadIdentityProviderID *string `json:"workloadIdentityProviderId,omitempty"` +} + +// DefenderForContainersGcpOfferingNativeCloudConnection the native cloud connection configuration +type DefenderForContainersGcpOfferingNativeCloudConnection struct { + // ServiceAccountEmailAddress - The service account email address in GCP for this offering + ServiceAccountEmailAddress *string `json:"serviceAccountEmailAddress,omitempty"` + // WorkloadIdentityProviderID - The GCP workload identity provider id for this offering + WorkloadIdentityProviderID *string `json:"workloadIdentityProviderId,omitempty"` +} + +// DefenderForServersAwsOffering the Defender for Servers AWS offering +type DefenderForServersAwsOffering struct { + // DefenderForServers - The Defender for servers connection configuration + DefenderForServers *DefenderForServersAwsOfferingDefenderForServers `json:"defenderForServers,omitempty"` + // ArcAutoProvisioning - The ARC autoprovisioning configuration + ArcAutoProvisioning *DefenderForServersAwsOfferingArcAutoProvisioning `json:"arcAutoProvisioning,omitempty"` + // VaAutoProvisioning - The Vulnerability Assessment autoprovisioning configuration + VaAutoProvisioning *DefenderForServersAwsOfferingVaAutoProvisioning `json:"vaAutoProvisioning,omitempty"` + // MdeAutoProvisioning - The Microsoft Defender for Endpoint autoprovisioning configuration + MdeAutoProvisioning *DefenderForServersAwsOfferingMdeAutoProvisioning `json:"mdeAutoProvisioning,omitempty"` + // SubPlan - configuration for the servers offering subPlan + SubPlan *DefenderForServersAwsOfferingSubPlan `json:"subPlan,omitempty"` + // Description - READ-ONLY; The offering description. + Description *string `json:"description,omitempty"` + // OfferingType - Possible values include: 'OfferingTypeCloudOffering', 'OfferingTypeCspmMonitorAws', 'OfferingTypeDefenderForContainersAws', 'OfferingTypeDefenderForServersAws', 'OfferingTypeInformationProtectionAws', 'OfferingTypeCspmMonitorGcp', 'OfferingTypeDefenderForServersGcp', 'OfferingTypeDefenderForContainersGcp', 'OfferingTypeCspmMonitorGithub' + OfferingType OfferingType `json:"offeringType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) MarshalJSON() ([]byte, error) { + dfsao.OfferingType = OfferingTypeDefenderForServersAws objectMap := make(map[string]interface{}) - if ess.Kind != "" { - objectMap["kind"] = ess.Kind + if dfsao.DefenderForServers != nil { + objectMap["defenderForServers"] = dfsao.DefenderForServers + } + if dfsao.ArcAutoProvisioning != nil { + objectMap["arcAutoProvisioning"] = dfsao.ArcAutoProvisioning + } + if dfsao.VaAutoProvisioning != nil { + objectMap["vaAutoProvisioning"] = dfsao.VaAutoProvisioning + } + if dfsao.MdeAutoProvisioning != nil { + objectMap["mdeAutoProvisioning"] = dfsao.MdeAutoProvisioning + } + if dfsao.SubPlan != nil { + objectMap["subPlan"] = dfsao.SubPlan + } + if dfsao.OfferingType != "" { + objectMap["offeringType"] = dfsao.OfferingType } return json.Marshal(objectMap) } -// AsCefExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. -func (ess ExternalSecuritySolution) AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) { +// AsCspmMonitorAwsOffering is the BasicCloudOffering implementation for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) { return nil, false } -// AsAtaExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. -func (ess ExternalSecuritySolution) AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) { +// AsDefenderForContainersAwsOffering is the BasicCloudOffering implementation for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) { return nil, false } -// AsAadExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. -func (ess ExternalSecuritySolution) AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) { +// AsDefenderForServersAwsOffering is the BasicCloudOffering implementation for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) { + return &dfsao, true +} + +// AsInformationProtectionAwsOffering is the BasicCloudOffering implementation for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) { return nil, false } -// AsExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. -func (ess ExternalSecuritySolution) AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) { - return &ess, true +// AsCspmMonitorGcpOffering is the BasicCloudOffering implementation for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) AsCspmMonitorGcpOffering() (*CspmMonitorGcpOffering, bool) { + return nil, false } -// AsBasicExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. -func (ess ExternalSecuritySolution) AsBasicExternalSecuritySolution() (BasicExternalSecuritySolution, bool) { - return &ess, true +// AsDefenderForServersGcpOffering is the BasicCloudOffering implementation for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) AsDefenderForServersGcpOffering() (*DefenderForServersGcpOffering, bool) { + return nil, false } -// ExternalSecuritySolutionKind1 describes an Azure resource with kind -type ExternalSecuritySolutionKind1 struct { - // Kind - The kind of the external solution. Possible values include: 'CEF', 'ATA', 'AAD' - Kind ExternalSecuritySolutionKind `json:"kind,omitempty"` +// AsDefenderForContainersGcpOffering is the BasicCloudOffering implementation for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) AsDefenderForContainersGcpOffering() (*DefenderForContainersGcpOffering, bool) { + return nil, false } -// ExternalSecuritySolutionList ... -type ExternalSecuritySolutionList struct { - autorest.Response `json:"-"` - Value *[]BasicExternalSecuritySolution `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` +// AsCspmMonitorGithubOffering is the BasicCloudOffering implementation for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) AsCspmMonitorGithubOffering() (*CspmMonitorGithubOffering, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for ExternalSecuritySolutionList. -func (essl ExternalSecuritySolutionList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if essl.Value != nil { - objectMap["value"] = essl.Value - } - return json.Marshal(objectMap) +// AsCloudOffering is the BasicCloudOffering implementation for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) AsCloudOffering() (*CloudOffering, bool) { + return nil, false } -// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionList struct. -func (essl *ExternalSecuritySolutionList) 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 "value": - if v != nil { - value, err := unmarshalBasicExternalSecuritySolutionArray(*v) - if err != nil { - return err - } - essl.Value = &value - } - case "nextLink": - if v != nil { - var nextLink string - err = json.Unmarshal(*v, &nextLink) - if err != nil { - return err - } - essl.NextLink = &nextLink - } - } - } +// AsBasicCloudOffering is the BasicCloudOffering implementation for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) AsBasicCloudOffering() (BasicCloudOffering, bool) { + return &dfsao, true +} - return nil +// DefenderForServersAwsOfferingArcAutoProvisioning the ARC autoprovisioning configuration +type DefenderForServersAwsOfferingArcAutoProvisioning struct { + // Enabled - Is arc auto provisioning enabled + Enabled *bool `json:"enabled,omitempty"` + // ServicePrincipalSecretMetadata - Metadata of Service Principal secret for autoprovisioning + ServicePrincipalSecretMetadata *DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata `json:"servicePrincipalSecretMetadata,omitempty"` } -// ExternalSecuritySolutionListIterator provides access to a complete listing of ExternalSecuritySolution -// values. -type ExternalSecuritySolutionListIterator struct { - i int - page ExternalSecuritySolutionListPage +// DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata metadata of Service +// Principal secret for autoprovisioning +type DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata struct { + // ExpiryDate - expiration date of service principal secret + ExpiryDate *string `json:"expiryDate,omitempty"` + // ParameterStoreRegion - region of parameter store where secret is kept + ParameterStoreRegion *string `json:"parameterStoreRegion,omitempty"` + // ParameterNameInStore - name of secret resource in parameter store + ParameterNameInStore *string `json:"parameterNameInStore,omitempty"` } -// 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 *ExternalSecuritySolutionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() +// DefenderForServersAwsOfferingDefenderForServers the Defender for servers connection configuration +type DefenderForServersAwsOfferingDefenderForServers struct { + // CloudRoleArn - The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` +} + +// DefenderForServersAwsOfferingMdeAutoProvisioning the Microsoft Defender for Endpoint autoprovisioning +// configuration +type DefenderForServersAwsOfferingMdeAutoProvisioning struct { + // Enabled - Is Microsoft Defender for Endpoint auto provisioning enabled + Enabled *bool `json:"enabled,omitempty"` + // Configuration - configuration for Microsoft Defender for Endpoint autoprovisioning + Configuration interface{} `json:"configuration,omitempty"` +} + +// DefenderForServersAwsOfferingSubPlan configuration for the servers offering subPlan +type DefenderForServersAwsOfferingSubPlan struct { + // Type - The available sub plans. Possible values include: 'P1', 'P2' + Type SubPlan `json:"type,omitempty"` +} + +// DefenderForServersAwsOfferingVaAutoProvisioning the Vulnerability Assessment autoprovisioning +// configuration +type DefenderForServersAwsOfferingVaAutoProvisioning struct { + // Enabled - Is Vulnerability Assessment auto provisioning enabled + Enabled *bool `json:"enabled,omitempty"` + // Configuration - configuration for Vulnerability Assessment autoprovisioning + Configuration *DefenderForServersAwsOfferingVaAutoProvisioningConfiguration `json:"configuration,omitempty"` +} + +// DefenderForServersAwsOfferingVaAutoProvisioningConfiguration configuration for Vulnerability Assessment +// autoprovisioning +type DefenderForServersAwsOfferingVaAutoProvisioningConfiguration struct { + // Type - The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'. Possible values include: 'Qualys', 'TVM' + Type Type `json:"type,omitempty"` +} + +// DefenderForServersGcpOffering the Defender for Servers GCP offering configurations +type DefenderForServersGcpOffering struct { + // DefenderForServers - The Defender for servers connection configuration + DefenderForServers *DefenderForServersGcpOfferingDefenderForServers `json:"defenderForServers,omitempty"` + // ArcAutoProvisioning - The ARC autoprovisioning configuration + ArcAutoProvisioning *DefenderForServersGcpOfferingArcAutoProvisioning `json:"arcAutoProvisioning,omitempty"` + // VaAutoProvisioning - The Vulnerability Assessment autoprovisioning configuration + VaAutoProvisioning *DefenderForServersGcpOfferingVaAutoProvisioning `json:"vaAutoProvisioning,omitempty"` + // MdeAutoProvisioning - The Microsoft Defender for Endpoint autoprovisioning configuration + MdeAutoProvisioning *DefenderForServersGcpOfferingMdeAutoProvisioning `json:"mdeAutoProvisioning,omitempty"` + // SubPlan - configuration for the servers offering subPlan + SubPlan *DefenderForServersGcpOfferingSubPlan `json:"subPlan,omitempty"` + // Description - READ-ONLY; The offering description. + Description *string `json:"description,omitempty"` + // OfferingType - Possible values include: 'OfferingTypeCloudOffering', 'OfferingTypeCspmMonitorAws', 'OfferingTypeDefenderForContainersAws', 'OfferingTypeDefenderForServersAws', 'OfferingTypeInformationProtectionAws', 'OfferingTypeCspmMonitorGcp', 'OfferingTypeDefenderForServersGcp', 'OfferingTypeDefenderForContainersGcp', 'OfferingTypeCspmMonitorGithub' + OfferingType OfferingType `json:"offeringType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DefenderForServersGcpOffering. +func (dfsgo DefenderForServersGcpOffering) MarshalJSON() ([]byte, error) { + dfsgo.OfferingType = OfferingTypeDefenderForServersGcp + objectMap := make(map[string]interface{}) + if dfsgo.DefenderForServers != nil { + objectMap["defenderForServers"] = dfsgo.DefenderForServers } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil + if dfsgo.ArcAutoProvisioning != nil { + objectMap["arcAutoProvisioning"] = dfsgo.ArcAutoProvisioning } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err + if dfsgo.VaAutoProvisioning != nil { + objectMap["vaAutoProvisioning"] = dfsgo.VaAutoProvisioning } - iter.i = 0 - return nil + if dfsgo.MdeAutoProvisioning != nil { + objectMap["mdeAutoProvisioning"] = dfsgo.MdeAutoProvisioning + } + if dfsgo.SubPlan != nil { + objectMap["subPlan"] = dfsgo.SubPlan + } + if dfsgo.OfferingType != "" { + objectMap["offeringType"] = dfsgo.OfferingType + } + return json.Marshal(objectMap) } -// 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 *ExternalSecuritySolutionListIterator) Next() error { - return iter.NextWithContext(context.Background()) +// AsCspmMonitorAwsOffering is the BasicCloudOffering implementation for DefenderForServersGcpOffering. +func (dfsgo DefenderForServersGcpOffering) AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) { + return nil, false } -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExternalSecuritySolutionListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) +// AsDefenderForContainersAwsOffering is the BasicCloudOffering implementation for DefenderForServersGcpOffering. +func (dfsgo DefenderForServersGcpOffering) AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (iter ExternalSecuritySolutionListIterator) Response() ExternalSecuritySolutionList { - return iter.page.Response() +// AsDefenderForServersAwsOffering is the BasicCloudOffering implementation for DefenderForServersGcpOffering. +func (dfsgo DefenderForServersGcpOffering) AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) { + return nil, false } -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ExternalSecuritySolutionListIterator) Value() BasicExternalSecuritySolution { - if !iter.page.NotDone() { - return ExternalSecuritySolution{} - } - return iter.page.Values()[iter.i] +// AsInformationProtectionAwsOffering is the BasicCloudOffering implementation for DefenderForServersGcpOffering. +func (dfsgo DefenderForServersGcpOffering) AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) { + return nil, false } -// Creates a new instance of the ExternalSecuritySolutionListIterator type. -func NewExternalSecuritySolutionListIterator(page ExternalSecuritySolutionListPage) ExternalSecuritySolutionListIterator { - return ExternalSecuritySolutionListIterator{page: page} +// AsCspmMonitorGcpOffering is the BasicCloudOffering implementation for DefenderForServersGcpOffering. +func (dfsgo DefenderForServersGcpOffering) AsCspmMonitorGcpOffering() (*CspmMonitorGcpOffering, bool) { + return nil, false } -// IsEmpty returns true if the ListResult contains no values. -func (essl ExternalSecuritySolutionList) IsEmpty() bool { - return essl.Value == nil || len(*essl.Value) == 0 +// AsDefenderForServersGcpOffering is the BasicCloudOffering implementation for DefenderForServersGcpOffering. +func (dfsgo DefenderForServersGcpOffering) AsDefenderForServersGcpOffering() (*DefenderForServersGcpOffering, bool) { + return &dfsgo, true } -// hasNextLink returns true if the NextLink is not empty. -func (essl ExternalSecuritySolutionList) hasNextLink() bool { - return essl.NextLink != nil && len(*essl.NextLink) != 0 +// AsDefenderForContainersGcpOffering is the BasicCloudOffering implementation for DefenderForServersGcpOffering. +func (dfsgo DefenderForServersGcpOffering) AsDefenderForContainersGcpOffering() (*DefenderForContainersGcpOffering, bool) { + return nil, false } -// externalSecuritySolutionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (essl ExternalSecuritySolutionList) externalSecuritySolutionListPreparer(ctx context.Context) (*http.Request, error) { - if !essl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(essl.NextLink))) +// AsCspmMonitorGithubOffering is the BasicCloudOffering implementation for DefenderForServersGcpOffering. +func (dfsgo DefenderForServersGcpOffering) AsCspmMonitorGithubOffering() (*CspmMonitorGithubOffering, bool) { + return nil, false } -// ExternalSecuritySolutionListPage contains a page of BasicExternalSecuritySolution values. -type ExternalSecuritySolutionListPage struct { - fn func(context.Context, ExternalSecuritySolutionList) (ExternalSecuritySolutionList, error) - essl ExternalSecuritySolutionList +// AsCloudOffering is the BasicCloudOffering implementation for DefenderForServersGcpOffering. +func (dfsgo DefenderForServersGcpOffering) AsCloudOffering() (*CloudOffering, bool) { + return nil, false } -// 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 *ExternalSecuritySolutionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionListPage.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.essl) - if err != nil { - return err - } - page.essl = 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 *ExternalSecuritySolutionListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExternalSecuritySolutionListPage) NotDone() bool { - return !page.essl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ExternalSecuritySolutionListPage) Response() ExternalSecuritySolutionList { - return page.essl +// AsBasicCloudOffering is the BasicCloudOffering implementation for DefenderForServersGcpOffering. +func (dfsgo DefenderForServersGcpOffering) AsBasicCloudOffering() (BasicCloudOffering, bool) { + return &dfsgo, true } -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExternalSecuritySolutionListPage) Values() []BasicExternalSecuritySolution { - if page.essl.IsEmpty() { - return nil - } - return *page.essl.Value +// DefenderForServersGcpOfferingArcAutoProvisioning the ARC autoprovisioning configuration +type DefenderForServersGcpOfferingArcAutoProvisioning struct { + // Enabled - Is arc auto provisioning enabled + Enabled *bool `json:"enabled,omitempty"` + // Configuration - Configuration for ARC autoprovisioning + Configuration *DefenderForServersGcpOfferingArcAutoProvisioningConfiguration `json:"configuration,omitempty"` } -// Creates a new instance of the ExternalSecuritySolutionListPage type. -func NewExternalSecuritySolutionListPage(cur ExternalSecuritySolutionList, getNextPage func(context.Context, ExternalSecuritySolutionList) (ExternalSecuritySolutionList, error)) ExternalSecuritySolutionListPage { - return ExternalSecuritySolutionListPage{ - fn: getNextPage, - essl: cur, - } +// DefenderForServersGcpOfferingArcAutoProvisioningConfiguration configuration for ARC autoprovisioning +type DefenderForServersGcpOfferingArcAutoProvisioningConfiguration struct { + // ClientID - The Azure service principal client id for agent onboarding + ClientID *string `json:"clientId,omitempty"` + // AgentOnboardingServiceAccountNumericID - The agent onboarding service account numeric id + AgentOnboardingServiceAccountNumericID *string `json:"agentOnboardingServiceAccountNumericId,omitempty"` } -// ExternalSecuritySolutionModel ... -type ExternalSecuritySolutionModel struct { - autorest.Response `json:"-"` - Value BasicExternalSecuritySolution `json:"value,omitempty"` +// DefenderForServersGcpOfferingDefenderForServers the Defender for servers connection configuration +type DefenderForServersGcpOfferingDefenderForServers struct { + // WorkloadIdentityProviderID - The workload identity provider id in GCP for this feature + WorkloadIdentityProviderID *string `json:"workloadIdentityProviderId,omitempty"` + // ServiceAccountEmailAddress - The service account email address in GCP for this feature + ServiceAccountEmailAddress *string `json:"serviceAccountEmailAddress,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionModel struct. -func (essm *ExternalSecuritySolutionModel) UnmarshalJSON(body []byte) error { - ess, err := unmarshalBasicExternalSecuritySolution(body) - if err != nil { - return err - } - essm.Value = ess - - return nil +// DefenderForServersGcpOfferingMdeAutoProvisioning the Microsoft Defender for Endpoint autoprovisioning +// configuration +type DefenderForServersGcpOfferingMdeAutoProvisioning struct { + // Enabled - Is Microsoft Defender for Endpoint auto provisioning enabled + Enabled *bool `json:"enabled,omitempty"` + // Configuration - configuration for Microsoft Defender for Endpoint autoprovisioning + Configuration interface{} `json:"configuration,omitempty"` } -// ExternalSecuritySolutionProperties the solution properties (correspond to the solution kind) -type ExternalSecuritySolutionProperties struct { - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - DeviceVendor *string `json:"deviceVendor,omitempty"` - DeviceType *string `json:"deviceType,omitempty"` - Workspace *ConnectedWorkspace `json:"workspace,omitempty"` +// DefenderForServersGcpOfferingSubPlan configuration for the servers offering subPlan +type DefenderForServersGcpOfferingSubPlan struct { + // Type - The available sub plans. Possible values include: 'P1', 'P2' + Type SubPlan `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for ExternalSecuritySolutionProperties. -func (essp ExternalSecuritySolutionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if essp.DeviceVendor != nil { - objectMap["deviceVendor"] = essp.DeviceVendor - } - if essp.DeviceType != nil { - objectMap["deviceType"] = essp.DeviceType - } - if essp.Workspace != nil { - objectMap["workspace"] = essp.Workspace - } - for k, v := range essp.AdditionalProperties { - objectMap[k] = v - } - return json.Marshal(objectMap) +// DefenderForServersGcpOfferingVaAutoProvisioning the Vulnerability Assessment autoprovisioning +// configuration +type DefenderForServersGcpOfferingVaAutoProvisioning struct { + // Enabled - Is Vulnerability Assessment auto provisioning enabled + Enabled *bool `json:"enabled,omitempty"` + // Configuration - configuration for Vulnerability Assessment autoprovisioning + Configuration *DefenderForServersGcpOfferingVaAutoProvisioningConfiguration `json:"configuration,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionProperties struct. -func (essp *ExternalSecuritySolutionProperties) 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 essp.AdditionalProperties == nil { - essp.AdditionalProperties = make(map[string]interface{}) - } - essp.AdditionalProperties[k] = additionalProperties - } - case "deviceVendor": - if v != nil { - var deviceVendor string - err = json.Unmarshal(*v, &deviceVendor) - if err != nil { - return err - } - essp.DeviceVendor = &deviceVendor - } - case "deviceType": - if v != nil { - var deviceType string - err = json.Unmarshal(*v, &deviceType) - if err != nil { - return err - } - essp.DeviceType = &deviceType - } - case "workspace": - if v != nil { - var workspace ConnectedWorkspace - err = json.Unmarshal(*v, &workspace) - if err != nil { - return err - } - essp.Workspace = &workspace - } - } - } - - return nil +// DefenderForServersGcpOfferingVaAutoProvisioningConfiguration configuration for Vulnerability Assessment +// autoprovisioning +type DefenderForServersGcpOfferingVaAutoProvisioningConfiguration struct { + // Type - The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'. Possible values include: 'Qualys', 'TVM' + Type Type `json:"type,omitempty"` } -// FailedLocalLoginsNotInAllowedRange number of failed local logins is not in allowed range. -type FailedLocalLoginsNotInAllowedRange struct { - // TimeWindowSize - The time window size in iso8601 format. - TimeWindowSize *string `json:"timeWindowSize,omitempty"` - // MinThreshold - The minimum threshold. - MinThreshold *int32 `json:"minThreshold,omitempty"` - // MaxThreshold - The maximum threshold. - MaxThreshold *int32 `json:"maxThreshold,omitempty"` +// DenylistCustomAlertRule a custom alert rule that checks if a value (depends on the custom alert type) is +// denied. +type DenylistCustomAlertRule struct { + // DenylistValues - The values to deny. The format of the values depends on the rule type. + DenylistValues *[]string `json:"denylistValues,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. @@ -7295,366 +8139,1835 @@ type FailedLocalLoginsNotInAllowedRange struct { RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } -// MarshalJSON is the custom marshaler for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) MarshalJSON() ([]byte, error) { - fllniar.RuleType = RuleTypeFailedLocalLoginsNotInAllowedRange +// MarshalJSON is the custom marshaler for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) MarshalJSON() ([]byte, error) { + dcar.RuleType = RuleTypeDenylistCustomAlertRule objectMap := make(map[string]interface{}) - if fllniar.TimeWindowSize != nil { - objectMap["timeWindowSize"] = fllniar.TimeWindowSize - } - if fllniar.MinThreshold != nil { - objectMap["minThreshold"] = fllniar.MinThreshold - } - if fllniar.MaxThreshold != nil { - objectMap["maxThreshold"] = fllniar.MaxThreshold + if dcar.DenylistValues != nil { + objectMap["denylistValues"] = dcar.DenylistValues } - if fllniar.IsEnabled != nil { - objectMap["isEnabled"] = fllniar.IsEnabled + if dcar.IsEnabled != nil { + objectMap["isEnabled"] = dcar.IsEnabled } - if fllniar.RuleType != "" { - objectMap["ruleType"] = fllniar.RuleType + if dcar.RuleType != "" { + objectMap["ruleType"] = dcar.RuleType } return json.Marshal(objectMap) } -// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { return nil, false } -// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { - return &fllniar, true -} - -// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { return nil, false } -// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { - return &fllniar, true +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false } -// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { return nil, false } -// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { return nil, false } -// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { return nil, false } -// AsListCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { - return nil, false +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return &dcar, true } -// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { return nil, false } -// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { - return nil, false +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return &dcar, true } -// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { return nil, false } -// AsProcessNotAllowed is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false } -// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { return nil, false } -// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { return nil, false } -// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { return nil, false } -// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { return nil, false } -// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { return nil, false } -// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { return nil, false } -// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { return nil, false } -// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { return nil, false } -// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { return nil, false } -// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { return nil, false } -// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { return nil, false } -// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { - return &fllniar, true +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false } -// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { return nil, false } -// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { return nil, false } -// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { return nil, false } -// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { return nil, false } -// AsCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { return nil, false } -// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { - return &fllniar, true +// AsCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false } -// FileUploadsNotInAllowedRange number of file uploads is not in allowed range. -type FileUploadsNotInAllowedRange struct { - // TimeWindowSize - The time window size in iso8601 format. - TimeWindowSize *string `json:"timeWindowSize,omitempty"` - // MinThreshold - The minimum threshold. - MinThreshold *int32 `json:"minThreshold,omitempty"` - // MaxThreshold - The maximum threshold. - MaxThreshold *int32 `json:"maxThreshold,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', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &dcar, true } -// MarshalJSON is the custom marshaler for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) MarshalJSON() ([]byte, error) { - funiar.RuleType = RuleTypeFileUploadsNotInAllowedRange +// DeviceSecurityGroup the device security group resource +type DeviceSecurityGroup struct { + autorest.Response `json:"-"` + // DeviceSecurityGroupProperties - Device Security group data + *DeviceSecurityGroupProperties `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 DeviceSecurityGroup. +func (dsg DeviceSecurityGroup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if funiar.TimeWindowSize != nil { - objectMap["timeWindowSize"] = funiar.TimeWindowSize - } - if funiar.MinThreshold != nil { - objectMap["minThreshold"] = funiar.MinThreshold - } - if funiar.MaxThreshold != nil { - objectMap["maxThreshold"] = funiar.MaxThreshold - } - if funiar.IsEnabled != nil { - objectMap["isEnabled"] = funiar.IsEnabled - } - if funiar.RuleType != "" { - objectMap["ruleType"] = funiar.RuleType + if dsg.DeviceSecurityGroupProperties != nil { + objectMap["properties"] = dsg.DeviceSecurityGroupProperties } return json.Marshal(objectMap) } -// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { - return nil, false +// UnmarshalJSON is the custom unmarshaler for DeviceSecurityGroup struct. +func (dsg *DeviceSecurityGroup) 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 deviceSecurityGroupProperties DeviceSecurityGroupProperties + err = json.Unmarshal(*v, &deviceSecurityGroupProperties) + if err != nil { + return err + } + dsg.DeviceSecurityGroupProperties = &deviceSecurityGroupProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dsg.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dsg.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dsg.Type = &typeVar + } + } + } + + return nil } -// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { - return &funiar, true +// DeviceSecurityGroupList list of device security groups +type DeviceSecurityGroupList struct { + autorest.Response `json:"-"` + // Value - List of device security group objects + Value *[]DeviceSecurityGroup `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` } -// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { - return nil, false +// MarshalJSON is the custom marshaler for DeviceSecurityGroupList. +func (dsgl DeviceSecurityGroupList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dsgl.Value != nil { + objectMap["value"] = dsgl.Value + } + return json.Marshal(objectMap) } -// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { - return &funiar, true +// DeviceSecurityGroupListIterator provides access to a complete listing of DeviceSecurityGroup values. +type DeviceSecurityGroupListIterator struct { + i int + page DeviceSecurityGroupListPage } -// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { - return nil, false +// 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 *DeviceSecurityGroupListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupListIterator.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 } -// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { - return nil, false +// 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 *DeviceSecurityGroupListIterator) Next() error { + return iter.NextWithContext(context.Background()) } -// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { - return nil, false +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DeviceSecurityGroupListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// AsListCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { - return nil, false +// Response returns the raw server response from the last page request. +func (iter DeviceSecurityGroupListIterator) Response() DeviceSecurityGroupList { + return iter.page.Response() } -// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { - return nil, false +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DeviceSecurityGroupListIterator) Value() DeviceSecurityGroup { + if !iter.page.NotDone() { + return DeviceSecurityGroup{} + } + return iter.page.Values()[iter.i] } -// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { - return nil, false +// Creates a new instance of the DeviceSecurityGroupListIterator type. +func NewDeviceSecurityGroupListIterator(page DeviceSecurityGroupListPage) DeviceSecurityGroupListIterator { + return DeviceSecurityGroupListIterator{page: page} } -// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { - return nil, false +// IsEmpty returns true if the ListResult contains no values. +func (dsgl DeviceSecurityGroupList) IsEmpty() bool { + return dsgl.Value == nil || len(*dsgl.Value) == 0 } -// AsProcessNotAllowed is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { - return nil, false +// hasNextLink returns true if the NextLink is not empty. +func (dsgl DeviceSecurityGroupList) hasNextLink() bool { + return dsgl.NextLink != nil && len(*dsgl.NextLink) != 0 } -// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { - return nil, false +// deviceSecurityGroupListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dsgl DeviceSecurityGroupList) deviceSecurityGroupListPreparer(ctx context.Context) (*http.Request, error) { + if !dsgl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dsgl.NextLink))) } -// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { - return nil, false +// DeviceSecurityGroupListPage contains a page of DeviceSecurityGroup values. +type DeviceSecurityGroupListPage struct { + fn func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error) + dsgl DeviceSecurityGroupList } -// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { +// 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 *DeviceSecurityGroupListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupListPage.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.dsgl) + if err != nil { + return err + } + page.dsgl = 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 *DeviceSecurityGroupListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DeviceSecurityGroupListPage) NotDone() bool { + return !page.dsgl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DeviceSecurityGroupListPage) Response() DeviceSecurityGroupList { + return page.dsgl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DeviceSecurityGroupListPage) Values() []DeviceSecurityGroup { + if page.dsgl.IsEmpty() { + return nil + } + return *page.dsgl.Value +} + +// Creates a new instance of the DeviceSecurityGroupListPage type. +func NewDeviceSecurityGroupListPage(cur DeviceSecurityGroupList, getNextPage func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error)) DeviceSecurityGroupListPage { + return DeviceSecurityGroupListPage{ + fn: getNextPage, + dsgl: cur, + } +} + +// DeviceSecurityGroupProperties describes properties of a security group. +type DeviceSecurityGroupProperties struct { + // ThresholdRules - The list of custom alert threshold rules. + ThresholdRules *[]BasicThresholdCustomAlertRule `json:"thresholdRules,omitempty"` + // TimeWindowRules - The list of custom alert time-window rules. + TimeWindowRules *[]BasicTimeWindowCustomAlertRule `json:"timeWindowRules,omitempty"` + // AllowlistRules - The allow-list custom alert rules. + AllowlistRules *[]BasicAllowlistCustomAlertRule `json:"allowlistRules,omitempty"` + // DenylistRules - The deny-list custom alert rules. + DenylistRules *[]DenylistCustomAlertRule `json:"denylistRules,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DeviceSecurityGroupProperties struct. +func (dsgp *DeviceSecurityGroupProperties) 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 "thresholdRules": + if v != nil { + thresholdRules, err := unmarshalBasicThresholdCustomAlertRuleArray(*v) + if err != nil { + return err + } + dsgp.ThresholdRules = &thresholdRules + } + case "timeWindowRules": + if v != nil { + timeWindowRules, err := unmarshalBasicTimeWindowCustomAlertRuleArray(*v) + if err != nil { + return err + } + dsgp.TimeWindowRules = &timeWindowRules + } + case "allowlistRules": + if v != nil { + allowlistRules, err := unmarshalBasicAllowlistCustomAlertRuleArray(*v) + if err != nil { + return err + } + dsgp.AllowlistRules = &allowlistRules + } + case "denylistRules": + if v != nil { + var denylistRules []DenylistCustomAlertRule + err = json.Unmarshal(*v, &denylistRules) + if err != nil { + return err + } + dsgp.DenylistRules = &denylistRules + } + } + } + + return nil +} + +// DirectMethodInvokesNotInAllowedRange number of direct method invokes is not in allowed range. +type DirectMethodInvokesNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,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', '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 DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) MarshalJSON() ([]byte, error) { + dminiar.RuleType = RuleTypeDirectMethodInvokesNotInAllowedRange + objectMap := make(map[string]interface{}) + if dminiar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = dminiar.TimeWindowSize + } + if dminiar.MinThreshold != nil { + objectMap["minThreshold"] = dminiar.MinThreshold + } + if dminiar.MaxThreshold != nil { + objectMap["maxThreshold"] = dminiar.MaxThreshold + } + if dminiar.IsEnabled != nil { + objectMap["isEnabled"] = dminiar.IsEnabled + } + if dminiar.RuleType != "" { + objectMap["ruleType"] = dminiar.RuleType + } + return json.Marshal(objectMap) +} + +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { return nil, false } -// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &dminiar, true +} + +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { return nil, false } -// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &dminiar, true +} + +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { return nil, false } -// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { return nil, false } -// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { return nil, false } -// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { return nil, false } -// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { return nil, false } -// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { return nil, false } -// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false } -// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { return nil, false } -// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { - return &funiar, true +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false } -// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { return nil, false } -// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { return nil, false } -// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { return nil, false } -// AsCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { return nil, false } -// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { - return &funiar, true +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return &dminiar, true +} + +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false +} + +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false +} + +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false +} + +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false +} + +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false +} + +// AsCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false +} + +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &dminiar, true +} + +// DiscoveredSecuritySolution ... +type DiscoveredSecuritySolution struct { + autorest.Response `json:"-"` + // 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"` + // Location - READ-ONLY; Location where the resource is stored + Location *string `json:"location,omitempty"` + *DiscoveredSecuritySolutionProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiscoveredSecuritySolution. +func (dss DiscoveredSecuritySolution) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dss.DiscoveredSecuritySolutionProperties != nil { + objectMap["properties"] = dss.DiscoveredSecuritySolutionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DiscoveredSecuritySolution struct. +func (dss *DiscoveredSecuritySolution) 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 "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dss.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dss.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dss.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dss.Location = &location + } + case "properties": + if v != nil { + var discoveredSecuritySolutionProperties DiscoveredSecuritySolutionProperties + err = json.Unmarshal(*v, &discoveredSecuritySolutionProperties) + if err != nil { + return err + } + dss.DiscoveredSecuritySolutionProperties = &discoveredSecuritySolutionProperties + } + } + } + + return nil +} + +// DiscoveredSecuritySolutionList ... +type DiscoveredSecuritySolutionList struct { + autorest.Response `json:"-"` + Value *[]DiscoveredSecuritySolution `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiscoveredSecuritySolutionList. +func (dssl DiscoveredSecuritySolutionList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dssl.Value != nil { + objectMap["value"] = dssl.Value + } + return json.Marshal(objectMap) +} + +// DiscoveredSecuritySolutionListIterator provides access to a complete listing of +// DiscoveredSecuritySolution values. +type DiscoveredSecuritySolutionListIterator struct { + i int + page DiscoveredSecuritySolutionListPage +} + +// 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 *DiscoveredSecuritySolutionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionListIterator.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 *DiscoveredSecuritySolutionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DiscoveredSecuritySolutionListIterator) 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 DiscoveredSecuritySolutionListIterator) Response() DiscoveredSecuritySolutionList { + 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 DiscoveredSecuritySolutionListIterator) Value() DiscoveredSecuritySolution { + if !iter.page.NotDone() { + return DiscoveredSecuritySolution{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DiscoveredSecuritySolutionListIterator type. +func NewDiscoveredSecuritySolutionListIterator(page DiscoveredSecuritySolutionListPage) DiscoveredSecuritySolutionListIterator { + return DiscoveredSecuritySolutionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dssl DiscoveredSecuritySolutionList) IsEmpty() bool { + return dssl.Value == nil || len(*dssl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dssl DiscoveredSecuritySolutionList) hasNextLink() bool { + return dssl.NextLink != nil && len(*dssl.NextLink) != 0 +} + +// discoveredSecuritySolutionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dssl DiscoveredSecuritySolutionList) discoveredSecuritySolutionListPreparer(ctx context.Context) (*http.Request, error) { + if !dssl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dssl.NextLink))) +} + +// DiscoveredSecuritySolutionListPage contains a page of DiscoveredSecuritySolution values. +type DiscoveredSecuritySolutionListPage struct { + fn func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error) + dssl DiscoveredSecuritySolutionList +} + +// 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 *DiscoveredSecuritySolutionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionListPage.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.dssl) + if err != nil { + return err + } + page.dssl = 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 *DiscoveredSecuritySolutionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DiscoveredSecuritySolutionListPage) NotDone() bool { + return !page.dssl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DiscoveredSecuritySolutionListPage) Response() DiscoveredSecuritySolutionList { + return page.dssl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DiscoveredSecuritySolutionListPage) Values() []DiscoveredSecuritySolution { + if page.dssl.IsEmpty() { + return nil + } + return *page.dssl.Value +} + +// Creates a new instance of the DiscoveredSecuritySolutionListPage type. +func NewDiscoveredSecuritySolutionListPage(cur DiscoveredSecuritySolutionList, getNextPage func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error)) DiscoveredSecuritySolutionListPage { + return DiscoveredSecuritySolutionListPage{ + fn: getNextPage, + dssl: cur, + } +} + +// DiscoveredSecuritySolutionProperties ... +type DiscoveredSecuritySolutionProperties struct { + // SecurityFamily - The security family of the discovered solution. Possible values include: 'Waf', 'Ngfw', 'SaasWaf', 'Va' + SecurityFamily Family `json:"securityFamily,omitempty"` + // Offer - The security solutions' image offer + Offer *string `json:"offer,omitempty"` + // Publisher - The security solutions' image publisher + Publisher *string `json:"publisher,omitempty"` + // Sku - The security solutions' image sku + Sku *string `json:"sku,omitempty"` +} + +// EffectiveNetworkSecurityGroups describes the Network Security Groups effective on a network interface +type EffectiveNetworkSecurityGroups struct { + // NetworkInterface - The Azure resource ID of the network interface + NetworkInterface *string `json:"networkInterface,omitempty"` + // NetworkSecurityGroups - The Network Security Groups effective on the network interface + NetworkSecurityGroups *[]string `json:"networkSecurityGroups,omitempty"` +} + +// BasicEnvironmentData the security connector environment data. +type BasicEnvironmentData interface { + AsAWSEnvironmentData() (*AWSEnvironmentData, bool) + AsGcpProjectEnvironmentData() (*GcpProjectEnvironmentData, bool) + AsGithubScopeEnvironmentData() (*GithubScopeEnvironmentData, bool) + AsEnvironmentData() (*EnvironmentData, bool) +} + +// EnvironmentData the security connector environment data. +type EnvironmentData struct { + // EnvironmentType - Possible values include: 'EnvironmentTypeEnvironmentData', 'EnvironmentTypeAwsAccount', 'EnvironmentTypeGcpProject', 'EnvironmentTypeGithubScope' + EnvironmentType EnvironmentType `json:"environmentType,omitempty"` +} + +func unmarshalBasicEnvironmentData(body []byte) (BasicEnvironmentData, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["environmentType"] { + case string(EnvironmentTypeAwsAccount): + var aed AWSEnvironmentData + err := json.Unmarshal(body, &aed) + return aed, err + case string(EnvironmentTypeGcpProject): + var gped GcpProjectEnvironmentData + err := json.Unmarshal(body, &gped) + return gped, err + case string(EnvironmentTypeGithubScope): + var gsed GithubScopeEnvironmentData + err := json.Unmarshal(body, &gsed) + return gsed, err + default: + var ed EnvironmentData + err := json.Unmarshal(body, &ed) + return ed, err + } +} +func unmarshalBasicEnvironmentDataArray(body []byte) ([]BasicEnvironmentData, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + edArray := make([]BasicEnvironmentData, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ed, err := unmarshalBasicEnvironmentData(*rawMessage) + if err != nil { + return nil, err + } + edArray[index] = ed + } + return edArray, nil +} + +// MarshalJSON is the custom marshaler for EnvironmentData. +func (ed EnvironmentData) MarshalJSON() ([]byte, error) { + ed.EnvironmentType = EnvironmentTypeEnvironmentData + objectMap := make(map[string]interface{}) + if ed.EnvironmentType != "" { + objectMap["environmentType"] = ed.EnvironmentType + } + return json.Marshal(objectMap) +} + +// AsAWSEnvironmentData is the BasicEnvironmentData implementation for EnvironmentData. +func (ed EnvironmentData) AsAWSEnvironmentData() (*AWSEnvironmentData, bool) { + return nil, false +} + +// AsGcpProjectEnvironmentData is the BasicEnvironmentData implementation for EnvironmentData. +func (ed EnvironmentData) AsGcpProjectEnvironmentData() (*GcpProjectEnvironmentData, bool) { + return nil, false +} + +// AsGithubScopeEnvironmentData is the BasicEnvironmentData implementation for EnvironmentData. +func (ed EnvironmentData) AsGithubScopeEnvironmentData() (*GithubScopeEnvironmentData, bool) { + return nil, false +} + +// AsEnvironmentData is the BasicEnvironmentData implementation for EnvironmentData. +func (ed EnvironmentData) AsEnvironmentData() (*EnvironmentData, bool) { + return &ed, true +} + +// AsBasicEnvironmentData is the BasicEnvironmentData implementation for EnvironmentData. +func (ed EnvironmentData) AsBasicEnvironmentData() (BasicEnvironmentData, bool) { + return &ed, true +} + +// 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. + Etag *string `json:"etag,omitempty"` +} + +// BasicExternalSecuritySolution represents a security solution external to Microsoft Defender for Cloud which sends +// information to an OMS workspace and whose data is displayed by Microsoft Defender for Cloud. +type BasicExternalSecuritySolution interface { + AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) + AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) + AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) + AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) +} + +// ExternalSecuritySolution represents a security solution external to Microsoft Defender for Cloud which sends +// information to an OMS workspace and whose data is displayed by Microsoft Defender for Cloud. +type ExternalSecuritySolution struct { + autorest.Response `json:"-"` + // 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"` + // Location - READ-ONLY; Location where the resource is stored + Location *string `json:"location,omitempty"` + // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' + Kind KindEnum1 `json:"kind,omitempty"` +} + +func unmarshalBasicExternalSecuritySolution(body []byte) (BasicExternalSecuritySolution, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindCEF): + var cess CefExternalSecuritySolution + err := json.Unmarshal(body, &cess) + return cess, err + case string(KindATA): + var aess AtaExternalSecuritySolution + err := json.Unmarshal(body, &aess) + return aess, err + case string(KindAAD): + var aess AadExternalSecuritySolution + err := json.Unmarshal(body, &aess) + return aess, err + default: + var ess ExternalSecuritySolution + err := json.Unmarshal(body, &ess) + return ess, err + } +} +func unmarshalBasicExternalSecuritySolutionArray(body []byte) ([]BasicExternalSecuritySolution, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + essArray := make([]BasicExternalSecuritySolution, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ess, err := unmarshalBasicExternalSecuritySolution(*rawMessage) + if err != nil { + return nil, err + } + essArray[index] = ess + } + return essArray, nil +} + +// MarshalJSON is the custom marshaler for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) MarshalJSON() ([]byte, error) { + ess.Kind = KindExternalSecuritySolution + objectMap := make(map[string]interface{}) + if ess.Kind != "" { + objectMap["kind"] = ess.Kind + } + return json.Marshal(objectMap) +} + +// AsCefExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) { + return nil, false +} + +// AsAtaExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) { + return nil, false +} + +// AsAadExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) { + return nil, false +} + +// AsExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) { + return &ess, true +} + +// AsBasicExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) AsBasicExternalSecuritySolution() (BasicExternalSecuritySolution, bool) { + return &ess, true +} + +// ExternalSecuritySolutionKind1 describes an Azure resource with kind +type ExternalSecuritySolutionKind1 struct { + // Kind - The kind of the external solution. Possible values include: 'CEF', 'ATA', 'AAD' + Kind ExternalSecuritySolutionKind `json:"kind,omitempty"` +} + +// ExternalSecuritySolutionList ... +type ExternalSecuritySolutionList struct { + autorest.Response `json:"-"` + Value *[]BasicExternalSecuritySolution `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExternalSecuritySolutionList. +func (essl ExternalSecuritySolutionList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if essl.Value != nil { + objectMap["value"] = essl.Value + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionList struct. +func (essl *ExternalSecuritySolutionList) 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 "value": + if v != nil { + value, err := unmarshalBasicExternalSecuritySolutionArray(*v) + if err != nil { + return err + } + essl.Value = &value + } + case "nextLink": + if v != nil { + var nextLink string + err = json.Unmarshal(*v, &nextLink) + if err != nil { + return err + } + essl.NextLink = &nextLink + } + } + } + + return nil +} + +// ExternalSecuritySolutionListIterator provides access to a complete listing of ExternalSecuritySolution +// values. +type ExternalSecuritySolutionListIterator struct { + i int + page ExternalSecuritySolutionListPage +} + +// 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 *ExternalSecuritySolutionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionListIterator.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 *ExternalSecuritySolutionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ExternalSecuritySolutionListIterator) 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 ExternalSecuritySolutionListIterator) Response() ExternalSecuritySolutionList { + 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 ExternalSecuritySolutionListIterator) Value() BasicExternalSecuritySolution { + if !iter.page.NotDone() { + return ExternalSecuritySolution{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ExternalSecuritySolutionListIterator type. +func NewExternalSecuritySolutionListIterator(page ExternalSecuritySolutionListPage) ExternalSecuritySolutionListIterator { + return ExternalSecuritySolutionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (essl ExternalSecuritySolutionList) IsEmpty() bool { + return essl.Value == nil || len(*essl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (essl ExternalSecuritySolutionList) hasNextLink() bool { + return essl.NextLink != nil && len(*essl.NextLink) != 0 +} + +// externalSecuritySolutionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (essl ExternalSecuritySolutionList) externalSecuritySolutionListPreparer(ctx context.Context) (*http.Request, error) { + if !essl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(essl.NextLink))) +} + +// ExternalSecuritySolutionListPage contains a page of BasicExternalSecuritySolution values. +type ExternalSecuritySolutionListPage struct { + fn func(context.Context, ExternalSecuritySolutionList) (ExternalSecuritySolutionList, error) + essl ExternalSecuritySolutionList +} + +// 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 *ExternalSecuritySolutionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionListPage.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.essl) + if err != nil { + return err + } + page.essl = 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 *ExternalSecuritySolutionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ExternalSecuritySolutionListPage) NotDone() bool { + return !page.essl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ExternalSecuritySolutionListPage) Response() ExternalSecuritySolutionList { + return page.essl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ExternalSecuritySolutionListPage) Values() []BasicExternalSecuritySolution { + if page.essl.IsEmpty() { + return nil + } + return *page.essl.Value +} + +// Creates a new instance of the ExternalSecuritySolutionListPage type. +func NewExternalSecuritySolutionListPage(cur ExternalSecuritySolutionList, getNextPage func(context.Context, ExternalSecuritySolutionList) (ExternalSecuritySolutionList, error)) ExternalSecuritySolutionListPage { + return ExternalSecuritySolutionListPage{ + fn: getNextPage, + essl: cur, + } +} + +// ExternalSecuritySolutionModel ... +type ExternalSecuritySolutionModel struct { + autorest.Response `json:"-"` + Value BasicExternalSecuritySolution `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionModel struct. +func (essm *ExternalSecuritySolutionModel) UnmarshalJSON(body []byte) error { + ess, err := unmarshalBasicExternalSecuritySolution(body) + if err != nil { + return err + } + essm.Value = ess + + return nil +} + +// ExternalSecuritySolutionProperties the solution properties (correspond to the solution kind) +type ExternalSecuritySolutionProperties struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + DeviceVendor *string `json:"deviceVendor,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + Workspace *ConnectedWorkspace `json:"workspace,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExternalSecuritySolutionProperties. +func (essp ExternalSecuritySolutionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if essp.DeviceVendor != nil { + objectMap["deviceVendor"] = essp.DeviceVendor + } + if essp.DeviceType != nil { + objectMap["deviceType"] = essp.DeviceType + } + if essp.Workspace != nil { + objectMap["workspace"] = essp.Workspace + } + for k, v := range essp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionProperties struct. +func (essp *ExternalSecuritySolutionProperties) 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 essp.AdditionalProperties == nil { + essp.AdditionalProperties = make(map[string]interface{}) + } + essp.AdditionalProperties[k] = additionalProperties + } + case "deviceVendor": + if v != nil { + var deviceVendor string + err = json.Unmarshal(*v, &deviceVendor) + if err != nil { + return err + } + essp.DeviceVendor = &deviceVendor + } + case "deviceType": + if v != nil { + var deviceType string + err = json.Unmarshal(*v, &deviceType) + if err != nil { + return err + } + essp.DeviceType = &deviceType + } + case "workspace": + if v != nil { + var workspace ConnectedWorkspace + err = json.Unmarshal(*v, &workspace) + if err != nil { + return err + } + essp.Workspace = &workspace + } + } + } + + return nil +} + +// FailedLocalLoginsNotInAllowedRange number of failed local logins is not in allowed range. +type FailedLocalLoginsNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,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', '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 FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) MarshalJSON() ([]byte, error) { + fllniar.RuleType = RuleTypeFailedLocalLoginsNotInAllowedRange + objectMap := make(map[string]interface{}) + if fllniar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = fllniar.TimeWindowSize + } + if fllniar.MinThreshold != nil { + objectMap["minThreshold"] = fllniar.MinThreshold + } + if fllniar.MaxThreshold != nil { + objectMap["maxThreshold"] = fllniar.MaxThreshold + } + if fllniar.IsEnabled != nil { + objectMap["isEnabled"] = fllniar.IsEnabled + } + if fllniar.RuleType != "" { + objectMap["ruleType"] = fllniar.RuleType + } + return json.Marshal(objectMap) +} + +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false +} + +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &fllniar, true +} + +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &fllniar, true +} + +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false +} + +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false +} + +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false +} + +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false +} + +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false +} + +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false +} + +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false +} + +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return &fllniar, true +} + +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false +} + +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false +} + +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false +} + +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false +} + +// AsCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false +} + +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &fllniar, true +} + +// FileUploadsNotInAllowedRange number of file uploads is not in allowed range. +type FileUploadsNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,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', '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 FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) MarshalJSON() ([]byte, error) { + funiar.RuleType = RuleTypeFileUploadsNotInAllowedRange + objectMap := make(map[string]interface{}) + if funiar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = funiar.TimeWindowSize + } + if funiar.MinThreshold != nil { + objectMap["minThreshold"] = funiar.MinThreshold + } + if funiar.MaxThreshold != nil { + objectMap["maxThreshold"] = funiar.MaxThreshold + } + if funiar.IsEnabled != nil { + objectMap["isEnabled"] = funiar.IsEnabled + } + if funiar.RuleType != "" { + objectMap["ruleType"] = funiar.RuleType + } + return json.Marshal(objectMap) +} + +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false +} + +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &funiar, true +} + +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &funiar, true +} + +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false +} + +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false +} + +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false +} + +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false +} + +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false +} + +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false +} + +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false +} + +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false +} + +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return &funiar, true +} + +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false +} + +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false +} + +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false +} + +// AsCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false +} + +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &funiar, true } // GcpCredentialsDetailsProperties GCP cloud account connector based service to service credentials, the @@ -7733,29 +10046,358 @@ func (gcdp GcpCredentialsDetailsProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// AsAwsCredsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. -func (gcdp GcpCredentialsDetailsProperties) AsAwsCredsAuthenticationDetailsProperties() (*AwsCredsAuthenticationDetailsProperties, bool) { +// AsAwsCredsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. +func (gcdp GcpCredentialsDetailsProperties) AsAwsCredsAuthenticationDetailsProperties() (*AwsCredsAuthenticationDetailsProperties, bool) { + return nil, false +} + +// AsAwAssumeRoleAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. +func (gcdp GcpCredentialsDetailsProperties) AsAwAssumeRoleAuthenticationDetailsProperties() (*AwAssumeRoleAuthenticationDetailsProperties, bool) { + return nil, false +} + +// AsGcpCredentialsDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. +func (gcdp GcpCredentialsDetailsProperties) AsGcpCredentialsDetailsProperties() (*GcpCredentialsDetailsProperties, bool) { + return &gcdp, true +} + +// AsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. +func (gcdp GcpCredentialsDetailsProperties) AsAuthenticationDetailsProperties() (*AuthenticationDetailsProperties, bool) { + return nil, false +} + +// AsBasicAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. +func (gcdp GcpCredentialsDetailsProperties) AsBasicAuthenticationDetailsProperties() (BasicAuthenticationDetailsProperties, bool) { + return &gcdp, true +} + +// BasicGcpOrganizationalData the gcpOrganization data +type BasicGcpOrganizationalData interface { + AsGcpOrganizationalDataOrganization() (*GcpOrganizationalDataOrganization, bool) + AsGcpOrganizationalDataMember() (*GcpOrganizationalDataMember, bool) + AsGcpOrganizationalData() (*GcpOrganizationalData, bool) +} + +// GcpOrganizationalData the gcpOrganization data +type GcpOrganizationalData struct { + // OrganizationMembershipType - Possible values include: 'OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeGcpOrganizationalData', 'OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeOrganization', 'OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeMember' + OrganizationMembershipType OrganizationMembershipTypeBasicGcpOrganizationalData `json:"organizationMembershipType,omitempty"` +} + +func unmarshalBasicGcpOrganizationalData(body []byte) (BasicGcpOrganizationalData, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["organizationMembershipType"] { + case string(OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeOrganization): + var godo GcpOrganizationalDataOrganization + err := json.Unmarshal(body, &godo) + return godo, err + case string(OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeMember): + var godm GcpOrganizationalDataMember + err := json.Unmarshal(body, &godm) + return godm, err + default: + var god GcpOrganizationalData + err := json.Unmarshal(body, &god) + return god, err + } +} +func unmarshalBasicGcpOrganizationalDataArray(body []byte) ([]BasicGcpOrganizationalData, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + godArray := make([]BasicGcpOrganizationalData, len(rawMessages)) + + for index, rawMessage := range rawMessages { + god, err := unmarshalBasicGcpOrganizationalData(*rawMessage) + if err != nil { + return nil, err + } + godArray[index] = god + } + return godArray, nil +} + +// MarshalJSON is the custom marshaler for GcpOrganizationalData. +func (god GcpOrganizationalData) MarshalJSON() ([]byte, error) { + god.OrganizationMembershipType = OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeGcpOrganizationalData + objectMap := make(map[string]interface{}) + if god.OrganizationMembershipType != "" { + objectMap["organizationMembershipType"] = god.OrganizationMembershipType + } + return json.Marshal(objectMap) +} + +// AsGcpOrganizationalDataOrganization is the BasicGcpOrganizationalData implementation for GcpOrganizationalData. +func (god GcpOrganizationalData) AsGcpOrganizationalDataOrganization() (*GcpOrganizationalDataOrganization, bool) { + return nil, false +} + +// AsGcpOrganizationalDataMember is the BasicGcpOrganizationalData implementation for GcpOrganizationalData. +func (god GcpOrganizationalData) AsGcpOrganizationalDataMember() (*GcpOrganizationalDataMember, bool) { + return nil, false +} + +// AsGcpOrganizationalData is the BasicGcpOrganizationalData implementation for GcpOrganizationalData. +func (god GcpOrganizationalData) AsGcpOrganizationalData() (*GcpOrganizationalData, bool) { + return &god, true +} + +// AsBasicGcpOrganizationalData is the BasicGcpOrganizationalData implementation for GcpOrganizationalData. +func (god GcpOrganizationalData) AsBasicGcpOrganizationalData() (BasicGcpOrganizationalData, bool) { + return &god, true +} + +// GcpOrganizationalDataMember the gcpOrganization data for the member account +type GcpOrganizationalDataMember struct { + // ParentHierarchyID - If the multi cloud account is not of membership type organization, this will be the ID of the project's parent + ParentHierarchyID *string `json:"parentHierarchyId,omitempty"` + // OrganizationMembershipType - Possible values include: 'OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeGcpOrganizationalData', 'OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeOrganization', 'OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeMember' + OrganizationMembershipType OrganizationMembershipTypeBasicGcpOrganizationalData `json:"organizationMembershipType,omitempty"` +} + +// MarshalJSON is the custom marshaler for GcpOrganizationalDataMember. +func (godm GcpOrganizationalDataMember) MarshalJSON() ([]byte, error) { + godm.OrganizationMembershipType = OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeMember + objectMap := make(map[string]interface{}) + if godm.ParentHierarchyID != nil { + objectMap["parentHierarchyId"] = godm.ParentHierarchyID + } + if godm.OrganizationMembershipType != "" { + objectMap["organizationMembershipType"] = godm.OrganizationMembershipType + } + return json.Marshal(objectMap) +} + +// AsGcpOrganizationalDataOrganization is the BasicGcpOrganizationalData implementation for GcpOrganizationalDataMember. +func (godm GcpOrganizationalDataMember) AsGcpOrganizationalDataOrganization() (*GcpOrganizationalDataOrganization, bool) { + return nil, false +} + +// AsGcpOrganizationalDataMember is the BasicGcpOrganizationalData implementation for GcpOrganizationalDataMember. +func (godm GcpOrganizationalDataMember) AsGcpOrganizationalDataMember() (*GcpOrganizationalDataMember, bool) { + return &godm, true +} + +// AsGcpOrganizationalData is the BasicGcpOrganizationalData implementation for GcpOrganizationalDataMember. +func (godm GcpOrganizationalDataMember) AsGcpOrganizationalData() (*GcpOrganizationalData, bool) { + return nil, false +} + +// AsBasicGcpOrganizationalData is the BasicGcpOrganizationalData implementation for GcpOrganizationalDataMember. +func (godm GcpOrganizationalDataMember) AsBasicGcpOrganizationalData() (BasicGcpOrganizationalData, bool) { + return &godm, true +} + +// GcpOrganizationalDataOrganization the gcpOrganization data for the parent account +type GcpOrganizationalDataOrganization struct { + // ExcludedProjectNumbers - If the multi cloud account is of membership type organization, list of accounts excluded from offering + ExcludedProjectNumbers *[]string `json:"excludedProjectNumbers,omitempty"` + // ServiceAccountEmailAddress - The service account email address which represents the organization level permissions container. + ServiceAccountEmailAddress *string `json:"serviceAccountEmailAddress,omitempty"` + // WorkloadIdentityProviderID - The GCP workload identity provider id which represents the permissions required to auto provision security connectors + WorkloadIdentityProviderID *string `json:"workloadIdentityProviderId,omitempty"` + // OrganizationMembershipType - Possible values include: 'OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeGcpOrganizationalData', 'OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeOrganization', 'OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeMember' + OrganizationMembershipType OrganizationMembershipTypeBasicGcpOrganizationalData `json:"organizationMembershipType,omitempty"` +} + +// MarshalJSON is the custom marshaler for GcpOrganizationalDataOrganization. +func (godo GcpOrganizationalDataOrganization) MarshalJSON() ([]byte, error) { + godo.OrganizationMembershipType = OrganizationMembershipTypeBasicGcpOrganizationalDataOrganizationMembershipTypeOrganization + objectMap := make(map[string]interface{}) + if godo.ExcludedProjectNumbers != nil { + objectMap["excludedProjectNumbers"] = godo.ExcludedProjectNumbers + } + if godo.ServiceAccountEmailAddress != nil { + objectMap["serviceAccountEmailAddress"] = godo.ServiceAccountEmailAddress + } + if godo.WorkloadIdentityProviderID != nil { + objectMap["workloadIdentityProviderId"] = godo.WorkloadIdentityProviderID + } + if godo.OrganizationMembershipType != "" { + objectMap["organizationMembershipType"] = godo.OrganizationMembershipType + } + return json.Marshal(objectMap) +} + +// AsGcpOrganizationalDataOrganization is the BasicGcpOrganizationalData implementation for GcpOrganizationalDataOrganization. +func (godo GcpOrganizationalDataOrganization) AsGcpOrganizationalDataOrganization() (*GcpOrganizationalDataOrganization, bool) { + return &godo, true +} + +// AsGcpOrganizationalDataMember is the BasicGcpOrganizationalData implementation for GcpOrganizationalDataOrganization. +func (godo GcpOrganizationalDataOrganization) AsGcpOrganizationalDataMember() (*GcpOrganizationalDataMember, bool) { + return nil, false +} + +// AsGcpOrganizationalData is the BasicGcpOrganizationalData implementation for GcpOrganizationalDataOrganization. +func (godo GcpOrganizationalDataOrganization) AsGcpOrganizationalData() (*GcpOrganizationalData, bool) { + return nil, false +} + +// AsBasicGcpOrganizationalData is the BasicGcpOrganizationalData implementation for GcpOrganizationalDataOrganization. +func (godo GcpOrganizationalDataOrganization) AsBasicGcpOrganizationalData() (BasicGcpOrganizationalData, bool) { + return &godo, true +} + +// GcpProjectDetails the details about the project represented by the security connector +type GcpProjectDetails struct { + // ProjectNumber - The unique GCP Project number + ProjectNumber *string `json:"projectNumber,omitempty"` + // ProjectID - The GCP Project id + ProjectID *string `json:"projectId,omitempty"` + // WorkloadIdentityPoolID - READ-ONLY; The GCP workload identity federation pool id + WorkloadIdentityPoolID *string `json:"workloadIdentityPoolId,omitempty"` +} + +// MarshalJSON is the custom marshaler for GcpProjectDetails. +func (gpd GcpProjectDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gpd.ProjectNumber != nil { + objectMap["projectNumber"] = gpd.ProjectNumber + } + if gpd.ProjectID != nil { + objectMap["projectId"] = gpd.ProjectID + } + return json.Marshal(objectMap) +} + +// GcpProjectEnvironmentData the GCP project connector environment data +type GcpProjectEnvironmentData struct { + // OrganizationalData - The Gcp project's organizational data + OrganizationalData BasicGcpOrganizationalData `json:"organizationalData,omitempty"` + // ProjectDetails - The Gcp project's details + ProjectDetails *GcpProjectDetails `json:"projectDetails,omitempty"` + // EnvironmentType - Possible values include: 'EnvironmentTypeEnvironmentData', 'EnvironmentTypeAwsAccount', 'EnvironmentTypeGcpProject', 'EnvironmentTypeGithubScope' + EnvironmentType EnvironmentType `json:"environmentType,omitempty"` +} + +// MarshalJSON is the custom marshaler for GcpProjectEnvironmentData. +func (gped GcpProjectEnvironmentData) MarshalJSON() ([]byte, error) { + gped.EnvironmentType = EnvironmentTypeGcpProject + objectMap := make(map[string]interface{}) + objectMap["organizationalData"] = gped.OrganizationalData + if gped.ProjectDetails != nil { + objectMap["projectDetails"] = gped.ProjectDetails + } + if gped.EnvironmentType != "" { + objectMap["environmentType"] = gped.EnvironmentType + } + return json.Marshal(objectMap) +} + +// AsAWSEnvironmentData is the BasicEnvironmentData implementation for GcpProjectEnvironmentData. +func (gped GcpProjectEnvironmentData) AsAWSEnvironmentData() (*AWSEnvironmentData, bool) { + return nil, false +} + +// AsGcpProjectEnvironmentData is the BasicEnvironmentData implementation for GcpProjectEnvironmentData. +func (gped GcpProjectEnvironmentData) AsGcpProjectEnvironmentData() (*GcpProjectEnvironmentData, bool) { + return &gped, true +} + +// AsGithubScopeEnvironmentData is the BasicEnvironmentData implementation for GcpProjectEnvironmentData. +func (gped GcpProjectEnvironmentData) AsGithubScopeEnvironmentData() (*GithubScopeEnvironmentData, bool) { + return nil, false +} + +// AsEnvironmentData is the BasicEnvironmentData implementation for GcpProjectEnvironmentData. +func (gped GcpProjectEnvironmentData) AsEnvironmentData() (*EnvironmentData, bool) { + return nil, false +} + +// AsBasicEnvironmentData is the BasicEnvironmentData implementation for GcpProjectEnvironmentData. +func (gped GcpProjectEnvironmentData) AsBasicEnvironmentData() (BasicEnvironmentData, bool) { + return &gped, true +} + +// UnmarshalJSON is the custom unmarshaler for GcpProjectEnvironmentData struct. +func (gped *GcpProjectEnvironmentData) 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 "organizationalData": + if v != nil { + organizationalData, err := unmarshalBasicGcpOrganizationalData(*v) + if err != nil { + return err + } + gped.OrganizationalData = organizationalData + } + case "projectDetails": + if v != nil { + var projectDetails GcpProjectDetails + err = json.Unmarshal(*v, &projectDetails) + if err != nil { + return err + } + gped.ProjectDetails = &projectDetails + } + case "environmentType": + if v != nil { + var environmentType EnvironmentType + err = json.Unmarshal(*v, &environmentType) + if err != nil { + return err + } + gped.EnvironmentType = environmentType + } + } + } + + return nil +} + +// GithubScopeEnvironmentData the github scope connector's environment data +type GithubScopeEnvironmentData struct { + // EnvironmentType - Possible values include: 'EnvironmentTypeEnvironmentData', 'EnvironmentTypeAwsAccount', 'EnvironmentTypeGcpProject', 'EnvironmentTypeGithubScope' + EnvironmentType EnvironmentType `json:"environmentType,omitempty"` +} + +// MarshalJSON is the custom marshaler for GithubScopeEnvironmentData. +func (gsed GithubScopeEnvironmentData) MarshalJSON() ([]byte, error) { + gsed.EnvironmentType = EnvironmentTypeGithubScope + objectMap := make(map[string]interface{}) + if gsed.EnvironmentType != "" { + objectMap["environmentType"] = gsed.EnvironmentType + } + return json.Marshal(objectMap) +} + +// AsAWSEnvironmentData is the BasicEnvironmentData implementation for GithubScopeEnvironmentData. +func (gsed GithubScopeEnvironmentData) AsAWSEnvironmentData() (*AWSEnvironmentData, bool) { return nil, false } -// AsAwAssumeRoleAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. -func (gcdp GcpCredentialsDetailsProperties) AsAwAssumeRoleAuthenticationDetailsProperties() (*AwAssumeRoleAuthenticationDetailsProperties, bool) { +// AsGcpProjectEnvironmentData is the BasicEnvironmentData implementation for GithubScopeEnvironmentData. +func (gsed GithubScopeEnvironmentData) AsGcpProjectEnvironmentData() (*GcpProjectEnvironmentData, bool) { return nil, false } -// AsGcpCredentialsDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. -func (gcdp GcpCredentialsDetailsProperties) AsGcpCredentialsDetailsProperties() (*GcpCredentialsDetailsProperties, bool) { - return &gcdp, true +// AsGithubScopeEnvironmentData is the BasicEnvironmentData implementation for GithubScopeEnvironmentData. +func (gsed GithubScopeEnvironmentData) AsGithubScopeEnvironmentData() (*GithubScopeEnvironmentData, bool) { + return &gsed, true } -// AsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. -func (gcdp GcpCredentialsDetailsProperties) AsAuthenticationDetailsProperties() (*AuthenticationDetailsProperties, bool) { +// AsEnvironmentData is the BasicEnvironmentData implementation for GithubScopeEnvironmentData. +func (gsed GithubScopeEnvironmentData) AsEnvironmentData() (*EnvironmentData, bool) { return nil, false } -// AsBasicAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. -func (gcdp GcpCredentialsDetailsProperties) AsBasicAuthenticationDetailsProperties() (BasicAuthenticationDetailsProperties, bool) { - return &gcdp, true +// AsBasicEnvironmentData is the BasicEnvironmentData implementation for GithubScopeEnvironmentData. +func (gsed GithubScopeEnvironmentData) AsBasicEnvironmentData() (BasicEnvironmentData, bool) { + return &gsed, true } // HTTPC2DMessagesNotInAllowedRange number of cloud to device messages (HTTP protocol) is not in allowed @@ -8368,6 +11010,85 @@ func (hcsp HybridComputeSettingsProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// InformationProtectionAwsOffering the information protection for AWS offering +type InformationProtectionAwsOffering struct { + // InformationProtection - The native cloud connection configuration + InformationProtection *InformationProtectionAwsOfferingInformationProtection `json:"informationProtection,omitempty"` + // Description - READ-ONLY; The offering description. + Description *string `json:"description,omitempty"` + // OfferingType - Possible values include: 'OfferingTypeCloudOffering', 'OfferingTypeCspmMonitorAws', 'OfferingTypeDefenderForContainersAws', 'OfferingTypeDefenderForServersAws', 'OfferingTypeInformationProtectionAws', 'OfferingTypeCspmMonitorGcp', 'OfferingTypeDefenderForServersGcp', 'OfferingTypeDefenderForContainersGcp', 'OfferingTypeCspmMonitorGithub' + OfferingType OfferingType `json:"offeringType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) MarshalJSON() ([]byte, error) { + ipao.OfferingType = OfferingTypeInformationProtectionAws + objectMap := make(map[string]interface{}) + if ipao.InformationProtection != nil { + objectMap["informationProtection"] = ipao.InformationProtection + } + if ipao.OfferingType != "" { + objectMap["offeringType"] = ipao.OfferingType + } + return json.Marshal(objectMap) +} + +// AsCspmMonitorAwsOffering is the BasicCloudOffering implementation for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) { + return nil, false +} + +// AsDefenderForContainersAwsOffering is the BasicCloudOffering implementation for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) { + return nil, false +} + +// AsDefenderForServersAwsOffering is the BasicCloudOffering implementation for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) { + return nil, false +} + +// AsInformationProtectionAwsOffering is the BasicCloudOffering implementation for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) { + return &ipao, true +} + +// AsCspmMonitorGcpOffering is the BasicCloudOffering implementation for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) AsCspmMonitorGcpOffering() (*CspmMonitorGcpOffering, bool) { + return nil, false +} + +// AsDefenderForServersGcpOffering is the BasicCloudOffering implementation for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) AsDefenderForServersGcpOffering() (*DefenderForServersGcpOffering, bool) { + return nil, false +} + +// AsDefenderForContainersGcpOffering is the BasicCloudOffering implementation for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) AsDefenderForContainersGcpOffering() (*DefenderForContainersGcpOffering, bool) { + return nil, false +} + +// AsCspmMonitorGithubOffering is the BasicCloudOffering implementation for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) AsCspmMonitorGithubOffering() (*CspmMonitorGithubOffering, bool) { + return nil, false +} + +// AsCloudOffering is the BasicCloudOffering implementation for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) AsCloudOffering() (*CloudOffering, bool) { + return nil, false +} + +// AsBasicCloudOffering is the BasicCloudOffering implementation for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) AsBasicCloudOffering() (BasicCloudOffering, bool) { + return &ipao, true +} + +// InformationProtectionAwsOfferingInformationProtection the native cloud connection configuration +type InformationProtectionAwsOfferingInformationProtection struct { + // CloudRoleArn - The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` +} + // InformationProtectionKeyword the information type keyword. type InformationProtectionKeyword struct { // Pattern - The keyword pattern. @@ -8450,39 +11171,283 @@ func (ipp *InformationProtectionPolicy) UnmarshalJSON(body []byte) error { } } - return nil + return nil +} + +// InformationProtectionPolicyList information protection policies response. +type InformationProtectionPolicyList struct { + autorest.Response `json:"-"` + // Value - List of information protection policies. + Value *[]InformationProtectionPolicy `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for InformationProtectionPolicyList. +func (ippl InformationProtectionPolicyList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ippl.Value != nil { + objectMap["value"] = ippl.Value + } + return json.Marshal(objectMap) +} + +// InformationProtectionPolicyListIterator provides access to a complete listing of +// InformationProtectionPolicy values. +type InformationProtectionPolicyListIterator struct { + i int + page InformationProtectionPolicyListPage +} + +// 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 *InformationProtectionPolicyListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InformationProtectionPolicyListIterator.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 *InformationProtectionPolicyListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter InformationProtectionPolicyListIterator) 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 InformationProtectionPolicyListIterator) Response() InformationProtectionPolicyList { + 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 InformationProtectionPolicyListIterator) Value() InformationProtectionPolicy { + if !iter.page.NotDone() { + return InformationProtectionPolicy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the InformationProtectionPolicyListIterator type. +func NewInformationProtectionPolicyListIterator(page InformationProtectionPolicyListPage) InformationProtectionPolicyListIterator { + return InformationProtectionPolicyListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ippl InformationProtectionPolicyList) IsEmpty() bool { + return ippl.Value == nil || len(*ippl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ippl InformationProtectionPolicyList) hasNextLink() bool { + return ippl.NextLink != nil && len(*ippl.NextLink) != 0 +} + +// informationProtectionPolicyListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ippl InformationProtectionPolicyList) informationProtectionPolicyListPreparer(ctx context.Context) (*http.Request, error) { + if !ippl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ippl.NextLink))) +} + +// InformationProtectionPolicyListPage contains a page of InformationProtectionPolicy values. +type InformationProtectionPolicyListPage struct { + fn func(context.Context, InformationProtectionPolicyList) (InformationProtectionPolicyList, error) + ippl InformationProtectionPolicyList +} + +// 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 *InformationProtectionPolicyListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InformationProtectionPolicyListPage.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.ippl) + if err != nil { + return err + } + page.ippl = 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 *InformationProtectionPolicyListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page InformationProtectionPolicyListPage) NotDone() bool { + return !page.ippl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page InformationProtectionPolicyListPage) Response() InformationProtectionPolicyList { + return page.ippl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page InformationProtectionPolicyListPage) Values() []InformationProtectionPolicy { + if page.ippl.IsEmpty() { + return nil + } + return *page.ippl.Value +} + +// Creates a new instance of the InformationProtectionPolicyListPage type. +func NewInformationProtectionPolicyListPage(cur InformationProtectionPolicyList, getNextPage func(context.Context, InformationProtectionPolicyList) (InformationProtectionPolicyList, error)) InformationProtectionPolicyListPage { + return InformationProtectionPolicyListPage{ + fn: getNextPage, + ippl: cur, + } +} + +// InformationProtectionPolicyProperties describes properties of an information protection policy. +type InformationProtectionPolicyProperties struct { + // LastModifiedUtc - READ-ONLY; Describes the last UTC time the policy was modified. + LastModifiedUtc *date.Time `json:"lastModifiedUtc,omitempty"` + // Version - READ-ONLY; Describes the version of the policy. + Version *string `json:"version,omitempty"` + // Labels - Dictionary of sensitivity labels. + Labels map[string]*SensitivityLabel `json:"labels"` + // InformationTypes - The sensitivity information types. + InformationTypes map[string]*InformationType `json:"informationTypes"` +} + +// MarshalJSON is the custom marshaler for InformationProtectionPolicyProperties. +func (ippp InformationProtectionPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ippp.Labels != nil { + objectMap["labels"] = ippp.Labels + } + if ippp.InformationTypes != nil { + objectMap["informationTypes"] = ippp.InformationTypes + } + return json.Marshal(objectMap) +} + +// InformationType the information type. +type InformationType struct { + // DisplayName - The name of the information type. + DisplayName *string `json:"displayName,omitempty"` + // Description - The description of the information type. + Description *string `json:"description,omitempty"` + // Order - The order of the information type. + Order *int32 `json:"order,omitempty"` + // RecommendedLabelID - The recommended label id to be associated with this information type. + RecommendedLabelID *uuid.UUID `json:"recommendedLabelId,omitempty"` + // Enabled - Indicates whether the information type is enabled or not. + Enabled *bool `json:"enabled,omitempty"` + // Custom - Indicates whether the information type is custom or not. + Custom *bool `json:"custom,omitempty"` + // Keywords - The information type keywords. + Keywords *[]InformationProtectionKeyword `json:"keywords,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"` } -// InformationProtectionPolicyList information protection policies response. -type InformationProtectionPolicyList struct { +// MarshalJSON is the custom marshaler for IngestionConnectionString. +func (ics IngestionConnectionString) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// IngestionSetting configures how to correlate scan data and logs with resources associated with the +// subscription. +type IngestionSetting struct { autorest.Response `json:"-"` - // Value - List of information protection policies. - Value *[]InformationProtectionPolicy `json:"value,omitempty"` + // 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"` +} + +// 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) +} + +// IngestionSettingList list of ingestion settings +type IngestionSettingList struct { + autorest.Response `json:"-"` + // 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"` } -// MarshalJSON is the custom marshaler for InformationProtectionPolicyList. -func (ippl InformationProtectionPolicyList) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for IngestionSettingList. +func (isl IngestionSettingList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ippl.Value != nil { - objectMap["value"] = ippl.Value - } return json.Marshal(objectMap) } -// InformationProtectionPolicyListIterator provides access to a complete listing of -// InformationProtectionPolicy values. -type InformationProtectionPolicyListIterator struct { +// IngestionSettingListIterator provides access to a complete listing of IngestionSetting values. +type IngestionSettingListIterator struct { i int - page InformationProtectionPolicyListPage + 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 *InformationProtectionPolicyListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *IngestionSettingListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InformationProtectionPolicyListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/IngestionSettingListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -8507,67 +11472,67 @@ func (iter *InformationProtectionPolicyListIterator) NextWithContext(ctx context // 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 *InformationProtectionPolicyListIterator) 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 InformationProtectionPolicyListIterator) 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 InformationProtectionPolicyListIterator) Response() InformationProtectionPolicyList { +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 InformationProtectionPolicyListIterator) Value() InformationProtectionPolicy { +func (iter IngestionSettingListIterator) Value() IngestionSetting { if !iter.page.NotDone() { - return InformationProtectionPolicy{} + return IngestionSetting{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the InformationProtectionPolicyListIterator type. -func NewInformationProtectionPolicyListIterator(page InformationProtectionPolicyListPage) InformationProtectionPolicyListIterator { - return InformationProtectionPolicyListIterator{page: page} +// Creates a new instance of the IngestionSettingListIterator type. +func NewIngestionSettingListIterator(page IngestionSettingListPage) IngestionSettingListIterator { + return IngestionSettingListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (ippl InformationProtectionPolicyList) IsEmpty() bool { - return ippl.Value == nil || len(*ippl.Value) == 0 +func (isl IngestionSettingList) IsEmpty() bool { + return isl.Value == nil || len(*isl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (ippl InformationProtectionPolicyList) hasNextLink() bool { - return ippl.NextLink != nil && len(*ippl.NextLink) != 0 +func (isl IngestionSettingList) hasNextLink() bool { + return isl.NextLink != nil && len(*isl.NextLink) != 0 } -// informationProtectionPolicyListPreparer prepares a request to retrieve the next set of results. +// ingestionSettingListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (ippl InformationProtectionPolicyList) informationProtectionPolicyListPreparer(ctx context.Context) (*http.Request, error) { - if !ippl.hasNextLink() { +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(ippl.NextLink))) + autorest.WithBaseURL(to.String(isl.NextLink))) } -// InformationProtectionPolicyListPage contains a page of InformationProtectionPolicy values. -type InformationProtectionPolicyListPage struct { - fn func(context.Context, InformationProtectionPolicyList) (InformationProtectionPolicyList, error) - ippl InformationProtectionPolicyList +// 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 *InformationProtectionPolicyListPage) NextWithContext(ctx context.Context) (err error) { +func (page *IngestionSettingListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InformationProtectionPolicyListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/IngestionSettingListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -8577,11 +11542,11 @@ func (page *InformationProtectionPolicyListPage) NextWithContext(ctx context.Con }() } for { - next, err := page.fn(ctx, page.ippl) + next, err := page.fn(ctx, page.isl) if err != nil { return err } - page.ippl = next + page.isl = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -8592,78 +11557,50 @@ func (page *InformationProtectionPolicyListPage) NextWithContext(ctx context.Con // 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 *InformationProtectionPolicyListPage) Next() error { +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 InformationProtectionPolicyListPage) NotDone() bool { - return !page.ippl.IsEmpty() +func (page IngestionSettingListPage) NotDone() bool { + return !page.isl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page InformationProtectionPolicyListPage) Response() InformationProtectionPolicyList { - return page.ippl +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 InformationProtectionPolicyListPage) Values() []InformationProtectionPolicy { - if page.ippl.IsEmpty() { +func (page IngestionSettingListPage) Values() []IngestionSetting { + if page.isl.IsEmpty() { return nil } - return *page.ippl.Value + return *page.isl.Value } -// Creates a new instance of the InformationProtectionPolicyListPage type. -func NewInformationProtectionPolicyListPage(cur InformationProtectionPolicyList, getNextPage func(context.Context, InformationProtectionPolicyList) (InformationProtectionPolicyList, error)) InformationProtectionPolicyListPage { - return InformationProtectionPolicyListPage{ - fn: getNextPage, - ippl: cur, +// 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, } } -// InformationProtectionPolicyProperties describes properties of an information protection policy. -type InformationProtectionPolicyProperties struct { - // LastModifiedUtc - READ-ONLY; Describes the last UTC time the policy was modified. - LastModifiedUtc *date.Time `json:"lastModifiedUtc,omitempty"` - // Version - READ-ONLY; Describes the version of the policy. - Version *string `json:"version,omitempty"` - // Labels - Dictionary of sensitivity labels. - Labels map[string]*SensitivityLabel `json:"labels"` - // InformationTypes - The sensitivity information types. - InformationTypes map[string]*InformationType `json:"informationTypes"` +// 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 InformationProtectionPolicyProperties. -func (ippp InformationProtectionPolicyProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for IngestionSettingToken. +func (ist IngestionSettingToken) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ippp.Labels != nil { - objectMap["labels"] = ippp.Labels - } - if ippp.InformationTypes != nil { - objectMap["informationTypes"] = ippp.InformationTypes - } return json.Marshal(objectMap) } -// InformationType the information type. -type InformationType struct { - // DisplayName - The name of the information type. - DisplayName *string `json:"displayName,omitempty"` - // Description - The description of the information type. - Description *string `json:"description,omitempty"` - // Order - The order of the information type. - Order *int32 `json:"order,omitempty"` - // RecommendedLabelID - The recommended label id to be associated with this information type. - RecommendedLabelID *uuid.UUID `json:"recommendedLabelId,omitempty"` - // Enabled - Indicates whether the information type is enabled or not. - Enabled *bool `json:"enabled,omitempty"` - // Custom - Indicates whether the information type is custom or not. - Custom *bool `json:"custom,omitempty"` - // Keywords - The information type keywords. - Keywords *[]InformationProtectionKeyword `json:"keywords,omitempty"` -} - // JitNetworkAccessPoliciesList ... type JitNetworkAccessPoliciesList struct { autorest.Response `json:"-"` @@ -9477,6 +12414,94 @@ func (l Location) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MdeOnboardingData the resource of the configuration or data needed to onboard the machine to MDE +type MdeOnboardingData struct { + autorest.Response `json:"-"` + *MdeOnboardingDataProperties `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 MdeOnboardingData. +func (mod MdeOnboardingData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mod.MdeOnboardingDataProperties != nil { + objectMap["properties"] = mod.MdeOnboardingDataProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MdeOnboardingData struct. +func (mod *MdeOnboardingData) 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 mdeOnboardingDataProperties MdeOnboardingDataProperties + err = json.Unmarshal(*v, &mdeOnboardingDataProperties) + if err != nil { + return err + } + mod.MdeOnboardingDataProperties = &mdeOnboardingDataProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mod.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mod.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mod.Type = &typeVar + } + } + } + + return nil +} + +// MdeOnboardingDataList list of all MDE onboarding data resources +type MdeOnboardingDataList struct { + autorest.Response `json:"-"` + // Value - List of the resources of the configuration or data needed to onboard the machine to MDE + Value *[]MdeOnboardingData `json:"value,omitempty"` +} + +// MdeOnboardingDataProperties properties of the MDE configuration or data parameter needed to onboard the +// machine to MDE +type MdeOnboardingDataProperties struct { + // OnboardingPackageWindows - The onboarding package used to onboard Windows machines to MDE, coded in base64. This can also be used for onboarding using the dedicated VM Extension + OnboardingPackageWindows *[]byte `json:"onboardingPackageWindows,omitempty"` + // OnboardingPackageLinux - The onboarding package used to onboard Linux machines to MDE, coded in base64. This can also be used for onboarding using the dedicated VM Extension + OnboardingPackageLinux *[]byte `json:"onboardingPackageLinux,omitempty"` +} + // MqttC2DMessagesNotInAllowedRange number of cloud to device messages (MQTT protocol) is not in allowed // range. type MqttC2DMessagesNotInAllowedRange struct { @@ -10446,7 +13471,7 @@ type PathRecommendation struct { // Action - Possible values include: 'Recommended', 'Add', 'Remove' Action Action `json:"action,omitempty"` // Type - Possible values include: 'File', 'FileHash', 'PublisherSignature', 'ProductSignature', 'BinarySignature', 'VersionAndAboveSignature' - Type Type `json:"type,omitempty"` + Type Type1 `json:"type,omitempty"` PublisherInfo *PublisherInfo `json:"publisherInfo,omitempty"` // Common - Whether the path is commonly run on the machine Common *bool `json:"common,omitempty"` @@ -12251,8 +15276,80 @@ func (se ScopeElement) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ScopeElement struct. -func (se *ScopeElement) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ScopeElement struct. +func (se *ScopeElement) 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 se.AdditionalProperties == nil { + se.AdditionalProperties = make(map[string]interface{}) + } + se.AdditionalProperties[k] = additionalProperties + } + case "field": + if v != nil { + var field string + err = json.Unmarshal(*v, &field) + if err != nil { + return err + } + se.Field = &field + } + } + } + + return nil +} + +// ScoreDetails calculation result data +type ScoreDetails struct { + // Max - READ-ONLY; Maximum score available + Max *int32 `json:"max,omitempty"` + // Current - READ-ONLY; Current score + Current *float64 `json:"current,omitempty"` + // Percentage - READ-ONLY; Ratio of the current score divided by the maximum. Rounded to 4 digits after the decimal point + Percentage *float64 `json:"percentage,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScoreDetails. +func (sd ScoreDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SecureScoreControlDefinitionItem information about the security control. +type SecureScoreControlDefinitionItem struct { + *SecureScoreControlDefinitionItemProperties `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 SecureScoreControlDefinitionItem. +func (sscdi SecureScoreControlDefinitionItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sscdi.SecureScoreControlDefinitionItemProperties != nil { + objectMap["properties"] = sscdi.SecureScoreControlDefinitionItemProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecureScoreControlDefinitionItem struct. +func (sscdi *SecureScoreControlDefinitionItem) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -12260,26 +15357,41 @@ func (se *ScopeElement) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - default: + case "properties": if v != nil { - var additionalProperties interface{} - err = json.Unmarshal(*v, &additionalProperties) + var secureScoreControlDefinitionItemProperties SecureScoreControlDefinitionItemProperties + err = json.Unmarshal(*v, &secureScoreControlDefinitionItemProperties) if err != nil { return err } - if se.AdditionalProperties == nil { - se.AdditionalProperties = make(map[string]interface{}) + sscdi.SecureScoreControlDefinitionItemProperties = &secureScoreControlDefinitionItemProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err } - se.AdditionalProperties[k] = additionalProperties + sscdi.ID = &ID } - case "field": + case "name": if v != nil { - var field string - err = json.Unmarshal(*v, &field) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - se.Field = &field + sscdi.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sscdi.Type = &typeVar } } } @@ -12287,25 +15399,202 @@ func (se *ScopeElement) UnmarshalJSON(body []byte) error { return nil } -// ScoreDetails calculation result data -type ScoreDetails struct { - // Max - READ-ONLY; Maximum score available - Max *int32 `json:"max,omitempty"` - // Current - READ-ONLY; Current score - Current *float64 `json:"current,omitempty"` - // Percentage - READ-ONLY; Ratio of the current score divided by the maximum. Rounded to 4 digits after the decimal point - Percentage *float64 `json:"percentage,omitempty"` +// SecureScoreControlDefinitionItemProperties security Control Definition Properties. +type SecureScoreControlDefinitionItemProperties struct { + // DisplayName - READ-ONLY; User friendly display name of the control + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; User friendly description of the control + Description *string `json:"description,omitempty"` + // MaxScore - READ-ONLY; Maximum control score (0..10) + MaxScore *int32 `json:"maxScore,omitempty"` + // Source - READ-ONLY; Source object from which the control was created + Source *SecureScoreControlDefinitionSource `json:"source,omitempty"` + // AssessmentDefinitions - READ-ONLY; Array of assessments metadata IDs that are included in this security control + AssessmentDefinitions *[]AzureResourceLink `json:"assessmentDefinitions,omitempty"` } -// MarshalJSON is the custom marshaler for ScoreDetails. -func (sd ScoreDetails) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for SecureScoreControlDefinitionItemProperties. +func (sscdip SecureScoreControlDefinitionItemProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) return json.Marshal(objectMap) } -// SecureScoreControlDefinitionItem information about the security control. -type SecureScoreControlDefinitionItem struct { - *SecureScoreControlDefinitionItemProperties `json:"properties,omitempty"` +// SecureScoreControlDefinitionList list of security controls definition +type SecureScoreControlDefinitionList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Collection of security controls definition in this page + Value *[]SecureScoreControlDefinitionItem `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecureScoreControlDefinitionList. +func (sscdl SecureScoreControlDefinitionList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SecureScoreControlDefinitionListIterator provides access to a complete listing of +// SecureScoreControlDefinitionItem values. +type SecureScoreControlDefinitionListIterator struct { + i int + page SecureScoreControlDefinitionListPage +} + +// 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 *SecureScoreControlDefinitionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionListIterator.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 *SecureScoreControlDefinitionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SecureScoreControlDefinitionListIterator) 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 SecureScoreControlDefinitionListIterator) Response() SecureScoreControlDefinitionList { + 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 SecureScoreControlDefinitionListIterator) Value() SecureScoreControlDefinitionItem { + if !iter.page.NotDone() { + return SecureScoreControlDefinitionItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SecureScoreControlDefinitionListIterator type. +func NewSecureScoreControlDefinitionListIterator(page SecureScoreControlDefinitionListPage) SecureScoreControlDefinitionListIterator { + return SecureScoreControlDefinitionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sscdl SecureScoreControlDefinitionList) IsEmpty() bool { + return sscdl.Value == nil || len(*sscdl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (sscdl SecureScoreControlDefinitionList) hasNextLink() bool { + return sscdl.NextLink != nil && len(*sscdl.NextLink) != 0 +} + +// secureScoreControlDefinitionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sscdl SecureScoreControlDefinitionList) secureScoreControlDefinitionListPreparer(ctx context.Context) (*http.Request, error) { + if !sscdl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sscdl.NextLink))) +} + +// SecureScoreControlDefinitionListPage contains a page of SecureScoreControlDefinitionItem values. +type SecureScoreControlDefinitionListPage struct { + fn func(context.Context, SecureScoreControlDefinitionList) (SecureScoreControlDefinitionList, error) + sscdl SecureScoreControlDefinitionList +} + +// 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 *SecureScoreControlDefinitionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionListPage.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.sscdl) + if err != nil { + return err + } + page.sscdl = 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 *SecureScoreControlDefinitionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SecureScoreControlDefinitionListPage) NotDone() bool { + return !page.sscdl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SecureScoreControlDefinitionListPage) Response() SecureScoreControlDefinitionList { + return page.sscdl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SecureScoreControlDefinitionListPage) Values() []SecureScoreControlDefinitionItem { + if page.sscdl.IsEmpty() { + return nil + } + return *page.sscdl.Value +} + +// Creates a new instance of the SecureScoreControlDefinitionListPage type. +func NewSecureScoreControlDefinitionListPage(cur SecureScoreControlDefinitionList, getNextPage func(context.Context, SecureScoreControlDefinitionList) (SecureScoreControlDefinitionList, error)) SecureScoreControlDefinitionListPage { + return SecureScoreControlDefinitionListPage{ + fn: getNextPage, + sscdl: cur, + } +} + +// SecureScoreControlDefinitionSource the type of the security control (For example, BuiltIn) +type SecureScoreControlDefinitionSource struct { + // SourceType - The type of security control (for example, BuiltIn). Possible values include: 'BuiltIn', 'Custom' + SourceType ControlType `json:"sourceType,omitempty"` +} + +// SecureScoreControlDetails details of the security control, its score, and the health status of the +// relevant resources. +type SecureScoreControlDetails struct { + *SecureScoreControlScoreDetails `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name @@ -12314,17 +15603,17 @@ type SecureScoreControlDefinitionItem struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for SecureScoreControlDefinitionItem. -func (sscdi SecureScoreControlDefinitionItem) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for SecureScoreControlDetails. +func (sscd SecureScoreControlDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if sscdi.SecureScoreControlDefinitionItemProperties != nil { - objectMap["properties"] = sscdi.SecureScoreControlDefinitionItemProperties + if sscd.SecureScoreControlScoreDetails != nil { + objectMap["properties"] = sscd.SecureScoreControlScoreDetails } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for SecureScoreControlDefinitionItem struct. -func (sscdi *SecureScoreControlDefinitionItem) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for SecureScoreControlDetails struct. +func (sscd *SecureScoreControlDetails) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -12334,12 +15623,12 @@ func (sscdi *SecureScoreControlDefinitionItem) UnmarshalJSON(body []byte) error switch k { case "properties": if v != nil { - var secureScoreControlDefinitionItemProperties SecureScoreControlDefinitionItemProperties - err = json.Unmarshal(*v, &secureScoreControlDefinitionItemProperties) + var secureScoreControlScoreDetails SecureScoreControlScoreDetails + err = json.Unmarshal(*v, &secureScoreControlScoreDetails) if err != nil { return err } - sscdi.SecureScoreControlDefinitionItemProperties = &secureScoreControlDefinitionItemProperties + sscd.SecureScoreControlScoreDetails = &secureScoreControlScoreDetails } case "id": if v != nil { @@ -12348,7 +15637,7 @@ func (sscdi *SecureScoreControlDefinitionItem) UnmarshalJSON(body []byte) error if err != nil { return err } - sscdi.ID = &ID + sscd.ID = &ID } case "name": if v != nil { @@ -12357,7 +15646,7 @@ func (sscdi *SecureScoreControlDefinitionItem) UnmarshalJSON(body []byte) error if err != nil { return err } - sscdi.Name = &name + sscd.Name = &name } case "type": if v != nil { @@ -12366,7 +15655,7 @@ func (sscdi *SecureScoreControlDefinitionItem) UnmarshalJSON(body []byte) error if err != nil { return err } - sscdi.Type = &typeVar + sscd.Type = &typeVar } } } @@ -12374,53 +15663,33 @@ func (sscdi *SecureScoreControlDefinitionItem) UnmarshalJSON(body []byte) error return nil } -// SecureScoreControlDefinitionItemProperties security Control Definition Properties. -type SecureScoreControlDefinitionItemProperties struct { - // DisplayName - READ-ONLY; User friendly display name of the control - DisplayName *string `json:"displayName,omitempty"` - // Description - READ-ONLY; User friendly description of the control - Description *string `json:"description,omitempty"` - // MaxScore - READ-ONLY; Maximum control score (0..10) - MaxScore *int32 `json:"maxScore,omitempty"` - // Source - READ-ONLY; Source object from which the control was created - Source *SecureScoreControlDefinitionSource `json:"source,omitempty"` - // AssessmentDefinitions - READ-ONLY; Array of assessments metadata IDs that are included in this security control - AssessmentDefinitions *[]AzureResourceLink `json:"assessmentDefinitions,omitempty"` -} - -// MarshalJSON is the custom marshaler for SecureScoreControlDefinitionItemProperties. -func (sscdip SecureScoreControlDefinitionItemProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// SecureScoreControlDefinitionList list of security controls definition -type SecureScoreControlDefinitionList struct { +// SecureScoreControlList list of security controls +type SecureScoreControlList struct { autorest.Response `json:"-"` - // Value - READ-ONLY; Collection of security controls definition in this page - Value *[]SecureScoreControlDefinitionItem `json:"value,omitempty"` + // Value - READ-ONLY; Collection of security controls in this page + Value *[]SecureScoreControlDetails `json:"value,omitempty"` // NextLink - READ-ONLY; The URI to fetch the next page. NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for SecureScoreControlDefinitionList. -func (sscdl SecureScoreControlDefinitionList) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for SecureScoreControlList. +func (sscl SecureScoreControlList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) return json.Marshal(objectMap) } -// SecureScoreControlDefinitionListIterator provides access to a complete listing of -// SecureScoreControlDefinitionItem values. -type SecureScoreControlDefinitionListIterator struct { +// SecureScoreControlListIterator provides access to a complete listing of SecureScoreControlDetails +// values. +type SecureScoreControlListIterator struct { i int - page SecureScoreControlDefinitionListPage + page SecureScoreControlListPage } // 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 *SecureScoreControlDefinitionListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *SecureScoreControlListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -12445,67 +15714,67 @@ func (iter *SecureScoreControlDefinitionListIterator) NextWithContext(ctx contex // 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 *SecureScoreControlDefinitionListIterator) Next() error { +func (iter *SecureScoreControlListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SecureScoreControlDefinitionListIterator) NotDone() bool { +func (iter SecureScoreControlListIterator) 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 SecureScoreControlDefinitionListIterator) Response() SecureScoreControlDefinitionList { +func (iter SecureScoreControlListIterator) Response() SecureScoreControlList { 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 SecureScoreControlDefinitionListIterator) Value() SecureScoreControlDefinitionItem { +func (iter SecureScoreControlListIterator) Value() SecureScoreControlDetails { if !iter.page.NotDone() { - return SecureScoreControlDefinitionItem{} + return SecureScoreControlDetails{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the SecureScoreControlDefinitionListIterator type. -func NewSecureScoreControlDefinitionListIterator(page SecureScoreControlDefinitionListPage) SecureScoreControlDefinitionListIterator { - return SecureScoreControlDefinitionListIterator{page: page} +// Creates a new instance of the SecureScoreControlListIterator type. +func NewSecureScoreControlListIterator(page SecureScoreControlListPage) SecureScoreControlListIterator { + return SecureScoreControlListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (sscdl SecureScoreControlDefinitionList) IsEmpty() bool { - return sscdl.Value == nil || len(*sscdl.Value) == 0 +func (sscl SecureScoreControlList) IsEmpty() bool { + return sscl.Value == nil || len(*sscl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (sscdl SecureScoreControlDefinitionList) hasNextLink() bool { - return sscdl.NextLink != nil && len(*sscdl.NextLink) != 0 +func (sscl SecureScoreControlList) hasNextLink() bool { + return sscl.NextLink != nil && len(*sscl.NextLink) != 0 } -// secureScoreControlDefinitionListPreparer prepares a request to retrieve the next set of results. +// secureScoreControlListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (sscdl SecureScoreControlDefinitionList) secureScoreControlDefinitionListPreparer(ctx context.Context) (*http.Request, error) { - if !sscdl.hasNextLink() { +func (sscl SecureScoreControlList) secureScoreControlListPreparer(ctx context.Context) (*http.Request, error) { + if !sscl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(sscdl.NextLink))) + autorest.WithBaseURL(to.String(sscl.NextLink))) } -// SecureScoreControlDefinitionListPage contains a page of SecureScoreControlDefinitionItem values. -type SecureScoreControlDefinitionListPage struct { - fn func(context.Context, SecureScoreControlDefinitionList) (SecureScoreControlDefinitionList, error) - sscdl SecureScoreControlDefinitionList +// SecureScoreControlListPage contains a page of SecureScoreControlDetails values. +type SecureScoreControlListPage struct { + fn func(context.Context, SecureScoreControlList) (SecureScoreControlList, error) + sscl SecureScoreControlList } // 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 *SecureScoreControlDefinitionListPage) NextWithContext(ctx context.Context) (err error) { +func (page *SecureScoreControlListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -12515,11 +15784,11 @@ func (page *SecureScoreControlDefinitionListPage) NextWithContext(ctx context.Co }() } for { - next, err := page.fn(ctx, page.sscdl) + next, err := page.fn(ctx, page.sscl) if err != nil { return err } - page.sscdl = next + page.sscl = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -12530,46 +15799,164 @@ func (page *SecureScoreControlDefinitionListPage) NextWithContext(ctx context.Co // 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 *SecureScoreControlDefinitionListPage) Next() error { +func (page *SecureScoreControlListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SecureScoreControlDefinitionListPage) NotDone() bool { - return !page.sscdl.IsEmpty() +func (page SecureScoreControlListPage) NotDone() bool { + return !page.sscl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page SecureScoreControlDefinitionListPage) Response() SecureScoreControlDefinitionList { - return page.sscdl +func (page SecureScoreControlListPage) Response() SecureScoreControlList { + return page.sscl } // Values returns the slice of values for the current page or nil if there are no values. -func (page SecureScoreControlDefinitionListPage) Values() []SecureScoreControlDefinitionItem { - if page.sscdl.IsEmpty() { +func (page SecureScoreControlListPage) Values() []SecureScoreControlDetails { + if page.sscl.IsEmpty() { return nil } - return *page.sscdl.Value + return *page.sscl.Value } -// Creates a new instance of the SecureScoreControlDefinitionListPage type. -func NewSecureScoreControlDefinitionListPage(cur SecureScoreControlDefinitionList, getNextPage func(context.Context, SecureScoreControlDefinitionList) (SecureScoreControlDefinitionList, error)) SecureScoreControlDefinitionListPage { - return SecureScoreControlDefinitionListPage{ - fn: getNextPage, - sscdl: cur, +// Creates a new instance of the SecureScoreControlListPage type. +func NewSecureScoreControlListPage(cur SecureScoreControlList, getNextPage func(context.Context, SecureScoreControlList) (SecureScoreControlList, error)) SecureScoreControlListPage { + return SecureScoreControlListPage{ + fn: getNextPage, + sscl: cur, } } -// SecureScoreControlDefinitionSource the type of the security control (For example, BuiltIn) -type SecureScoreControlDefinitionSource struct { - // SourceType - The type of security control (for example, BuiltIn). Possible values include: 'BuiltIn', 'Custom' - SourceType ControlType `json:"sourceType,omitempty"` +// SecureScoreControlScore calculation result data +type SecureScoreControlScore struct { + // Max - READ-ONLY; Maximum control score (0..10) + Max *int32 `json:"max,omitempty"` + // Current - READ-ONLY; Actual score for the control = (achieved points / total points) * max score. if total points is zeroed, the return number is 0.00 + Current *float64 `json:"current,omitempty"` + // Percentage - READ-ONLY; Ratio of the current score divided by the maximum. Rounded to 4 digits after the decimal point + Percentage *float64 `json:"percentage,omitempty"` } -// SecureScoreControlDetails details of the security control, its score, and the health status of the -// relevant resources. -type SecureScoreControlDetails struct { - *SecureScoreControlScoreDetails `json:"properties,omitempty"` +// MarshalJSON is the custom marshaler for SecureScoreControlScore. +func (sscs SecureScoreControlScore) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SecureScoreControlScoreDetails calculation result data in control level +type SecureScoreControlScoreDetails struct { + // DisplayName - READ-ONLY; User friendly display name of the control + DisplayName *string `json:"displayName,omitempty"` + // ScoreDetails - Actual score object for the control + *ScoreDetails `json:"score,omitempty"` + // HealthyResourceCount - READ-ONLY; Number of healthy resources in the control + HealthyResourceCount *int32 `json:"healthyResourceCount,omitempty"` + // UnhealthyResourceCount - READ-ONLY; Number of unhealthy resources in the control + UnhealthyResourceCount *int32 `json:"unhealthyResourceCount,omitempty"` + // NotApplicableResourceCount - READ-ONLY; Number of not applicable resources in the control + NotApplicableResourceCount *int32 `json:"notApplicableResourceCount,omitempty"` + // Weight - READ-ONLY; The relative weight for this specific control in each of your subscriptions. Used when calculating an aggregated score for this control across all of your subscriptions. + Weight *int64 `json:"weight,omitempty"` + Definition *SecureScoreControlDefinitionItem `json:"definition,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecureScoreControlScoreDetails. +func (sscsd SecureScoreControlScoreDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sscsd.ScoreDetails != nil { + objectMap["score"] = sscsd.ScoreDetails + } + if sscsd.Definition != nil { + objectMap["definition"] = sscsd.Definition + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecureScoreControlScoreDetails struct. +func (sscsd *SecureScoreControlScoreDetails) 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 "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + sscsd.DisplayName = &displayName + } + case "score": + if v != nil { + var scoreDetails ScoreDetails + err = json.Unmarshal(*v, &scoreDetails) + if err != nil { + return err + } + sscsd.ScoreDetails = &scoreDetails + } + case "healthyResourceCount": + if v != nil { + var healthyResourceCount int32 + err = json.Unmarshal(*v, &healthyResourceCount) + if err != nil { + return err + } + sscsd.HealthyResourceCount = &healthyResourceCount + } + case "unhealthyResourceCount": + if v != nil { + var unhealthyResourceCount int32 + err = json.Unmarshal(*v, &unhealthyResourceCount) + if err != nil { + return err + } + sscsd.UnhealthyResourceCount = &unhealthyResourceCount + } + case "notApplicableResourceCount": + if v != nil { + var notApplicableResourceCount int32 + err = json.Unmarshal(*v, ¬ApplicableResourceCount) + if err != nil { + return err + } + sscsd.NotApplicableResourceCount = ¬ApplicableResourceCount + } + case "weight": + if v != nil { + var weight int64 + err = json.Unmarshal(*v, &weight) + if err != nil { + return err + } + sscsd.Weight = &weight + } + case "definition": + if v != nil { + var definition SecureScoreControlDefinitionItem + err = json.Unmarshal(*v, &definition) + if err != nil { + return err + } + sscsd.Definition = &definition + } + } + } + + return nil +} + +// SecureScoreItem secure score item data model +type SecureScoreItem struct { + autorest.Response `json:"-"` + // SecureScoreItemProperties - READ-ONLY; Secure score item + *SecureScoreItemProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name @@ -12578,17 +15965,14 @@ type SecureScoreControlDetails struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for SecureScoreControlDetails. -func (sscd SecureScoreControlDetails) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for SecureScoreItem. +func (ssi SecureScoreItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if sscd.SecureScoreControlScoreDetails != nil { - objectMap["properties"] = sscd.SecureScoreControlScoreDetails - } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for SecureScoreControlDetails struct. -func (sscd *SecureScoreControlDetails) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for SecureScoreItem struct. +func (ssi *SecureScoreItem) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -12598,12 +15982,12 @@ func (sscd *SecureScoreControlDetails) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var secureScoreControlScoreDetails SecureScoreControlScoreDetails - err = json.Unmarshal(*v, &secureScoreControlScoreDetails) + var secureScoreItemProperties SecureScoreItemProperties + err = json.Unmarshal(*v, &secureScoreItemProperties) if err != nil { return err } - sscd.SecureScoreControlScoreDetails = &secureScoreControlScoreDetails + ssi.SecureScoreItemProperties = &secureScoreItemProperties } case "id": if v != nil { @@ -12612,7 +15996,7 @@ func (sscd *SecureScoreControlDetails) UnmarshalJSON(body []byte) error { if err != nil { return err } - sscd.ID = &ID + ssi.ID = &ID } case "name": if v != nil { @@ -12621,7 +16005,7 @@ func (sscd *SecureScoreControlDetails) UnmarshalJSON(body []byte) error { if err != nil { return err } - sscd.Name = &name + ssi.Name = &name } case "type": if v != nil { @@ -12630,7 +16014,7 @@ func (sscd *SecureScoreControlDetails) UnmarshalJSON(body []byte) error { if err != nil { return err } - sscd.Type = &typeVar + ssi.Type = &typeVar } } } @@ -12638,33 +16022,90 @@ func (sscd *SecureScoreControlDetails) UnmarshalJSON(body []byte) error { return nil } -// SecureScoreControlList list of security controls -type SecureScoreControlList struct { +// SecureScoreItemProperties describes properties of a calculated secure score. +type SecureScoreItemProperties struct { + // DisplayName - READ-ONLY; The initiative’s name + DisplayName *string `json:"displayName,omitempty"` + // ScoreDetails - READ-ONLY; score object + *ScoreDetails `json:"score,omitempty"` + // Weight - READ-ONLY; The relative weight for each subscription. Used when calculating an aggregated secure score for multiple subscriptions. + Weight *int64 `json:"weight,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecureScoreItemProperties. +func (ssip SecureScoreItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecureScoreItemProperties struct. +func (ssip *SecureScoreItemProperties) 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 "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + ssip.DisplayName = &displayName + } + case "score": + if v != nil { + var scoreDetails ScoreDetails + err = json.Unmarshal(*v, &scoreDetails) + if err != nil { + return err + } + ssip.ScoreDetails = &scoreDetails + } + case "weight": + if v != nil { + var weight int64 + err = json.Unmarshal(*v, &weight) + if err != nil { + return err + } + ssip.Weight = &weight + } + } + } + + return nil +} + +// SecureScoresList list of secure scores +type SecureScoresList struct { autorest.Response `json:"-"` - // Value - READ-ONLY; Collection of security controls in this page - Value *[]SecureScoreControlDetails `json:"value,omitempty"` + // Value - READ-ONLY; Collection of secure scores in this page + Value *[]SecureScoreItem `json:"value,omitempty"` // NextLink - READ-ONLY; The URI to fetch the next page. NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for SecureScoreControlList. -func (sscl SecureScoreControlList) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for SecureScoresList. +func (ssl SecureScoresList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) return json.Marshal(objectMap) } -// SecureScoreControlListIterator provides access to a complete listing of SecureScoreControlDetails -// values. -type SecureScoreControlListIterator struct { +// SecureScoresListIterator provides access to a complete listing of SecureScoreItem values. +type SecureScoresListIterator struct { i int - page SecureScoreControlListPage + page SecureScoresListPage } // 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 *SecureScoreControlListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *SecureScoresListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -12689,67 +16130,67 @@ func (iter *SecureScoreControlListIterator) NextWithContext(ctx context.Context) // 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 *SecureScoreControlListIterator) Next() error { +func (iter *SecureScoresListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SecureScoreControlListIterator) NotDone() bool { +func (iter SecureScoresListIterator) 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 SecureScoreControlListIterator) Response() SecureScoreControlList { +func (iter SecureScoresListIterator) Response() SecureScoresList { 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 SecureScoreControlListIterator) Value() SecureScoreControlDetails { +func (iter SecureScoresListIterator) Value() SecureScoreItem { if !iter.page.NotDone() { - return SecureScoreControlDetails{} + return SecureScoreItem{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the SecureScoreControlListIterator type. -func NewSecureScoreControlListIterator(page SecureScoreControlListPage) SecureScoreControlListIterator { - return SecureScoreControlListIterator{page: page} +// Creates a new instance of the SecureScoresListIterator type. +func NewSecureScoresListIterator(page SecureScoresListPage) SecureScoresListIterator { + return SecureScoresListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (sscl SecureScoreControlList) IsEmpty() bool { - return sscl.Value == nil || len(*sscl.Value) == 0 +func (ssl SecureScoresList) IsEmpty() bool { + return ssl.Value == nil || len(*ssl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (sscl SecureScoreControlList) hasNextLink() bool { - return sscl.NextLink != nil && len(*sscl.NextLink) != 0 +func (ssl SecureScoresList) hasNextLink() bool { + return ssl.NextLink != nil && len(*ssl.NextLink) != 0 } -// secureScoreControlListPreparer prepares a request to retrieve the next set of results. +// secureScoresListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (sscl SecureScoreControlList) secureScoreControlListPreparer(ctx context.Context) (*http.Request, error) { - if !sscl.hasNextLink() { +func (ssl SecureScoresList) secureScoresListPreparer(ctx context.Context) (*http.Request, error) { + if !ssl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(sscl.NextLink))) + autorest.WithBaseURL(to.String(ssl.NextLink))) } -// SecureScoreControlListPage contains a page of SecureScoreControlDetails values. -type SecureScoreControlListPage struct { - fn func(context.Context, SecureScoreControlList) (SecureScoreControlList, error) - sscl SecureScoreControlList +// SecureScoresListPage contains a page of SecureScoreItem values. +type SecureScoresListPage struct { + fn func(context.Context, SecureScoresList) (SecureScoresList, error) + ssl SecureScoresList } // 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 *SecureScoreControlListPage) NextWithContext(ctx context.Context) (err error) { +func (page *SecureScoresListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -12759,11 +16200,11 @@ func (page *SecureScoreControlListPage) NextWithContext(ctx context.Context) (er }() } for { - next, err := page.fn(ctx, page.sscl) + next, err := page.fn(ctx, page.ssl) if err != nil { return err } - page.sscl = next + page.ssl = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -12774,164 +16215,124 @@ func (page *SecureScoreControlListPage) NextWithContext(ctx context.Context) (er // 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 *SecureScoreControlListPage) Next() error { +func (page *SecureScoresListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SecureScoreControlListPage) NotDone() bool { - return !page.sscl.IsEmpty() +func (page SecureScoresListPage) NotDone() bool { + return !page.ssl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page SecureScoreControlListPage) Response() SecureScoreControlList { - return page.sscl +func (page SecureScoresListPage) Response() SecureScoresList { + return page.ssl } // Values returns the slice of values for the current page or nil if there are no values. -func (page SecureScoreControlListPage) Values() []SecureScoreControlDetails { - if page.sscl.IsEmpty() { +func (page SecureScoresListPage) Values() []SecureScoreItem { + if page.ssl.IsEmpty() { return nil } - return *page.sscl.Value + return *page.ssl.Value } -// Creates a new instance of the SecureScoreControlListPage type. -func NewSecureScoreControlListPage(cur SecureScoreControlList, getNextPage func(context.Context, SecureScoreControlList) (SecureScoreControlList, error)) SecureScoreControlListPage { - return SecureScoreControlListPage{ - fn: getNextPage, - sscl: cur, +// Creates a new instance of the SecureScoresListPage type. +func NewSecureScoresListPage(cur SecureScoresList, getNextPage func(context.Context, SecureScoresList) (SecureScoresList, error)) SecureScoresListPage { + return SecureScoresListPage{ + fn: getNextPage, + ssl: cur, } } -// SecureScoreControlScore calculation result data -type SecureScoreControlScore struct { - // Max - READ-ONLY; Maximum control score (0..10) - Max *int32 `json:"max,omitempty"` - // Current - READ-ONLY; Actual score for the control = (achieved points / total points) * max score. if total points is zeroed, the return number is 0.00 - Current *float64 `json:"current,omitempty"` - // Percentage - READ-ONLY; Ratio of the current score divided by the maximum. Rounded to 4 digits after the decimal point - Percentage *float64 `json:"percentage,omitempty"` +// SensitivityLabel the sensitivity label. +type SensitivityLabel struct { + // DisplayName - The name of the sensitivity label. + DisplayName *string `json:"displayName,omitempty"` + // Description - The description of the sensitivity label. + Description *string `json:"description,omitempty"` + // Rank - The rank of the sensitivity label. Possible values include: 'RankNone', 'RankLow', 'RankMedium', 'RankHigh', 'RankCritical' + Rank Rank `json:"rank,omitempty"` + // Order - The order of the sensitivity label. + Order *int32 `json:"order,omitempty"` + // Enabled - Indicates whether the label is enabled or not. + Enabled *bool `json:"enabled,omitempty"` } -// MarshalJSON is the custom marshaler for SecureScoreControlScore. -func (sscs SecureScoreControlScore) MarshalJSON() ([]byte, error) { +// ServerVulnerabilityProperties additional context fields for server vulnerability assessment +type ServerVulnerabilityProperties struct { + // Type - READ-ONLY; Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered + Type *string `json:"type,omitempty"` + // Cvss - READ-ONLY; Dictionary from cvss version to cvss details object + Cvss map[string]*CVSS `json:"cvss"` + // Patchable - READ-ONLY; Indicates whether a patch is available or not + Patchable *bool `json:"patchable,omitempty"` + // Cve - READ-ONLY; List of CVEs + Cve *[]CVE `json:"cve,omitempty"` + // Threat - READ-ONLY; Threat name + Threat *string `json:"threat,omitempty"` + // PublishedTime - READ-ONLY; Published time + PublishedTime *date.Time `json:"publishedTime,omitempty"` + // VendorReferences - READ-ONLY + VendorReferences *[]VendorReference `json:"vendorReferences,omitempty"` + // AssessedResourceType - Possible values include: 'AssessedResourceTypeAdditionalData', 'AssessedResourceTypeSQLServerVulnerability', 'AssessedResourceTypeContainerRegistryVulnerability', 'AssessedResourceTypeServerVulnerabilityAssessment' + AssessedResourceType AssessedResourceType `json:"assessedResourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) MarshalJSON() ([]byte, error) { + svp.AssessedResourceType = AssessedResourceTypeServerVulnerabilityAssessment objectMap := make(map[string]interface{}) + if svp.AssessedResourceType != "" { + objectMap["assessedResourceType"] = svp.AssessedResourceType + } return json.Marshal(objectMap) } -// SecureScoreControlScoreDetails calculation result data in control level -type SecureScoreControlScoreDetails struct { - // DisplayName - READ-ONLY; User friendly display name of the control - DisplayName *string `json:"displayName,omitempty"` - // ScoreDetails - Actual score object for the control - *ScoreDetails `json:"score,omitempty"` - // HealthyResourceCount - READ-ONLY; Number of healthy resources in the control - HealthyResourceCount *int32 `json:"healthyResourceCount,omitempty"` - // UnhealthyResourceCount - READ-ONLY; Number of unhealthy resources in the control - UnhealthyResourceCount *int32 `json:"unhealthyResourceCount,omitempty"` - // NotApplicableResourceCount - READ-ONLY; Number of not applicable resources in the control - NotApplicableResourceCount *int32 `json:"notApplicableResourceCount,omitempty"` - // Weight - READ-ONLY; The relative weight for this specific control in each of your subscriptions. Used when calculating an aggregated score for this control across all of your subscriptions. - Weight *int64 `json:"weight,omitempty"` - Definition *SecureScoreControlDefinitionItem `json:"definition,omitempty"` +// AsSQLServerVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) { + return nil, false +} + +// AsContainerRegistryVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for SecureScoreControlScoreDetails. -func (sscsd SecureScoreControlScoreDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sscsd.ScoreDetails != nil { - objectMap["score"] = sscsd.ScoreDetails - } - if sscsd.Definition != nil { - objectMap["definition"] = sscsd.Definition - } - return json.Marshal(objectMap) +// AsServerVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) { + return &svp, true } -// UnmarshalJSON is the custom unmarshaler for SecureScoreControlScoreDetails struct. -func (sscsd *SecureScoreControlScoreDetails) 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 "displayName": - if v != nil { - var displayName string - err = json.Unmarshal(*v, &displayName) - if err != nil { - return err - } - sscsd.DisplayName = &displayName - } - case "score": - if v != nil { - var scoreDetails ScoreDetails - err = json.Unmarshal(*v, &scoreDetails) - if err != nil { - return err - } - sscsd.ScoreDetails = &scoreDetails - } - case "healthyResourceCount": - if v != nil { - var healthyResourceCount int32 - err = json.Unmarshal(*v, &healthyResourceCount) - if err != nil { - return err - } - sscsd.HealthyResourceCount = &healthyResourceCount - } - case "unhealthyResourceCount": - if v != nil { - var unhealthyResourceCount int32 - err = json.Unmarshal(*v, &unhealthyResourceCount) - if err != nil { - return err - } - sscsd.UnhealthyResourceCount = &unhealthyResourceCount - } - case "notApplicableResourceCount": - if v != nil { - var notApplicableResourceCount int32 - err = json.Unmarshal(*v, ¬ApplicableResourceCount) - if err != nil { - return err - } - sscsd.NotApplicableResourceCount = ¬ApplicableResourceCount - } - case "weight": - if v != nil { - var weight int64 - err = json.Unmarshal(*v, &weight) - if err != nil { - return err - } - sscsd.Weight = &weight - } - case "definition": - if v != nil { - var definition SecureScoreControlDefinitionItem - err = json.Unmarshal(*v, &definition) - if err != nil { - return err - } - sscsd.Definition = &definition - } - } - } +// AsAdditionalData is the BasicAdditionalData implementation for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) AsAdditionalData() (*AdditionalData, bool) { + return nil, false +} - return nil +// AsBasicAdditionalData is the BasicAdditionalData implementation for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) AsBasicAdditionalData() (BasicAdditionalData, bool) { + return &svp, true } -// SecureScoreItem secure score item data model -type SecureScoreItem struct { +// ServicePrincipalProperties details of the service principal. +type ServicePrincipalProperties struct { + // ApplicationID - Application ID of service principal. + ApplicationID *string `json:"applicationId,omitempty"` + // Secret - A secret string that the application uses to prove its identity, also can be referred to as application password (write only). + Secret *string `json:"secret,omitempty"` +} + +// BasicSetting the kind of the security setting +type BasicSetting interface { + AsDataExportSetting() (*DataExportSetting, bool) + AsSetting() (*Setting, bool) +} + +// Setting the kind of the security setting +type Setting struct { autorest.Response `json:"-"` - // SecureScoreItemProperties - READ-ONLY; Secure score item - *SecureScoreItemProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindSetting', 'KindDataExportSetting' + Kind KindEnum `json:"kind,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name @@ -12940,81 +16341,105 @@ type SecureScoreItem struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for SecureScoreItem. -func (ssi SecureScoreItem) MarshalJSON() ([]byte, error) { +func unmarshalBasicSetting(body []byte) (BasicSetting, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindDataExportSetting): + var desVar DataExportSetting + err := json.Unmarshal(body, &desVar) + return desVar, err + default: + var s Setting + err := json.Unmarshal(body, &s) + return s, err + } +} +func unmarshalBasicSettingArray(body []byte) ([]BasicSetting, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sArray := make([]BasicSetting, len(rawMessages)) + + for index, rawMessage := range rawMessages { + s, err := unmarshalBasicSetting(*rawMessage) + if err != nil { + return nil, err + } + sArray[index] = s + } + return sArray, nil +} + +// MarshalJSON is the custom marshaler for Setting. +func (s Setting) MarshalJSON() ([]byte, error) { + s.Kind = KindSetting objectMap := make(map[string]interface{}) + if s.Kind != "" { + objectMap["kind"] = s.Kind + } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for SecureScoreItem struct. -func (ssi *SecureScoreItem) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) +// AsDataExportSetting is the BasicSetting implementation for Setting. +func (s Setting) AsDataExportSetting() (*DataExportSetting, bool) { + return nil, false +} + +// AsSetting is the BasicSetting implementation for Setting. +func (s Setting) AsSetting() (*Setting, bool) { + return &s, true +} + +// AsBasicSetting is the BasicSetting implementation for Setting. +func (s Setting) AsBasicSetting() (BasicSetting, bool) { + return &s, true +} + +// SettingModel ... +type SettingModel struct { + autorest.Response `json:"-"` + Value BasicSetting `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SettingModel struct. +func (sm *SettingModel) UnmarshalJSON(body []byte) error { + s, err := unmarshalBasicSetting(body) if err != nil { return err } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var secureScoreItemProperties SecureScoreItemProperties - err = json.Unmarshal(*v, &secureScoreItemProperties) - if err != nil { - return err - } - ssi.SecureScoreItemProperties = &secureScoreItemProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ssi.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ssi.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ssi.Type = &typeVar - } - } - } + sm.Value = s return nil } -// SecureScoreItemProperties describes properties of a calculated secure score. -type SecureScoreItemProperties struct { - // DisplayName - READ-ONLY; The initiative’s name - DisplayName *string `json:"displayName,omitempty"` - // ScoreDetails - READ-ONLY; score object - *ScoreDetails `json:"score,omitempty"` - // Weight - READ-ONLY; The relative weight for each subscription. Used when calculating an aggregated secure score for multiple subscriptions. - Weight *int64 `json:"weight,omitempty"` +// SettingsList subscription settings list. +type SettingsList struct { + autorest.Response `json:"-"` + // Value - The settings list. + Value *[]BasicSetting `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for SecureScoreItemProperties. -func (ssip SecureScoreItemProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for SettingsList. +func (sl SettingsList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if sl.Value != nil { + objectMap["value"] = sl.Value + } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for SecureScoreItemProperties struct. -func (ssip *SecureScoreItemProperties) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for SettingsList struct. +func (sl *SettingsList) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -13022,65 +16447,40 @@ func (ssip *SecureScoreItemProperties) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "displayName": - if v != nil { - var displayName string - err = json.Unmarshal(*v, &displayName) - if err != nil { - return err - } - ssip.DisplayName = &displayName - } - case "score": + case "value": if v != nil { - var scoreDetails ScoreDetails - err = json.Unmarshal(*v, &scoreDetails) + value, err := unmarshalBasicSettingArray(*v) if err != nil { return err } - ssip.ScoreDetails = &scoreDetails + sl.Value = &value } - case "weight": + case "nextLink": if v != nil { - var weight int64 - err = json.Unmarshal(*v, &weight) + var nextLink string + err = json.Unmarshal(*v, &nextLink) if err != nil { return err } - ssip.Weight = &weight - } - } - } - - return nil -} - -// SecureScoresList list of secure scores -type SecureScoresList struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Collection of secure scores in this page - Value *[]SecureScoreItem `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` -} + sl.NextLink = &nextLink + } + } + } -// MarshalJSON is the custom marshaler for SecureScoresList. -func (ssl SecureScoresList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) + return nil } -// SecureScoresListIterator provides access to a complete listing of SecureScoreItem values. -type SecureScoresListIterator struct { +// SettingsListIterator provides access to a complete listing of Setting values. +type SettingsListIterator struct { i int - page SecureScoresListPage + page SettingsListPage } // 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 *SecureScoresListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *SettingsListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/SettingsListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -13105,67 +16505,67 @@ func (iter *SecureScoresListIterator) NextWithContext(ctx context.Context) (err // 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 *SecureScoresListIterator) Next() error { +func (iter *SettingsListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SecureScoresListIterator) NotDone() bool { +func (iter SettingsListIterator) 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 SecureScoresListIterator) Response() SecureScoresList { +func (iter SettingsListIterator) Response() SettingsList { 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 SecureScoresListIterator) Value() SecureScoreItem { +func (iter SettingsListIterator) Value() BasicSetting { if !iter.page.NotDone() { - return SecureScoreItem{} + return Setting{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the SecureScoresListIterator type. -func NewSecureScoresListIterator(page SecureScoresListPage) SecureScoresListIterator { - return SecureScoresListIterator{page: page} +// Creates a new instance of the SettingsListIterator type. +func NewSettingsListIterator(page SettingsListPage) SettingsListIterator { + return SettingsListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (ssl SecureScoresList) IsEmpty() bool { - return ssl.Value == nil || len(*ssl.Value) == 0 +func (sl SettingsList) IsEmpty() bool { + return sl.Value == nil || len(*sl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (ssl SecureScoresList) hasNextLink() bool { - return ssl.NextLink != nil && len(*ssl.NextLink) != 0 +func (sl SettingsList) hasNextLink() bool { + return sl.NextLink != nil && len(*sl.NextLink) != 0 } -// secureScoresListPreparer prepares a request to retrieve the next set of results. +// settingsListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (ssl SecureScoresList) secureScoresListPreparer(ctx context.Context) (*http.Request, error) { - if !ssl.hasNextLink() { +func (sl SettingsList) settingsListPreparer(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(ssl.NextLink))) + autorest.WithBaseURL(to.String(sl.NextLink))) } -// SecureScoresListPage contains a page of SecureScoreItem values. -type SecureScoresListPage struct { - fn func(context.Context, SecureScoresList) (SecureScoresList, error) - ssl SecureScoresList +// SettingsListPage contains a page of BasicSetting values. +type SettingsListPage struct { + fn func(context.Context, SettingsList) (SettingsList, error) + sl SettingsList } // 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 *SecureScoresListPage) NextWithContext(ctx context.Context) (err error) { +func (page *SettingsListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/SettingsListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -13175,11 +16575,11 @@ func (page *SecureScoresListPage) NextWithContext(ctx context.Context) (err erro }() } for { - next, err := page.fn(ctx, page.ssl) + next, err := page.fn(ctx, page.sl) if err != nil { return err } - page.ssl = next + page.sl = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -13190,118 +16590,41 @@ func (page *SecureScoresListPage) NextWithContext(ctx context.Context) (err erro // 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 *SecureScoresListPage) Next() error { +func (page *SettingsListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SecureScoresListPage) NotDone() bool { - return !page.ssl.IsEmpty() +func (page SettingsListPage) NotDone() bool { + return !page.sl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page SecureScoresListPage) Response() SecureScoresList { - return page.ssl +func (page SettingsListPage) Response() SettingsList { + return page.sl } // Values returns the slice of values for the current page or nil if there are no values. -func (page SecureScoresListPage) Values() []SecureScoreItem { - if page.ssl.IsEmpty() { +func (page SettingsListPage) Values() []BasicSetting { + if page.sl.IsEmpty() { return nil } - return *page.ssl.Value -} - -// Creates a new instance of the SecureScoresListPage type. -func NewSecureScoresListPage(cur SecureScoresList, getNextPage func(context.Context, SecureScoresList) (SecureScoresList, error)) SecureScoresListPage { - return SecureScoresListPage{ - fn: getNextPage, - ssl: cur, - } -} - -// SensitivityLabel the sensitivity label. -type SensitivityLabel struct { - // DisplayName - The name of the sensitivity label. - DisplayName *string `json:"displayName,omitempty"` - // Description - The description of the sensitivity label. - Description *string `json:"description,omitempty"` - // Rank - The rank of the sensitivity label. Possible values include: 'RankNone', 'RankLow', 'RankMedium', 'RankHigh', 'RankCritical' - Rank Rank `json:"rank,omitempty"` - // Order - The order of the sensitivity label. - Order *int32 `json:"order,omitempty"` - // Enabled - Indicates whether the label is enabled or not. - Enabled *bool `json:"enabled,omitempty"` -} - -// ServerVulnerabilityProperties additional context fields for server vulnerability assessment -type ServerVulnerabilityProperties struct { - // Type - READ-ONLY; Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered - Type *string `json:"type,omitempty"` - // Cvss - READ-ONLY; Dictionary from cvss version to cvss details object - Cvss map[string]*CVSS `json:"cvss"` - // Patchable - READ-ONLY; Indicates whether a patch is available or not - Patchable *bool `json:"patchable,omitempty"` - // Cve - READ-ONLY; List of CVEs - Cve *[]CVE `json:"cve,omitempty"` - // Threat - READ-ONLY; Threat name - Threat *string `json:"threat,omitempty"` - // PublishedTime - READ-ONLY; Published time - PublishedTime *date.Time `json:"publishedTime,omitempty"` - // VendorReferences - READ-ONLY - VendorReferences *[]VendorReference `json:"vendorReferences,omitempty"` - // AssessedResourceType - Possible values include: 'AssessedResourceTypeAdditionalData', 'AssessedResourceTypeSQLServerVulnerability', 'AssessedResourceTypeContainerRegistryVulnerability', 'AssessedResourceTypeServerVulnerabilityAssessment' - AssessedResourceType AssessedResourceType `json:"assessedResourceType,omitempty"` + return *page.sl.Value } -// MarshalJSON is the custom marshaler for ServerVulnerabilityProperties. -func (svp ServerVulnerabilityProperties) MarshalJSON() ([]byte, error) { - svp.AssessedResourceType = AssessedResourceTypeServerVulnerabilityAssessment - objectMap := make(map[string]interface{}) - if svp.AssessedResourceType != "" { - objectMap["assessedResourceType"] = svp.AssessedResourceType +// Creates a new instance of the SettingsListPage type. +func NewSettingsListPage(cur SettingsList, getNextPage func(context.Context, SettingsList) (SettingsList, error)) SettingsListPage { + return SettingsListPage{ + fn: getNextPage, + sl: cur, } - return json.Marshal(objectMap) -} - -// AsSQLServerVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. -func (svp ServerVulnerabilityProperties) AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) { - return nil, false -} - -// AsContainerRegistryVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. -func (svp ServerVulnerabilityProperties) AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) { - return nil, false -} - -// AsServerVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. -func (svp ServerVulnerabilityProperties) AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) { - return &svp, true -} - -// AsAdditionalData is the BasicAdditionalData implementation for ServerVulnerabilityProperties. -func (svp ServerVulnerabilityProperties) AsAdditionalData() (*AdditionalData, bool) { - return nil, false -} - -// AsBasicAdditionalData is the BasicAdditionalData implementation for ServerVulnerabilityProperties. -func (svp ServerVulnerabilityProperties) AsBasicAdditionalData() (BasicAdditionalData, bool) { - return &svp, true -} - -// ServicePrincipalProperties details of the service principal. -type ServicePrincipalProperties struct { - // ApplicationID - Application ID of service principal. - ApplicationID *string `json:"applicationId,omitempty"` - // Secret - A secret string that the application uses to prove its identity, also can be referred to as application password (write only). - Secret *string `json:"secret,omitempty"` } -// Setting represents a security setting in Azure Security Center. -type Setting struct { +// Software represents a software data +type Software struct { autorest.Response `json:"-"` - // Kind - the kind of the settings string (DataExportSetting). Possible values include: 'SettingKindDataExportSetting', 'SettingKindAlertSuppressionSetting' - Kind SettingKind `json:"kind,omitempty"` + // 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 @@ -13310,47 +16633,98 @@ type Setting struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for Setting. -func (s Setting) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for Software. +func (s Software) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if s.Kind != "" { - objectMap["kind"] = s.Kind + if s.SoftwareProperties != nil { + objectMap["properties"] = s.SoftwareProperties } return json.Marshal(objectMap) } -// SettingResource the kind of the security setting -type SettingResource struct { - // Kind - the kind of the settings string (DataExportSetting). Possible values include: 'SettingKindDataExportSetting', 'SettingKindAlertSuppressionSetting' - Kind SettingKind `json:"kind,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 SettingResource. -func (sr SettingResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sr.Kind != "" { - objectMap["kind"] = sr.Kind +// 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 } - return json.Marshal(objectMap) + 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 } -// SettingsList subscription settings list. -type SettingsList struct { +// 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 - The settings list. - Value *[]Setting `json:"value,omitempty"` + 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 SettingsList. -func (sl SettingsList) MarshalJSON() ([]byte, error) { +// 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 @@ -13358,17 +16732,17 @@ func (sl SettingsList) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// SettingsListIterator provides access to a complete listing of Setting values. -type SettingsListIterator struct { +// SoftwaresListIterator provides access to a complete listing of Software values. +type SoftwaresListIterator struct { i int - page SettingsListPage + 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 *SettingsListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *SoftwaresListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SettingsListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/SoftwaresListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -13393,47 +16767,47 @@ func (iter *SettingsListIterator) 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 *SettingsListIterator) Next() error { +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 SettingsListIterator) NotDone() bool { +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 SettingsListIterator) Response() SettingsList { +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 SettingsListIterator) Value() Setting { +func (iter SoftwaresListIterator) Value() Software { if !iter.page.NotDone() { - return Setting{} + return Software{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the SettingsListIterator type. -func NewSettingsListIterator(page SettingsListPage) SettingsListIterator { - return SettingsListIterator{page: page} +// 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 SettingsList) IsEmpty() bool { +func (sl SoftwaresList) IsEmpty() bool { return sl.Value == nil || len(*sl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (sl SettingsList) hasNextLink() bool { +func (sl SoftwaresList) hasNextLink() bool { return sl.NextLink != nil && len(*sl.NextLink) != 0 } -// settingsListPreparer prepares a request to retrieve the next set of results. +// softwaresListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (sl SettingsList) settingsListPreparer(ctx context.Context) (*http.Request, error) { +func (sl SoftwaresList) softwaresListPreparer(ctx context.Context) (*http.Request, error) { if !sl.hasNextLink() { return nil, nil } @@ -13443,17 +16817,17 @@ func (sl SettingsList) settingsListPreparer(ctx context.Context) (*http.Request, autorest.WithBaseURL(to.String(sl.NextLink))) } -// SettingsListPage contains a page of Setting values. -type SettingsListPage struct { - fn func(context.Context, SettingsList) (SettingsList, error) - sl SettingsList +// 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 *SettingsListPage) NextWithContext(ctx context.Context) (err error) { +func (page *SoftwaresListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SettingsListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/SoftwaresListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -13478,31 +16852,31 @@ func (page *SettingsListPage) NextWithContext(ctx context.Context) (err error) { // 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 *SettingsListPage) Next() error { +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 SettingsListPage) NotDone() bool { +func (page SoftwaresListPage) NotDone() bool { return !page.sl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page SettingsListPage) Response() SettingsList { +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 SettingsListPage) Values() []Setting { +func (page SoftwaresListPage) Values() []Software { if page.sl.IsEmpty() { return nil } return *page.sl.Value } -// Creates a new instance of the SettingsListPage type. -func NewSettingsListPage(cur SettingsList, getNextPage func(context.Context, SettingsList) (SettingsList, error)) SettingsListPage { - return SettingsListPage{ +// 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, } @@ -13949,6 +17323,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. diff --git a/services/preview/security/mgmt/v1.0/security/operations.go b/services/preview/security/mgmt/v1.0/security/operations.go index af10a5f55613..ddb59b6b17ec 100644 --- a/services/preview/security/mgmt/v1.0/security/operations.go +++ b/services/preview/security/mgmt/v1.0/security/operations.go @@ -20,14 +20,14 @@ type OperationsClient struct { } // NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID string, ascLocation string) OperationsClient { - return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewOperationsClientWithBaseURI creates an instance of the OperationsClient 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 NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) OperationsClient { - return OperationsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} } // List exposes all available operations for discovery purposes. diff --git a/services/preview/security/mgmt/v1.0/security/pricings.go b/services/preview/security/mgmt/v1.0/security/pricings.go index 0f56127329c2..31f68e696d73 100644 --- a/services/preview/security/mgmt/v1.0/security/pricings.go +++ b/services/preview/security/mgmt/v1.0/security/pricings.go @@ -21,14 +21,14 @@ type PricingsClient struct { } // NewPricingsClient creates an instance of the PricingsClient client. -func NewPricingsClient(subscriptionID string, ascLocation string) PricingsClient { - return NewPricingsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewPricingsClient(subscriptionID string) PricingsClient { + return NewPricingsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewPricingsClientWithBaseURI creates an instance of the PricingsClient 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 NewPricingsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) PricingsClient { - return PricingsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewPricingsClientWithBaseURI(baseURI string, subscriptionID string) PricingsClient { + return PricingsClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdateResourceGroupPricing security pricing configuration in the resource group diff --git a/services/preview/security/mgmt/v1.0/security/regulatorycomplianceassessments.go b/services/preview/security/mgmt/v1.0/security/regulatorycomplianceassessments.go index 7706ccb00bed..b9186c6a5562 100644 --- a/services/preview/security/mgmt/v1.0/security/regulatorycomplianceassessments.go +++ b/services/preview/security/mgmt/v1.0/security/regulatorycomplianceassessments.go @@ -22,15 +22,15 @@ type RegulatoryComplianceAssessmentsClient struct { } // NewRegulatoryComplianceAssessmentsClient creates an instance of the RegulatoryComplianceAssessmentsClient client. -func NewRegulatoryComplianceAssessmentsClient(subscriptionID string, ascLocation string) RegulatoryComplianceAssessmentsClient { - return NewRegulatoryComplianceAssessmentsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewRegulatoryComplianceAssessmentsClient(subscriptionID string) RegulatoryComplianceAssessmentsClient { + return NewRegulatoryComplianceAssessmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewRegulatoryComplianceAssessmentsClientWithBaseURI creates an instance of the RegulatoryComplianceAssessmentsClient // 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 NewRegulatoryComplianceAssessmentsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) RegulatoryComplianceAssessmentsClient { - return RegulatoryComplianceAssessmentsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewRegulatoryComplianceAssessmentsClientWithBaseURI(baseURI string, subscriptionID string) RegulatoryComplianceAssessmentsClient { + return RegulatoryComplianceAssessmentsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get supported regulatory compliance details and state for selected assessment diff --git a/services/preview/security/mgmt/v1.0/security/regulatorycompliancecontrols.go b/services/preview/security/mgmt/v1.0/security/regulatorycompliancecontrols.go index 54847e13b4ed..ae94c4b1cccf 100644 --- a/services/preview/security/mgmt/v1.0/security/regulatorycompliancecontrols.go +++ b/services/preview/security/mgmt/v1.0/security/regulatorycompliancecontrols.go @@ -21,15 +21,15 @@ type RegulatoryComplianceControlsClient struct { } // NewRegulatoryComplianceControlsClient creates an instance of the RegulatoryComplianceControlsClient client. -func NewRegulatoryComplianceControlsClient(subscriptionID string, ascLocation string) RegulatoryComplianceControlsClient { - return NewRegulatoryComplianceControlsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewRegulatoryComplianceControlsClient(subscriptionID string) RegulatoryComplianceControlsClient { + return NewRegulatoryComplianceControlsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewRegulatoryComplianceControlsClientWithBaseURI creates an instance of the RegulatoryComplianceControlsClient // 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 NewRegulatoryComplianceControlsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) RegulatoryComplianceControlsClient { - return RegulatoryComplianceControlsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewRegulatoryComplianceControlsClientWithBaseURI(baseURI string, subscriptionID string) RegulatoryComplianceControlsClient { + return RegulatoryComplianceControlsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get selected regulatory compliance control details and state diff --git a/services/preview/security/mgmt/v1.0/security/regulatorycompliancestandards.go b/services/preview/security/mgmt/v1.0/security/regulatorycompliancestandards.go index 32e0167c7ffa..02b59e4ea221 100644 --- a/services/preview/security/mgmt/v1.0/security/regulatorycompliancestandards.go +++ b/services/preview/security/mgmt/v1.0/security/regulatorycompliancestandards.go @@ -21,15 +21,15 @@ type RegulatoryComplianceStandardsClient struct { } // NewRegulatoryComplianceStandardsClient creates an instance of the RegulatoryComplianceStandardsClient client. -func NewRegulatoryComplianceStandardsClient(subscriptionID string, ascLocation string) RegulatoryComplianceStandardsClient { - return NewRegulatoryComplianceStandardsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewRegulatoryComplianceStandardsClient(subscriptionID string) RegulatoryComplianceStandardsClient { + return NewRegulatoryComplianceStandardsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewRegulatoryComplianceStandardsClientWithBaseURI creates an instance of the RegulatoryComplianceStandardsClient // 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 NewRegulatoryComplianceStandardsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) RegulatoryComplianceStandardsClient { - return RegulatoryComplianceStandardsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewRegulatoryComplianceStandardsClientWithBaseURI(baseURI string, subscriptionID string) RegulatoryComplianceStandardsClient { + return RegulatoryComplianceStandardsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get supported regulatory compliance details state for selected standard diff --git a/services/preview/security/mgmt/v1.0/security/securescorecontroldefinitions.go b/services/preview/security/mgmt/v1.0/security/securescorecontroldefinitions.go index 4da0f88bad68..b3cc63bac4d3 100644 --- a/services/preview/security/mgmt/v1.0/security/securescorecontroldefinitions.go +++ b/services/preview/security/mgmt/v1.0/security/securescorecontroldefinitions.go @@ -21,15 +21,15 @@ type SecureScoreControlDefinitionsClient struct { } // NewSecureScoreControlDefinitionsClient creates an instance of the SecureScoreControlDefinitionsClient client. -func NewSecureScoreControlDefinitionsClient(subscriptionID string, ascLocation string) SecureScoreControlDefinitionsClient { - return NewSecureScoreControlDefinitionsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSecureScoreControlDefinitionsClient(subscriptionID string) SecureScoreControlDefinitionsClient { + return NewSecureScoreControlDefinitionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSecureScoreControlDefinitionsClientWithBaseURI creates an instance of the SecureScoreControlDefinitionsClient // 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 NewSecureScoreControlDefinitionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SecureScoreControlDefinitionsClient { - return SecureScoreControlDefinitionsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSecureScoreControlDefinitionsClientWithBaseURI(baseURI string, subscriptionID string) SecureScoreControlDefinitionsClient { + return SecureScoreControlDefinitionsClient{NewWithBaseURI(baseURI, subscriptionID)} } // List list the available security controls, their assessments, and the max score diff --git a/services/preview/security/mgmt/v1.0/security/securescorecontrols.go b/services/preview/security/mgmt/v1.0/security/securescorecontrols.go index e24665b89ceb..717f3f32557e 100644 --- a/services/preview/security/mgmt/v1.0/security/securescorecontrols.go +++ b/services/preview/security/mgmt/v1.0/security/securescorecontrols.go @@ -21,15 +21,15 @@ type SecureScoreControlsClient struct { } // NewSecureScoreControlsClient creates an instance of the SecureScoreControlsClient client. -func NewSecureScoreControlsClient(subscriptionID string, ascLocation string) SecureScoreControlsClient { - return NewSecureScoreControlsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSecureScoreControlsClient(subscriptionID string) SecureScoreControlsClient { + return NewSecureScoreControlsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSecureScoreControlsClientWithBaseURI creates an instance of the SecureScoreControlsClient 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 NewSecureScoreControlsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SecureScoreControlsClient { - return SecureScoreControlsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSecureScoreControlsClientWithBaseURI(baseURI string, subscriptionID string) SecureScoreControlsClient { + return SecureScoreControlsClient{NewWithBaseURI(baseURI, subscriptionID)} } // List get all security controls within a scope diff --git a/services/preview/security/mgmt/v1.0/security/securescores.go b/services/preview/security/mgmt/v1.0/security/securescores.go index a9b7adc201df..bf8ac2b4e1c7 100644 --- a/services/preview/security/mgmt/v1.0/security/securescores.go +++ b/services/preview/security/mgmt/v1.0/security/securescores.go @@ -21,18 +21,18 @@ type SecureScoresClient struct { } // NewSecureScoresClient creates an instance of the SecureScoresClient client. -func NewSecureScoresClient(subscriptionID string, ascLocation string) SecureScoresClient { - return NewSecureScoresClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSecureScoresClient(subscriptionID string) SecureScoresClient { + return NewSecureScoresClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSecureScoresClientWithBaseURI creates an instance of the SecureScoresClient 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 NewSecureScoresClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SecureScoresClient { - return SecureScoresClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSecureScoresClientWithBaseURI(baseURI string, subscriptionID string) SecureScoresClient { + return SecureScoresClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get get secure score for a specific Security Center initiative within your current scope. For the ASC Default -// initiative, use 'ascScore'. +// Get get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC +// Default initiative, use 'ascScore'. // Parameters: // secureScoreName - the initiative name. For the ASC Default initiative, use 'ascScore' as in the sample // request below. @@ -113,7 +113,7 @@ func (client SecureScoresClient) GetResponder(resp *http.Response) (result Secur return } -// List list secure scores for all your Security Center initiatives within your current scope. +// List list secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. func (client SecureScoresClient) List(ctx context.Context) (result SecureScoresListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresClient.List") diff --git a/services/preview/security/mgmt/v1.0/security/securityapi/interfaces.go b/services/preview/security/mgmt/v1.0/security/securityapi/interfaces.go index 0088922aaf64..8fbf4d1b47c9 100644 --- a/services/preview/security/mgmt/v1.0/security/securityapi/interfaces.go +++ b/services/preview/security/mgmt/v1.0/security/securityapi/interfaces.go @@ -12,6 +12,65 @@ import ( "github.com/Azure/go-autorest/autorest" ) +// ConnectorsClientAPI contains the set of methods on the ConnectorsClient type. +type ConnectorsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector security.Connector) (result security.Connector, err error) + Delete(ctx context.Context, resourceGroupName string, securityConnectorName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, securityConnectorName string) (result security.Connector, err error) + List(ctx context.Context) (result security.ConnectorsListPage, err error) + ListComplete(ctx context.Context) (result security.ConnectorsListIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result security.ConnectorsListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result security.ConnectorsListIterator, err error) + Update(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector security.Connector) (result security.Connector, err error) +} + +var _ ConnectorsClientAPI = (*security.ConnectorsClient)(nil) + +// MdeOnboardingsClientAPI contains the set of methods on the MdeOnboardingsClient type. +type MdeOnboardingsClientAPI interface { + Get(ctx context.Context) (result security.MdeOnboardingData, err error) + List(ctx context.Context) (result security.MdeOnboardingDataList, err error) +} + +var _ MdeOnboardingsClientAPI = (*security.MdeOnboardingsClient)(nil) + +// CustomAssessmentAutomationsClientAPI contains the set of methods on the CustomAssessmentAutomationsClient type. +type CustomAssessmentAutomationsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string, customAssessmentAutomationBody security.CustomAssessmentAutomationRequest) (result security.CustomAssessmentAutomation, err error) + Delete(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string) (result security.CustomAssessmentAutomation, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result security.CustomAssessmentAutomationsListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result security.CustomAssessmentAutomationsListResultIterator, err error) + ListBySubscription(ctx context.Context) (result security.CustomAssessmentAutomationsListResultPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result security.CustomAssessmentAutomationsListResultIterator, err error) +} + +var _ CustomAssessmentAutomationsClientAPI = (*security.CustomAssessmentAutomationsClient)(nil) + +// CustomEntityStoreAssignmentsClientAPI contains the set of methods on the CustomEntityStoreAssignmentsClient type. +type CustomEntityStoreAssignmentsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string, customEntityStoreAssignmentRequestBody security.CustomEntityStoreAssignmentRequest) (result security.CustomEntityStoreAssignment, err error) + Delete(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string) (result security.CustomEntityStoreAssignment, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result security.CustomEntityStoreAssignmentsListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result security.CustomEntityStoreAssignmentsListResultIterator, err error) + ListBySubscription(ctx context.Context) (result security.CustomEntityStoreAssignmentsListResultPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result security.CustomEntityStoreAssignmentsListResultIterator, err error) +} + +var _ CustomEntityStoreAssignmentsClientAPI = (*security.CustomEntityStoreAssignmentsClient)(nil) + +// SoftwareInventoriesClientAPI contains the set of methods on the SoftwareInventoriesClient type. +type SoftwareInventoriesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, softwareName string) (result security.Software, err error) + ListByExtendedResource(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (result security.SoftwaresListPage, err error) + ListByExtendedResourceComplete(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (result security.SoftwaresListIterator, err error) + ListBySubscription(ctx context.Context) (result security.SoftwaresListPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result security.SoftwaresListIterator, err error) +} + +var _ SoftwareInventoriesClientAPI = (*security.SoftwareInventoriesClient)(nil) + // SQLVulnerabilityAssessmentScansClientAPI contains the set of methods on the SQLVulnerabilityAssessmentScansClient type. type SQLVulnerabilityAssessmentScansClientAPI interface { Get(ctx context.Context, scanID string, workspaceID string, APIVersion string, resourceID string) (result security.Scan, err error) @@ -68,8 +127,8 @@ type SecureScoreControlDefinitionsClientAPI interface { var _ SecureScoreControlDefinitionsClientAPI = (*security.SecureScoreControlDefinitionsClient)(nil) -// ConnectorsClientAPI contains the set of methods on the ConnectorsClient type. -type ConnectorsClientAPI interface { +// ConnectorsGroupClientAPI contains the set of methods on the ConnectorsGroupClient type. +type ConnectorsGroupClientAPI interface { CreateOrUpdate(ctx context.Context, connectorName string, connectorSetting security.ConnectorSetting) (result security.ConnectorSetting, err error) Delete(ctx context.Context, connectorName string) (result autorest.Response, err error) Get(ctx context.Context, connectorName string) (result security.ConnectorSetting, err error) @@ -77,7 +136,7 @@ type ConnectorsClientAPI interface { ListComplete(ctx context.Context) (result security.ConnectorSettingListIterator, err error) } -var _ ConnectorsClientAPI = (*security.ConnectorsClient)(nil) +var _ ConnectorsGroupClientAPI = (*security.ConnectorsGroupClient)(nil) // AutomationsClientAPI contains the set of methods on the AutomationsClient type. type AutomationsClientAPI interface { @@ -209,18 +268,18 @@ var _ DeviceSecurityGroupsClientAPI = (*security.DeviceSecurityGroupsClient)(nil // SettingsClientAPI contains the set of methods on the SettingsClient type. type SettingsClientAPI interface { - Get(ctx context.Context, settingName string) (result security.Setting, err error) + Get(ctx context.Context, settingName string) (result security.SettingModel, err error) List(ctx context.Context) (result security.SettingsListPage, err error) ListComplete(ctx context.Context) (result security.SettingsListIterator, err error) - Update(ctx context.Context, settingName string, setting security.Setting) (result security.Setting, err error) + Update(ctx context.Context, settingName string, setting security.BasicSetting) (result security.SettingModel, err error) } var _ SettingsClientAPI = (*security.SettingsClient)(nil) // InformationProtectionPoliciesClientAPI contains the set of methods on the InformationProtectionPoliciesClient type. type InformationProtectionPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, scope string, informationProtectionPolicyName string, informationProtectionPolicy security.InformationProtectionPolicy) (result security.InformationProtectionPolicy, err error) - Get(ctx context.Context, scope string, informationProtectionPolicyName string) (result security.InformationProtectionPolicy, err error) + CreateOrUpdate(ctx context.Context, scope string, informationProtectionPolicyName security.InformationProtectionPolicyName, informationProtectionPolicy security.InformationProtectionPolicy) (result security.InformationProtectionPolicy, err error) + Get(ctx context.Context, scope string, informationProtectionPolicyName security.InformationProtectionPolicyName) (result security.InformationProtectionPolicy, err error) List(ctx context.Context, scope string) (result security.InformationProtectionPolicyListPage, err error) ListComplete(ctx context.Context, scope string) (result security.InformationProtectionPolicyListIterator, err error) } @@ -237,7 +296,7 @@ var _ OperationsClientAPI = (*security.OperationsClient)(nil) // LocationsClientAPI contains the set of methods on the LocationsClient type. type LocationsClientAPI interface { - Get(ctx context.Context) (result security.AscLocation, err error) + Get(ctx context.Context, ascLocation string) (result security.AscLocation, err error) List(ctx context.Context) (result security.AscLocationListPage, err error) ListComplete(ctx context.Context) (result security.AscLocationListIterator, err error) } @@ -246,108 +305,108 @@ var _ LocationsClientAPI = (*security.LocationsClient)(nil) // TasksClientAPI contains the set of methods on the TasksClient type. type TasksClientAPI interface { - GetResourceGroupLevelTask(ctx context.Context, resourceGroupName string, taskName string) (result security.Task, err error) - GetSubscriptionLevelTask(ctx context.Context, taskName string) (result security.Task, err error) + GetResourceGroupLevelTask(ctx context.Context, resourceGroupName string, ascLocation string, taskName string) (result security.Task, err error) + GetSubscriptionLevelTask(ctx context.Context, ascLocation string, taskName string) (result security.Task, err error) List(ctx context.Context, filter string) (result security.TaskListPage, err error) ListComplete(ctx context.Context, filter string) (result security.TaskListIterator, err error) - ListByHomeRegion(ctx context.Context, filter string) (result security.TaskListPage, err error) - ListByHomeRegionComplete(ctx context.Context, filter string) (result security.TaskListIterator, err error) - ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string) (result security.TaskListPage, err error) - ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string) (result security.TaskListIterator, err error) - UpdateResourceGroupLevelTaskState(ctx context.Context, resourceGroupName string, taskName string, taskUpdateActionType string) (result autorest.Response, err error) - UpdateSubscriptionLevelTaskState(ctx context.Context, taskName string, taskUpdateActionType string) (result autorest.Response, err error) + ListByHomeRegion(ctx context.Context, ascLocation string, filter string) (result security.TaskListPage, err error) + ListByHomeRegionComplete(ctx context.Context, ascLocation string, filter string) (result security.TaskListIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string, ascLocation string, filter string) (result security.TaskListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, ascLocation string, filter string) (result security.TaskListIterator, err error) + UpdateResourceGroupLevelTaskState(ctx context.Context, resourceGroupName string, ascLocation string, taskName string, taskUpdateActionType security.TaskUpdateActionType) (result autorest.Response, err error) + UpdateSubscriptionLevelTaskState(ctx context.Context, ascLocation string, taskName string, taskUpdateActionType security.TaskUpdateActionType) (result autorest.Response, err error) } var _ TasksClientAPI = (*security.TasksClient)(nil) // AlertsClientAPI contains the set of methods on the AlertsClient type. type AlertsClientAPI interface { - GetResourceGroupLevelAlerts(ctx context.Context, alertName string, resourceGroupName string) (result security.Alert, err error) - GetSubscriptionLevelAlert(ctx context.Context, alertName string) (result security.Alert, err error) + GetResourceGroupLevelAlerts(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (result security.Alert, err error) + GetSubscriptionLevelAlert(ctx context.Context, ascLocation string, alertName string) (result security.Alert, err error) List(ctx context.Context, filter string, selectParameter string, expand string) (result security.AlertListPage, err error) ListComplete(ctx context.Context, filter string, selectParameter string, expand string) (result security.AlertListIterator, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (result security.AlertListPage, err error) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (result security.AlertListIterator, err error) - ListResourceGroupLevelAlertsByRegion(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (result security.AlertListPage, err error) - ListResourceGroupLevelAlertsByRegionComplete(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (result security.AlertListIterator, err error) - ListSubscriptionLevelAlertsByRegion(ctx context.Context, filter string, selectParameter string, expand string) (result security.AlertListPage, err error) - ListSubscriptionLevelAlertsByRegionComplete(ctx context.Context, filter string, selectParameter string, expand string) (result security.AlertListIterator, err error) - UpdateResourceGroupLevelAlertStateToDismiss(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) - UpdateResourceGroupLevelAlertStateToReactivate(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) - UpdateSubscriptionLevelAlertStateToDismiss(ctx context.Context, alertName string) (result autorest.Response, err error) - UpdateSubscriptionLevelAlertStateToReactivate(ctx context.Context, alertName string) (result autorest.Response, err error) + ListResourceGroupLevelAlertsByRegion(ctx context.Context, ascLocation string, resourceGroupName string, filter string, selectParameter string, expand string) (result security.AlertListPage, err error) + ListResourceGroupLevelAlertsByRegionComplete(ctx context.Context, ascLocation string, resourceGroupName string, filter string, selectParameter string, expand string) (result security.AlertListIterator, err error) + ListSubscriptionLevelAlertsByRegion(ctx context.Context, ascLocation string, filter string, selectParameter string, expand string) (result security.AlertListPage, err error) + ListSubscriptionLevelAlertsByRegionComplete(ctx context.Context, ascLocation string, filter string, selectParameter string, expand string) (result security.AlertListIterator, err error) + UpdateResourceGroupLevelAlertStateToDismiss(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (result autorest.Response, err error) + UpdateResourceGroupLevelAlertStateToReactivate(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (result autorest.Response, err error) + UpdateSubscriptionLevelAlertStateToDismiss(ctx context.Context, ascLocation string, alertName string) (result autorest.Response, err error) + UpdateSubscriptionLevelAlertStateToReactivate(ctx context.Context, ascLocation string, alertName string) (result autorest.Response, err error) } var _ AlertsClientAPI = (*security.AlertsClient)(nil) // DiscoveredSecuritySolutionsClientAPI contains the set of methods on the DiscoveredSecuritySolutionsClient type. type DiscoveredSecuritySolutionsClientAPI interface { - Get(ctx context.Context, resourceGroupName string, discoveredSecuritySolutionName string) (result security.DiscoveredSecuritySolution, err error) + Get(ctx context.Context, resourceGroupName string, ascLocation string, discoveredSecuritySolutionName string) (result security.DiscoveredSecuritySolution, err error) List(ctx context.Context) (result security.DiscoveredSecuritySolutionListPage, err error) ListComplete(ctx context.Context) (result security.DiscoveredSecuritySolutionListIterator, err error) - ListByHomeRegion(ctx context.Context) (result security.DiscoveredSecuritySolutionListPage, err error) - ListByHomeRegionComplete(ctx context.Context) (result security.DiscoveredSecuritySolutionListIterator, err error) + ListByHomeRegion(ctx context.Context, ascLocation string) (result security.DiscoveredSecuritySolutionListPage, err error) + ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result security.DiscoveredSecuritySolutionListIterator, err error) } var _ DiscoveredSecuritySolutionsClientAPI = (*security.DiscoveredSecuritySolutionsClient)(nil) // JitNetworkAccessPoliciesClientAPI contains the set of methods on the JitNetworkAccessPoliciesClient type. type JitNetworkAccessPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string, body security.JitNetworkAccessPolicy) (result security.JitNetworkAccessPolicy, err error) - Delete(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string) (result security.JitNetworkAccessPolicy, err error) - Initiate(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string, body security.JitNetworkAccessPolicyInitiateRequest) (result security.JitNetworkAccessRequest, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body security.JitNetworkAccessPolicy) (result security.JitNetworkAccessPolicy, err error) + Delete(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string) (result security.JitNetworkAccessPolicy, err error) + Initiate(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body security.JitNetworkAccessPolicyInitiateRequest) (result security.JitNetworkAccessRequest, err error) List(ctx context.Context) (result security.JitNetworkAccessPoliciesListPage, err error) ListComplete(ctx context.Context) (result security.JitNetworkAccessPoliciesListIterator, err error) - ListByRegion(ctx context.Context) (result security.JitNetworkAccessPoliciesListPage, err error) - ListByRegionComplete(ctx context.Context) (result security.JitNetworkAccessPoliciesListIterator, err error) + ListByRegion(ctx context.Context, ascLocation string) (result security.JitNetworkAccessPoliciesListPage, err error) + ListByRegionComplete(ctx context.Context, ascLocation string) (result security.JitNetworkAccessPoliciesListIterator, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result security.JitNetworkAccessPoliciesListPage, err error) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result security.JitNetworkAccessPoliciesListIterator, err error) - ListByResourceGroupAndRegion(ctx context.Context, resourceGroupName string) (result security.JitNetworkAccessPoliciesListPage, err error) - ListByResourceGroupAndRegionComplete(ctx context.Context, resourceGroupName string) (result security.JitNetworkAccessPoliciesListIterator, err error) + ListByResourceGroupAndRegion(ctx context.Context, resourceGroupName string, ascLocation string) (result security.JitNetworkAccessPoliciesListPage, err error) + ListByResourceGroupAndRegionComplete(ctx context.Context, resourceGroupName string, ascLocation string) (result security.JitNetworkAccessPoliciesListIterator, err error) } var _ JitNetworkAccessPoliciesClientAPI = (*security.JitNetworkAccessPoliciesClient)(nil) // AdaptiveApplicationControlsClientAPI contains the set of methods on the AdaptiveApplicationControlsClient type. type AdaptiveApplicationControlsClientAPI interface { - Delete(ctx context.Context, groupName string) (result autorest.Response, err error) - Get(ctx context.Context, groupName string) (result security.AppWhitelistingGroup, err error) + Delete(ctx context.Context, ascLocation string, groupName string) (result autorest.Response, err error) + Get(ctx context.Context, ascLocation string, groupName string) (result security.AppWhitelistingGroup, err error) List(ctx context.Context, includePathRecommendations *bool, summary *bool) (result security.AppWhitelistingGroups, err error) - Put(ctx context.Context, groupName string, body security.AppWhitelistingPutGroupData) (result security.AppWhitelistingGroup, err error) + Put(ctx context.Context, ascLocation string, groupName string, body security.AppWhitelistingPutGroupData) (result security.AppWhitelistingGroup, err error) } var _ AdaptiveApplicationControlsClientAPI = (*security.AdaptiveApplicationControlsClient)(nil) // ExternalSecuritySolutionsClientAPI contains the set of methods on the ExternalSecuritySolutionsClient type. type ExternalSecuritySolutionsClientAPI interface { - Get(ctx context.Context, resourceGroupName string, externalSecuritySolutionsName string) (result security.ExternalSecuritySolutionModel, err error) + Get(ctx context.Context, resourceGroupName string, ascLocation string, externalSecuritySolutionsName string) (result security.ExternalSecuritySolutionModel, err error) List(ctx context.Context) (result security.ExternalSecuritySolutionListPage, err error) ListComplete(ctx context.Context) (result security.ExternalSecuritySolutionListIterator, err error) - ListByHomeRegion(ctx context.Context) (result security.ExternalSecuritySolutionListPage, err error) - ListByHomeRegionComplete(ctx context.Context) (result security.ExternalSecuritySolutionListIterator, err error) + ListByHomeRegion(ctx context.Context, ascLocation string) (result security.ExternalSecuritySolutionListPage, err error) + ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result security.ExternalSecuritySolutionListIterator, err error) } var _ ExternalSecuritySolutionsClientAPI = (*security.ExternalSecuritySolutionsClient)(nil) // TopologyClientAPI contains the set of methods on the TopologyClient type. type TopologyClientAPI interface { - Get(ctx context.Context, resourceGroupName string, topologyResourceName string) (result security.TopologyResource, err error) + Get(ctx context.Context, resourceGroupName string, ascLocation string, topologyResourceName string) (result security.TopologyResource, err error) List(ctx context.Context) (result security.TopologyListPage, err error) ListComplete(ctx context.Context) (result security.TopologyListIterator, err error) - ListByHomeRegion(ctx context.Context) (result security.TopologyListPage, err error) - ListByHomeRegionComplete(ctx context.Context) (result security.TopologyListIterator, err error) + ListByHomeRegion(ctx context.Context, ascLocation string) (result security.TopologyListPage, err error) + ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result security.TopologyListIterator, err error) } var _ TopologyClientAPI = (*security.TopologyClient)(nil) // AllowedConnectionsClientAPI contains the set of methods on the AllowedConnectionsClient type. type AllowedConnectionsClientAPI interface { - Get(ctx context.Context, resourceGroupName string, connectionType security.ConnectionType) (result security.AllowedConnectionsResource, err error) + Get(ctx context.Context, resourceGroupName string, ascLocation string, connectionType security.ConnectionType) (result security.AllowedConnectionsResource, err error) List(ctx context.Context) (result security.AllowedConnectionsListPage, err error) ListComplete(ctx context.Context) (result security.AllowedConnectionsListIterator, err error) - ListByHomeRegion(ctx context.Context) (result security.AllowedConnectionsListPage, err error) - ListByHomeRegionComplete(ctx context.Context) (result security.AllowedConnectionsListIterator, err error) + ListByHomeRegion(ctx context.Context, ascLocation string) (result security.AllowedConnectionsListPage, err error) + ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result security.AllowedConnectionsListIterator, err error) } var _ AllowedConnectionsClientAPI = (*security.AllowedConnectionsClient)(nil) @@ -372,3 +431,16 @@ type AlertsSuppressionRulesClientAPI interface { } var _ AlertsSuppressionRulesClientAPI = (*security.AlertsSuppressionRulesClient)(nil) + +// IngestionSettingsClientAPI contains the set of methods on the IngestionSettingsClient type. +type IngestionSettingsClientAPI interface { + Create(ctx context.Context, ingestionSettingName string, ingestionSetting security.IngestionSetting) (result security.IngestionSetting, err error) + Delete(ctx context.Context, ingestionSettingName string) (result autorest.Response, err error) + Get(ctx context.Context, ingestionSettingName string) (result security.IngestionSetting, err error) + List(ctx context.Context) (result security.IngestionSettingListPage, err error) + ListComplete(ctx context.Context) (result security.IngestionSettingListIterator, err error) + ListConnectionStrings(ctx context.Context, ingestionSettingName string) (result security.ConnectionStrings, err error) + ListTokens(ctx context.Context, ingestionSettingName string) (result security.IngestionSettingToken, err error) +} + +var _ IngestionSettingsClientAPI = (*security.IngestionSettingsClient)(nil) diff --git a/services/preview/security/mgmt/v1.0/security/settings.go b/services/preview/security/mgmt/v1.0/security/settings.go index 5d87a8857e37..44a0e480242b 100644 --- a/services/preview/security/mgmt/v1.0/security/settings.go +++ b/services/preview/security/mgmt/v1.0/security/settings.go @@ -21,20 +21,20 @@ type SettingsClient struct { } // NewSettingsClient creates an instance of the SettingsClient client. -func NewSettingsClient(subscriptionID string, ascLocation string) SettingsClient { - return NewSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSettingsClient(subscriptionID string) SettingsClient { + return NewSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSettingsClientWithBaseURI creates an instance of the SettingsClient 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 NewSettingsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SettingsClient { - return SettingsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSettingsClientWithBaseURI(baseURI string, subscriptionID string) SettingsClient { + return SettingsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get settings of different configurations in security center +// Get settings of different configurations in Microsoft Defender for Cloud // Parameters: // settingName - name of setting: (MCAS/WDATP) -func (client SettingsClient) Get(ctx context.Context, settingName string) (result Setting, err error) { +func (client SettingsClient) Get(ctx context.Context, settingName string) (result SettingModel, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SettingsClient.Get") defer func() { @@ -101,7 +101,7 @@ func (client SettingsClient) GetSender(req *http.Request) (*http.Response, error // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client SettingsClient) GetResponder(resp *http.Response) (result Setting, err error) { +func (client SettingsClient) GetResponder(resp *http.Response) (result SettingModel, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -111,7 +111,7 @@ func (client SettingsClient) GetResponder(resp *http.Response) (result Setting, return } -// List settings about different configurations in security center +// List settings about different configurations in Microsoft Defender for Cloud func (client SettingsClient) List(ctx context.Context) (result SettingsListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SettingsClient.List") @@ -230,11 +230,11 @@ func (client SettingsClient) ListComplete(ctx context.Context) (result SettingsL return } -// Update updating settings about different configurations in security center +// Update updating settings about different configurations in Microsoft Defender for Cloud // Parameters: // settingName - name of setting: (MCAS/WDATP) // setting - setting object -func (client SettingsClient) Update(ctx context.Context, settingName string, setting Setting) (result Setting, err error) { +func (client SettingsClient) Update(ctx context.Context, settingName string, setting BasicSetting) (result SettingModel, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SettingsClient.Update") defer func() { @@ -274,7 +274,7 @@ func (client SettingsClient) Update(ctx context.Context, settingName string, set } // UpdatePreparer prepares the Update request. -func (client SettingsClient) UpdatePreparer(ctx context.Context, settingName string, setting Setting) (*http.Request, error) { +func (client SettingsClient) UpdatePreparer(ctx context.Context, settingName string, setting BasicSetting) (*http.Request, error) { pathParameters := map[string]interface{}{ "settingName": autorest.Encode("path", settingName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -303,7 +303,7 @@ func (client SettingsClient) UpdateSender(req *http.Request) (*http.Response, er // UpdateResponder handles the response to the Update request. The method always // closes the http.Response Body. -func (client SettingsClient) UpdateResponder(resp *http.Response) (result Setting, err error) { +func (client SettingsClient) UpdateResponder(resp *http.Response) (result SettingModel, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/services/preview/security/mgmt/v1.0/security/softwareinventories.go b/services/preview/security/mgmt/v1.0/security/softwareinventories.go new file mode 100644 index 000000000000..352d7a173dd7 --- /dev/null +++ b/services/preview/security/mgmt/v1.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) SoftwareInventoriesClient { + return NewSoftwareInventoriesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// 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) SoftwareInventoriesClient { + return SoftwareInventoriesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// 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/services/preview/security/mgmt/v1.0/security/sqlvulnerabilityassessmentbaselinerules.go b/services/preview/security/mgmt/v1.0/security/sqlvulnerabilityassessmentbaselinerules.go index dac36e6f0626..fca9c4dc4938 100644 --- a/services/preview/security/mgmt/v1.0/security/sqlvulnerabilityassessmentbaselinerules.go +++ b/services/preview/security/mgmt/v1.0/security/sqlvulnerabilityassessmentbaselinerules.go @@ -22,15 +22,15 @@ type SQLVulnerabilityAssessmentBaselineRulesClient struct { // NewSQLVulnerabilityAssessmentBaselineRulesClient creates an instance of the // SQLVulnerabilityAssessmentBaselineRulesClient client. -func NewSQLVulnerabilityAssessmentBaselineRulesClient(subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentBaselineRulesClient { - return NewSQLVulnerabilityAssessmentBaselineRulesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSQLVulnerabilityAssessmentBaselineRulesClient(subscriptionID string) SQLVulnerabilityAssessmentBaselineRulesClient { + return NewSQLVulnerabilityAssessmentBaselineRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSQLVulnerabilityAssessmentBaselineRulesClientWithBaseURI creates an instance of the // SQLVulnerabilityAssessmentBaselineRulesClient 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 NewSQLVulnerabilityAssessmentBaselineRulesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentBaselineRulesClient { - return SQLVulnerabilityAssessmentBaselineRulesClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSQLVulnerabilityAssessmentBaselineRulesClientWithBaseURI(baseURI string, subscriptionID string) SQLVulnerabilityAssessmentBaselineRulesClient { + return SQLVulnerabilityAssessmentBaselineRulesClient{NewWithBaseURI(baseURI, subscriptionID)} } // Add sends the add request. diff --git a/services/preview/security/mgmt/v1.0/security/sqlvulnerabilityassessmentscanresults.go b/services/preview/security/mgmt/v1.0/security/sqlvulnerabilityassessmentscanresults.go index 6310b4f1014b..1f1b3740d3e1 100644 --- a/services/preview/security/mgmt/v1.0/security/sqlvulnerabilityassessmentscanresults.go +++ b/services/preview/security/mgmt/v1.0/security/sqlvulnerabilityassessmentscanresults.go @@ -22,15 +22,15 @@ type SQLVulnerabilityAssessmentScanResultsClient struct { // NewSQLVulnerabilityAssessmentScanResultsClient creates an instance of the // SQLVulnerabilityAssessmentScanResultsClient client. -func NewSQLVulnerabilityAssessmentScanResultsClient(subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentScanResultsClient { - return NewSQLVulnerabilityAssessmentScanResultsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSQLVulnerabilityAssessmentScanResultsClient(subscriptionID string) SQLVulnerabilityAssessmentScanResultsClient { + return NewSQLVulnerabilityAssessmentScanResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSQLVulnerabilityAssessmentScanResultsClientWithBaseURI creates an instance of the // SQLVulnerabilityAssessmentScanResultsClient 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 NewSQLVulnerabilityAssessmentScanResultsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentScanResultsClient { - return SQLVulnerabilityAssessmentScanResultsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSQLVulnerabilityAssessmentScanResultsClientWithBaseURI(baseURI string, subscriptionID string) SQLVulnerabilityAssessmentScanResultsClient { + return SQLVulnerabilityAssessmentScanResultsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get sends the get request. diff --git a/services/preview/security/mgmt/v1.0/security/sqlvulnerabilityassessmentscans.go b/services/preview/security/mgmt/v1.0/security/sqlvulnerabilityassessmentscans.go index 1b2f59ba954b..c7507a2d53be 100644 --- a/services/preview/security/mgmt/v1.0/security/sqlvulnerabilityassessmentscans.go +++ b/services/preview/security/mgmt/v1.0/security/sqlvulnerabilityassessmentscans.go @@ -21,15 +21,15 @@ type SQLVulnerabilityAssessmentScansClient struct { } // NewSQLVulnerabilityAssessmentScansClient creates an instance of the SQLVulnerabilityAssessmentScansClient client. -func NewSQLVulnerabilityAssessmentScansClient(subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentScansClient { - return NewSQLVulnerabilityAssessmentScansClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSQLVulnerabilityAssessmentScansClient(subscriptionID string) SQLVulnerabilityAssessmentScansClient { + return NewSQLVulnerabilityAssessmentScansClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSQLVulnerabilityAssessmentScansClientWithBaseURI creates an instance of the SQLVulnerabilityAssessmentScansClient // 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 NewSQLVulnerabilityAssessmentScansClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentScansClient { - return SQLVulnerabilityAssessmentScansClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSQLVulnerabilityAssessmentScansClientWithBaseURI(baseURI string, subscriptionID string) SQLVulnerabilityAssessmentScansClient { + return SQLVulnerabilityAssessmentScansClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get sends the get request. diff --git a/services/preview/security/mgmt/v1.0/security/subassessments.go b/services/preview/security/mgmt/v1.0/security/subassessments.go index d767fbbc6b05..a2440cb9293f 100644 --- a/services/preview/security/mgmt/v1.0/security/subassessments.go +++ b/services/preview/security/mgmt/v1.0/security/subassessments.go @@ -20,14 +20,14 @@ type SubAssessmentsClient struct { } // NewSubAssessmentsClient creates an instance of the SubAssessmentsClient client. -func NewSubAssessmentsClient(subscriptionID string, ascLocation string) SubAssessmentsClient { - return NewSubAssessmentsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSubAssessmentsClient(subscriptionID string) SubAssessmentsClient { + return NewSubAssessmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSubAssessmentsClientWithBaseURI creates an instance of the SubAssessmentsClient 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 NewSubAssessmentsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SubAssessmentsClient { - return SubAssessmentsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSubAssessmentsClientWithBaseURI(baseURI string, subscriptionID string) SubAssessmentsClient { + return SubAssessmentsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get get a security sub-assessment on your scanned resource diff --git a/services/preview/security/mgmt/v1.0/security/tasks.go b/services/preview/security/mgmt/v1.0/security/tasks.go index cd9940c935b8..f0c6ec950e9c 100644 --- a/services/preview/security/mgmt/v1.0/security/tasks.go +++ b/services/preview/security/mgmt/v1.0/security/tasks.go @@ -21,22 +21,24 @@ type TasksClient struct { } // NewTasksClient creates an instance of the TasksClient client. -func NewTasksClient(subscriptionID string, ascLocation string) TasksClient { - return NewTasksClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewTasksClient(subscriptionID string) TasksClient { + return NewTasksClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewTasksClientWithBaseURI creates an instance of the TasksClient 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 NewTasksClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) TasksClient { - return TasksClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewTasksClientWithBaseURI(baseURI string, subscriptionID string) TasksClient { + return TasksClient{NewWithBaseURI(baseURI, subscriptionID)} } // GetResourceGroupLevelTask recommended tasks that will help improve the security of the subscription proactively // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // taskName - name of the task object, will be a GUID -func (client TasksClient) GetResourceGroupLevelTask(ctx context.Context, resourceGroupName string, taskName string) (result Task, err error) { +func (client TasksClient) GetResourceGroupLevelTask(ctx context.Context, resourceGroupName string, ascLocation string, taskName string) (result Task, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.GetResourceGroupLevelTask") defer func() { @@ -57,7 +59,7 @@ func (client TasksClient) GetResourceGroupLevelTask(ctx context.Context, resourc return result, validation.NewError("security.TasksClient", "GetResourceGroupLevelTask", err.Error()) } - req, err := client.GetResourceGroupLevelTaskPreparer(ctx, resourceGroupName, taskName) + req, err := client.GetResourceGroupLevelTaskPreparer(ctx, resourceGroupName, ascLocation, taskName) if err != nil { err = autorest.NewErrorWithError(err, "security.TasksClient", "GetResourceGroupLevelTask", nil, "Failure preparing request") return @@ -80,9 +82,9 @@ func (client TasksClient) GetResourceGroupLevelTask(ctx context.Context, resourc } // GetResourceGroupLevelTaskPreparer prepares the GetResourceGroupLevelTask request. -func (client TasksClient) GetResourceGroupLevelTaskPreparer(ctx context.Context, resourceGroupName string, taskName string) (*http.Request, error) { +func (client TasksClient) GetResourceGroupLevelTaskPreparer(ctx context.Context, resourceGroupName string, ascLocation string, taskName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "taskName": autorest.Encode("path", taskName), @@ -121,8 +123,10 @@ func (client TasksClient) GetResourceGroupLevelTaskResponder(resp *http.Response // GetSubscriptionLevelTask recommended tasks that will help improve the security of the subscription proactively // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // taskName - name of the task object, will be a GUID -func (client TasksClient) GetSubscriptionLevelTask(ctx context.Context, taskName string) (result Task, err error) { +func (client TasksClient) GetSubscriptionLevelTask(ctx context.Context, ascLocation string, taskName string) (result Task, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.GetSubscriptionLevelTask") defer func() { @@ -139,7 +143,7 @@ func (client TasksClient) GetSubscriptionLevelTask(ctx context.Context, taskName return result, validation.NewError("security.TasksClient", "GetSubscriptionLevelTask", err.Error()) } - req, err := client.GetSubscriptionLevelTaskPreparer(ctx, taskName) + req, err := client.GetSubscriptionLevelTaskPreparer(ctx, ascLocation, taskName) if err != nil { err = autorest.NewErrorWithError(err, "security.TasksClient", "GetSubscriptionLevelTask", nil, "Failure preparing request") return @@ -162,9 +166,9 @@ func (client TasksClient) GetSubscriptionLevelTask(ctx context.Context, taskName } // GetSubscriptionLevelTaskPreparer prepares the GetSubscriptionLevelTask request. -func (client TasksClient) GetSubscriptionLevelTaskPreparer(ctx context.Context, taskName string) (*http.Request, error) { +func (client TasksClient) GetSubscriptionLevelTaskPreparer(ctx context.Context, ascLocation string, taskName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "taskName": autorest.Encode("path", taskName), } @@ -326,8 +330,10 @@ func (client TasksClient) ListComplete(ctx context.Context, filter string) (resu // ListByHomeRegion recommended tasks that will help improve the security of the subscription proactively // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // filter - oData filter. Optional. -func (client TasksClient) ListByHomeRegion(ctx context.Context, filter string) (result TaskListPage, err error) { +func (client TasksClient) ListByHomeRegion(ctx context.Context, ascLocation string, filter string) (result TaskListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.ListByHomeRegion") defer func() { @@ -345,7 +351,7 @@ func (client TasksClient) ListByHomeRegion(ctx context.Context, filter string) ( } result.fn = client.listByHomeRegionNextResults - req, err := client.ListByHomeRegionPreparer(ctx, filter) + req, err := client.ListByHomeRegionPreparer(ctx, ascLocation, filter) if err != nil { err = autorest.NewErrorWithError(err, "security.TasksClient", "ListByHomeRegion", nil, "Failure preparing request") return @@ -372,9 +378,9 @@ func (client TasksClient) ListByHomeRegion(ctx context.Context, filter string) ( } // ListByHomeRegionPreparer prepares the ListByHomeRegion request. -func (client TasksClient) ListByHomeRegionPreparer(ctx context.Context, filter string) (*http.Request, error) { +func (client TasksClient) ListByHomeRegionPreparer(ctx context.Context, ascLocation string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -434,7 +440,7 @@ func (client TasksClient) listByHomeRegionNextResults(ctx context.Context, lastR } // ListByHomeRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client TasksClient) ListByHomeRegionComplete(ctx context.Context, filter string) (result TaskListIterator, err error) { +func (client TasksClient) ListByHomeRegionComplete(ctx context.Context, ascLocation string, filter string) (result TaskListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.ListByHomeRegion") defer func() { @@ -445,7 +451,7 @@ func (client TasksClient) ListByHomeRegionComplete(ctx context.Context, filter s tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByHomeRegion(ctx, filter) + result.page, err = client.ListByHomeRegion(ctx, ascLocation, filter) return } @@ -453,8 +459,10 @@ func (client TasksClient) ListByHomeRegionComplete(ctx context.Context, filter s // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // filter - oData filter. Optional. -func (client TasksClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string) (result TaskListPage, err error) { +func (client TasksClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, ascLocation string, filter string) (result TaskListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.ListByResourceGroup") defer func() { @@ -476,7 +484,7 @@ func (client TasksClient) ListByResourceGroup(ctx context.Context, resourceGroup } result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, filter) + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, ascLocation, filter) if err != nil { err = autorest.NewErrorWithError(err, "security.TasksClient", "ListByResourceGroup", nil, "Failure preparing request") return @@ -503,9 +511,9 @@ func (client TasksClient) ListByResourceGroup(ctx context.Context, resourceGroup } // ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client TasksClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string) (*http.Request, error) { +func (client TasksClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, ascLocation string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -566,7 +574,7 @@ func (client TasksClient) listByResourceGroupNextResults(ctx context.Context, la } // ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client TasksClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string) (result TaskListIterator, err error) { +func (client TasksClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, ascLocation string, filter string) (result TaskListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.ListByResourceGroup") defer func() { @@ -577,7 +585,7 @@ func (client TasksClient) ListByResourceGroupComplete(ctx context.Context, resou tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, filter) + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, ascLocation, filter) return } @@ -586,9 +594,11 @@ func (client TasksClient) ListByResourceGroupComplete(ctx context.Context, resou // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // taskName - name of the task object, will be a GUID // taskUpdateActionType - type of the action to do on the task -func (client TasksClient) UpdateResourceGroupLevelTaskState(ctx context.Context, resourceGroupName string, taskName string, taskUpdateActionType string) (result autorest.Response, err error) { +func (client TasksClient) UpdateResourceGroupLevelTaskState(ctx context.Context, resourceGroupName string, ascLocation string, taskName string, taskUpdateActionType TaskUpdateActionType) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.UpdateResourceGroupLevelTaskState") defer func() { @@ -609,7 +619,7 @@ func (client TasksClient) UpdateResourceGroupLevelTaskState(ctx context.Context, return result, validation.NewError("security.TasksClient", "UpdateResourceGroupLevelTaskState", err.Error()) } - req, err := client.UpdateResourceGroupLevelTaskStatePreparer(ctx, resourceGroupName, taskName, taskUpdateActionType) + req, err := client.UpdateResourceGroupLevelTaskStatePreparer(ctx, resourceGroupName, ascLocation, taskName, taskUpdateActionType) if err != nil { err = autorest.NewErrorWithError(err, "security.TasksClient", "UpdateResourceGroupLevelTaskState", nil, "Failure preparing request") return @@ -632,9 +642,9 @@ func (client TasksClient) UpdateResourceGroupLevelTaskState(ctx context.Context, } // UpdateResourceGroupLevelTaskStatePreparer prepares the UpdateResourceGroupLevelTaskState request. -func (client TasksClient) UpdateResourceGroupLevelTaskStatePreparer(ctx context.Context, resourceGroupName string, taskName string, taskUpdateActionType string) (*http.Request, error) { +func (client TasksClient) UpdateResourceGroupLevelTaskStatePreparer(ctx context.Context, resourceGroupName string, ascLocation string, taskName string, taskUpdateActionType TaskUpdateActionType) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "taskName": autorest.Encode("path", taskName), @@ -674,9 +684,11 @@ func (client TasksClient) UpdateResourceGroupLevelTaskStateResponder(resp *http. // UpdateSubscriptionLevelTaskState recommended tasks that will help improve the security of the subscription // proactively // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // taskName - name of the task object, will be a GUID // taskUpdateActionType - type of the action to do on the task -func (client TasksClient) UpdateSubscriptionLevelTaskState(ctx context.Context, taskName string, taskUpdateActionType string) (result autorest.Response, err error) { +func (client TasksClient) UpdateSubscriptionLevelTaskState(ctx context.Context, ascLocation string, taskName string, taskUpdateActionType TaskUpdateActionType) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.UpdateSubscriptionLevelTaskState") defer func() { @@ -693,7 +705,7 @@ func (client TasksClient) UpdateSubscriptionLevelTaskState(ctx context.Context, return result, validation.NewError("security.TasksClient", "UpdateSubscriptionLevelTaskState", err.Error()) } - req, err := client.UpdateSubscriptionLevelTaskStatePreparer(ctx, taskName, taskUpdateActionType) + req, err := client.UpdateSubscriptionLevelTaskStatePreparer(ctx, ascLocation, taskName, taskUpdateActionType) if err != nil { err = autorest.NewErrorWithError(err, "security.TasksClient", "UpdateSubscriptionLevelTaskState", nil, "Failure preparing request") return @@ -716,9 +728,9 @@ func (client TasksClient) UpdateSubscriptionLevelTaskState(ctx context.Context, } // UpdateSubscriptionLevelTaskStatePreparer prepares the UpdateSubscriptionLevelTaskState request. -func (client TasksClient) UpdateSubscriptionLevelTaskStatePreparer(ctx context.Context, taskName string, taskUpdateActionType string) (*http.Request, error) { +func (client TasksClient) UpdateSubscriptionLevelTaskStatePreparer(ctx context.Context, ascLocation string, taskName string, taskUpdateActionType TaskUpdateActionType) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "taskName": autorest.Encode("path", taskName), "taskUpdateActionType": autorest.Encode("path", taskUpdateActionType), diff --git a/services/preview/security/mgmt/v1.0/security/topology.go b/services/preview/security/mgmt/v1.0/security/topology.go index ef1277abeb37..f0779ad4d394 100644 --- a/services/preview/security/mgmt/v1.0/security/topology.go +++ b/services/preview/security/mgmt/v1.0/security/topology.go @@ -21,22 +21,24 @@ type TopologyClient struct { } // NewTopologyClient creates an instance of the TopologyClient client. -func NewTopologyClient(subscriptionID string, ascLocation string) TopologyClient { - return NewTopologyClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewTopologyClient(subscriptionID string) TopologyClient { + return NewTopologyClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewTopologyClientWithBaseURI creates an instance of the TopologyClient 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 NewTopologyClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) TopologyClient { - return TopologyClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewTopologyClientWithBaseURI(baseURI string, subscriptionID string) TopologyClient { + return TopologyClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets a specific topology component. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // topologyResourceName - name of a topology resources collection. -func (client TopologyClient) Get(ctx context.Context, resourceGroupName string, topologyResourceName string) (result TopologyResource, err error) { +func (client TopologyClient) Get(ctx context.Context, resourceGroupName string, ascLocation string, topologyResourceName string) (result TopologyResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TopologyClient.Get") defer func() { @@ -57,7 +59,7 @@ func (client TopologyClient) Get(ctx context.Context, resourceGroupName string, return result, validation.NewError("security.TopologyClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, topologyResourceName) + req, err := client.GetPreparer(ctx, resourceGroupName, ascLocation, topologyResourceName) if err != nil { err = autorest.NewErrorWithError(err, "security.TopologyClient", "Get", nil, "Failure preparing request") return @@ -80,9 +82,9 @@ func (client TopologyClient) Get(ctx context.Context, resourceGroupName string, } // GetPreparer prepares the Get request. -func (client TopologyClient) GetPreparer(ctx context.Context, resourceGroupName string, topologyResourceName string) (*http.Request, error) { +func (client TopologyClient) GetPreparer(ctx context.Context, resourceGroupName string, ascLocation string, topologyResourceName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "topologyResourceName": autorest.Encode("path", topologyResourceName), @@ -239,7 +241,10 @@ func (client TopologyClient) ListComplete(ctx context.Context) (result TopologyL } // ListByHomeRegion gets a list that allows to build a topology view of a subscription and location. -func (client TopologyClient) ListByHomeRegion(ctx context.Context) (result TopologyListPage, err error) { +// Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations +func (client TopologyClient) ListByHomeRegion(ctx context.Context, ascLocation string) (result TopologyListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TopologyClient.ListByHomeRegion") defer func() { @@ -257,7 +262,7 @@ func (client TopologyClient) ListByHomeRegion(ctx context.Context) (result Topol } result.fn = client.listByHomeRegionNextResults - req, err := client.ListByHomeRegionPreparer(ctx) + req, err := client.ListByHomeRegionPreparer(ctx, ascLocation) if err != nil { err = autorest.NewErrorWithError(err, "security.TopologyClient", "ListByHomeRegion", nil, "Failure preparing request") return @@ -284,9 +289,9 @@ func (client TopologyClient) ListByHomeRegion(ctx context.Context) (result Topol } // ListByHomeRegionPreparer prepares the ListByHomeRegion request. -func (client TopologyClient) ListByHomeRegionPreparer(ctx context.Context) (*http.Request, error) { +func (client TopologyClient) ListByHomeRegionPreparer(ctx context.Context, ascLocation string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -343,7 +348,7 @@ func (client TopologyClient) listByHomeRegionNextResults(ctx context.Context, la } // ListByHomeRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client TopologyClient) ListByHomeRegionComplete(ctx context.Context) (result TopologyListIterator, err error) { +func (client TopologyClient) ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result TopologyListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TopologyClient.ListByHomeRegion") defer func() { @@ -354,6 +359,6 @@ func (client TopologyClient) ListByHomeRegionComplete(ctx context.Context) (resu tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByHomeRegion(ctx) + result.page, err = client.ListByHomeRegion(ctx, ascLocation) return } diff --git a/services/preview/security/mgmt/v1.0/security/workspacesettings.go b/services/preview/security/mgmt/v1.0/security/workspacesettings.go index 8b402a5755ec..8d7642baf7e0 100644 --- a/services/preview/security/mgmt/v1.0/security/workspacesettings.go +++ b/services/preview/security/mgmt/v1.0/security/workspacesettings.go @@ -21,15 +21,15 @@ type WorkspaceSettingsClient struct { } // NewWorkspaceSettingsClient creates an instance of the WorkspaceSettingsClient client. -func NewWorkspaceSettingsClient(subscriptionID string, ascLocation string) WorkspaceSettingsClient { - return NewWorkspaceSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewWorkspaceSettingsClient(subscriptionID string) WorkspaceSettingsClient { + return NewWorkspaceSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewWorkspaceSettingsClientWithBaseURI creates an instance of the WorkspaceSettingsClient 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 NewWorkspaceSettingsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) WorkspaceSettingsClient { - return WorkspaceSettingsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewWorkspaceSettingsClientWithBaseURI(baseURI string, subscriptionID string) WorkspaceSettingsClient { + return WorkspaceSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Create creating settings about where we should store your security data and logs diff --git a/services/preview/security/mgmt/v2.0/security/CHANGELOG.md b/services/preview/security/mgmt/v2.0/security/CHANGELOG.md index 52911e4cc5e4..4d50fde10874 100644 --- a/services/preview/security/mgmt/v2.0/security/CHANGELOG.md +++ b/services/preview/security/mgmt/v2.0/security/CHANGELOG.md @@ -1,2 +1,1176 @@ -# Change History +# Unreleased +## Breaking Changes + +### Removed Constants + +1. EnforcementMode.Audit +1. EnforcementMode.Enforce +1. EventSource.Alerts +1. EventSource.Assessments +1. EventSource.SecureScoreControls +1. EventSource.SecureScores +1. EventSource.SubAssessments +1. SettingKind.SettingKindAlertSuppressionSetting +1. SettingKind.SettingKindDataExportSetting + +### Removed Funcs + +1. PossibleSettingKindValues() []SettingKind +1. SettingResource.MarshalJSON() ([]byte, error) + +### Struct Changes + +#### Removed Structs + +1. SettingResource + +#### Removed Struct Fields + +1. BaseClient.AscLocation + +### Signature Changes + +#### Const Types + +1. KindAAD changed type from KindEnum to KindEnum1 +1. KindATA changed type from KindEnum to KindEnum1 +1. KindCEF changed type from KindEnum to KindEnum1 +1. KindExternalSecuritySolution changed type from KindEnum to KindEnum1 +1. None changed type from EnforcementMode to EndOfSupportStatus + +#### Funcs + +1. AdaptiveApplicationControlsClient.Delete + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AdaptiveApplicationControlsClient.DeletePreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AdaptiveApplicationControlsClient.Get + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AdaptiveApplicationControlsClient.GetPreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AdaptiveApplicationControlsClient.Put + - Params + - From: context.Context, string, AppWhitelistingPutGroupData + - To: context.Context, string, string, AppWhitelistingPutGroupData +1. AdaptiveApplicationControlsClient.PutPreparer + - Params + - From: context.Context, string, AppWhitelistingPutGroupData + - To: context.Context, string, string, AppWhitelistingPutGroupData +1. AlertsClient.GetResourceGroupLevelAlerts + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. AlertsClient.GetResourceGroupLevelAlertsPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. AlertsClient.GetSubscriptionLevelAlert + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AlertsClient.GetSubscriptionLevelAlertPreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AlertsClient.ListResourceGroupLevelAlertsByRegion + - Params + - From: context.Context, string, string, string, string, string + - To: context.Context, string, string, string, string, string, string +1. AlertsClient.ListResourceGroupLevelAlertsByRegionComplete + - Params + - From: context.Context, string, string, string, string, string + - To: context.Context, string, string, string, string, string, string +1. AlertsClient.ListResourceGroupLevelAlertsByRegionPreparer + - Params + - From: context.Context, string, string, string, string, string + - To: context.Context, string, string, string, string, string, string +1. AlertsClient.ListSubscriptionLevelAlertsByRegion + - Params + - From: context.Context, string, string, string, string + - To: context.Context, string, string, string, string, string +1. AlertsClient.ListSubscriptionLevelAlertsByRegionComplete + - Params + - From: context.Context, string, string, string, string + - To: context.Context, string, string, string, string, string +1. AlertsClient.ListSubscriptionLevelAlertsByRegionPreparer + - Params + - From: context.Context, string, string, string, string + - To: context.Context, string, string, string, string, string +1. AlertsClient.UpdateResourceGroupLevelAlertStateToDismiss + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. AlertsClient.UpdateResourceGroupLevelAlertStateToDismissPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. AlertsClient.UpdateResourceGroupLevelAlertStateToReactivate + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. AlertsClient.UpdateResourceGroupLevelAlertStateToReactivatePreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. AlertsClient.UpdateSubscriptionLevelAlertStateToDismiss + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AlertsClient.UpdateSubscriptionLevelAlertStateToDismissPreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AlertsClient.UpdateSubscriptionLevelAlertStateToReactivate + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AlertsClient.UpdateSubscriptionLevelAlertStateToReactivatePreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AllowedConnectionsClient.Get + - Params + - From: context.Context, string, ConnectionType + - To: context.Context, string, string, ConnectionType +1. AllowedConnectionsClient.GetPreparer + - Params + - From: context.Context, string, ConnectionType + - To: context.Context, string, string, ConnectionType +1. AllowedConnectionsClient.ListByHomeRegion + - Params + - From: context.Context + - To: context.Context, string +1. AllowedConnectionsClient.ListByHomeRegionComplete + - Params + - From: context.Context + - To: context.Context, string +1. AllowedConnectionsClient.ListByHomeRegionPreparer + - Params + - From: context.Context + - To: context.Context, string +1. ConnectorsClient.CreateOrUpdate + - Params + - From: context.Context, string, ConnectorSetting + - To: context.Context, string, string, Connector + - Returns + - From: ConnectorSetting, error + - To: Connector, error +1. ConnectorsClient.CreateOrUpdatePreparer + - Params + - From: context.Context, string, ConnectorSetting + - To: context.Context, string, string, Connector +1. ConnectorsClient.CreateOrUpdateResponder + - Returns + - From: ConnectorSetting, error + - To: Connector, error +1. ConnectorsClient.Delete + - Params + - From: context.Context, string + - To: context.Context, string, string +1. ConnectorsClient.DeletePreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. ConnectorsClient.Get + - Params + - From: context.Context, string + - To: context.Context, string, string + - Returns + - From: ConnectorSetting, error + - To: Connector, error +1. ConnectorsClient.GetPreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. ConnectorsClient.GetResponder + - Returns + - From: ConnectorSetting, error + - To: Connector, error +1. ConnectorsClient.List + - Returns + - From: ConnectorSettingListPage, error + - To: ConnectorsListPage, error +1. ConnectorsClient.ListComplete + - Returns + - From: ConnectorSettingListIterator, error + - To: ConnectorsListIterator, error +1. ConnectorsClient.ListResponder + - Returns + - From: ConnectorSettingList, error + - To: ConnectorsList, error +1. DiscoveredSecuritySolutionsClient.Get + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. DiscoveredSecuritySolutionsClient.GetPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. DiscoveredSecuritySolutionsClient.ListByHomeRegion + - Params + - From: context.Context + - To: context.Context, string +1. DiscoveredSecuritySolutionsClient.ListByHomeRegionComplete + - Params + - From: context.Context + - To: context.Context, string +1. DiscoveredSecuritySolutionsClient.ListByHomeRegionPreparer + - Params + - From: context.Context + - To: context.Context, string +1. ExternalSecuritySolutionsClient.Get + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. ExternalSecuritySolutionsClient.GetPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. ExternalSecuritySolutionsClient.ListByHomeRegion + - Params + - From: context.Context + - To: context.Context, string +1. ExternalSecuritySolutionsClient.ListByHomeRegionComplete + - Params + - From: context.Context + - To: context.Context, string +1. ExternalSecuritySolutionsClient.ListByHomeRegionPreparer + - Params + - From: context.Context + - To: context.Context, string +1. InformationProtectionPoliciesClient.CreateOrUpdate + - Params + - From: context.Context, string, string, InformationProtectionPolicy + - To: context.Context, string, InformationProtectionPolicyName, InformationProtectionPolicy +1. InformationProtectionPoliciesClient.CreateOrUpdatePreparer + - Params + - From: context.Context, string, string, InformationProtectionPolicy + - To: context.Context, string, InformationProtectionPolicyName, InformationProtectionPolicy +1. InformationProtectionPoliciesClient.Get + - Params + - From: context.Context, string, string + - To: context.Context, string, InformationProtectionPolicyName +1. InformationProtectionPoliciesClient.GetPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, InformationProtectionPolicyName +1. JitNetworkAccessPoliciesClient.CreateOrUpdate + - Params + - From: context.Context, string, string, JitNetworkAccessPolicy + - To: context.Context, string, string, string, JitNetworkAccessPolicy +1. JitNetworkAccessPoliciesClient.CreateOrUpdatePreparer + - Params + - From: context.Context, string, string, JitNetworkAccessPolicy + - To: context.Context, string, string, string, JitNetworkAccessPolicy +1. JitNetworkAccessPoliciesClient.Delete + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. JitNetworkAccessPoliciesClient.DeletePreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. JitNetworkAccessPoliciesClient.Get + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. JitNetworkAccessPoliciesClient.GetPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. JitNetworkAccessPoliciesClient.Initiate + - Params + - From: context.Context, string, string, JitNetworkAccessPolicyInitiateRequest + - To: context.Context, string, string, string, JitNetworkAccessPolicyInitiateRequest +1. JitNetworkAccessPoliciesClient.InitiatePreparer + - Params + - From: context.Context, string, string, JitNetworkAccessPolicyInitiateRequest + - To: context.Context, string, string, string, JitNetworkAccessPolicyInitiateRequest +1. JitNetworkAccessPoliciesClient.ListByRegion + - Params + - From: context.Context + - To: context.Context, string +1. JitNetworkAccessPoliciesClient.ListByRegionComplete + - Params + - From: context.Context + - To: context.Context, string +1. JitNetworkAccessPoliciesClient.ListByRegionPreparer + - Params + - From: context.Context + - To: context.Context, string +1. JitNetworkAccessPoliciesClient.ListByResourceGroupAndRegion + - Params + - From: context.Context, string + - To: context.Context, string, string +1. JitNetworkAccessPoliciesClient.ListByResourceGroupAndRegionComplete + - Params + - From: context.Context, string + - To: context.Context, string, string +1. JitNetworkAccessPoliciesClient.ListByResourceGroupAndRegionPreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. LocationsClient.Get + - Params + - From: context.Context + - To: context.Context, string +1. LocationsClient.GetPreparer + - Params + - From: context.Context + - To: context.Context, string +1. New + - Params + - From: string, string + - To: string +1. NewAdaptiveApplicationControlsClient + - Params + - From: string, string + - To: string +1. NewAdaptiveApplicationControlsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewAdaptiveNetworkHardeningsClient + - Params + - From: string, string + - To: string +1. NewAdaptiveNetworkHardeningsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewAdvancedThreatProtectionClient + - Params + - From: string, string + - To: string +1. NewAdvancedThreatProtectionClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewAlertsClient + - Params + - From: string, string + - To: string +1. NewAlertsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewAlertsSuppressionRulesClient + - Params + - From: string, string + - To: string +1. NewAlertsSuppressionRulesClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewAllowedConnectionsClient + - Params + - From: string, string + - To: string +1. NewAllowedConnectionsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewAutoProvisioningSettingsClient + - Params + - From: string, string + - To: string +1. NewAutoProvisioningSettingsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewAutomationsClient + - Params + - From: string, string + - To: string +1. NewAutomationsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewCompliancesClient + - Params + - From: string, string + - To: string +1. NewCompliancesClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewConnectorsClient + - Params + - From: string, string + - To: string +1. NewConnectorsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewContactsClient + - Params + - From: string, string + - To: string +1. NewContactsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewDeviceSecurityGroupsClient + - Params + - From: string, string + - To: string +1. NewDeviceSecurityGroupsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewDiscoveredSecuritySolutionsClient + - Params + - From: string, string + - To: string +1. NewDiscoveredSecuritySolutionsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewExternalSecuritySolutionsClient + - Params + - From: string, string + - To: string +1. NewExternalSecuritySolutionsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewInformationProtectionPoliciesClient + - Params + - From: string, string + - To: string +1. NewInformationProtectionPoliciesClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewIoTSecuritySolutionsAnalyticsAggregatedAlertClient + - Params + - From: string, string + - To: string +1. NewIoTSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClient + - Params + - From: string, string + - To: string +1. NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewIoTSecuritySolutionsAnalyticsClient + - Params + - From: string, string + - To: string +1. NewIoTSecuritySolutionsAnalyticsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewIoTSecuritySolutionsAnalyticsRecommendationClient + - Params + - From: string, string + - To: string +1. NewIoTSecuritySolutionsAnalyticsRecommendationClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewIoTSecuritySolutionsAnalyticsRecommendationsClient + - Params + - From: string, string + - To: string +1. NewIoTSecuritySolutionsAnalyticsRecommendationsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewIoTSecuritySolutionsClient + - Params + - From: string, string + - To: string +1. NewIoTSecuritySolutionsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewIoTSecuritySolutionsResourceGroupClient + - Params + - From: string, string + - To: string +1. NewIoTSecuritySolutionsResourceGroupClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewIotSecuritySolutionClient + - Params + - From: string, string + - To: string +1. NewIotSecuritySolutionClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewJitNetworkAccessPoliciesClient + - Params + - From: string, string + - To: string +1. NewJitNetworkAccessPoliciesClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewLocationsClient + - Params + - From: string, string + - To: string +1. NewLocationsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewOperationsClient + - Params + - From: string, string + - To: string +1. NewOperationsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewPricingsClient + - Params + - From: string, string + - To: string +1. NewPricingsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewRegulatoryComplianceAssessmentsClient + - Params + - From: string, string + - To: string +1. NewRegulatoryComplianceAssessmentsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewRegulatoryComplianceControlsClient + - Params + - From: string, string + - To: string +1. NewRegulatoryComplianceControlsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewRegulatoryComplianceStandardsClient + - Params + - From: string, string + - To: string +1. NewRegulatoryComplianceStandardsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSQLVulnerabilityAssessmentBaselineRulesClient + - Params + - From: string, string + - To: string +1. NewSQLVulnerabilityAssessmentBaselineRulesClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSQLVulnerabilityAssessmentScanResultsClient + - Params + - From: string, string + - To: string +1. NewSQLVulnerabilityAssessmentScanResultsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSQLVulnerabilityAssessmentScansClient + - Params + - From: string, string + - To: string +1. NewSQLVulnerabilityAssessmentScansClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSecureScoreControlDefinitionsClient + - Params + - From: string, string + - To: string +1. NewSecureScoreControlDefinitionsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSecureScoreControlsClient + - Params + - From: string, string + - To: string +1. NewSecureScoreControlsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSecureScoresClient + - Params + - From: string, string + - To: string +1. NewSecureScoresClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSettingsClient + - Params + - From: string, string + - To: string +1. NewSettingsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSubAssessmentsClient + - Params + - From: string, string + - To: string +1. NewSubAssessmentsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewTasksClient + - Params + - From: string, string + - To: string +1. NewTasksClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewTopologyClient + - Params + - From: string, string + - To: string +1. NewTopologyClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewWorkspaceSettingsClient + - Params + - From: string, string + - To: string +1. NewWorkspaceSettingsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. SettingsClient.Get + - Returns + - From: Setting, error + - To: SettingModel, error +1. SettingsClient.GetResponder + - Returns + - From: Setting, error + - To: SettingModel, error +1. SettingsClient.Update + - Params + - From: context.Context, string, Setting + - To: context.Context, string, BasicSetting + - Returns + - From: Setting, error + - To: SettingModel, error +1. SettingsClient.UpdatePreparer + - Params + - From: context.Context, string, Setting + - To: context.Context, string, BasicSetting +1. SettingsClient.UpdateResponder + - Returns + - From: Setting, error + - To: SettingModel, error +1. SettingsListIterator.Value + - Returns + - From: Setting + - To: BasicSetting +1. SettingsListPage.Values + - Returns + - From: []Setting + - To: []BasicSetting +1. TasksClient.GetResourceGroupLevelTask + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. TasksClient.GetResourceGroupLevelTaskPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. TasksClient.GetSubscriptionLevelTask + - Params + - From: context.Context, string + - To: context.Context, string, string +1. TasksClient.GetSubscriptionLevelTaskPreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. TasksClient.ListByHomeRegion + - Params + - From: context.Context, string + - To: context.Context, string, string +1. TasksClient.ListByHomeRegionComplete + - Params + - From: context.Context, string + - To: context.Context, string, string +1. TasksClient.ListByHomeRegionPreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. TasksClient.ListByResourceGroup + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. TasksClient.ListByResourceGroupComplete + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. TasksClient.ListByResourceGroupPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. TasksClient.UpdateResourceGroupLevelTaskState + - Params + - From: context.Context, string, string, string + - To: context.Context, string, string, string, TaskUpdateActionType +1. TasksClient.UpdateResourceGroupLevelTaskStatePreparer + - Params + - From: context.Context, string, string, string + - To: context.Context, string, string, string, TaskUpdateActionType +1. TasksClient.UpdateSubscriptionLevelTaskState + - Params + - From: context.Context, string, string + - To: context.Context, string, string, TaskUpdateActionType +1. TasksClient.UpdateSubscriptionLevelTaskStatePreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, TaskUpdateActionType +1. TopologyClient.Get + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. TopologyClient.GetPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. TopologyClient.ListByHomeRegion + - Params + - From: context.Context + - To: context.Context, string +1. TopologyClient.ListByHomeRegionComplete + - Params + - From: context.Context + - To: context.Context, string +1. TopologyClient.ListByHomeRegionPreparer + - Params + - From: context.Context + - To: context.Context, string + +#### Struct Fields + +1. AadExternalSecuritySolution.Kind changed type from KindEnum to KindEnum1 +1. AtaExternalSecuritySolution.Kind changed type from KindEnum to KindEnum1 +1. CefExternalSecuritySolution.Kind changed type from KindEnum to KindEnum1 +1. DataExportSetting.Kind changed type from SettingKind to KindEnum +1. ExternalSecuritySolution.Kind changed type from KindEnum to KindEnum1 +1. Setting.Kind changed type from SettingKind to KindEnum +1. SettingsList.Value changed type from *[]Setting to *[]BasicSetting + +## Additive Changes + +### New Constants + +1. CloudName.AWS +1. CloudName.Azure +1. CloudName.GCP +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.EventSourceAssessmentsSnapshot +1. EventSource.EventSourceRegulatoryComplianceAssessment +1. EventSource.EventSourceRegulatoryComplianceAssessmentSnapshot +1. EventSource.EventSourceSecureScoreControls +1. EventSource.EventSourceSecureScoreControlsSnapshot +1. EventSource.EventSourceSecureScores +1. EventSource.EventSourceSecureScoresSnapshot +1. EventSource.EventSourceSubAssessments +1. EventSource.EventSourceSubAssessmentsSnapshot +1. InformationProtectionPolicyName.InformationProtectionPolicyNameCustom +1. InformationProtectionPolicyName.InformationProtectionPolicyNameEffective +1. KindEnum.KindDataExportSetting +1. KindEnum.KindSetting +1. OfferingType.OfferingTypeCloudOffering +1. OfferingType.OfferingTypeCspmMonitorAws +1. OfferingType.OfferingTypeDefenderForContainersAws +1. OfferingType.OfferingTypeDefenderForServersAws +1. OfferingType.OfferingTypeInformationProtectionAws +1. OrganizationMembershipType.Member +1. OrganizationMembershipType.Organization +1. SeverityEnum.SeverityEnumHigh +1. SeverityEnum.SeverityEnumLow +1. SeverityEnum.SeverityEnumMedium +1. SupportedCloudEnum.SupportedCloudEnumAWS +1. SupportedCloudEnum.SupportedCloudEnumGCP +1. TaskUpdateActionType.Activate +1. TaskUpdateActionType.Close +1. TaskUpdateActionType.Dismiss +1. TaskUpdateActionType.Resolve +1. TaskUpdateActionType.Start + +### New Funcs + +1. *Connector.UnmarshalJSON([]byte) error +1. *ConnectorProperties.UnmarshalJSON([]byte) error +1. *ConnectorsListIterator.Next() error +1. *ConnectorsListIterator.NextWithContext(context.Context) error +1. *ConnectorsListPage.Next() error +1. *ConnectorsListPage.NextWithContext(context.Context) error +1. *CustomAssessmentAutomation.UnmarshalJSON([]byte) error +1. *CustomAssessmentAutomationRequest.UnmarshalJSON([]byte) error +1. *CustomAssessmentAutomationsListResultIterator.Next() error +1. *CustomAssessmentAutomationsListResultIterator.NextWithContext(context.Context) error +1. *CustomAssessmentAutomationsListResultPage.Next() error +1. *CustomAssessmentAutomationsListResultPage.NextWithContext(context.Context) error +1. *CustomEntityStoreAssignment.UnmarshalJSON([]byte) error +1. *CustomEntityStoreAssignmentRequest.UnmarshalJSON([]byte) error +1. *CustomEntityStoreAssignmentsListResultIterator.Next() error +1. *CustomEntityStoreAssignmentsListResultIterator.NextWithContext(context.Context) error +1. *CustomEntityStoreAssignmentsListResultPage.Next() error +1. *CustomEntityStoreAssignmentsListResultPage.NextWithContext(context.Context) error +1. *IngestionSettingListIterator.Next() error +1. *IngestionSettingListIterator.NextWithContext(context.Context) error +1. *IngestionSettingListPage.Next() error +1. *IngestionSettingListPage.NextWithContext(context.Context) error +1. *MdeOnboardingData.UnmarshalJSON([]byte) error +1. *SettingModel.UnmarshalJSON([]byte) error +1. *SettingsList.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. CloudOffering.AsBasicCloudOffering() (BasicCloudOffering, bool) +1. CloudOffering.AsCloudOffering() (*CloudOffering, bool) +1. CloudOffering.AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) +1. CloudOffering.AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) +1. CloudOffering.AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) +1. CloudOffering.AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) +1. CloudOffering.MarshalJSON() ([]byte, error) +1. Connector.MarshalJSON() ([]byte, error) +1. ConnectorsClient.ListByResourceGroup(context.Context, string) (ConnectorsListPage, error) +1. ConnectorsClient.ListByResourceGroupComplete(context.Context, string) (ConnectorsListIterator, error) +1. ConnectorsClient.ListByResourceGroupPreparer(context.Context, string) (*http.Request, error) +1. ConnectorsClient.ListByResourceGroupResponder(*http.Response) (ConnectorsList, error) +1. ConnectorsClient.ListByResourceGroupSender(*http.Request) (*http.Response, error) +1. ConnectorsClient.Update(context.Context, string, string, Connector) (Connector, error) +1. ConnectorsClient.UpdatePreparer(context.Context, string, string, Connector) (*http.Request, error) +1. ConnectorsClient.UpdateResponder(*http.Response) (Connector, error) +1. ConnectorsClient.UpdateSender(*http.Request) (*http.Response, error) +1. ConnectorsGroupClient.CreateOrUpdate(context.Context, string, ConnectorSetting) (ConnectorSetting, error) +1. ConnectorsGroupClient.CreateOrUpdatePreparer(context.Context, string, ConnectorSetting) (*http.Request, error) +1. ConnectorsGroupClient.CreateOrUpdateResponder(*http.Response) (ConnectorSetting, error) +1. ConnectorsGroupClient.CreateOrUpdateSender(*http.Request) (*http.Response, error) +1. ConnectorsGroupClient.Delete(context.Context, string) (autorest.Response, error) +1. ConnectorsGroupClient.DeletePreparer(context.Context, string) (*http.Request, error) +1. ConnectorsGroupClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. ConnectorsGroupClient.DeleteSender(*http.Request) (*http.Response, error) +1. ConnectorsGroupClient.Get(context.Context, string) (ConnectorSetting, error) +1. ConnectorsGroupClient.GetPreparer(context.Context, string) (*http.Request, error) +1. ConnectorsGroupClient.GetResponder(*http.Response) (ConnectorSetting, error) +1. ConnectorsGroupClient.GetSender(*http.Request) (*http.Response, error) +1. ConnectorsGroupClient.List(context.Context) (ConnectorSettingListPage, error) +1. ConnectorsGroupClient.ListComplete(context.Context) (ConnectorSettingListIterator, error) +1. ConnectorsGroupClient.ListPreparer(context.Context) (*http.Request, error) +1. ConnectorsGroupClient.ListResponder(*http.Response) (ConnectorSettingList, error) +1. ConnectorsGroupClient.ListSender(*http.Request) (*http.Response, error) +1. ConnectorsList.IsEmpty() bool +1. ConnectorsList.MarshalJSON() ([]byte, error) +1. ConnectorsListIterator.NotDone() bool +1. ConnectorsListIterator.Response() ConnectorsList +1. ConnectorsListIterator.Value() Connector +1. ConnectorsListPage.NotDone() bool +1. ConnectorsListPage.Response() ConnectorsList +1. ConnectorsListPage.Values() []Connector +1. CspmMonitorAwsOffering.AsBasicCloudOffering() (BasicCloudOffering, bool) +1. CspmMonitorAwsOffering.AsCloudOffering() (*CloudOffering, bool) +1. CspmMonitorAwsOffering.AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) +1. CspmMonitorAwsOffering.AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) +1. CspmMonitorAwsOffering.AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) +1. CspmMonitorAwsOffering.AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) +1. CspmMonitorAwsOffering.MarshalJSON() ([]byte, error) +1. CustomAssessmentAutomation.MarshalJSON() ([]byte, error) +1. CustomAssessmentAutomationRequest.MarshalJSON() ([]byte, error) +1. CustomAssessmentAutomationsClient.Create(context.Context, string, string, CustomAssessmentAutomationRequest) (CustomAssessmentAutomation, error) +1. CustomAssessmentAutomationsClient.CreatePreparer(context.Context, string, string, CustomAssessmentAutomationRequest) (*http.Request, error) +1. CustomAssessmentAutomationsClient.CreateResponder(*http.Response) (CustomAssessmentAutomation, error) +1. CustomAssessmentAutomationsClient.CreateSender(*http.Request) (*http.Response, error) +1. CustomAssessmentAutomationsClient.Delete(context.Context, string, string) (autorest.Response, error) +1. CustomAssessmentAutomationsClient.DeletePreparer(context.Context, string, string) (*http.Request, error) +1. CustomAssessmentAutomationsClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. CustomAssessmentAutomationsClient.DeleteSender(*http.Request) (*http.Response, error) +1. CustomAssessmentAutomationsClient.Get(context.Context, string, string) (CustomAssessmentAutomation, error) +1. CustomAssessmentAutomationsClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. CustomAssessmentAutomationsClient.GetResponder(*http.Response) (CustomAssessmentAutomation, error) +1. CustomAssessmentAutomationsClient.GetSender(*http.Request) (*http.Response, error) +1. CustomAssessmentAutomationsClient.ListByResourceGroup(context.Context, string) (CustomAssessmentAutomationsListResultPage, error) +1. CustomAssessmentAutomationsClient.ListByResourceGroupComplete(context.Context, string) (CustomAssessmentAutomationsListResultIterator, error) +1. CustomAssessmentAutomationsClient.ListByResourceGroupPreparer(context.Context, string) (*http.Request, error) +1. CustomAssessmentAutomationsClient.ListByResourceGroupResponder(*http.Response) (CustomAssessmentAutomationsListResult, error) +1. CustomAssessmentAutomationsClient.ListByResourceGroupSender(*http.Request) (*http.Response, error) +1. CustomAssessmentAutomationsClient.ListBySubscription(context.Context) (CustomAssessmentAutomationsListResultPage, error) +1. CustomAssessmentAutomationsClient.ListBySubscriptionComplete(context.Context) (CustomAssessmentAutomationsListResultIterator, error) +1. CustomAssessmentAutomationsClient.ListBySubscriptionPreparer(context.Context) (*http.Request, error) +1. CustomAssessmentAutomationsClient.ListBySubscriptionResponder(*http.Response) (CustomAssessmentAutomationsListResult, error) +1. CustomAssessmentAutomationsClient.ListBySubscriptionSender(*http.Request) (*http.Response, error) +1. CustomAssessmentAutomationsListResult.IsEmpty() bool +1. CustomAssessmentAutomationsListResult.MarshalJSON() ([]byte, error) +1. CustomAssessmentAutomationsListResultIterator.NotDone() bool +1. CustomAssessmentAutomationsListResultIterator.Response() CustomAssessmentAutomationsListResult +1. CustomAssessmentAutomationsListResultIterator.Value() CustomAssessmentAutomation +1. CustomAssessmentAutomationsListResultPage.NotDone() bool +1. CustomAssessmentAutomationsListResultPage.Response() CustomAssessmentAutomationsListResult +1. CustomAssessmentAutomationsListResultPage.Values() []CustomAssessmentAutomation +1. CustomEntityStoreAssignment.MarshalJSON() ([]byte, error) +1. CustomEntityStoreAssignmentRequest.MarshalJSON() ([]byte, error) +1. CustomEntityStoreAssignmentsClient.Create(context.Context, string, string, CustomEntityStoreAssignmentRequest) (CustomEntityStoreAssignment, error) +1. CustomEntityStoreAssignmentsClient.CreatePreparer(context.Context, string, string, CustomEntityStoreAssignmentRequest) (*http.Request, error) +1. CustomEntityStoreAssignmentsClient.CreateResponder(*http.Response) (CustomEntityStoreAssignment, error) +1. CustomEntityStoreAssignmentsClient.CreateSender(*http.Request) (*http.Response, error) +1. CustomEntityStoreAssignmentsClient.Delete(context.Context, string, string) (autorest.Response, error) +1. CustomEntityStoreAssignmentsClient.DeletePreparer(context.Context, string, string) (*http.Request, error) +1. CustomEntityStoreAssignmentsClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. CustomEntityStoreAssignmentsClient.DeleteSender(*http.Request) (*http.Response, error) +1. CustomEntityStoreAssignmentsClient.Get(context.Context, string, string) (CustomEntityStoreAssignment, error) +1. CustomEntityStoreAssignmentsClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. CustomEntityStoreAssignmentsClient.GetResponder(*http.Response) (CustomEntityStoreAssignment, error) +1. CustomEntityStoreAssignmentsClient.GetSender(*http.Request) (*http.Response, error) +1. CustomEntityStoreAssignmentsClient.ListByResourceGroup(context.Context, string) (CustomEntityStoreAssignmentsListResultPage, error) +1. CustomEntityStoreAssignmentsClient.ListByResourceGroupComplete(context.Context, string) (CustomEntityStoreAssignmentsListResultIterator, error) +1. CustomEntityStoreAssignmentsClient.ListByResourceGroupPreparer(context.Context, string) (*http.Request, error) +1. CustomEntityStoreAssignmentsClient.ListByResourceGroupResponder(*http.Response) (CustomEntityStoreAssignmentsListResult, error) +1. CustomEntityStoreAssignmentsClient.ListByResourceGroupSender(*http.Request) (*http.Response, error) +1. CustomEntityStoreAssignmentsClient.ListBySubscription(context.Context) (CustomEntityStoreAssignmentsListResultPage, error) +1. CustomEntityStoreAssignmentsClient.ListBySubscriptionComplete(context.Context) (CustomEntityStoreAssignmentsListResultIterator, error) +1. CustomEntityStoreAssignmentsClient.ListBySubscriptionPreparer(context.Context) (*http.Request, error) +1. CustomEntityStoreAssignmentsClient.ListBySubscriptionResponder(*http.Response) (CustomEntityStoreAssignmentsListResult, error) +1. CustomEntityStoreAssignmentsClient.ListBySubscriptionSender(*http.Request) (*http.Response, error) +1. CustomEntityStoreAssignmentsListResult.IsEmpty() bool +1. CustomEntityStoreAssignmentsListResult.MarshalJSON() ([]byte, error) +1. CustomEntityStoreAssignmentsListResultIterator.NotDone() bool +1. CustomEntityStoreAssignmentsListResultIterator.Response() CustomEntityStoreAssignmentsListResult +1. CustomEntityStoreAssignmentsListResultIterator.Value() CustomEntityStoreAssignment +1. CustomEntityStoreAssignmentsListResultPage.NotDone() bool +1. CustomEntityStoreAssignmentsListResultPage.Response() CustomEntityStoreAssignmentsListResult +1. CustomEntityStoreAssignmentsListResultPage.Values() []CustomEntityStoreAssignment +1. DataExportSetting.AsBasicSetting() (BasicSetting, bool) +1. DataExportSetting.AsDataExportSetting() (*DataExportSetting, bool) +1. DataExportSetting.AsSetting() (*Setting, bool) +1. DefenderForContainersAwsOffering.AsBasicCloudOffering() (BasicCloudOffering, bool) +1. DefenderForContainersAwsOffering.AsCloudOffering() (*CloudOffering, bool) +1. DefenderForContainersAwsOffering.AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) +1. DefenderForContainersAwsOffering.AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) +1. DefenderForContainersAwsOffering.AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) +1. DefenderForContainersAwsOffering.AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) +1. DefenderForContainersAwsOffering.MarshalJSON() ([]byte, error) +1. DefenderForServersAwsOffering.AsBasicCloudOffering() (BasicCloudOffering, bool) +1. DefenderForServersAwsOffering.AsCloudOffering() (*CloudOffering, bool) +1. DefenderForServersAwsOffering.AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) +1. DefenderForServersAwsOffering.AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) +1. DefenderForServersAwsOffering.AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) +1. DefenderForServersAwsOffering.AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) +1. DefenderForServersAwsOffering.MarshalJSON() ([]byte, error) +1. ErrorAdditionalInfo.MarshalJSON() ([]byte, error) +1. InformationProtectionAwsOffering.AsBasicCloudOffering() (BasicCloudOffering, bool) +1. InformationProtectionAwsOffering.AsCloudOffering() (*CloudOffering, bool) +1. InformationProtectionAwsOffering.AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) +1. InformationProtectionAwsOffering.AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) +1. InformationProtectionAwsOffering.AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) +1. InformationProtectionAwsOffering.AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) +1. InformationProtectionAwsOffering.MarshalJSON() ([]byte, error) +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. MdeOnboardingData.MarshalJSON() ([]byte, error) +1. MdeOnboardingsClient.Get(context.Context) (MdeOnboardingData, error) +1. MdeOnboardingsClient.GetPreparer(context.Context) (*http.Request, error) +1. MdeOnboardingsClient.GetResponder(*http.Response) (MdeOnboardingData, error) +1. MdeOnboardingsClient.GetSender(*http.Request) (*http.Response, error) +1. MdeOnboardingsClient.List(context.Context) (MdeOnboardingDataList, error) +1. MdeOnboardingsClient.ListPreparer(context.Context) (*http.Request, error) +1. MdeOnboardingsClient.ListResponder(*http.Response) (MdeOnboardingDataList, error) +1. MdeOnboardingsClient.ListSender(*http.Request) (*http.Response, error) +1. NewConnectorsGroupClient(string) ConnectorsGroupClient +1. NewConnectorsGroupClientWithBaseURI(string, string) ConnectorsGroupClient +1. NewConnectorsListIterator(ConnectorsListPage) ConnectorsListIterator +1. NewConnectorsListPage(ConnectorsList, func(context.Context, ConnectorsList) (ConnectorsList, error)) ConnectorsListPage +1. NewCustomAssessmentAutomationsClient(string) CustomAssessmentAutomationsClient +1. NewCustomAssessmentAutomationsClientWithBaseURI(string, string) CustomAssessmentAutomationsClient +1. NewCustomAssessmentAutomationsListResultIterator(CustomAssessmentAutomationsListResultPage) CustomAssessmentAutomationsListResultIterator +1. NewCustomAssessmentAutomationsListResultPage(CustomAssessmentAutomationsListResult, func(context.Context, CustomAssessmentAutomationsListResult) (CustomAssessmentAutomationsListResult, error)) CustomAssessmentAutomationsListResultPage +1. NewCustomEntityStoreAssignmentsClient(string) CustomEntityStoreAssignmentsClient +1. NewCustomEntityStoreAssignmentsClientWithBaseURI(string, string) CustomEntityStoreAssignmentsClient +1. NewCustomEntityStoreAssignmentsListResultIterator(CustomEntityStoreAssignmentsListResultPage) CustomEntityStoreAssignmentsListResultIterator +1. NewCustomEntityStoreAssignmentsListResultPage(CustomEntityStoreAssignmentsListResult, func(context.Context, CustomEntityStoreAssignmentsListResult) (CustomEntityStoreAssignmentsListResult, error)) CustomEntityStoreAssignmentsListResultPage +1. NewIngestionSettingListIterator(IngestionSettingListPage) IngestionSettingListIterator +1. NewIngestionSettingListPage(IngestionSettingList, func(context.Context, IngestionSettingList) (IngestionSettingList, error)) IngestionSettingListPage +1. NewIngestionSettingsClient(string) IngestionSettingsClient +1. NewIngestionSettingsClientWithBaseURI(string, string) IngestionSettingsClient +1. NewMdeOnboardingsClient(string) MdeOnboardingsClient +1. NewMdeOnboardingsClientWithBaseURI(string, string) MdeOnboardingsClient +1. NewSoftwareInventoriesClient(string) SoftwareInventoriesClient +1. NewSoftwareInventoriesClientWithBaseURI(string, string) SoftwareInventoriesClient +1. NewSoftwaresListIterator(SoftwaresListPage) SoftwaresListIterator +1. NewSoftwaresListPage(SoftwaresList, func(context.Context, SoftwaresList) (SoftwaresList, error)) SoftwaresListPage +1. PossibleCloudNameValues() []CloudName +1. PossibleCreatedByTypeValues() []CreatedByType +1. PossibleEndOfSupportStatusValues() []EndOfSupportStatus +1. PossibleInformationProtectionPolicyNameValues() []InformationProtectionPolicyName +1. PossibleKindEnum1Values() []KindEnum1 +1. PossibleOfferingTypeValues() []OfferingType +1. PossibleOrganizationMembershipTypeValues() []OrganizationMembershipType +1. PossibleSeverityEnumValues() []SeverityEnum +1. PossibleSupportedCloudEnumValues() []SupportedCloudEnum +1. PossibleTaskUpdateActionTypeValues() []TaskUpdateActionType +1. Setting.AsBasicSetting() (BasicSetting, bool) +1. Setting.AsDataExportSetting() (*DataExportSetting, bool) +1. Setting.AsSetting() (*Setting, 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 + +### Struct Changes + +#### New Structs + +1. CloudOffering +1. ConnectionStrings +1. Connector +1. ConnectorProperties +1. ConnectorPropertiesOrganizationalData +1. ConnectorsGroupClient +1. ConnectorsList +1. ConnectorsListIterator +1. ConnectorsListPage +1. CspmMonitorAwsOffering +1. CspmMonitorAwsOfferingNativeCloudConnection +1. CustomAssessmentAutomation +1. CustomAssessmentAutomationProperties +1. CustomAssessmentAutomationRequest +1. CustomAssessmentAutomationRequestProperties +1. CustomAssessmentAutomationsClient +1. CustomAssessmentAutomationsListResult +1. CustomAssessmentAutomationsListResultIterator +1. CustomAssessmentAutomationsListResultPage +1. CustomEntityStoreAssignment +1. CustomEntityStoreAssignmentProperties +1. CustomEntityStoreAssignmentRequest +1. CustomEntityStoreAssignmentRequestProperties +1. CustomEntityStoreAssignmentsClient +1. CustomEntityStoreAssignmentsListResult +1. CustomEntityStoreAssignmentsListResultIterator +1. CustomEntityStoreAssignmentsListResultPage +1. DefenderForContainersAwsOffering +1. DefenderForContainersAwsOfferingCloudWatchToKinesis +1. DefenderForContainersAwsOfferingKinesisToS3 +1. DefenderForContainersAwsOfferingKubernetesScubaReader +1. DefenderForContainersAwsOfferingKubernetesService +1. DefenderForServersAwsOffering +1. DefenderForServersAwsOfferingArcAutoProvisioning +1. DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata +1. DefenderForServersAwsOfferingDefenderForServers +1. ErrorAdditionalInfo +1. InformationProtectionAwsOffering +1. InformationProtectionAwsOfferingInformationProtection +1. IngestionConnectionString +1. IngestionSetting +1. IngestionSettingList +1. IngestionSettingListIterator +1. IngestionSettingListPage +1. IngestionSettingToken +1. IngestionSettingsClient +1. MdeOnboardingData +1. MdeOnboardingDataList +1. MdeOnboardingDataProperties +1. MdeOnboardingsClient +1. SettingModel +1. Software +1. SoftwareInventoriesClient +1. SoftwareProperties +1. SoftwaresList +1. SoftwaresListIterator +1. SoftwaresListPage +1. SystemData + +#### New Struct Fields + +1. CloudErrorBody.AdditionalInfo +1. CloudErrorBody.Details +1. CloudErrorBody.Target diff --git a/services/preview/security/mgmt/v2.0/security/_meta.json b/services/preview/security/mgmt/v2.0/security/_meta.json index 6b448a3394c6..5cffec5f4502 100644 --- a/services/preview/security/mgmt/v2.0/security/_meta.json +++ b/services/preview/security/mgmt/v2.0/security/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "1fcd59731c6317078adb20e3cb954e073ab2de40", "readme": "/_/azure-rest-api-specs/specification/security/resource-manager/readme.md", "tag": "package-composite-v2", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/security/mgmt/v2.0/security/adaptiveapplicationcontrols.go b/services/preview/security/mgmt/v2.0/security/adaptiveapplicationcontrols.go index 104e40be78d8..77207c193667 100644 --- a/services/preview/security/mgmt/v2.0/security/adaptiveapplicationcontrols.go +++ b/services/preview/security/mgmt/v2.0/security/adaptiveapplicationcontrols.go @@ -21,21 +21,23 @@ type AdaptiveApplicationControlsClient struct { } // NewAdaptiveApplicationControlsClient creates an instance of the AdaptiveApplicationControlsClient client. -func NewAdaptiveApplicationControlsClient(subscriptionID string, ascLocation string) AdaptiveApplicationControlsClient { - return NewAdaptiveApplicationControlsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAdaptiveApplicationControlsClient(subscriptionID string) AdaptiveApplicationControlsClient { + return NewAdaptiveApplicationControlsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAdaptiveApplicationControlsClientWithBaseURI creates an instance of the AdaptiveApplicationControlsClient 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 NewAdaptiveApplicationControlsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AdaptiveApplicationControlsClient { - return AdaptiveApplicationControlsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAdaptiveApplicationControlsClientWithBaseURI(baseURI string, subscriptionID string) AdaptiveApplicationControlsClient { + return AdaptiveApplicationControlsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Delete delete an application control VM/server group // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // groupName - name of an application control VM/server group -func (client AdaptiveApplicationControlsClient) Delete(ctx context.Context, groupName string) (result autorest.Response, err error) { +func (client AdaptiveApplicationControlsClient) Delete(ctx context.Context, ascLocation string, groupName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveApplicationControlsClient.Delete") defer func() { @@ -52,7 +54,7 @@ func (client AdaptiveApplicationControlsClient) Delete(ctx context.Context, grou return result, validation.NewError("security.AdaptiveApplicationControlsClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, groupName) + req, err := client.DeletePreparer(ctx, ascLocation, groupName) if err != nil { err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Delete", nil, "Failure preparing request") return @@ -75,9 +77,9 @@ func (client AdaptiveApplicationControlsClient) Delete(ctx context.Context, grou } // DeletePreparer prepares the Delete request. -func (client AdaptiveApplicationControlsClient) DeletePreparer(ctx context.Context, groupName string) (*http.Request, error) { +func (client AdaptiveApplicationControlsClient) DeletePreparer(ctx context.Context, ascLocation string, groupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "groupName": autorest.Encode("path", groupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -114,8 +116,10 @@ func (client AdaptiveApplicationControlsClient) DeleteResponder(resp *http.Respo // Get gets an application control VM/server group. // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // groupName - name of an application control VM/server group -func (client AdaptiveApplicationControlsClient) Get(ctx context.Context, groupName string) (result AppWhitelistingGroup, err error) { +func (client AdaptiveApplicationControlsClient) Get(ctx context.Context, ascLocation string, groupName string) (result AppWhitelistingGroup, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveApplicationControlsClient.Get") defer func() { @@ -132,7 +136,7 @@ func (client AdaptiveApplicationControlsClient) Get(ctx context.Context, groupNa return result, validation.NewError("security.AdaptiveApplicationControlsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, groupName) + req, err := client.GetPreparer(ctx, ascLocation, groupName) if err != nil { err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Get", nil, "Failure preparing request") return @@ -155,9 +159,9 @@ func (client AdaptiveApplicationControlsClient) Get(ctx context.Context, groupNa } // GetPreparer prepares the Get request. -func (client AdaptiveApplicationControlsClient) GetPreparer(ctx context.Context, groupName string) (*http.Request, error) { +func (client AdaptiveApplicationControlsClient) GetPreparer(ctx context.Context, ascLocation string, groupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "groupName": autorest.Encode("path", groupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -281,9 +285,11 @@ func (client AdaptiveApplicationControlsClient) ListResponder(resp *http.Respons // Put update an application control VM/server group // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // groupName - name of an application control VM/server group // body - the updated VM/server group data -func (client AdaptiveApplicationControlsClient) Put(ctx context.Context, groupName string, body AppWhitelistingPutGroupData) (result AppWhitelistingGroup, err error) { +func (client AdaptiveApplicationControlsClient) Put(ctx context.Context, ascLocation string, groupName string, body AppWhitelistingPutGroupData) (result AppWhitelistingGroup, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveApplicationControlsClient.Put") defer func() { @@ -300,7 +306,7 @@ func (client AdaptiveApplicationControlsClient) Put(ctx context.Context, groupNa return result, validation.NewError("security.AdaptiveApplicationControlsClient", "Put", err.Error()) } - req, err := client.PutPreparer(ctx, groupName, body) + req, err := client.PutPreparer(ctx, ascLocation, groupName, body) if err != nil { err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Put", nil, "Failure preparing request") return @@ -323,9 +329,9 @@ func (client AdaptiveApplicationControlsClient) Put(ctx context.Context, groupNa } // PutPreparer prepares the Put request. -func (client AdaptiveApplicationControlsClient) PutPreparer(ctx context.Context, groupName string, body AppWhitelistingPutGroupData) (*http.Request, error) { +func (client AdaptiveApplicationControlsClient) PutPreparer(ctx context.Context, ascLocation string, groupName string, body AppWhitelistingPutGroupData) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "groupName": autorest.Encode("path", groupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } diff --git a/services/preview/security/mgmt/v2.0/security/adaptivenetworkhardenings.go b/services/preview/security/mgmt/v2.0/security/adaptivenetworkhardenings.go index 8ba5351c1e7b..58e967ea0c5c 100644 --- a/services/preview/security/mgmt/v2.0/security/adaptivenetworkhardenings.go +++ b/services/preview/security/mgmt/v2.0/security/adaptivenetworkhardenings.go @@ -21,15 +21,15 @@ type AdaptiveNetworkHardeningsClient struct { } // NewAdaptiveNetworkHardeningsClient creates an instance of the AdaptiveNetworkHardeningsClient client. -func NewAdaptiveNetworkHardeningsClient(subscriptionID string, ascLocation string) AdaptiveNetworkHardeningsClient { - return NewAdaptiveNetworkHardeningsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAdaptiveNetworkHardeningsClient(subscriptionID string) AdaptiveNetworkHardeningsClient { + return NewAdaptiveNetworkHardeningsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAdaptiveNetworkHardeningsClientWithBaseURI creates an instance of the AdaptiveNetworkHardeningsClient 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 NewAdaptiveNetworkHardeningsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AdaptiveNetworkHardeningsClient { - return AdaptiveNetworkHardeningsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAdaptiveNetworkHardeningsClientWithBaseURI(baseURI string, subscriptionID string) AdaptiveNetworkHardeningsClient { + return AdaptiveNetworkHardeningsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Enforce enforces the given rules on the NSG(s) listed in the request diff --git a/services/preview/security/mgmt/v2.0/security/advancedthreatprotection.go b/services/preview/security/mgmt/v2.0/security/advancedthreatprotection.go index 0e6c537e4376..2c2131dd6167 100644 --- a/services/preview/security/mgmt/v2.0/security/advancedthreatprotection.go +++ b/services/preview/security/mgmt/v2.0/security/advancedthreatprotection.go @@ -20,15 +20,15 @@ type AdvancedThreatProtectionClient struct { } // NewAdvancedThreatProtectionClient creates an instance of the AdvancedThreatProtectionClient client. -func NewAdvancedThreatProtectionClient(subscriptionID string, ascLocation string) AdvancedThreatProtectionClient { - return NewAdvancedThreatProtectionClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAdvancedThreatProtectionClient(subscriptionID string) AdvancedThreatProtectionClient { + return NewAdvancedThreatProtectionClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAdvancedThreatProtectionClientWithBaseURI creates an instance of the AdvancedThreatProtectionClient 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 NewAdvancedThreatProtectionClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AdvancedThreatProtectionClient { - return AdvancedThreatProtectionClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAdvancedThreatProtectionClientWithBaseURI(baseURI string, subscriptionID string) AdvancedThreatProtectionClient { + return AdvancedThreatProtectionClient{NewWithBaseURI(baseURI, subscriptionID)} } // Create creates or updates the Advanced Threat Protection settings on a specified resource. diff --git a/services/preview/security/mgmt/v2.0/security/alerts.go b/services/preview/security/mgmt/v2.0/security/alerts.go index ac584c7e94c8..678a6fef8b2f 100644 --- a/services/preview/security/mgmt/v2.0/security/alerts.go +++ b/services/preview/security/mgmt/v2.0/security/alerts.go @@ -21,22 +21,24 @@ type AlertsClient struct { } // NewAlertsClient creates an instance of the AlertsClient client. -func NewAlertsClient(subscriptionID string, ascLocation string) AlertsClient { - return NewAlertsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAlertsClient(subscriptionID string) AlertsClient { + return NewAlertsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAlertsClientWithBaseURI creates an instance of the AlertsClient 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 NewAlertsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AlertsClient { - return AlertsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAlertsClientWithBaseURI(baseURI string, subscriptionID string) AlertsClient { + return AlertsClient{NewWithBaseURI(baseURI, subscriptionID)} } // GetResourceGroupLevelAlerts get an alert that is associated a resource group or a resource in a resource group // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // 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) GetResourceGroupLevelAlerts(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (result Alert, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.GetResourceGroupLevelAlerts") defer func() { @@ -57,7 +59,7 @@ func (client AlertsClient) GetResourceGroupLevelAlerts(ctx context.Context, aler return result, validation.NewError("security.AlertsClient", "GetResourceGroupLevelAlerts", err.Error()) } - req, err := client.GetResourceGroupLevelAlertsPreparer(ctx, alertName, resourceGroupName) + req, err := client.GetResourceGroupLevelAlertsPreparer(ctx, ascLocation, alertName, resourceGroupName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetResourceGroupLevelAlerts", nil, "Failure preparing request") return @@ -80,10 +82,10 @@ func (client AlertsClient) GetResourceGroupLevelAlerts(ctx context.Context, aler } // GetResourceGroupLevelAlertsPreparer prepares the GetResourceGroupLevelAlerts request. -func (client AlertsClient) GetResourceGroupLevelAlertsPreparer(ctx context.Context, alertName string, resourceGroupName string) (*http.Request, error) { +func (client AlertsClient) GetResourceGroupLevelAlertsPreparer(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -121,8 +123,10 @@ func (client AlertsClient) GetResourceGroupLevelAlertsResponder(resp *http.Respo // GetSubscriptionLevelAlert get an alert that is associated with a subscription // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // alertName - name of the alert object -func (client AlertsClient) GetSubscriptionLevelAlert(ctx context.Context, alertName string) (result Alert, err error) { +func (client AlertsClient) GetSubscriptionLevelAlert(ctx context.Context, ascLocation string, alertName string) (result Alert, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.GetSubscriptionLevelAlert") defer func() { @@ -139,7 +143,7 @@ func (client AlertsClient) GetSubscriptionLevelAlert(ctx context.Context, alertN return result, validation.NewError("security.AlertsClient", "GetSubscriptionLevelAlert", err.Error()) } - req, err := client.GetSubscriptionLevelAlertPreparer(ctx, alertName) + req, err := client.GetSubscriptionLevelAlertPreparer(ctx, ascLocation, alertName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetSubscriptionLevelAlert", nil, "Failure preparing request") return @@ -162,10 +166,10 @@ func (client AlertsClient) GetSubscriptionLevelAlert(ctx context.Context, alertN } // GetSubscriptionLevelAlertPreparer prepares the GetSubscriptionLevelAlert request. -func (client AlertsClient) GetSubscriptionLevelAlertPreparer(ctx context.Context, alertName string) (*http.Request, error) { +func (client AlertsClient) GetSubscriptionLevelAlertPreparer(ctx context.Context, ascLocation string, alertName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -484,6 +488,8 @@ func (client AlertsClient) ListByResourceGroupComplete(ctx context.Context, reso // ListResourceGroupLevelAlertsByRegion list all the alerts that are associated with the resource group that are stored // in a specific location // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. // filter - oData filter. Optional. @@ -491,7 +497,7 @@ func (client AlertsClient) ListByResourceGroupComplete(ctx context.Context, reso // expand - oData expand. Optional. // autoDismissRuleName - the name of an existing auto dismiss rule. Use it to simulate the rule on existing // alerts and get the alerts that would have been dismissed if the rule was enabled when the alert was created -func (client AlertsClient) ListResourceGroupLevelAlertsByRegion(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListPage, err error) { +func (client AlertsClient) ListResourceGroupLevelAlertsByRegion(ctx context.Context, ascLocation string, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListResourceGroupLevelAlertsByRegion") defer func() { @@ -513,7 +519,7 @@ func (client AlertsClient) ListResourceGroupLevelAlertsByRegion(ctx context.Cont } result.fn = client.listResourceGroupLevelAlertsByRegionNextResults - req, err := client.ListResourceGroupLevelAlertsByRegionPreparer(ctx, resourceGroupName, filter, selectParameter, expand, autoDismissRuleName) + req, err := client.ListResourceGroupLevelAlertsByRegionPreparer(ctx, ascLocation, resourceGroupName, filter, selectParameter, expand, autoDismissRuleName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListResourceGroupLevelAlertsByRegion", nil, "Failure preparing request") return @@ -540,9 +546,9 @@ func (client AlertsClient) ListResourceGroupLevelAlertsByRegion(ctx context.Cont } // ListResourceGroupLevelAlertsByRegionPreparer prepares the ListResourceGroupLevelAlertsByRegion request. -func (client AlertsClient) ListResourceGroupLevelAlertsByRegionPreparer(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (*http.Request, error) { +func (client AlertsClient) ListResourceGroupLevelAlertsByRegionPreparer(ctx context.Context, ascLocation string, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -612,7 +618,7 @@ func (client AlertsClient) listResourceGroupLevelAlertsByRegionNextResults(ctx c } // ListResourceGroupLevelAlertsByRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AlertsClient) ListResourceGroupLevelAlertsByRegionComplete(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListIterator, err error) { +func (client AlertsClient) ListResourceGroupLevelAlertsByRegionComplete(ctx context.Context, ascLocation string, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListResourceGroupLevelAlertsByRegion") defer func() { @@ -623,19 +629,21 @@ func (client AlertsClient) ListResourceGroupLevelAlertsByRegionComplete(ctx cont tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListResourceGroupLevelAlertsByRegion(ctx, resourceGroupName, filter, selectParameter, expand, autoDismissRuleName) + result.page, err = client.ListResourceGroupLevelAlertsByRegion(ctx, ascLocation, resourceGroupName, filter, selectParameter, expand, autoDismissRuleName) return } // ListSubscriptionLevelAlertsByRegion list all the alerts that are associated with the subscription that are stored in // a specific location // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // filter - oData filter. Optional. // selectParameter - oData select. Optional. // expand - oData expand. Optional. // autoDismissRuleName - the name of an existing auto dismiss rule. Use it to simulate the rule on existing // alerts and get the alerts that would have been dismissed if the rule was enabled when the alert was created -func (client AlertsClient) ListSubscriptionLevelAlertsByRegion(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListPage, err error) { +func (client AlertsClient) ListSubscriptionLevelAlertsByRegion(ctx context.Context, ascLocation string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListSubscriptionLevelAlertsByRegion") defer func() { @@ -653,7 +661,7 @@ func (client AlertsClient) ListSubscriptionLevelAlertsByRegion(ctx context.Conte } result.fn = client.listSubscriptionLevelAlertsByRegionNextResults - req, err := client.ListSubscriptionLevelAlertsByRegionPreparer(ctx, filter, selectParameter, expand, autoDismissRuleName) + req, err := client.ListSubscriptionLevelAlertsByRegionPreparer(ctx, ascLocation, filter, selectParameter, expand, autoDismissRuleName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListSubscriptionLevelAlertsByRegion", nil, "Failure preparing request") return @@ -680,9 +688,9 @@ func (client AlertsClient) ListSubscriptionLevelAlertsByRegion(ctx context.Conte } // ListSubscriptionLevelAlertsByRegionPreparer prepares the ListSubscriptionLevelAlertsByRegion request. -func (client AlertsClient) ListSubscriptionLevelAlertsByRegionPreparer(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (*http.Request, error) { +func (client AlertsClient) ListSubscriptionLevelAlertsByRegionPreparer(ctx context.Context, ascLocation string, filter string, selectParameter string, expand string, autoDismissRuleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -751,7 +759,7 @@ func (client AlertsClient) listSubscriptionLevelAlertsByRegionNextResults(ctx co } // ListSubscriptionLevelAlertsByRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AlertsClient) ListSubscriptionLevelAlertsByRegionComplete(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListIterator, err error) { +func (client AlertsClient) ListSubscriptionLevelAlertsByRegionComplete(ctx context.Context, ascLocation string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListSubscriptionLevelAlertsByRegion") defer func() { @@ -762,16 +770,18 @@ func (client AlertsClient) ListSubscriptionLevelAlertsByRegionComplete(ctx conte tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListSubscriptionLevelAlertsByRegion(ctx, filter, selectParameter, expand, autoDismissRuleName) + result.page, err = client.ListSubscriptionLevelAlertsByRegion(ctx, ascLocation, filter, selectParameter, expand, autoDismissRuleName) return } // UpdateResourceGroupLevelAlertStateToDismiss update the alert's state // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // 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) UpdateResourceGroupLevelAlertStateToDismiss(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateResourceGroupLevelAlertStateToDismiss") defer func() { @@ -792,7 +802,7 @@ func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismiss(ctx conte return result, validation.NewError("security.AlertsClient", "UpdateResourceGroupLevelAlertStateToDismiss", err.Error()) } - req, err := client.UpdateResourceGroupLevelAlertStateToDismissPreparer(ctx, alertName, resourceGroupName) + req, err := client.UpdateResourceGroupLevelAlertStateToDismissPreparer(ctx, ascLocation, alertName, resourceGroupName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelAlertStateToDismiss", nil, "Failure preparing request") return @@ -815,10 +825,10 @@ func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismiss(ctx conte } // UpdateResourceGroupLevelAlertStateToDismissPreparer prepares the UpdateResourceGroupLevelAlertStateToDismiss request. -func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismissPreparer(ctx context.Context, alertName string, resourceGroupName string) (*http.Request, error) { +func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismissPreparer(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -855,10 +865,12 @@ func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismissResponder( // UpdateResourceGroupLevelAlertStateToReactivate update the alert's state // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // 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) UpdateResourceGroupLevelAlertStateToReactivate(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateResourceGroupLevelAlertStateToReactivate") defer func() { @@ -879,7 +891,7 @@ func (client AlertsClient) UpdateResourceGroupLevelAlertStateToReactivate(ctx co return result, validation.NewError("security.AlertsClient", "UpdateResourceGroupLevelAlertStateToReactivate", err.Error()) } - req, err := client.UpdateResourceGroupLevelAlertStateToReactivatePreparer(ctx, alertName, resourceGroupName) + req, err := client.UpdateResourceGroupLevelAlertStateToReactivatePreparer(ctx, ascLocation, alertName, resourceGroupName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelAlertStateToReactivate", nil, "Failure preparing request") return @@ -902,10 +914,10 @@ func (client AlertsClient) UpdateResourceGroupLevelAlertStateToReactivate(ctx co } // UpdateResourceGroupLevelAlertStateToReactivatePreparer prepares the UpdateResourceGroupLevelAlertStateToReactivate request. -func (client AlertsClient) UpdateResourceGroupLevelAlertStateToReactivatePreparer(ctx context.Context, alertName string, resourceGroupName string) (*http.Request, error) { +func (client AlertsClient) UpdateResourceGroupLevelAlertStateToReactivatePreparer(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -942,8 +954,10 @@ func (client AlertsClient) UpdateResourceGroupLevelAlertStateToReactivateRespond // UpdateSubscriptionLevelAlertStateToDismiss update the alert's state // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // alertName - name of the alert object -func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismiss(ctx context.Context, alertName string) (result autorest.Response, err error) { +func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismiss(ctx context.Context, ascLocation string, alertName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateSubscriptionLevelAlertStateToDismiss") defer func() { @@ -960,7 +974,7 @@ func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismiss(ctx contex return result, validation.NewError("security.AlertsClient", "UpdateSubscriptionLevelAlertStateToDismiss", err.Error()) } - req, err := client.UpdateSubscriptionLevelAlertStateToDismissPreparer(ctx, alertName) + req, err := client.UpdateSubscriptionLevelAlertStateToDismissPreparer(ctx, ascLocation, alertName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelAlertStateToDismiss", nil, "Failure preparing request") return @@ -983,10 +997,10 @@ func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismiss(ctx contex } // UpdateSubscriptionLevelAlertStateToDismissPreparer prepares the UpdateSubscriptionLevelAlertStateToDismiss request. -func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismissPreparer(ctx context.Context, alertName string) (*http.Request, error) { +func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismissPreparer(ctx context.Context, ascLocation string, alertName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -1022,8 +1036,10 @@ func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismissResponder(r // UpdateSubscriptionLevelAlertStateToReactivate update the alert's state // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // alertName - name of the alert object -func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivate(ctx context.Context, alertName string) (result autorest.Response, err error) { +func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivate(ctx context.Context, ascLocation string, alertName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateSubscriptionLevelAlertStateToReactivate") defer func() { @@ -1040,7 +1056,7 @@ func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivate(ctx con return result, validation.NewError("security.AlertsClient", "UpdateSubscriptionLevelAlertStateToReactivate", err.Error()) } - req, err := client.UpdateSubscriptionLevelAlertStateToReactivatePreparer(ctx, alertName) + req, err := client.UpdateSubscriptionLevelAlertStateToReactivatePreparer(ctx, ascLocation, alertName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelAlertStateToReactivate", nil, "Failure preparing request") return @@ -1063,10 +1079,10 @@ func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivate(ctx con } // UpdateSubscriptionLevelAlertStateToReactivatePreparer prepares the UpdateSubscriptionLevelAlertStateToReactivate request. -func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivatePreparer(ctx context.Context, alertName string) (*http.Request, error) { +func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivatePreparer(ctx context.Context, ascLocation string, alertName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } diff --git a/services/preview/security/mgmt/v2.0/security/alertssuppressionrules.go b/services/preview/security/mgmt/v2.0/security/alertssuppressionrules.go index 6b7c70e4f188..4ff181fc65c9 100644 --- a/services/preview/security/mgmt/v2.0/security/alertssuppressionrules.go +++ b/services/preview/security/mgmt/v2.0/security/alertssuppressionrules.go @@ -21,15 +21,15 @@ type AlertsSuppressionRulesClient struct { } // NewAlertsSuppressionRulesClient creates an instance of the AlertsSuppressionRulesClient client. -func NewAlertsSuppressionRulesClient(subscriptionID string, ascLocation string) AlertsSuppressionRulesClient { - return NewAlertsSuppressionRulesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAlertsSuppressionRulesClient(subscriptionID string) AlertsSuppressionRulesClient { + return NewAlertsSuppressionRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAlertsSuppressionRulesClientWithBaseURI creates an instance of the AlertsSuppressionRulesClient 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 NewAlertsSuppressionRulesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AlertsSuppressionRulesClient { - return AlertsSuppressionRulesClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAlertsSuppressionRulesClientWithBaseURI(baseURI string, subscriptionID string) AlertsSuppressionRulesClient { + return AlertsSuppressionRulesClient{NewWithBaseURI(baseURI, subscriptionID)} } // Delete delete dismiss alert rule for this subscription. diff --git a/services/preview/security/mgmt/v2.0/security/allowedconnections.go b/services/preview/security/mgmt/v2.0/security/allowedconnections.go index c735ef352802..98e01ff8d5fc 100644 --- a/services/preview/security/mgmt/v2.0/security/allowedconnections.go +++ b/services/preview/security/mgmt/v2.0/security/allowedconnections.go @@ -21,15 +21,15 @@ type AllowedConnectionsClient struct { } // NewAllowedConnectionsClient creates an instance of the AllowedConnectionsClient client. -func NewAllowedConnectionsClient(subscriptionID string, ascLocation string) AllowedConnectionsClient { - return NewAllowedConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAllowedConnectionsClient(subscriptionID string) AllowedConnectionsClient { + return NewAllowedConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAllowedConnectionsClientWithBaseURI creates an instance of the AllowedConnectionsClient 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 NewAllowedConnectionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AllowedConnectionsClient { - return AllowedConnectionsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAllowedConnectionsClientWithBaseURI(baseURI string, subscriptionID string) AllowedConnectionsClient { + return AllowedConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets the list of all possible traffic between resources for the subscription and location, based on connection @@ -37,8 +37,10 @@ func NewAllowedConnectionsClientWithBaseURI(baseURI string, subscriptionID strin // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // connectionType - the type of allowed connections (Internal, External) -func (client AllowedConnectionsClient) Get(ctx context.Context, resourceGroupName string, connectionType ConnectionType) (result AllowedConnectionsResource, err error) { +func (client AllowedConnectionsClient) Get(ctx context.Context, resourceGroupName string, ascLocation string, connectionType ConnectionType) (result AllowedConnectionsResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AllowedConnectionsClient.Get") defer func() { @@ -59,7 +61,7 @@ func (client AllowedConnectionsClient) Get(ctx context.Context, resourceGroupNam return result, validation.NewError("security.AllowedConnectionsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, connectionType) + req, err := client.GetPreparer(ctx, resourceGroupName, ascLocation, connectionType) if err != nil { err = autorest.NewErrorWithError(err, "security.AllowedConnectionsClient", "Get", nil, "Failure preparing request") return @@ -82,9 +84,9 @@ func (client AllowedConnectionsClient) Get(ctx context.Context, resourceGroupNam } // GetPreparer prepares the Get request. -func (client AllowedConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, connectionType ConnectionType) (*http.Request, error) { +func (client AllowedConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, ascLocation string, connectionType ConnectionType) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "connectionType": autorest.Encode("path", connectionType), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -241,7 +243,10 @@ func (client AllowedConnectionsClient) ListComplete(ctx context.Context) (result } // ListByHomeRegion gets the list of all possible traffic between resources for the subscription and location. -func (client AllowedConnectionsClient) ListByHomeRegion(ctx context.Context) (result AllowedConnectionsListPage, err error) { +// Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations +func (client AllowedConnectionsClient) ListByHomeRegion(ctx context.Context, ascLocation string) (result AllowedConnectionsListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AllowedConnectionsClient.ListByHomeRegion") defer func() { @@ -259,7 +264,7 @@ func (client AllowedConnectionsClient) ListByHomeRegion(ctx context.Context) (re } result.fn = client.listByHomeRegionNextResults - req, err := client.ListByHomeRegionPreparer(ctx) + req, err := client.ListByHomeRegionPreparer(ctx, ascLocation) if err != nil { err = autorest.NewErrorWithError(err, "security.AllowedConnectionsClient", "ListByHomeRegion", nil, "Failure preparing request") return @@ -286,9 +291,9 @@ func (client AllowedConnectionsClient) ListByHomeRegion(ctx context.Context) (re } // ListByHomeRegionPreparer prepares the ListByHomeRegion request. -func (client AllowedConnectionsClient) ListByHomeRegionPreparer(ctx context.Context) (*http.Request, error) { +func (client AllowedConnectionsClient) ListByHomeRegionPreparer(ctx context.Context, ascLocation string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -345,7 +350,7 @@ func (client AllowedConnectionsClient) listByHomeRegionNextResults(ctx context.C } // ListByHomeRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AllowedConnectionsClient) ListByHomeRegionComplete(ctx context.Context) (result AllowedConnectionsListIterator, err error) { +func (client AllowedConnectionsClient) ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result AllowedConnectionsListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AllowedConnectionsClient.ListByHomeRegion") defer func() { @@ -356,6 +361,6 @@ func (client AllowedConnectionsClient) ListByHomeRegionComplete(ctx context.Cont tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByHomeRegion(ctx) + result.page, err = client.ListByHomeRegion(ctx, ascLocation) return } diff --git a/services/preview/security/mgmt/v2.0/security/automations.go b/services/preview/security/mgmt/v2.0/security/automations.go index e7011a9534d3..1a586996bcaf 100644 --- a/services/preview/security/mgmt/v2.0/security/automations.go +++ b/services/preview/security/mgmt/v2.0/security/automations.go @@ -21,14 +21,14 @@ type AutomationsClient struct { } // NewAutomationsClient creates an instance of the AutomationsClient client. -func NewAutomationsClient(subscriptionID string, ascLocation string) AutomationsClient { - return NewAutomationsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAutomationsClient(subscriptionID string) AutomationsClient { + return NewAutomationsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAutomationsClientWithBaseURI creates an instance of the AutomationsClient 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 NewAutomationsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AutomationsClient { - return AutomationsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAutomationsClientWithBaseURI(baseURI string, subscriptionID string) AutomationsClient { + return AutomationsClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate creates or updates a security automation. If a security automation is already created and a diff --git a/services/preview/security/mgmt/v2.0/security/autoprovisioningsettings.go b/services/preview/security/mgmt/v2.0/security/autoprovisioningsettings.go index 0fed155d0347..5abc636c42ab 100644 --- a/services/preview/security/mgmt/v2.0/security/autoprovisioningsettings.go +++ b/services/preview/security/mgmt/v2.0/security/autoprovisioningsettings.go @@ -21,15 +21,15 @@ type AutoProvisioningSettingsClient struct { } // NewAutoProvisioningSettingsClient creates an instance of the AutoProvisioningSettingsClient client. -func NewAutoProvisioningSettingsClient(subscriptionID string, ascLocation string) AutoProvisioningSettingsClient { - return NewAutoProvisioningSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAutoProvisioningSettingsClient(subscriptionID string) AutoProvisioningSettingsClient { + return NewAutoProvisioningSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAutoProvisioningSettingsClientWithBaseURI creates an instance of the AutoProvisioningSettingsClient 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 NewAutoProvisioningSettingsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AutoProvisioningSettingsClient { - return AutoProvisioningSettingsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAutoProvisioningSettingsClientWithBaseURI(baseURI string, subscriptionID string) AutoProvisioningSettingsClient { + return AutoProvisioningSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Create details of a specific setting diff --git a/services/preview/security/mgmt/v2.0/security/client.go b/services/preview/security/mgmt/v2.0/security/client.go index 586d9c1a0478..8d050f3fc301 100644 --- a/services/preview/security/mgmt/v2.0/security/client.go +++ b/services/preview/security/mgmt/v2.0/security/client.go @@ -23,21 +23,19 @@ type BaseClient struct { autorest.Client BaseURI string SubscriptionID string - AscLocation string } // New creates an instance of the BaseClient client. -func New(subscriptionID string, ascLocation string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) } // NewWithBaseURI creates an instance of the BaseClient 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 NewWithBaseURI(baseURI string, subscriptionID string, ascLocation string) BaseClient { +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return BaseClient{ Client: autorest.NewClientWithUserAgent(UserAgent()), BaseURI: baseURI, SubscriptionID: subscriptionID, - AscLocation: ascLocation, } } diff --git a/services/preview/security/mgmt/v2.0/security/compliances.go b/services/preview/security/mgmt/v2.0/security/compliances.go index 742bf3ad09b1..b5e7ad8314a3 100644 --- a/services/preview/security/mgmt/v2.0/security/compliances.go +++ b/services/preview/security/mgmt/v2.0/security/compliances.go @@ -20,14 +20,14 @@ type CompliancesClient struct { } // NewCompliancesClient creates an instance of the CompliancesClient client. -func NewCompliancesClient(subscriptionID string, ascLocation string) CompliancesClient { - return NewCompliancesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewCompliancesClient(subscriptionID string) CompliancesClient { + return NewCompliancesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewCompliancesClientWithBaseURI creates an instance of the CompliancesClient 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 NewCompliancesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) CompliancesClient { - return CompliancesClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewCompliancesClientWithBaseURI(baseURI string, subscriptionID string) CompliancesClient { + return CompliancesClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get details of a specific Compliance. diff --git a/services/preview/security/mgmt/v2.0/security/connectors.go b/services/preview/security/mgmt/v2.0/security/connectors.go index 0dd69473fe13..ad5dcc430e99 100644 --- a/services/preview/security/mgmt/v2.0/security/connectors.go +++ b/services/preview/security/mgmt/v2.0/security/connectors.go @@ -21,22 +21,24 @@ type ConnectorsClient struct { } // NewConnectorsClient creates an instance of the ConnectorsClient client. -func NewConnectorsClient(subscriptionID string, ascLocation string) ConnectorsClient { - return NewConnectorsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewConnectorsClient(subscriptionID string) ConnectorsClient { + return NewConnectorsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewConnectorsClientWithBaseURI creates an instance of the ConnectorsClient 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 NewConnectorsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) ConnectorsClient { - return ConnectorsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewConnectorsClientWithBaseURI(baseURI string, subscriptionID string) ConnectorsClient { + return ConnectorsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, -// use either account credentials or role-based authentication. For GCP, use account organization credentials. +// CreateOrUpdate creates or updates a security connector. If a security connector is already created and a subsequent +// request is issued for the same security connector id, then it will be updated. // Parameters: -// connectorName - name of the cloud account connector -// connectorSetting - settings for the cloud account connector -func (client ConnectorsClient) CreateOrUpdate(ctx context.Context, connectorName string, connectorSetting ConnectorSetting) (result ConnectorSetting, err error) { +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// securityConnectorName - the security connector name. +// securityConnector - the security connector resource +func (client ConnectorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector Connector) (result Connector, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsClient.CreateOrUpdate") defer func() { @@ -49,11 +51,15 @@ func (client ConnectorsClient) CreateOrUpdate(ctx context.Context, connectorName } 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 { + 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.ConnectorsClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, connectorName, connectorSetting) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, securityConnectorName, securityConnector) if err != nil { err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -76,23 +82,25 @@ func (client ConnectorsClient) CreateOrUpdate(ctx context.Context, connectorName } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ConnectorsClient) CreateOrUpdatePreparer(ctx context.Context, connectorName string, connectorSetting ConnectorSetting) (*http.Request, error) { +func (client ConnectorsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector Connector) (*http.Request, error) { pathParameters := map[string]interface{}{ - "connectorName": autorest.Encode("path", connectorName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "securityConnectorName": autorest.Encode("path", securityConnectorName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01-preview" + const APIVersion = "2021-07-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + securityConnector.SystemData = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}", pathParameters), - autorest.WithJSON(connectorSetting), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}", pathParameters), + autorest.WithJSON(securityConnector), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -105,20 +113,22 @@ func (client ConnectorsClient) CreateOrUpdateSender(req *http.Request) (*http.Re // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client ConnectorsClient) CreateOrUpdateResponder(resp *http.Response) (result ConnectorSetting, err error) { +func (client ConnectorsClient) CreateOrUpdateResponder(resp *http.Response) (result Connector, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// Delete delete a cloud account connector from a subscription +// Delete deletes a security connector. // Parameters: -// connectorName - name of the cloud account connector -func (client ConnectorsClient) Delete(ctx context.Context, connectorName string) (result autorest.Response, err error) { +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// securityConnectorName - the security connector name. +func (client ConnectorsClient) Delete(ctx context.Context, resourceGroupName string, securityConnectorName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsClient.Delete") defer func() { @@ -131,11 +141,15 @@ func (client ConnectorsClient) Delete(ctx context.Context, connectorName string) } 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 { + 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.ConnectorsClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, connectorName) + req, err := client.DeletePreparer(ctx, resourceGroupName, securityConnectorName) if err != nil { err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "Delete", nil, "Failure preparing request") return @@ -158,13 +172,14 @@ func (client ConnectorsClient) Delete(ctx context.Context, connectorName string) } // DeletePreparer prepares the Delete request. -func (client ConnectorsClient) DeletePreparer(ctx context.Context, connectorName string) (*http.Request, error) { +func (client ConnectorsClient) DeletePreparer(ctx context.Context, resourceGroupName string, securityConnectorName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "connectorName": autorest.Encode("path", connectorName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "securityConnectorName": autorest.Encode("path", securityConnectorName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01-preview" + const APIVersion = "2021-07-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -172,7 +187,7 @@ func (client ConnectorsClient) DeletePreparer(ctx context.Context, connectorName preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -194,10 +209,12 @@ func (client ConnectorsClient) DeleteResponder(resp *http.Response) (result auto return } -// Get details of a specific cloud account connector +// Get retrieves details of a specific security connector // Parameters: -// connectorName - name of the cloud account connector -func (client ConnectorsClient) Get(ctx context.Context, connectorName string) (result ConnectorSetting, err error) { +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// securityConnectorName - the security connector name. +func (client ConnectorsClient) Get(ctx context.Context, resourceGroupName string, securityConnectorName string) (result Connector, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsClient.Get") defer func() { @@ -210,11 +227,15 @@ func (client ConnectorsClient) Get(ctx context.Context, connectorName string) (r } 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 { + 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.ConnectorsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, connectorName) + req, err := client.GetPreparer(ctx, resourceGroupName, securityConnectorName) if err != nil { err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "Get", nil, "Failure preparing request") return @@ -237,13 +258,14 @@ func (client ConnectorsClient) Get(ctx context.Context, connectorName string) (r } // GetPreparer prepares the Get request. -func (client ConnectorsClient) GetPreparer(ctx context.Context, connectorName string) (*http.Request, error) { +func (client ConnectorsClient) GetPreparer(ctx context.Context, resourceGroupName string, securityConnectorName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "connectorName": autorest.Encode("path", connectorName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "securityConnectorName": autorest.Encode("path", securityConnectorName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01-preview" + const APIVersion = "2021-07-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -251,7 +273,7 @@ func (client ConnectorsClient) GetPreparer(ctx context.Context, connectorName st preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -264,7 +286,7 @@ func (client ConnectorsClient) GetSender(req *http.Request) (*http.Response, err // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client ConnectorsClient) GetResponder(resp *http.Response) (result ConnectorSetting, err error) { +func (client ConnectorsClient) GetResponder(resp *http.Response) (result Connector, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -274,14 +296,15 @@ func (client ConnectorsClient) GetResponder(resp *http.Response) (result Connect return } -// List cloud accounts connectors of a subscription -func (client ConnectorsClient) List(ctx context.Context) (result ConnectorSettingListPage, err error) { +// List lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to +// get the next page of security connectors for the specified subscription. +func (client ConnectorsClient) List(ctx context.Context) (result ConnectorsListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsClient.List") defer func() { sc := -1 - if result.csl.Response.Response != nil { - sc = result.csl.Response.Response.StatusCode + if result.cl.Response.Response != nil { + sc = result.cl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -301,17 +324,17 @@ func (client ConnectorsClient) List(ctx context.Context) (result ConnectorSettin resp, err := client.ListSender(req) if err != nil { - result.csl.Response = autorest.Response{Response: resp} + result.cl.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "List", resp, "Failure sending request") return } - result.csl, err = client.ListResponder(resp) + result.cl, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "List", resp, "Failure responding to request") return } - if result.csl.hasNextLink() && result.csl.IsEmpty() { + if result.cl.hasNextLink() && result.cl.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -325,7 +348,7 @@ func (client ConnectorsClient) ListPreparer(ctx context.Context) (*http.Request, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01-preview" + const APIVersion = "2021-07-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -333,7 +356,7 @@ func (client ConnectorsClient) ListPreparer(ctx context.Context) (*http.Request, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityConnectors", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -346,7 +369,7 @@ func (client ConnectorsClient) ListSender(req *http.Request) (*http.Response, er // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client ConnectorsClient) ListResponder(resp *http.Response) (result ConnectorSettingList, err error) { +func (client ConnectorsClient) ListResponder(resp *http.Response) (result ConnectorsList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -357,8 +380,8 @@ func (client ConnectorsClient) ListResponder(resp *http.Response) (result Connec } // listNextResults retrieves the next set of results, if any. -func (client ConnectorsClient) listNextResults(ctx context.Context, lastResults ConnectorSettingList) (result ConnectorSettingList, err error) { - req, err := lastResults.connectorSettingListPreparer(ctx) +func (client ConnectorsClient) listNextResults(ctx context.Context, lastResults ConnectorsList) (result ConnectorsList, err error) { + req, err := lastResults.connectorsListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "security.ConnectorsClient", "listNextResults", nil, "Failure preparing next results request") } @@ -378,7 +401,7 @@ func (client ConnectorsClient) listNextResults(ctx context.Context, lastResults } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ConnectorsClient) ListComplete(ctx context.Context) (result ConnectorSettingListIterator, err error) { +func (client ConnectorsClient) ListComplete(ctx context.Context) (result ConnectorsListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsClient.List") defer func() { @@ -392,3 +415,222 @@ func (client ConnectorsClient) ListComplete(ctx context.Context) (result Connect result.page, err = client.List(ctx) return } + +// ListByResourceGroup lists all the security connectors in the specified resource group. Use the 'nextLink' property +// in the response to get the next page of security connectors for the specified resource group. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +func (client ConnectorsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ConnectorsListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.cl.Response.Response != nil { + sc = result.cl.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.ConnectorsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.cl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.cl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.cl.hasNextLink() && result.cl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ConnectorsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-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/Microsoft.Security/securityConnectors", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectorsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client ConnectorsClient) ListByResourceGroupResponder(resp *http.Response) (result ConnectorsList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client ConnectorsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ConnectorsList) (result ConnectorsList, err error) { + req, err := lastResults.connectorsListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.ConnectorsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.ConnectorsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ConnectorsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ConnectorsListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsClient.ListByResourceGroup") + 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.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// Update updates a security connector +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// securityConnectorName - the security connector name. +// securityConnector - the security connector resource +func (client ConnectorsClient) Update(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector Connector) (result Connector, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsClient.Update") + 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.ConnectorsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, securityConnectorName, securityConnector) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ConnectorsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector Connector) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "securityConnectorName": autorest.Encode("path", securityConnectorName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + securityConnector.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}", pathParameters), + autorest.WithJSON(securityConnector), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectorsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ConnectorsClient) UpdateResponder(resp *http.Response) (result Connector, 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/services/preview/security/mgmt/v2.0/security/connectorsgroup.go b/services/preview/security/mgmt/v2.0/security/connectorsgroup.go new file mode 100644 index 000000000000..945b763e3943 --- /dev/null +++ b/services/preview/security/mgmt/v2.0/security/connectorsgroup.go @@ -0,0 +1,394 @@ +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" +) + +// ConnectorsGroupClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type ConnectorsGroupClient struct { + BaseClient +} + +// NewConnectorsGroupClient creates an instance of the ConnectorsGroupClient client. +func NewConnectorsGroupClient(subscriptionID string) ConnectorsGroupClient { + return NewConnectorsGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewConnectorsGroupClientWithBaseURI creates an instance of the ConnectorsGroupClient 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 NewConnectorsGroupClientWithBaseURI(baseURI string, subscriptionID string) ConnectorsGroupClient { + return ConnectorsGroupClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, +// use either account credentials or role-based authentication. For GCP, use account organization credentials. +// Parameters: +// connectorName - name of the cloud account connector +// connectorSetting - settings for the cloud account connector +func (client ConnectorsGroupClient) CreateOrUpdate(ctx context.Context, connectorName string, connectorSetting ConnectorSetting) (result ConnectorSetting, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsGroupClient.CreateOrUpdate") + 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.ConnectorsGroupClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, connectorName, connectorSetting) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ConnectorsGroupClient) CreateOrUpdatePreparer(ctx context.Context, connectorName string, connectorSetting ConnectorSetting) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "connectorName": autorest.Encode("path", connectorName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01-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/connectors/{connectorName}", pathParameters), + autorest.WithJSON(connectorSetting), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectorsGroupClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ConnectorsGroupClient) CreateOrUpdateResponder(resp *http.Response) (result ConnectorSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a cloud account connector from a subscription +// Parameters: +// connectorName - name of the cloud account connector +func (client ConnectorsGroupClient) Delete(ctx context.Context, connectorName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsGroupClient.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.ConnectorsGroupClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, connectorName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ConnectorsGroupClient) DeletePreparer(ctx context.Context, connectorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "connectorName": autorest.Encode("path", connectorName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}", 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 ConnectorsGroupClient) 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 ConnectorsGroupClient) 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 details of a specific cloud account connector +// Parameters: +// connectorName - name of the cloud account connector +func (client ConnectorsGroupClient) Get(ctx context.Context, connectorName string) (result ConnectorSetting, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsGroupClient.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.ConnectorsGroupClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, connectorName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "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.ConnectorsGroupClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ConnectorsGroupClient) GetPreparer(ctx context.Context, connectorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "connectorName": autorest.Encode("path", connectorName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-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/connectors/{connectorName}", 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 ConnectorsGroupClient) 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 ConnectorsGroupClient) GetResponder(resp *http.Response) (result ConnectorSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List cloud accounts connectors of a subscription +func (client ConnectorsGroupClient) List(ctx context.Context) (result ConnectorSettingListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsGroupClient.List") + defer func() { + sc := -1 + if result.csl.Response.Response != nil { + sc = result.csl.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.ConnectorsGroupClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.csl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "List", resp, "Failure sending request") + return + } + + result.csl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "List", resp, "Failure responding to request") + return + } + if result.csl.hasNextLink() && result.csl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ConnectorsGroupClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-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/connectors", 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 ConnectorsGroupClient) 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 ConnectorsGroupClient) ListResponder(resp *http.Response) (result ConnectorSettingList, 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 ConnectorsGroupClient) listNextResults(ctx context.Context, lastResults ConnectorSettingList) (result ConnectorSettingList, err error) { + req, err := lastResults.connectorSettingListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "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.ConnectorsGroupClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ConnectorsGroupClient) ListComplete(ctx context.Context) (result ConnectorSettingListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsGroupClient.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 +} diff --git a/services/preview/security/mgmt/v2.0/security/contacts.go b/services/preview/security/mgmt/v2.0/security/contacts.go index ccadbb870f93..6a36aef82c4f 100644 --- a/services/preview/security/mgmt/v2.0/security/contacts.go +++ b/services/preview/security/mgmt/v2.0/security/contacts.go @@ -21,14 +21,14 @@ type ContactsClient struct { } // NewContactsClient creates an instance of the ContactsClient client. -func NewContactsClient(subscriptionID string, ascLocation string) ContactsClient { - return NewContactsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewContactsClient(subscriptionID string) ContactsClient { + return NewContactsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewContactsClientWithBaseURI creates an instance of the ContactsClient 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 NewContactsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) ContactsClient { - return ContactsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewContactsClientWithBaseURI(baseURI string, subscriptionID string) ContactsClient { + return ContactsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Create security contact configurations for the subscription diff --git a/services/preview/security/mgmt/v2.0/security/customassessmentautomations.go b/services/preview/security/mgmt/v2.0/security/customassessmentautomations.go new file mode 100644 index 000000000000..178c8ec50cfb --- /dev/null +++ b/services/preview/security/mgmt/v2.0/security/customassessmentautomations.go @@ -0,0 +1,543 @@ +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" +) + +// CustomAssessmentAutomationsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type CustomAssessmentAutomationsClient struct { + BaseClient +} + +// NewCustomAssessmentAutomationsClient creates an instance of the CustomAssessmentAutomationsClient client. +func NewCustomAssessmentAutomationsClient(subscriptionID string) CustomAssessmentAutomationsClient { + return NewCustomAssessmentAutomationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCustomAssessmentAutomationsClientWithBaseURI creates an instance of the CustomAssessmentAutomationsClient 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 NewCustomAssessmentAutomationsClientWithBaseURI(baseURI string, subscriptionID string) CustomAssessmentAutomationsClient { + return CustomAssessmentAutomationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates or updates a custom assessment automation for the provided subscription. Please note that providing +// an existing custom assessment automation will replace the existing record. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// customAssessmentAutomationName - name of the Custom Assessment Automation. +// customAssessmentAutomationBody - custom Assessment Automation body +func (client CustomAssessmentAutomationsClient) Create(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string, customAssessmentAutomationBody CustomAssessmentAutomationRequest) (result CustomAssessmentAutomation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsClient.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}}}, + {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.CustomAssessmentAutomationsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, customAssessmentAutomationName, customAssessmentAutomationBody) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "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.CustomAssessmentAutomationsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client CustomAssessmentAutomationsClient) CreatePreparer(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string, customAssessmentAutomationBody CustomAssessmentAutomationRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customAssessmentAutomationName": autorest.Encode("path", customAssessmentAutomationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-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}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}", pathParameters), + autorest.WithJSON(customAssessmentAutomationBody), + 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 CustomAssessmentAutomationsClient) 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 CustomAssessmentAutomationsClient) CreateResponder(resp *http.Response) (result CustomAssessmentAutomation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a custom assessment automation by name for a provided subscription +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// customAssessmentAutomationName - name of the Custom Assessment Automation. +func (client CustomAssessmentAutomationsClient) Delete(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsClient.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}}}, + {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.CustomAssessmentAutomationsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, customAssessmentAutomationName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CustomAssessmentAutomationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customAssessmentAutomationName": autorest.Encode("path", customAssessmentAutomationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}", 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 CustomAssessmentAutomationsClient) 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 CustomAssessmentAutomationsClient) 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 gets a single custom assessment automation by name for the provided subscription and resource group. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// customAssessmentAutomationName - name of the Custom Assessment Automation. +func (client CustomAssessmentAutomationsClient) Get(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string) (result CustomAssessmentAutomation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsClient.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.CustomAssessmentAutomationsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, customAssessmentAutomationName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "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.CustomAssessmentAutomationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client CustomAssessmentAutomationsClient) GetPreparer(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customAssessmentAutomationName": autorest.Encode("path", customAssessmentAutomationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-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/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}", 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 CustomAssessmentAutomationsClient) 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 CustomAssessmentAutomationsClient) GetResponder(resp *http.Response) (result CustomAssessmentAutomation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup list custom assessment automations by provided subscription and resource group +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +func (client CustomAssessmentAutomationsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result CustomAssessmentAutomationsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.caalr.Response.Response != nil { + sc = result.caalr.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.CustomAssessmentAutomationsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.caalr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.caalr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.caalr.hasNextLink() && result.caalr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client CustomAssessmentAutomationsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-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/Microsoft.Security/customAssessmentAutomations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client CustomAssessmentAutomationsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client CustomAssessmentAutomationsClient) ListByResourceGroupResponder(resp *http.Response) (result CustomAssessmentAutomationsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client CustomAssessmentAutomationsClient) listByResourceGroupNextResults(ctx context.Context, lastResults CustomAssessmentAutomationsListResult) (result CustomAssessmentAutomationsListResult, err error) { + req, err := lastResults.customAssessmentAutomationsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client CustomAssessmentAutomationsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result CustomAssessmentAutomationsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsClient.ListByResourceGroup") + 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.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListBySubscription list custom assessment automations by provided subscription +func (client CustomAssessmentAutomationsClient) ListBySubscription(ctx context.Context) (result CustomAssessmentAutomationsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsClient.ListBySubscription") + defer func() { + sc := -1 + if result.caalr.Response.Response != nil { + sc = result.caalr.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.CustomAssessmentAutomationsClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.caalr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.caalr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.caalr.hasNextLink() && result.caalr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client CustomAssessmentAutomationsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-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/customAssessmentAutomations", 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 CustomAssessmentAutomationsClient) 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 CustomAssessmentAutomationsClient) ListBySubscriptionResponder(resp *http.Response) (result CustomAssessmentAutomationsListResult, 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 CustomAssessmentAutomationsClient) listBySubscriptionNextResults(ctx context.Context, lastResults CustomAssessmentAutomationsListResult) (result CustomAssessmentAutomationsListResult, err error) { + req, err := lastResults.customAssessmentAutomationsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "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.CustomAssessmentAutomationsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client CustomAssessmentAutomationsClient) ListBySubscriptionComplete(ctx context.Context) (result CustomAssessmentAutomationsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsClient.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/services/preview/security/mgmt/v2.0/security/customentitystoreassignments.go b/services/preview/security/mgmt/v2.0/security/customentitystoreassignments.go new file mode 100644 index 000000000000..615aa495c152 --- /dev/null +++ b/services/preview/security/mgmt/v2.0/security/customentitystoreassignments.go @@ -0,0 +1,542 @@ +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" +) + +// CustomEntityStoreAssignmentsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type CustomEntityStoreAssignmentsClient struct { + BaseClient +} + +// NewCustomEntityStoreAssignmentsClient creates an instance of the CustomEntityStoreAssignmentsClient client. +func NewCustomEntityStoreAssignmentsClient(subscriptionID string) CustomEntityStoreAssignmentsClient { + return NewCustomEntityStoreAssignmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCustomEntityStoreAssignmentsClientWithBaseURI creates an instance of the CustomEntityStoreAssignmentsClient +// 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 NewCustomEntityStoreAssignmentsClientWithBaseURI(baseURI string, subscriptionID string) CustomEntityStoreAssignmentsClient { + return CustomEntityStoreAssignmentsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a custom entity store assignment for the provided subscription, if not already exists. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// customEntityStoreAssignmentName - name of the custom entity store assignment. Generated name is GUID. +// customEntityStoreAssignmentRequestBody - custom entity store assignment body +func (client CustomEntityStoreAssignmentsClient) Create(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string, customEntityStoreAssignmentRequestBody CustomEntityStoreAssignmentRequest) (result CustomEntityStoreAssignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsClient.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}}}, + {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.CustomEntityStoreAssignmentsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, customEntityStoreAssignmentName, customEntityStoreAssignmentRequestBody) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "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.CustomEntityStoreAssignmentsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client CustomEntityStoreAssignmentsClient) CreatePreparer(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string, customEntityStoreAssignmentRequestBody CustomEntityStoreAssignmentRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customEntityStoreAssignmentName": autorest.Encode("path", customEntityStoreAssignmentName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-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}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}", pathParameters), + autorest.WithJSON(customEntityStoreAssignmentRequestBody), + 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 CustomEntityStoreAssignmentsClient) 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 CustomEntityStoreAssignmentsClient) CreateResponder(resp *http.Response) (result CustomEntityStoreAssignment, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a custom entity store assignment by name for a provided subscription +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// customEntityStoreAssignmentName - name of the custom entity store assignment. Generated name is GUID. +func (client CustomEntityStoreAssignmentsClient) Delete(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsClient.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}}}, + {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.CustomEntityStoreAssignmentsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, customEntityStoreAssignmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CustomEntityStoreAssignmentsClient) DeletePreparer(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customEntityStoreAssignmentName": autorest.Encode("path", customEntityStoreAssignmentName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}", 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 CustomEntityStoreAssignmentsClient) 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 CustomEntityStoreAssignmentsClient) 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 gets a single custom entity store assignment by name for the provided subscription and resource group. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// customEntityStoreAssignmentName - name of the custom entity store assignment. Generated name is GUID. +func (client CustomEntityStoreAssignmentsClient) Get(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string) (result CustomEntityStoreAssignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsClient.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.CustomEntityStoreAssignmentsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, customEntityStoreAssignmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "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.CustomEntityStoreAssignmentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client CustomEntityStoreAssignmentsClient) GetPreparer(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customEntityStoreAssignmentName": autorest.Encode("path", customEntityStoreAssignmentName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-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/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}", 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 CustomEntityStoreAssignmentsClient) 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 CustomEntityStoreAssignmentsClient) GetResponder(resp *http.Response) (result CustomEntityStoreAssignment, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup list custom entity store assignments by a provided subscription and resource group +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +func (client CustomEntityStoreAssignmentsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result CustomEntityStoreAssignmentsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.cesalr.Response.Response != nil { + sc = result.cesalr.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.CustomEntityStoreAssignmentsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.cesalr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.cesalr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.cesalr.hasNextLink() && result.cesalr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client CustomEntityStoreAssignmentsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-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/Microsoft.Security/customEntityStoreAssignments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client CustomEntityStoreAssignmentsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client CustomEntityStoreAssignmentsClient) ListByResourceGroupResponder(resp *http.Response) (result CustomEntityStoreAssignmentsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client CustomEntityStoreAssignmentsClient) listByResourceGroupNextResults(ctx context.Context, lastResults CustomEntityStoreAssignmentsListResult) (result CustomEntityStoreAssignmentsListResult, err error) { + req, err := lastResults.customEntityStoreAssignmentsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client CustomEntityStoreAssignmentsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result CustomEntityStoreAssignmentsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsClient.ListByResourceGroup") + 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.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListBySubscription list custom entity store assignments by provided subscription +func (client CustomEntityStoreAssignmentsClient) ListBySubscription(ctx context.Context) (result CustomEntityStoreAssignmentsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsClient.ListBySubscription") + defer func() { + sc := -1 + if result.cesalr.Response.Response != nil { + sc = result.cesalr.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.CustomEntityStoreAssignmentsClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.cesalr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.cesalr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.cesalr.hasNextLink() && result.cesalr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client CustomEntityStoreAssignmentsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-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/customEntityStoreAssignments", 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 CustomEntityStoreAssignmentsClient) 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 CustomEntityStoreAssignmentsClient) ListBySubscriptionResponder(resp *http.Response) (result CustomEntityStoreAssignmentsListResult, 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 CustomEntityStoreAssignmentsClient) listBySubscriptionNextResults(ctx context.Context, lastResults CustomEntityStoreAssignmentsListResult) (result CustomEntityStoreAssignmentsListResult, err error) { + req, err := lastResults.customEntityStoreAssignmentsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "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.CustomEntityStoreAssignmentsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client CustomEntityStoreAssignmentsClient) ListBySubscriptionComplete(ctx context.Context) (result CustomEntityStoreAssignmentsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsClient.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/services/preview/security/mgmt/v2.0/security/devicesecuritygroups.go b/services/preview/security/mgmt/v2.0/security/devicesecuritygroups.go index e38e86a95e18..6152531ffd85 100644 --- a/services/preview/security/mgmt/v2.0/security/devicesecuritygroups.go +++ b/services/preview/security/mgmt/v2.0/security/devicesecuritygroups.go @@ -20,15 +20,15 @@ type DeviceSecurityGroupsClient struct { } // NewDeviceSecurityGroupsClient creates an instance of the DeviceSecurityGroupsClient client. -func NewDeviceSecurityGroupsClient(subscriptionID string, ascLocation string) DeviceSecurityGroupsClient { - return NewDeviceSecurityGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewDeviceSecurityGroupsClient(subscriptionID string) DeviceSecurityGroupsClient { + return NewDeviceSecurityGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewDeviceSecurityGroupsClientWithBaseURI creates an instance of the DeviceSecurityGroupsClient 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 NewDeviceSecurityGroupsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) DeviceSecurityGroupsClient { - return DeviceSecurityGroupsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewDeviceSecurityGroupsClientWithBaseURI(baseURI string, subscriptionID string) DeviceSecurityGroupsClient { + return DeviceSecurityGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate use this method to creates or updates the device security group on a specified IoT Hub resource. diff --git a/services/preview/security/mgmt/v2.0/security/discoveredsecuritysolutions.go b/services/preview/security/mgmt/v2.0/security/discoveredsecuritysolutions.go index 6b6d3d945f58..8bcfe2739b40 100644 --- a/services/preview/security/mgmt/v2.0/security/discoveredsecuritysolutions.go +++ b/services/preview/security/mgmt/v2.0/security/discoveredsecuritysolutions.go @@ -21,23 +21,25 @@ type DiscoveredSecuritySolutionsClient struct { } // NewDiscoveredSecuritySolutionsClient creates an instance of the DiscoveredSecuritySolutionsClient client. -func NewDiscoveredSecuritySolutionsClient(subscriptionID string, ascLocation string) DiscoveredSecuritySolutionsClient { - return NewDiscoveredSecuritySolutionsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewDiscoveredSecuritySolutionsClient(subscriptionID string) DiscoveredSecuritySolutionsClient { + return NewDiscoveredSecuritySolutionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewDiscoveredSecuritySolutionsClientWithBaseURI creates an instance of the DiscoveredSecuritySolutionsClient 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 NewDiscoveredSecuritySolutionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) DiscoveredSecuritySolutionsClient { - return DiscoveredSecuritySolutionsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewDiscoveredSecuritySolutionsClientWithBaseURI(baseURI string, subscriptionID string) DiscoveredSecuritySolutionsClient { + return DiscoveredSecuritySolutionsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets a specific discovered Security Solution. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // discoveredSecuritySolutionName - name of a discovered security solution. -func (client DiscoveredSecuritySolutionsClient) Get(ctx context.Context, resourceGroupName string, discoveredSecuritySolutionName string) (result DiscoveredSecuritySolution, err error) { +func (client DiscoveredSecuritySolutionsClient) Get(ctx context.Context, resourceGroupName string, ascLocation string, discoveredSecuritySolutionName string) (result DiscoveredSecuritySolution, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionsClient.Get") defer func() { @@ -58,7 +60,7 @@ func (client DiscoveredSecuritySolutionsClient) Get(ctx context.Context, resourc return result, validation.NewError("security.DiscoveredSecuritySolutionsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, discoveredSecuritySolutionName) + req, err := client.GetPreparer(ctx, resourceGroupName, ascLocation, discoveredSecuritySolutionName) if err != nil { err = autorest.NewErrorWithError(err, "security.DiscoveredSecuritySolutionsClient", "Get", nil, "Failure preparing request") return @@ -81,9 +83,9 @@ func (client DiscoveredSecuritySolutionsClient) Get(ctx context.Context, resourc } // GetPreparer prepares the Get request. -func (client DiscoveredSecuritySolutionsClient) GetPreparer(ctx context.Context, resourceGroupName string, discoveredSecuritySolutionName string) (*http.Request, error) { +func (client DiscoveredSecuritySolutionsClient) GetPreparer(ctx context.Context, resourceGroupName string, ascLocation string, discoveredSecuritySolutionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "discoveredSecuritySolutionName": autorest.Encode("path", discoveredSecuritySolutionName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -240,7 +242,10 @@ func (client DiscoveredSecuritySolutionsClient) ListComplete(ctx context.Context } // ListByHomeRegion gets a list of discovered Security Solutions for the subscription and location. -func (client DiscoveredSecuritySolutionsClient) ListByHomeRegion(ctx context.Context) (result DiscoveredSecuritySolutionListPage, err error) { +// Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations +func (client DiscoveredSecuritySolutionsClient) ListByHomeRegion(ctx context.Context, ascLocation string) (result DiscoveredSecuritySolutionListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionsClient.ListByHomeRegion") defer func() { @@ -258,7 +263,7 @@ func (client DiscoveredSecuritySolutionsClient) ListByHomeRegion(ctx context.Con } result.fn = client.listByHomeRegionNextResults - req, err := client.ListByHomeRegionPreparer(ctx) + req, err := client.ListByHomeRegionPreparer(ctx, ascLocation) if err != nil { err = autorest.NewErrorWithError(err, "security.DiscoveredSecuritySolutionsClient", "ListByHomeRegion", nil, "Failure preparing request") return @@ -285,9 +290,9 @@ func (client DiscoveredSecuritySolutionsClient) ListByHomeRegion(ctx context.Con } // ListByHomeRegionPreparer prepares the ListByHomeRegion request. -func (client DiscoveredSecuritySolutionsClient) ListByHomeRegionPreparer(ctx context.Context) (*http.Request, error) { +func (client DiscoveredSecuritySolutionsClient) ListByHomeRegionPreparer(ctx context.Context, ascLocation string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -344,7 +349,7 @@ func (client DiscoveredSecuritySolutionsClient) listByHomeRegionNextResults(ctx } // ListByHomeRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiscoveredSecuritySolutionsClient) ListByHomeRegionComplete(ctx context.Context) (result DiscoveredSecuritySolutionListIterator, err error) { +func (client DiscoveredSecuritySolutionsClient) ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result DiscoveredSecuritySolutionListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionsClient.ListByHomeRegion") defer func() { @@ -355,6 +360,6 @@ func (client DiscoveredSecuritySolutionsClient) ListByHomeRegionComplete(ctx con tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByHomeRegion(ctx) + result.page, err = client.ListByHomeRegion(ctx, ascLocation) return } diff --git a/services/preview/security/mgmt/v2.0/security/enums.go b/services/preview/security/mgmt/v2.0/security/enums.go index 8d0b7725faa7..8475ea35aa24 100644 --- a/services/preview/security/mgmt/v2.0/security/enums.go +++ b/services/preview/security/mgmt/v2.0/security/enums.go @@ -161,6 +161,23 @@ func PossibleAutoProvisionValues() []AutoProvision { return []AutoProvision{AutoProvisionOff, AutoProvisionOn} } +// CloudName enumerates the values for cloud name. +type CloudName string + +const ( + // AWS ... + AWS CloudName = "AWS" + // Azure ... + Azure CloudName = "Azure" + // GCP ... + GCP CloudName = "GCP" +) + +// PossibleCloudNameValues returns an array of possible values for the CloudName const type. +func PossibleCloudNameValues() []CloudName { + return []CloudName{AWS, Azure, GCP} +} + // ConfigurationStatus enumerates the values for configuration status. type ConfigurationStatus string @@ -243,9 +260,9 @@ func PossibleConnectionTypeValues() []ConnectionType { type ControlType string const ( - // BuiltIn Azure Security Center managed assessments + // BuiltIn Microsoft Defender for Cloud managed assessments BuiltIn ControlType = "BuiltIn" - // Custom Non Azure Security Center managed assessments + // Custom Non Microsoft Defender for Cloud managed assessments Custom ControlType = "Custom" ) @@ -254,6 +271,25 @@ func PossibleControlTypeValues() []ControlType { return []ControlType{BuiltIn, Custom} } +// 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 @@ -282,21 +318,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} } // EnforcementMode1 enumerates the values for enforcement mode 1. @@ -337,21 +394,33 @@ 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" + // EventSourceAssessmentsSnapshot ... + EventSourceAssessmentsSnapshot EventSource = "AssessmentsSnapshot" + // 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" + // EventSourceSubAssessmentsSnapshot ... + EventSourceSubAssessmentsSnapshot EventSource = "SubAssessmentsSnapshot" ) // 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, EventSourceAssessmentsSnapshot, EventSourceRegulatoryComplianceAssessment, EventSourceRegulatoryComplianceAssessmentSnapshot, EventSourceSecureScoreControls, EventSourceSecureScoreControlsSnapshot, EventSourceSecureScores, EventSourceSecureScoresSnapshot, EventSourceSubAssessments, EventSourceSubAssessmentsSnapshot} } // Exe enumerates the values for exe. @@ -490,6 +559,21 @@ func PossibleHybridComputeProvisioningStateValues() []HybridComputeProvisioningS return []HybridComputeProvisioningState{HybridComputeProvisioningStateExpired, HybridComputeProvisioningStateInvalid, HybridComputeProvisioningStateValid} } +// InformationProtectionPolicyName enumerates the values for information protection policy name. +type InformationProtectionPolicyName string + +const ( + // InformationProtectionPolicyNameCustom ... + InformationProtectionPolicyNameCustom InformationProtectionPolicyName = "custom" + // InformationProtectionPolicyNameEffective ... + InformationProtectionPolicyNameEffective InformationProtectionPolicyName = "effective" +) + +// PossibleInformationProtectionPolicyNameValues returns an array of possible values for the InformationProtectionPolicyName const type. +func PossibleInformationProtectionPolicyNameValues() []InformationProtectionPolicyName { + return []InformationProtectionPolicyName{InformationProtectionPolicyNameCustom, InformationProtectionPolicyNameEffective} +} + // Issue enumerates the values for issue. type Issue string @@ -516,20 +600,35 @@ func PossibleIssueValues() []Issue { // KindEnum enumerates the values for kind enum. type KindEnum string +const ( + // KindDataExportSetting ... + KindDataExportSetting KindEnum = "DataExportSetting" + // KindSetting ... + KindSetting KindEnum = "Setting" +) + +// PossibleKindEnumValues returns an array of possible values for the KindEnum const type. +func PossibleKindEnumValues() []KindEnum { + return []KindEnum{KindDataExportSetting, KindSetting} +} + +// KindEnum1 enumerates the values for kind enum 1. +type KindEnum1 string + const ( // KindAAD ... - KindAAD KindEnum = "AAD" + KindAAD KindEnum1 = "AAD" // KindATA ... - KindATA KindEnum = "ATA" + KindATA KindEnum1 = "ATA" // KindCEF ... - KindCEF KindEnum = "CEF" + KindCEF KindEnum1 = "CEF" // KindExternalSecuritySolution ... - KindExternalSecuritySolution KindEnum = "ExternalSecuritySolution" + KindExternalSecuritySolution KindEnum1 = "ExternalSecuritySolution" ) -// PossibleKindEnumValues returns an array of possible values for the KindEnum const type. -func PossibleKindEnumValues() []KindEnum { - return []KindEnum{KindAAD, KindATA, KindCEF, KindExternalSecuritySolution} +// PossibleKindEnum1Values returns an array of possible values for the KindEnum1 const type. +func PossibleKindEnum1Values() []KindEnum1 { + return []KindEnum1{KindAAD, KindATA, KindCEF, KindExternalSecuritySolution} } // Msi enumerates the values for msi. @@ -549,27 +648,48 @@ func PossibleMsiValues() []Msi { return []Msi{MsiAudit, MsiEnforce, MsiNone} } +// OfferingType enumerates the values for offering type. +type OfferingType string + +const ( + // OfferingTypeCloudOffering ... + OfferingTypeCloudOffering OfferingType = "cloudOffering" + // OfferingTypeCspmMonitorAws ... + OfferingTypeCspmMonitorAws OfferingType = "CspmMonitorAws" + // OfferingTypeDefenderForContainersAws ... + OfferingTypeDefenderForContainersAws OfferingType = "DefenderForContainersAws" + // OfferingTypeDefenderForServersAws ... + OfferingTypeDefenderForServersAws OfferingType = "DefenderForServersAws" + // OfferingTypeInformationProtectionAws ... + OfferingTypeInformationProtectionAws OfferingType = "InformationProtectionAws" +) + +// PossibleOfferingTypeValues returns an array of possible values for the OfferingType const type. +func PossibleOfferingTypeValues() []OfferingType { + return []OfferingType{OfferingTypeCloudOffering, OfferingTypeCspmMonitorAws, OfferingTypeDefenderForContainersAws, OfferingTypeDefenderForServersAws, OfferingTypeInformationProtectionAws} +} + // 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" ) @@ -578,6 +698,21 @@ func PossibleOperatorValues() []Operator { return []Operator{Contains, EndsWith, Equals, GreaterThan, GreaterThanOrEqualTo, LesserThan, LesserThanOrEqualTo, NotEquals, StartsWith} } +// OrganizationMembershipType enumerates the values for organization membership type. +type OrganizationMembershipType string + +const ( + // Member ... + Member OrganizationMembershipType = "Member" + // Organization ... + Organization OrganizationMembershipType = "Organization" +) + +// PossibleOrganizationMembershipTypeValues returns an array of possible values for the OrganizationMembershipType const type. +func PossibleOrganizationMembershipTypeValues() []OrganizationMembershipType { + return []OrganizationMembershipType{Member, Organization} +} + // PermissionProperty enumerates the values for permission property. type PermissionProperty string @@ -602,9 +737,9 @@ func PossiblePermissionPropertyValues() []PermissionProperty { type PricingTier string const ( - // Free Get free Azure security center experience with basic security features + // Free Get free Microsoft Defender for Cloud experience with basic security features Free PricingTier = "Free" - // Standard Get the standard Azure security center experience with advanced security features + // Standard Get the standard Microsoft Defender for Cloud experience with advanced security features Standard PricingTier = "Standard" ) @@ -998,21 +1133,6 @@ func PossibleScriptValues() []Script { return []Script{ScriptAudit, ScriptEnforce, ScriptNone} } -// SettingKind enumerates the values for setting kind. -type SettingKind string - -const ( - // SettingKindAlertSuppressionSetting ... - SettingKindAlertSuppressionSetting SettingKind = "AlertSuppressionSetting" - // SettingKindDataExportSetting ... - SettingKindDataExportSetting SettingKind = "DataExportSetting" -) - -// PossibleSettingKindValues returns an array of possible values for the SettingKind const type. -func PossibleSettingKindValues() []SettingKind { - return []SettingKind{SettingKindAlertSuppressionSetting, SettingKindDataExportSetting} -} - // Severity enumerates the values for severity. type Severity string @@ -1030,6 +1150,23 @@ func PossibleSeverityValues() []Severity { return []Severity{SeverityHigh, SeverityLow, SeverityMedium} } +// SeverityEnum enumerates the values for severity enum. +type SeverityEnum string + +const ( + // SeverityEnumHigh ... + SeverityEnumHigh SeverityEnum = "High" + // SeverityEnumLow ... + SeverityEnumLow SeverityEnum = "Low" + // SeverityEnumMedium ... + SeverityEnumMedium SeverityEnum = "Medium" +) + +// PossibleSeverityEnumValues returns an array of possible values for the SeverityEnum const type. +func PossibleSeverityEnumValues() []SeverityEnum { + return []SeverityEnum{SeverityEnumHigh, SeverityEnumLow, SeverityEnumMedium} +} + // SolutionStatus enumerates the values for solution status. type SolutionStatus string @@ -1154,6 +1291,42 @@ func PossibleSubAssessmentStatusCodeValues() []SubAssessmentStatusCode { return []SubAssessmentStatusCode{Healthy, NotApplicable, Unhealthy} } +// SupportedCloudEnum enumerates the values for supported cloud enum. +type SupportedCloudEnum string + +const ( + // SupportedCloudEnumAWS ... + SupportedCloudEnumAWS SupportedCloudEnum = "AWS" + // SupportedCloudEnumGCP ... + SupportedCloudEnumGCP SupportedCloudEnum = "GCP" +) + +// PossibleSupportedCloudEnumValues returns an array of possible values for the SupportedCloudEnum const type. +func PossibleSupportedCloudEnumValues() []SupportedCloudEnum { + return []SupportedCloudEnum{SupportedCloudEnumAWS, SupportedCloudEnumGCP} +} + +// TaskUpdateActionType enumerates the values for task update action type. +type TaskUpdateActionType string + +const ( + // Activate ... + Activate TaskUpdateActionType = "Activate" + // Close ... + Close TaskUpdateActionType = "Close" + // Dismiss ... + Dismiss TaskUpdateActionType = "Dismiss" + // Resolve ... + Resolve TaskUpdateActionType = "Resolve" + // Start ... + Start TaskUpdateActionType = "Start" +) + +// PossibleTaskUpdateActionTypeValues returns an array of possible values for the TaskUpdateActionType const type. +func PossibleTaskUpdateActionTypeValues() []TaskUpdateActionType { + return []TaskUpdateActionType{Activate, Close, Dismiss, Resolve, Start} +} + // TransportProtocol enumerates the values for transport protocol. type TransportProtocol string diff --git a/services/preview/security/mgmt/v2.0/security/externalsecuritysolutions.go b/services/preview/security/mgmt/v2.0/security/externalsecuritysolutions.go index b068eb3e7320..c1c0fe127645 100644 --- a/services/preview/security/mgmt/v2.0/security/externalsecuritysolutions.go +++ b/services/preview/security/mgmt/v2.0/security/externalsecuritysolutions.go @@ -21,23 +21,25 @@ type ExternalSecuritySolutionsClient struct { } // NewExternalSecuritySolutionsClient creates an instance of the ExternalSecuritySolutionsClient client. -func NewExternalSecuritySolutionsClient(subscriptionID string, ascLocation string) ExternalSecuritySolutionsClient { - return NewExternalSecuritySolutionsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewExternalSecuritySolutionsClient(subscriptionID string) ExternalSecuritySolutionsClient { + return NewExternalSecuritySolutionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewExternalSecuritySolutionsClientWithBaseURI creates an instance of the ExternalSecuritySolutionsClient 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 NewExternalSecuritySolutionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) ExternalSecuritySolutionsClient { - return ExternalSecuritySolutionsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewExternalSecuritySolutionsClientWithBaseURI(baseURI string, subscriptionID string) ExternalSecuritySolutionsClient { + return ExternalSecuritySolutionsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets a specific external Security Solution. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // externalSecuritySolutionsName - name of an external security solution. -func (client ExternalSecuritySolutionsClient) Get(ctx context.Context, resourceGroupName string, externalSecuritySolutionsName string) (result ExternalSecuritySolutionModel, err error) { +func (client ExternalSecuritySolutionsClient) Get(ctx context.Context, resourceGroupName string, ascLocation string, externalSecuritySolutionsName string) (result ExternalSecuritySolutionModel, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionsClient.Get") defer func() { @@ -58,7 +60,7 @@ func (client ExternalSecuritySolutionsClient) Get(ctx context.Context, resourceG return result, validation.NewError("security.ExternalSecuritySolutionsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, externalSecuritySolutionsName) + req, err := client.GetPreparer(ctx, resourceGroupName, ascLocation, externalSecuritySolutionsName) if err != nil { err = autorest.NewErrorWithError(err, "security.ExternalSecuritySolutionsClient", "Get", nil, "Failure preparing request") return @@ -81,9 +83,9 @@ func (client ExternalSecuritySolutionsClient) Get(ctx context.Context, resourceG } // GetPreparer prepares the Get request. -func (client ExternalSecuritySolutionsClient) GetPreparer(ctx context.Context, resourceGroupName string, externalSecuritySolutionsName string) (*http.Request, error) { +func (client ExternalSecuritySolutionsClient) GetPreparer(ctx context.Context, resourceGroupName string, ascLocation string, externalSecuritySolutionsName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "externalSecuritySolutionsName": autorest.Encode("path", externalSecuritySolutionsName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -240,7 +242,10 @@ func (client ExternalSecuritySolutionsClient) ListComplete(ctx context.Context) } // ListByHomeRegion gets a list of external Security Solutions for the subscription and location. -func (client ExternalSecuritySolutionsClient) ListByHomeRegion(ctx context.Context) (result ExternalSecuritySolutionListPage, err error) { +// Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations +func (client ExternalSecuritySolutionsClient) ListByHomeRegion(ctx context.Context, ascLocation string) (result ExternalSecuritySolutionListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionsClient.ListByHomeRegion") defer func() { @@ -258,7 +263,7 @@ func (client ExternalSecuritySolutionsClient) ListByHomeRegion(ctx context.Conte } result.fn = client.listByHomeRegionNextResults - req, err := client.ListByHomeRegionPreparer(ctx) + req, err := client.ListByHomeRegionPreparer(ctx, ascLocation) if err != nil { err = autorest.NewErrorWithError(err, "security.ExternalSecuritySolutionsClient", "ListByHomeRegion", nil, "Failure preparing request") return @@ -285,9 +290,9 @@ func (client ExternalSecuritySolutionsClient) ListByHomeRegion(ctx context.Conte } // ListByHomeRegionPreparer prepares the ListByHomeRegion request. -func (client ExternalSecuritySolutionsClient) ListByHomeRegionPreparer(ctx context.Context) (*http.Request, error) { +func (client ExternalSecuritySolutionsClient) ListByHomeRegionPreparer(ctx context.Context, ascLocation string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -344,7 +349,7 @@ func (client ExternalSecuritySolutionsClient) listByHomeRegionNextResults(ctx co } // ListByHomeRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExternalSecuritySolutionsClient) ListByHomeRegionComplete(ctx context.Context) (result ExternalSecuritySolutionListIterator, err error) { +func (client ExternalSecuritySolutionsClient) ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result ExternalSecuritySolutionListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionsClient.ListByHomeRegion") defer func() { @@ -355,6 +360,6 @@ func (client ExternalSecuritySolutionsClient) ListByHomeRegionComplete(ctx conte tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByHomeRegion(ctx) + result.page, err = client.ListByHomeRegion(ctx, ascLocation) return } diff --git a/services/preview/security/mgmt/v2.0/security/informationprotectionpolicies.go b/services/preview/security/mgmt/v2.0/security/informationprotectionpolicies.go index ab62d290cbd9..f2e2cc818b8a 100644 --- a/services/preview/security/mgmt/v2.0/security/informationprotectionpolicies.go +++ b/services/preview/security/mgmt/v2.0/security/informationprotectionpolicies.go @@ -20,15 +20,15 @@ type InformationProtectionPoliciesClient struct { } // NewInformationProtectionPoliciesClient creates an instance of the InformationProtectionPoliciesClient client. -func NewInformationProtectionPoliciesClient(subscriptionID string, ascLocation string) InformationProtectionPoliciesClient { - return NewInformationProtectionPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewInformationProtectionPoliciesClient(subscriptionID string) InformationProtectionPoliciesClient { + return NewInformationProtectionPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewInformationProtectionPoliciesClientWithBaseURI creates an instance of the InformationProtectionPoliciesClient // 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 NewInformationProtectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) InformationProtectionPoliciesClient { - return InformationProtectionPoliciesClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewInformationProtectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) InformationProtectionPoliciesClient { + return InformationProtectionPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate details of the information protection policy. @@ -37,7 +37,7 @@ func NewInformationProtectionPoliciesClientWithBaseURI(baseURI string, subscript // management group (/providers/Microsoft.Management/managementGroups/mgName). // informationProtectionPolicyName - name of the information protection policy. // informationProtectionPolicy - information protection policy. -func (client InformationProtectionPoliciesClient) CreateOrUpdate(ctx context.Context, scope string, informationProtectionPolicyName string, informationProtectionPolicy InformationProtectionPolicy) (result InformationProtectionPolicy, err error) { +func (client InformationProtectionPoliciesClient) CreateOrUpdate(ctx context.Context, scope string, informationProtectionPolicyName InformationProtectionPolicyName, informationProtectionPolicy InformationProtectionPolicy) (result InformationProtectionPolicy, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/InformationProtectionPoliciesClient.CreateOrUpdate") defer func() { @@ -71,7 +71,7 @@ func (client InformationProtectionPoliciesClient) CreateOrUpdate(ctx context.Con } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client InformationProtectionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, scope string, informationProtectionPolicyName string, informationProtectionPolicy InformationProtectionPolicy) (*http.Request, error) { +func (client InformationProtectionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, scope string, informationProtectionPolicyName InformationProtectionPolicyName, informationProtectionPolicy InformationProtectionPolicy) (*http.Request, error) { pathParameters := map[string]interface{}{ "informationProtectionPolicyName": autorest.Encode("path", informationProtectionPolicyName), "scope": scope, @@ -115,7 +115,7 @@ func (client InformationProtectionPoliciesClient) CreateOrUpdateResponder(resp * // scope - scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or // management group (/providers/Microsoft.Management/managementGroups/mgName). // informationProtectionPolicyName - name of the information protection policy. -func (client InformationProtectionPoliciesClient) Get(ctx context.Context, scope string, informationProtectionPolicyName string) (result InformationProtectionPolicy, err error) { +func (client InformationProtectionPoliciesClient) Get(ctx context.Context, scope string, informationProtectionPolicyName InformationProtectionPolicyName) (result InformationProtectionPolicy, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/InformationProtectionPoliciesClient.Get") defer func() { @@ -149,7 +149,7 @@ func (client InformationProtectionPoliciesClient) Get(ctx context.Context, scope } // GetPreparer prepares the Get request. -func (client InformationProtectionPoliciesClient) GetPreparer(ctx context.Context, scope string, informationProtectionPolicyName string) (*http.Request, error) { +func (client InformationProtectionPoliciesClient) GetPreparer(ctx context.Context, scope string, informationProtectionPolicyName InformationProtectionPolicyName) (*http.Request, error) { pathParameters := map[string]interface{}{ "informationProtectionPolicyName": autorest.Encode("path", informationProtectionPolicyName), "scope": scope, diff --git a/services/preview/security/mgmt/v2.0/security/ingestionsettings.go b/services/preview/security/mgmt/v2.0/security/ingestionsettings.go new file mode 100644 index 000000000000..894afa66e205 --- /dev/null +++ b/services/preview/security/mgmt/v2.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) IngestionSettingsClient { + return NewIngestionSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// 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) IngestionSettingsClient { + return IngestionSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// 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/services/preview/security/mgmt/v2.0/security/iotsecuritysolution.go b/services/preview/security/mgmt/v2.0/security/iotsecuritysolution.go index 3f8a8ca7ae66..66e6d828ff37 100644 --- a/services/preview/security/mgmt/v2.0/security/iotsecuritysolution.go +++ b/services/preview/security/mgmt/v2.0/security/iotsecuritysolution.go @@ -21,15 +21,15 @@ type IotSecuritySolutionClient struct { } // NewIotSecuritySolutionClient creates an instance of the IotSecuritySolutionClient client. -func NewIotSecuritySolutionClient(subscriptionID string, ascLocation string) IotSecuritySolutionClient { - return NewIotSecuritySolutionClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewIotSecuritySolutionClient(subscriptionID string) IotSecuritySolutionClient { + return NewIotSecuritySolutionClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewIotSecuritySolutionClientWithBaseURI creates an instance of the IotSecuritySolutionClient 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 NewIotSecuritySolutionClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotSecuritySolutionClient { - return IotSecuritySolutionClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewIotSecuritySolutionClientWithBaseURI(baseURI string, subscriptionID string) IotSecuritySolutionClient { + return IotSecuritySolutionClient{NewWithBaseURI(baseURI, subscriptionID)} } // Create create new solution manager diff --git a/services/preview/security/mgmt/v2.0/security/iotsecuritysolutions.go b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutions.go index a415f8f553b7..c634e399031b 100644 --- a/services/preview/security/mgmt/v2.0/security/iotsecuritysolutions.go +++ b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutions.go @@ -21,15 +21,15 @@ type IoTSecuritySolutionsClient struct { } // NewIoTSecuritySolutionsClient creates an instance of the IoTSecuritySolutionsClient client. -func NewIoTSecuritySolutionsClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsClient { - return NewIoTSecuritySolutionsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewIoTSecuritySolutionsClient(subscriptionID string) IoTSecuritySolutionsClient { + return NewIoTSecuritySolutionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewIoTSecuritySolutionsClientWithBaseURI creates an instance of the IoTSecuritySolutionsClient 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 NewIoTSecuritySolutionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsClient { - return IoTSecuritySolutionsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewIoTSecuritySolutionsClientWithBaseURI(baseURI string, subscriptionID string) IoTSecuritySolutionsClient { + return IoTSecuritySolutionsClient{NewWithBaseURI(baseURI, subscriptionID)} } // List list of security solutions diff --git a/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalytics.go b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalytics.go index 24501564a5cb..6713124404de 100644 --- a/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalytics.go +++ b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalytics.go @@ -21,15 +21,15 @@ type IoTSecuritySolutionsAnalyticsClient struct { } // NewIoTSecuritySolutionsAnalyticsClient creates an instance of the IoTSecuritySolutionsAnalyticsClient client. -func NewIoTSecuritySolutionsAnalyticsClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsClient { - return NewIoTSecuritySolutionsAnalyticsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewIoTSecuritySolutionsAnalyticsClient(subscriptionID string) IoTSecuritySolutionsAnalyticsClient { + return NewIoTSecuritySolutionsAnalyticsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewIoTSecuritySolutionsAnalyticsClientWithBaseURI creates an instance of the IoTSecuritySolutionsAnalyticsClient // 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 NewIoTSecuritySolutionsAnalyticsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsClient { - return IoTSecuritySolutionsAnalyticsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewIoTSecuritySolutionsAnalyticsClientWithBaseURI(baseURI string, subscriptionID string) IoTSecuritySolutionsAnalyticsClient { + return IoTSecuritySolutionsAnalyticsClient{NewWithBaseURI(baseURI, subscriptionID)} } // GetAll security Analytics of a security solution diff --git a/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsaggregatedalert.go b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsaggregatedalert.go index beb11c128d1e..2abfc0b4a89c 100644 --- a/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsaggregatedalert.go +++ b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsaggregatedalert.go @@ -23,15 +23,15 @@ type IoTSecuritySolutionsAnalyticsAggregatedAlertClient struct { // NewIoTSecuritySolutionsAnalyticsAggregatedAlertClient creates an instance of the // IoTSecuritySolutionsAnalyticsAggregatedAlertClient client. -func NewIoTSecuritySolutionsAnalyticsAggregatedAlertClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsAggregatedAlertClient { - return NewIoTSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewIoTSecuritySolutionsAnalyticsAggregatedAlertClient(subscriptionID string) IoTSecuritySolutionsAnalyticsAggregatedAlertClient { + return NewIoTSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewIoTSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI creates an instance of the // IoTSecuritySolutionsAnalyticsAggregatedAlertClient 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 NewIoTSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsAggregatedAlertClient { - return IoTSecuritySolutionsAnalyticsAggregatedAlertClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewIoTSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI(baseURI string, subscriptionID string) IoTSecuritySolutionsAnalyticsAggregatedAlertClient { + return IoTSecuritySolutionsAnalyticsAggregatedAlertClient{NewWithBaseURI(baseURI, subscriptionID)} } // Dismiss security Analytics of a security solution diff --git a/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsaggregatedalerts.go b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsaggregatedalerts.go index 6c5b2b3362d9..ad6e8a41cd82 100644 --- a/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsaggregatedalerts.go +++ b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsaggregatedalerts.go @@ -23,15 +23,15 @@ type IoTSecuritySolutionsAnalyticsAggregatedAlertsClient struct { // NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClient creates an instance of the // IoTSecuritySolutionsAnalyticsAggregatedAlertsClient client. -func NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsAggregatedAlertsClient { - return NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClient(subscriptionID string) IoTSecuritySolutionsAnalyticsAggregatedAlertsClient { + return NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClientWithBaseURI creates an instance of the // IoTSecuritySolutionsAnalyticsAggregatedAlertsClient 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 NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsAggregatedAlertsClient { - return IoTSecuritySolutionsAnalyticsAggregatedAlertsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClientWithBaseURI(baseURI string, subscriptionID string) IoTSecuritySolutionsAnalyticsAggregatedAlertsClient { + return IoTSecuritySolutionsAnalyticsAggregatedAlertsClient{NewWithBaseURI(baseURI, subscriptionID)} } // List security Analytics of a security solution diff --git a/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsrecommendation.go b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsrecommendation.go index 5694e3f10169..91ed81158126 100644 --- a/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsrecommendation.go +++ b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsrecommendation.go @@ -23,15 +23,15 @@ type IoTSecuritySolutionsAnalyticsRecommendationClient struct { // NewIoTSecuritySolutionsAnalyticsRecommendationClient creates an instance of the // IoTSecuritySolutionsAnalyticsRecommendationClient client. -func NewIoTSecuritySolutionsAnalyticsRecommendationClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsRecommendationClient { - return NewIoTSecuritySolutionsAnalyticsRecommendationClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewIoTSecuritySolutionsAnalyticsRecommendationClient(subscriptionID string) IoTSecuritySolutionsAnalyticsRecommendationClient { + return NewIoTSecuritySolutionsAnalyticsRecommendationClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewIoTSecuritySolutionsAnalyticsRecommendationClientWithBaseURI creates an instance of the // IoTSecuritySolutionsAnalyticsRecommendationClient 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 NewIoTSecuritySolutionsAnalyticsRecommendationClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsRecommendationClient { - return IoTSecuritySolutionsAnalyticsRecommendationClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewIoTSecuritySolutionsAnalyticsRecommendationClientWithBaseURI(baseURI string, subscriptionID string) IoTSecuritySolutionsAnalyticsRecommendationClient { + return IoTSecuritySolutionsAnalyticsRecommendationClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get security Analytics of a security solution diff --git a/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsrecommendations.go b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsrecommendations.go index 8b427163821c..36b77fef9e18 100644 --- a/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsrecommendations.go +++ b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsanalyticsrecommendations.go @@ -23,15 +23,15 @@ type IoTSecuritySolutionsAnalyticsRecommendationsClient struct { // NewIoTSecuritySolutionsAnalyticsRecommendationsClient creates an instance of the // IoTSecuritySolutionsAnalyticsRecommendationsClient client. -func NewIoTSecuritySolutionsAnalyticsRecommendationsClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsRecommendationsClient { - return NewIoTSecuritySolutionsAnalyticsRecommendationsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewIoTSecuritySolutionsAnalyticsRecommendationsClient(subscriptionID string) IoTSecuritySolutionsAnalyticsRecommendationsClient { + return NewIoTSecuritySolutionsAnalyticsRecommendationsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewIoTSecuritySolutionsAnalyticsRecommendationsClientWithBaseURI creates an instance of the // IoTSecuritySolutionsAnalyticsRecommendationsClient 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 NewIoTSecuritySolutionsAnalyticsRecommendationsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsRecommendationsClient { - return IoTSecuritySolutionsAnalyticsRecommendationsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewIoTSecuritySolutionsAnalyticsRecommendationsClientWithBaseURI(baseURI string, subscriptionID string) IoTSecuritySolutionsAnalyticsRecommendationsClient { + return IoTSecuritySolutionsAnalyticsRecommendationsClient{NewWithBaseURI(baseURI, subscriptionID)} } // List security Analytics of a security solution diff --git a/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsresourcegroup.go b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsresourcegroup.go index e5c27ac01093..0d619dae4837 100644 --- a/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsresourcegroup.go +++ b/services/preview/security/mgmt/v2.0/security/iotsecuritysolutionsresourcegroup.go @@ -23,15 +23,15 @@ type IoTSecuritySolutionsResourceGroupClient struct { // NewIoTSecuritySolutionsResourceGroupClient creates an instance of the IoTSecuritySolutionsResourceGroupClient // client. -func NewIoTSecuritySolutionsResourceGroupClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsResourceGroupClient { - return NewIoTSecuritySolutionsResourceGroupClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewIoTSecuritySolutionsResourceGroupClient(subscriptionID string) IoTSecuritySolutionsResourceGroupClient { + return NewIoTSecuritySolutionsResourceGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewIoTSecuritySolutionsResourceGroupClientWithBaseURI creates an instance of the // IoTSecuritySolutionsResourceGroupClient 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 NewIoTSecuritySolutionsResourceGroupClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsResourceGroupClient { - return IoTSecuritySolutionsResourceGroupClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewIoTSecuritySolutionsResourceGroupClientWithBaseURI(baseURI string, subscriptionID string) IoTSecuritySolutionsResourceGroupClient { + return IoTSecuritySolutionsResourceGroupClient{NewWithBaseURI(baseURI, subscriptionID)} } // List list of security solutions diff --git a/services/preview/security/mgmt/v2.0/security/jitnetworkaccesspolicies.go b/services/preview/security/mgmt/v2.0/security/jitnetworkaccesspolicies.go index 9c9e93748cac..4110298de2b1 100644 --- a/services/preview/security/mgmt/v2.0/security/jitnetworkaccesspolicies.go +++ b/services/preview/security/mgmt/v2.0/security/jitnetworkaccesspolicies.go @@ -21,23 +21,25 @@ type JitNetworkAccessPoliciesClient struct { } // NewJitNetworkAccessPoliciesClient creates an instance of the JitNetworkAccessPoliciesClient client. -func NewJitNetworkAccessPoliciesClient(subscriptionID string, ascLocation string) JitNetworkAccessPoliciesClient { - return NewJitNetworkAccessPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewJitNetworkAccessPoliciesClient(subscriptionID string) JitNetworkAccessPoliciesClient { + return NewJitNetworkAccessPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewJitNetworkAccessPoliciesClientWithBaseURI creates an instance of the JitNetworkAccessPoliciesClient 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 NewJitNetworkAccessPoliciesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) JitNetworkAccessPoliciesClient { - return JitNetworkAccessPoliciesClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewJitNetworkAccessPoliciesClientWithBaseURI(baseURI string, subscriptionID string) JitNetworkAccessPoliciesClient { + return JitNetworkAccessPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate create a policy for protecting resources using Just-in-Time access control // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // jitNetworkAccessPolicyName - name of a Just-in-Time access configuration policy. -func (client JitNetworkAccessPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicy) (result JitNetworkAccessPolicy, err error) { +func (client JitNetworkAccessPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicy) (result JitNetworkAccessPolicy, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.CreateOrUpdate") defer func() { @@ -61,7 +63,7 @@ func (client JitNetworkAccessPoliciesClient) CreateOrUpdate(ctx context.Context, return result, validation.NewError("security.JitNetworkAccessPoliciesClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, jitNetworkAccessPolicyName, body) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body) if err != nil { err = autorest.NewErrorWithError(err, "security.JitNetworkAccessPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -84,9 +86,9 @@ func (client JitNetworkAccessPoliciesClient) CreateOrUpdate(ctx context.Context, } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client JitNetworkAccessPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicy) (*http.Request, error) { +func (client JitNetworkAccessPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicy) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "jitNetworkAccessPolicyName": autorest.Encode("path", jitNetworkAccessPolicyName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -133,8 +135,10 @@ func (client JitNetworkAccessPoliciesClient) CreateOrUpdateResponder(resp *http. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // jitNetworkAccessPolicyName - name of a Just-in-Time access configuration policy. -func (client JitNetworkAccessPoliciesClient) Delete(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string) (result autorest.Response, err error) { +func (client JitNetworkAccessPoliciesClient) Delete(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.Delete") defer func() { @@ -155,7 +159,7 @@ func (client JitNetworkAccessPoliciesClient) Delete(ctx context.Context, resourc return result, validation.NewError("security.JitNetworkAccessPoliciesClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, jitNetworkAccessPolicyName) + req, err := client.DeletePreparer(ctx, resourceGroupName, ascLocation, jitNetworkAccessPolicyName) if err != nil { err = autorest.NewErrorWithError(err, "security.JitNetworkAccessPoliciesClient", "Delete", nil, "Failure preparing request") return @@ -178,9 +182,9 @@ func (client JitNetworkAccessPoliciesClient) Delete(ctx context.Context, resourc } // DeletePreparer prepares the Delete request. -func (client JitNetworkAccessPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string) (*http.Request, error) { +func (client JitNetworkAccessPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "jitNetworkAccessPolicyName": autorest.Encode("path", jitNetworkAccessPolicyName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -220,8 +224,10 @@ func (client JitNetworkAccessPoliciesClient) DeleteResponder(resp *http.Response // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // jitNetworkAccessPolicyName - name of a Just-in-Time access configuration policy. -func (client JitNetworkAccessPoliciesClient) Get(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string) (result JitNetworkAccessPolicy, err error) { +func (client JitNetworkAccessPoliciesClient) Get(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string) (result JitNetworkAccessPolicy, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.Get") defer func() { @@ -242,7 +248,7 @@ func (client JitNetworkAccessPoliciesClient) Get(ctx context.Context, resourceGr return result, validation.NewError("security.JitNetworkAccessPoliciesClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, jitNetworkAccessPolicyName) + req, err := client.GetPreparer(ctx, resourceGroupName, ascLocation, jitNetworkAccessPolicyName) if err != nil { err = autorest.NewErrorWithError(err, "security.JitNetworkAccessPoliciesClient", "Get", nil, "Failure preparing request") return @@ -265,9 +271,9 @@ func (client JitNetworkAccessPoliciesClient) Get(ctx context.Context, resourceGr } // GetPreparer prepares the Get request. -func (client JitNetworkAccessPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string) (*http.Request, error) { +func (client JitNetworkAccessPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "jitNetworkAccessPolicyName": autorest.Encode("path", jitNetworkAccessPolicyName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -308,8 +314,10 @@ func (client JitNetworkAccessPoliciesClient) GetResponder(resp *http.Response) ( // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // jitNetworkAccessPolicyName - name of a Just-in-Time access configuration policy. -func (client JitNetworkAccessPoliciesClient) Initiate(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicyInitiateRequest) (result JitNetworkAccessRequest, err error) { +func (client JitNetworkAccessPoliciesClient) Initiate(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicyInitiateRequest) (result JitNetworkAccessRequest, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.Initiate") defer func() { @@ -332,7 +340,7 @@ func (client JitNetworkAccessPoliciesClient) Initiate(ctx context.Context, resou return result, validation.NewError("security.JitNetworkAccessPoliciesClient", "Initiate", err.Error()) } - req, err := client.InitiatePreparer(ctx, resourceGroupName, jitNetworkAccessPolicyName, body) + req, err := client.InitiatePreparer(ctx, resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body) if err != nil { err = autorest.NewErrorWithError(err, "security.JitNetworkAccessPoliciesClient", "Initiate", nil, "Failure preparing request") return @@ -355,9 +363,9 @@ func (client JitNetworkAccessPoliciesClient) Initiate(ctx context.Context, resou } // InitiatePreparer prepares the Initiate request. -func (client JitNetworkAccessPoliciesClient) InitiatePreparer(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicyInitiateRequest) (*http.Request, error) { +func (client JitNetworkAccessPoliciesClient) InitiatePreparer(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicyInitiateRequest) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "jitNetworkAccessPolicyInitiateType": autorest.Encode("path", "initiate"), "jitNetworkAccessPolicyName": autorest.Encode("path", jitNetworkAccessPolicyName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -517,7 +525,10 @@ func (client JitNetworkAccessPoliciesClient) ListComplete(ctx context.Context) ( } // ListByRegion policies for protecting resources using Just-in-Time access control for the subscription, location -func (client JitNetworkAccessPoliciesClient) ListByRegion(ctx context.Context) (result JitNetworkAccessPoliciesListPage, err error) { +// Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations +func (client JitNetworkAccessPoliciesClient) ListByRegion(ctx context.Context, ascLocation string) (result JitNetworkAccessPoliciesListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.ListByRegion") defer func() { @@ -535,7 +546,7 @@ func (client JitNetworkAccessPoliciesClient) ListByRegion(ctx context.Context) ( } result.fn = client.listByRegionNextResults - req, err := client.ListByRegionPreparer(ctx) + req, err := client.ListByRegionPreparer(ctx, ascLocation) if err != nil { err = autorest.NewErrorWithError(err, "security.JitNetworkAccessPoliciesClient", "ListByRegion", nil, "Failure preparing request") return @@ -562,9 +573,9 @@ func (client JitNetworkAccessPoliciesClient) ListByRegion(ctx context.Context) ( } // ListByRegionPreparer prepares the ListByRegion request. -func (client JitNetworkAccessPoliciesClient) ListByRegionPreparer(ctx context.Context) (*http.Request, error) { +func (client JitNetworkAccessPoliciesClient) ListByRegionPreparer(ctx context.Context, ascLocation string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -621,7 +632,7 @@ func (client JitNetworkAccessPoliciesClient) listByRegionNextResults(ctx context } // ListByRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client JitNetworkAccessPoliciesClient) ListByRegionComplete(ctx context.Context) (result JitNetworkAccessPoliciesListIterator, err error) { +func (client JitNetworkAccessPoliciesClient) ListByRegionComplete(ctx context.Context, ascLocation string) (result JitNetworkAccessPoliciesListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.ListByRegion") defer func() { @@ -632,7 +643,7 @@ func (client JitNetworkAccessPoliciesClient) ListByRegionComplete(ctx context.Co tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByRegion(ctx) + result.page, err = client.ListByRegion(ctx, ascLocation) return } @@ -769,7 +780,9 @@ func (client JitNetworkAccessPoliciesClient) ListByResourceGroupComplete(ctx con // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. -func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegion(ctx context.Context, resourceGroupName string) (result JitNetworkAccessPoliciesListPage, err error) { +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations +func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegion(ctx context.Context, resourceGroupName string, ascLocation string) (result JitNetworkAccessPoliciesListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.ListByResourceGroupAndRegion") defer func() { @@ -791,7 +804,7 @@ func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegion(ctx co } result.fn = client.listByResourceGroupAndRegionNextResults - req, err := client.ListByResourceGroupAndRegionPreparer(ctx, resourceGroupName) + req, err := client.ListByResourceGroupAndRegionPreparer(ctx, resourceGroupName, ascLocation) if err != nil { err = autorest.NewErrorWithError(err, "security.JitNetworkAccessPoliciesClient", "ListByResourceGroupAndRegion", nil, "Failure preparing request") return @@ -818,9 +831,9 @@ func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegion(ctx co } // ListByResourceGroupAndRegionPreparer prepares the ListByResourceGroupAndRegion request. -func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegionPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { +func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegionPreparer(ctx context.Context, resourceGroupName string, ascLocation string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -878,7 +891,7 @@ func (client JitNetworkAccessPoliciesClient) listByResourceGroupAndRegionNextRes } // ListByResourceGroupAndRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegionComplete(ctx context.Context, resourceGroupName string) (result JitNetworkAccessPoliciesListIterator, err error) { +func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegionComplete(ctx context.Context, resourceGroupName string, ascLocation string) (result JitNetworkAccessPoliciesListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.ListByResourceGroupAndRegion") defer func() { @@ -889,6 +902,6 @@ func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegionComplet tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByResourceGroupAndRegion(ctx, resourceGroupName) + result.page, err = client.ListByResourceGroupAndRegion(ctx, resourceGroupName, ascLocation) return } diff --git a/services/preview/security/mgmt/v2.0/security/locations.go b/services/preview/security/mgmt/v2.0/security/locations.go index a8b208f811fc..f6381e9bb043 100644 --- a/services/preview/security/mgmt/v2.0/security/locations.go +++ b/services/preview/security/mgmt/v2.0/security/locations.go @@ -21,18 +21,21 @@ type LocationsClient struct { } // NewLocationsClient creates an instance of the LocationsClient client. -func NewLocationsClient(subscriptionID string, ascLocation string) LocationsClient { - return NewLocationsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewLocationsClient(subscriptionID string) LocationsClient { + return NewLocationsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewLocationsClientWithBaseURI creates an instance of the LocationsClient 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 NewLocationsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) LocationsClient { - return LocationsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewLocationsClientWithBaseURI(baseURI string, subscriptionID string) LocationsClient { + return LocationsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get details of a specific location -func (client LocationsClient) Get(ctx context.Context) (result AscLocation, err error) { +// Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations +func (client LocationsClient) Get(ctx context.Context, ascLocation string) (result AscLocation, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LocationsClient.Get") defer func() { @@ -49,7 +52,7 @@ func (client LocationsClient) Get(ctx context.Context) (result AscLocation, err return result, validation.NewError("security.LocationsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx) + req, err := client.GetPreparer(ctx, ascLocation) if err != nil { err = autorest.NewErrorWithError(err, "security.LocationsClient", "Get", nil, "Failure preparing request") return @@ -72,9 +75,9 @@ func (client LocationsClient) Get(ctx context.Context) (result AscLocation, err } // GetPreparer prepares the Get request. -func (client LocationsClient) GetPreparer(ctx context.Context) (*http.Request, error) { +func (client LocationsClient) GetPreparer(ctx context.Context, ascLocation string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } diff --git a/services/preview/security/mgmt/v3.0/security/iotrecommendationtypes.go b/services/preview/security/mgmt/v2.0/security/mdeonboardings.go similarity index 52% rename from services/preview/security/mgmt/v3.0/security/iotrecommendationtypes.go rename to services/preview/security/mgmt/v2.0/security/mdeonboardings.go index 23f77b0dfd7b..9b52e014e356 100644 --- a/services/preview/security/mgmt/v3.0/security/iotrecommendationtypes.go +++ b/services/preview/security/mgmt/v2.0/security/mdeonboardings.go @@ -15,29 +15,26 @@ import ( "net/http" ) -// IotRecommendationTypesClient is the API spec for Microsoft.Security (Azure Security Center) resource provider -type IotRecommendationTypesClient struct { +// MdeOnboardingsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type MdeOnboardingsClient struct { BaseClient } -// NewIotRecommendationTypesClient creates an instance of the IotRecommendationTypesClient client. -func NewIotRecommendationTypesClient(subscriptionID string, ascLocation string) IotRecommendationTypesClient { - return NewIotRecommendationTypesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +// NewMdeOnboardingsClient creates an instance of the MdeOnboardingsClient client. +func NewMdeOnboardingsClient(subscriptionID string) MdeOnboardingsClient { + return NewMdeOnboardingsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewIotRecommendationTypesClientWithBaseURI creates an instance of the IotRecommendationTypesClient 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 NewIotRecommendationTypesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotRecommendationTypesClient { - return IotRecommendationTypesClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +// NewMdeOnboardingsClientWithBaseURI creates an instance of the MdeOnboardingsClient 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 NewMdeOnboardingsClientWithBaseURI(baseURI string, subscriptionID string) MdeOnboardingsClient { + return MdeOnboardingsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get get IoT recommendation type -// Parameters: -// iotRecommendationTypeName - name of the recommendation type -func (client IotRecommendationTypesClient) Get(ctx context.Context, iotRecommendationTypeName string) (result IotRecommendationType, err error) { +// Get the default configuration or data needed to onboard the machine to MDE +func (client MdeOnboardingsClient) Get(ctx context.Context) (result MdeOnboardingData, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationTypesClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/MdeOnboardingsClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -49,25 +46,25 @@ func (client IotRecommendationTypesClient) Get(ctx context.Context, iotRecommend 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", "Get", err.Error()) + return result, validation.NewError("security.MdeOnboardingsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, iotRecommendationTypeName) + req, err := client.GetPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "security.IotRecommendationTypesClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.MdeOnboardingsClient", "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.IotRecommendationTypesClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.MdeOnboardingsClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.IotRecommendationTypesClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.MdeOnboardingsClient", "Get", resp, "Failure responding to request") return } @@ -75,13 +72,12 @@ func (client IotRecommendationTypesClient) Get(ctx context.Context, iotRecommend } // GetPreparer prepares the Get request. -func (client IotRecommendationTypesClient) GetPreparer(ctx context.Context, iotRecommendationTypeName string) (*http.Request, error) { +func (client MdeOnboardingsClient) GetPreparer(ctx context.Context) (*http.Request, error) { pathParameters := map[string]interface{}{ - "iotRecommendationTypeName": autorest.Encode("path", iotRecommendationTypeName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-08-06-preview" + const APIVersion = "2021-10-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -89,20 +85,20 @@ func (client IotRecommendationTypesClient) GetPreparer(ctx context.Context, iotR preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes/{iotRecommendationTypeName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings/default", 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 IotRecommendationTypesClient) GetSender(req *http.Request) (*http.Response, error) { +func (client MdeOnboardingsClient) 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 IotRecommendationTypesClient) GetResponder(resp *http.Response) (result IotRecommendationType, err error) { +func (client MdeOnboardingsClient) GetResponder(resp *http.Response) (result MdeOnboardingData, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -112,10 +108,10 @@ func (client IotRecommendationTypesClient) GetResponder(resp *http.Response) (re return } -// List list IoT recommendation types -func (client IotRecommendationTypesClient) List(ctx context.Context) (result IotRecommendationTypeList, err error) { +// List the configuration or data needed to onboard the machine to MDE +func (client MdeOnboardingsClient) List(ctx context.Context) (result MdeOnboardingDataList, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationTypesClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/MdeOnboardingsClient.List") defer func() { sc := -1 if result.Response.Response != nil { @@ -127,25 +123,25 @@ func (client IotRecommendationTypesClient) List(ctx context.Context) (result Iot 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", "List", err.Error()) + return result, validation.NewError("security.MdeOnboardingsClient", "List", err.Error()) } req, err := client.ListPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "security.IotRecommendationTypesClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.MdeOnboardingsClient", "List", nil, "Failure preparing request") return } resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IotRecommendationTypesClient", "List", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.MdeOnboardingsClient", "List", resp, "Failure sending request") return } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.IotRecommendationTypesClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.MdeOnboardingsClient", "List", resp, "Failure responding to request") return } @@ -153,12 +149,12 @@ func (client IotRecommendationTypesClient) List(ctx context.Context) (result Iot } // ListPreparer prepares the List request. -func (client IotRecommendationTypesClient) ListPreparer(ctx context.Context) (*http.Request, error) { +func (client MdeOnboardingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-08-06-preview" + const APIVersion = "2021-10-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -166,20 +162,20 @@ func (client IotRecommendationTypesClient) ListPreparer(ctx context.Context) (*h preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings", 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 IotRecommendationTypesClient) ListSender(req *http.Request) (*http.Response, error) { +func (client MdeOnboardingsClient) 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 IotRecommendationTypesClient) ListResponder(resp *http.Response) (result IotRecommendationTypeList, err error) { +func (client MdeOnboardingsClient) ListResponder(resp *http.Response) (result MdeOnboardingDataList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/services/preview/security/mgmt/v2.0/security/models.go b/services/preview/security/mgmt/v2.0/security/models.go index 3e3bc607845d..ef1fbcf429db 100644 --- a/services/preview/security/mgmt/v2.0/security/models.go +++ b/services/preview/security/mgmt/v2.0/security/models.go @@ -40,7 +40,7 @@ type AadExternalSecuritySolution struct { // Location - READ-ONLY; Location where the resource is stored Location *string `json:"location,omitempty"` // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' - Kind KindEnum `json:"kind,omitempty"` + Kind KindEnum1 `json:"kind,omitempty"` } // MarshalJSON is the custom marshaler for AadExternalSecuritySolution. @@ -2548,10 +2548,10 @@ func (awg *AppWhitelistingGroup) UnmarshalJSON(body []byte) error { return nil } -// AppWhitelistingGroupData represents a VM/server group and set of rules that are Recommended by Azure -// Security Center to be allowed +// AppWhitelistingGroupData represents a VM/server group and set of rules that are Recommended by Microsoft +// Defender for Cloud to be allowed type AppWhitelistingGroupData 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 - Possible values include: 'ConfigurationStatus2Configured', 'ConfigurationStatus2NotConfigured', 'ConfigurationStatus2InProgress', 'ConfigurationStatus2Failed', 'ConfigurationStatus2NoStatus' @@ -2566,7 +2566,7 @@ type AppWhitelistingGroupData struct { } // AppWhitelistingGroups represents a list of VM/server groups and set of rules that are Recommended by -// Azure Security Center to be allowed +// Microsoft Defender for Cloud to be allowed type AppWhitelistingGroups struct { autorest.Response `json:"-"` Value *[]AppWhitelistingGroup `json:"value,omitempty"` @@ -2788,7 +2788,7 @@ type AtaExternalSecuritySolution struct { // Location - READ-ONLY; Location where the resource is stored Location *string `json:"location,omitempty"` // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' - Kind KindEnum `json:"kind,omitempty"` + Kind KindEnum1 `json:"kind,omitempty"` } // MarshalJSON is the custom marshaler for AtaExternalSecuritySolution. @@ -3245,7 +3245,7 @@ func (aa AutomationAction) AsBasicAutomationAction() (BasicAutomationAction, boo } // AutomationActionEventHub the target Event Hub to which event data will be exported. To learn more about -// Security Center continuous export capabilities, visit https://aka.ms/ASCExportLearnMore +// Microsoft Defender for Cloud continuous export capabilities, visit https://aka.ms/ASCExportLearnMore type AutomationActionEventHub struct { // EventHubResourceID - The target Event Hub Azure Resource ID. EventHubResourceID *string `json:"eventHubResourceId,omitempty"` @@ -3298,8 +3298,9 @@ func (aaeh AutomationActionEventHub) AsBasicAutomationAction() (BasicAutomationA return &aaeh, true } -// AutomationActionLogicApp the logic app action that should be triggered. To learn more about Security -// Center's Workflow Automation capabilities, visit https://aka.ms/ASCWorkflowAutomationLearnMore +// AutomationActionLogicApp the logic app action that should be triggered. To learn more about Microsoft +// Defender for Cloud's Workflow Automation capabilities, visit +// https://aka.ms/ASCWorkflowAutomationLearnMore type AutomationActionLogicApp struct { // LogicAppResourceID - The triggered Logic App Azure Resource ID. This can also reside on other subscriptions, given that you have permissions to trigger the Logic App LogicAppResourceID *string `json:"logicAppResourceId,omitempty"` @@ -3354,8 +3355,8 @@ func (aala AutomationActionLogicApp) AsBasicAutomationAction() (BasicAutomationA // alerts data will reside in the 'SecurityAlert' table and the assessments data will reside in the // 'SecurityRecommendation' table (under the 'Security'/'SecurityCenterFree' solutions). Note that in order // to view the data in the workspace, the Security Center Log Analytics free/standard solution needs to be -// enabled on that workspace. To learn more about Security Center continuous export capabilities, visit -// https://aka.ms/ASCExportLearnMore +// enabled on that workspace. To learn more about Microsoft Defender for Cloud continuous export +// capabilities, visit https://aka.ms/ASCExportLearnMore type AutomationActionWorkspace struct { // WorkspaceResourceID - The fully qualified Log Analytics Workspace Azure Resource ID. WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"` @@ -3662,7 +3663,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', 'EventSourceAssessmentsSnapshot', 'EventSourceSubAssessments', 'EventSourceSubAssessmentsSnapshot', '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"` @@ -4165,7 +4166,7 @@ type CefExternalSecuritySolution struct { // Location - READ-ONLY; Location where the resource is stored Location *string `json:"location,omitempty"` // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' - Kind KindEnum `json:"kind,omitempty"` + Kind KindEnum1 `json:"kind,omitempty"` } // MarshalJSON is the custom marshaler for CefExternalSecuritySolution. @@ -4326,9 +4327,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"` } @@ -4365,12 +4367,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. @@ -4379,6 +4387,112 @@ func (ceb CloudErrorBody) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// BasicCloudOffering the security offering details +type BasicCloudOffering interface { + AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) + AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) + AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) + AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) + AsCloudOffering() (*CloudOffering, bool) +} + +// CloudOffering the security offering details +type CloudOffering struct { + // Description - READ-ONLY; The offering description. + Description *string `json:"description,omitempty"` + // OfferingType - Possible values include: 'OfferingTypeCloudOffering', 'OfferingTypeCspmMonitorAws', 'OfferingTypeDefenderForContainersAws', 'OfferingTypeDefenderForServersAws', 'OfferingTypeInformationProtectionAws' + OfferingType OfferingType `json:"offeringType,omitempty"` +} + +func unmarshalBasicCloudOffering(body []byte) (BasicCloudOffering, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["offeringType"] { + case string(OfferingTypeCspmMonitorAws): + var cmao CspmMonitorAwsOffering + err := json.Unmarshal(body, &cmao) + return cmao, err + case string(OfferingTypeDefenderForContainersAws): + var dfcao DefenderForContainersAwsOffering + err := json.Unmarshal(body, &dfcao) + return dfcao, err + case string(OfferingTypeDefenderForServersAws): + var dfsao DefenderForServersAwsOffering + err := json.Unmarshal(body, &dfsao) + return dfsao, err + case string(OfferingTypeInformationProtectionAws): + var ipao InformationProtectionAwsOffering + err := json.Unmarshal(body, &ipao) + return ipao, err + default: + var co CloudOffering + err := json.Unmarshal(body, &co) + return co, err + } +} +func unmarshalBasicCloudOfferingArray(body []byte) ([]BasicCloudOffering, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + coArray := make([]BasicCloudOffering, len(rawMessages)) + + for index, rawMessage := range rawMessages { + co, err := unmarshalBasicCloudOffering(*rawMessage) + if err != nil { + return nil, err + } + coArray[index] = co + } + return coArray, nil +} + +// MarshalJSON is the custom marshaler for CloudOffering. +func (co CloudOffering) MarshalJSON() ([]byte, error) { + co.OfferingType = OfferingTypeCloudOffering + objectMap := make(map[string]interface{}) + if co.OfferingType != "" { + objectMap["offeringType"] = co.OfferingType + } + return json.Marshal(objectMap) +} + +// AsCspmMonitorAwsOffering is the BasicCloudOffering implementation for CloudOffering. +func (co CloudOffering) AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) { + return nil, false +} + +// AsDefenderForContainersAwsOffering is the BasicCloudOffering implementation for CloudOffering. +func (co CloudOffering) AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) { + return nil, false +} + +// AsDefenderForServersAwsOffering is the BasicCloudOffering implementation for CloudOffering. +func (co CloudOffering) AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) { + return nil, false +} + +// AsInformationProtectionAwsOffering is the BasicCloudOffering implementation for CloudOffering. +func (co CloudOffering) AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) { + return nil, false +} + +// AsCloudOffering is the BasicCloudOffering implementation for CloudOffering. +func (co CloudOffering) AsCloudOffering() (*CloudOffering, bool) { + return &co, true +} + +// AsBasicCloudOffering is the BasicCloudOffering implementation for CloudOffering. +func (co CloudOffering) AsBasicCloudOffering() (BasicCloudOffering, bool) { + return &co, true +} + // Compliance compliance of a scope type Compliance struct { autorest.Response `json:"-"` @@ -4690,6 +4804,13 @@ type ConnectedWorkspace struct { ID *string `json:"id,omitempty"` } +// 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 { @@ -4873,6 +4994,220 @@ func (ctina ConnectionToIPNotAllowed) AsBasicCustomAlertRule() (BasicCustomAlert return &ctina, true } +// Connector the security connector resource. +type Connector struct { + autorest.Response `json:"-"` + // SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty"` + // ConnectorProperties - Security connector data + *ConnectorProperties `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"` + // Location - Location where the resource is stored + Location *string `json:"location,omitempty"` + // Kind - Kind of the resource + Kind *string `json:"kind,omitempty"` + // Etag - Entity tag is used for comparing two or more entities from the same requested resource. + Etag *string `json:"etag,omitempty"` + // Tags - A list of key value pairs that describe the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Connector. +func (c Connector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.ConnectorProperties != nil { + objectMap["properties"] = c.ConnectorProperties + } + if c.Location != nil { + objectMap["location"] = c.Location + } + if c.Kind != nil { + objectMap["kind"] = c.Kind + } + if c.Etag != nil { + objectMap["etag"] = c.Etag + } + if c.Tags != nil { + objectMap["tags"] = c.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Connector struct. +func (c *Connector) 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 "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + c.SystemData = &systemData + } + case "properties": + if v != nil { + var connectorProperties ConnectorProperties + err = json.Unmarshal(*v, &connectorProperties) + if err != nil { + return err + } + c.ConnectorProperties = &connectorProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + c.Location = &location + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + c.Kind = &kind + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + c.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + c.Tags = tags + } + } + } + + return nil +} + +// ConnectorProperties a set of properties that defines the security connector configuration. +type ConnectorProperties struct { + // HierarchyIdentifier - The multi cloud resource identifier (account id in case of AWS connector). + HierarchyIdentifier *string `json:"hierarchyIdentifier,omitempty"` + // CloudName - The multi cloud resource's cloud name. Possible values include: 'Azure', 'AWS', 'GCP' + CloudName CloudName `json:"cloudName,omitempty"` + // Offerings - A collection of offerings for the security connector. + Offerings *[]BasicCloudOffering `json:"offerings,omitempty"` + // OrganizationalData - The multi cloud account's organizational data + OrganizationalData *ConnectorPropertiesOrganizationalData `json:"organizationalData,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ConnectorProperties struct. +func (cp *ConnectorProperties) 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 "hierarchyIdentifier": + if v != nil { + var hierarchyIdentifier string + err = json.Unmarshal(*v, &hierarchyIdentifier) + if err != nil { + return err + } + cp.HierarchyIdentifier = &hierarchyIdentifier + } + case "cloudName": + if v != nil { + var cloudName CloudName + err = json.Unmarshal(*v, &cloudName) + if err != nil { + return err + } + cp.CloudName = cloudName + } + case "offerings": + if v != nil { + offerings, err := unmarshalBasicCloudOfferingArray(*v) + if err != nil { + return err + } + cp.Offerings = &offerings + } + case "organizationalData": + if v != nil { + var organizationalData ConnectorPropertiesOrganizationalData + err = json.Unmarshal(*v, &organizationalData) + if err != nil { + return err + } + cp.OrganizationalData = &organizationalData + } + } + } + + return nil +} + +// ConnectorPropertiesOrganizationalData the multi cloud account's organizational data +type ConnectorPropertiesOrganizationalData struct { + // OrganizationMembershipType - The multi cloud account's membership type in the organization. Possible values include: 'Member', 'Organization' + OrganizationMembershipType OrganizationMembershipType `json:"organizationMembershipType,omitempty"` + // ParentHierarchyID - If the multi cloud account is not of membership type organization, this will be the ID of the account's parent + ParentHierarchyID *string `json:"parentHierarchyId,omitempty"` + // StacksetName - If the multi cloud account is of membership type organization, this will be the name of the onboarding stackset + StacksetName *string `json:"stacksetName,omitempty"` + // ExcludedAccountIds - If the multi cloud account is of membership type organization, list of accounts excluded from offering + ExcludedAccountIds *[]string `json:"excludedAccountIds,omitempty"` +} + // ConnectorSetting the connector setting type ConnectorSetting struct { autorest.Response `json:"-"` @@ -5154,48 +5489,216 @@ func (csp *ConnectorSettingProperties) UnmarshalJSON(body []byte) error { return nil } -// Contact contact details for security issues -type Contact struct { +// ConnectorsList list of security connectors response. +type ConnectorsList struct { autorest.Response `json:"-"` - // ContactProperties - Security contact data - *ContactProperties `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"` + // Value - The list of security connectors under the given scope. + Value *[]Connector `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for Contact. -func (c Contact) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ConnectorsList. +func (cl ConnectorsList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if c.ContactProperties != nil { - objectMap["properties"] = c.ContactProperties + if cl.Value != nil { + objectMap["value"] = cl.Value } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for Contact struct. -func (c *Contact) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) +// ConnectorsListIterator provides access to a complete listing of Connector values. +type ConnectorsListIterator struct { + i int + page ConnectorsListPage +} + +// 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 *ConnectorsListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsListIterator.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 } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var contactProperties ContactProperties - err = json.Unmarshal(*v, &contactProperties) - if err != nil { - return err - } - c.ContactProperties = &contactProperties - } - case "id": - if v != nil { + 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 *ConnectorsListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ConnectorsListIterator) 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 ConnectorsListIterator) Response() ConnectorsList { + 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 ConnectorsListIterator) Value() Connector { + if !iter.page.NotDone() { + return Connector{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ConnectorsListIterator type. +func NewConnectorsListIterator(page ConnectorsListPage) ConnectorsListIterator { + return ConnectorsListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cl ConnectorsList) IsEmpty() bool { + return cl.Value == nil || len(*cl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (cl ConnectorsList) hasNextLink() bool { + return cl.NextLink != nil && len(*cl.NextLink) != 0 +} + +// connectorsListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cl ConnectorsList) connectorsListPreparer(ctx context.Context) (*http.Request, error) { + if !cl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cl.NextLink))) +} + +// ConnectorsListPage contains a page of Connector values. +type ConnectorsListPage struct { + fn func(context.Context, ConnectorsList) (ConnectorsList, error) + cl ConnectorsList +} + +// 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 *ConnectorsListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsListPage.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.cl) + if err != nil { + return err + } + page.cl = 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 *ConnectorsListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ConnectorsListPage) NotDone() bool { + return !page.cl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ConnectorsListPage) Response() ConnectorsList { + return page.cl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ConnectorsListPage) Values() []Connector { + if page.cl.IsEmpty() { + return nil + } + return *page.cl.Value +} + +// Creates a new instance of the ConnectorsListPage type. +func NewConnectorsListPage(cur ConnectorsList, getNextPage func(context.Context, ConnectorsList) (ConnectorsList, error)) ConnectorsListPage { + return ConnectorsListPage{ + fn: getNextPage, + cl: cur, + } +} + +// Contact contact details for security issues +type Contact struct { + autorest.Response `json:"-"` + // ContactProperties - Security contact data + *ContactProperties `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 Contact. +func (c Contact) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.ContactProperties != nil { + objectMap["properties"] = c.ContactProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Contact struct. +func (c *Contact) 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 contactProperties ContactProperties + err = json.Unmarshal(*v, &contactProperties) + if err != nil { + return err + } + c.ContactProperties = &contactProperties + } + case "id": + if v != nil { var ID string err = json.Unmarshal(*v, &ID) if err != nil { @@ -5462,6 +5965,65 @@ func (crvp ContainerRegistryVulnerabilityProperties) AsBasicAdditionalData() (Ba return &crvp, true } +// CspmMonitorAwsOffering the CSPM monitoring for AWS offering configurations +type CspmMonitorAwsOffering struct { + // NativeCloudConnection - The native cloud connection configuration + NativeCloudConnection *CspmMonitorAwsOfferingNativeCloudConnection `json:"nativeCloudConnection,omitempty"` + // Description - READ-ONLY; The offering description. + Description *string `json:"description,omitempty"` + // OfferingType - Possible values include: 'OfferingTypeCloudOffering', 'OfferingTypeCspmMonitorAws', 'OfferingTypeDefenderForContainersAws', 'OfferingTypeDefenderForServersAws', 'OfferingTypeInformationProtectionAws' + OfferingType OfferingType `json:"offeringType,omitempty"` +} + +// MarshalJSON is the custom marshaler for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) MarshalJSON() ([]byte, error) { + cmao.OfferingType = OfferingTypeCspmMonitorAws + objectMap := make(map[string]interface{}) + if cmao.NativeCloudConnection != nil { + objectMap["nativeCloudConnection"] = cmao.NativeCloudConnection + } + if cmao.OfferingType != "" { + objectMap["offeringType"] = cmao.OfferingType + } + return json.Marshal(objectMap) +} + +// AsCspmMonitorAwsOffering is the BasicCloudOffering implementation for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) { + return &cmao, true +} + +// AsDefenderForContainersAwsOffering is the BasicCloudOffering implementation for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) { + return nil, false +} + +// AsDefenderForServersAwsOffering is the BasicCloudOffering implementation for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) { + return nil, false +} + +// AsInformationProtectionAwsOffering is the BasicCloudOffering implementation for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) { + return nil, false +} + +// AsCloudOffering is the BasicCloudOffering implementation for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) AsCloudOffering() (*CloudOffering, bool) { + return nil, false +} + +// AsBasicCloudOffering is the BasicCloudOffering implementation for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) AsBasicCloudOffering() (BasicCloudOffering, bool) { + return &cmao, true +} + +// CspmMonitorAwsOfferingNativeCloudConnection the native cloud connection configuration +type CspmMonitorAwsOfferingNativeCloudConnection struct { + // CloudRoleArn - The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` +} + // BasicCustomAlertRule a custom alert rule. type BasicCustomAlertRule interface { AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) @@ -5799,38 +6361,13 @@ func (car CustomAlertRule) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) return &car, true } -// CVE CVE details -type CVE struct { - // Title - READ-ONLY; CVE title - Title *string `json:"title,omitempty"` - // Link - READ-ONLY; Link url - Link *string `json:"link,omitempty"` -} - -// MarshalJSON is the custom marshaler for CVE. -func (c CVE) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// CVSS CVSS details -type CVSS struct { - // Base - READ-ONLY; CVSS base - Base *float64 `json:"base,omitempty"` -} - -// MarshalJSON is the custom marshaler for CVSS. -func (c CVSS) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// DataExportSetting represents a data export setting -type DataExportSetting struct { - // DataExportSettingProperties - Data export setting data - *DataExportSettingProperties `json:"properties,omitempty"` - // Kind - the kind of the settings string (DataExportSetting). Possible values include: 'SettingKindDataExportSetting', 'SettingKindAlertSuppressionSetting' - Kind SettingKind `json:"kind,omitempty"` +// CustomAssessmentAutomation custom Assessment Automation +type CustomAssessmentAutomation struct { + autorest.Response `json:"-"` + // SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty"` + // CustomAssessmentAutomationProperties - describes Custom Assessment Automation properties. + *CustomAssessmentAutomationProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name @@ -5839,20 +6376,17 @@ type DataExportSetting struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for DataExportSetting. -func (desVar DataExportSetting) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for CustomAssessmentAutomation. +func (caa CustomAssessmentAutomation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if desVar.DataExportSettingProperties != nil { - objectMap["properties"] = desVar.DataExportSettingProperties - } - if desVar.Kind != "" { - objectMap["kind"] = desVar.Kind + if caa.CustomAssessmentAutomationProperties != nil { + objectMap["properties"] = caa.CustomAssessmentAutomationProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for DataExportSetting struct. -func (desVar *DataExportSetting) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for CustomAssessmentAutomation struct. +func (caa *CustomAssessmentAutomation) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -5860,23 +6394,23 @@ func (desVar *DataExportSetting) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "properties": + case "systemData": if v != nil { - var dataExportSettingProperties DataExportSettingProperties - err = json.Unmarshal(*v, &dataExportSettingProperties) + var systemData SystemData + err = json.Unmarshal(*v, &systemData) if err != nil { return err } - desVar.DataExportSettingProperties = &dataExportSettingProperties + caa.SystemData = &systemData } - case "kind": + case "properties": if v != nil { - var kind SettingKind - err = json.Unmarshal(*v, &kind) + var customAssessmentAutomationProperties CustomAssessmentAutomationProperties + err = json.Unmarshal(*v, &customAssessmentAutomationProperties) if err != nil { return err } - desVar.Kind = kind + caa.CustomAssessmentAutomationProperties = &customAssessmentAutomationProperties } case "id": if v != nil { @@ -5885,7 +6419,7 @@ func (desVar *DataExportSetting) UnmarshalJSON(body []byte) error { if err != nil { return err } - desVar.ID = &ID + caa.ID = &ID } case "name": if v != nil { @@ -5894,7 +6428,7 @@ func (desVar *DataExportSetting) UnmarshalJSON(body []byte) error { if err != nil { return err } - desVar.Name = &name + caa.Name = &name } case "type": if v != nil { @@ -5903,7 +6437,7 @@ func (desVar *DataExportSetting) UnmarshalJSON(body []byte) error { if err != nil { return err } - desVar.Type = &typeVar + caa.Type = &typeVar } } } @@ -5911,219 +6445,47 @@ func (desVar *DataExportSetting) UnmarshalJSON(body []byte) error { return nil } -// DataExportSettingProperties the data export setting properties -type DataExportSettingProperties struct { - // Enabled - Is the data export setting is enabled - Enabled *bool `json:"enabled,omitempty"` -} - -// DenylistCustomAlertRule a custom alert rule that checks if a value (depends on the custom alert type) is -// denied. -type DenylistCustomAlertRule struct { - // DenylistValues - The values to deny. The format of the values depends on the rule type. - DenylistValues *[]string `json:"denylistValues,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. +// CustomAssessmentAutomationProperties describes the Custom Assessment Automation properties +type CustomAssessmentAutomationProperties struct { + // CompressedQuery - GZip encoded KQL query representing the assessment automation results required. + CompressedQuery *string `json:"compressedQuery,omitempty"` + // SupportedCloud - Relevant cloud for the custom assessment automation. Possible values include: 'SupportedCloudEnumAWS', 'SupportedCloudEnumGCP' + SupportedCloud SupportedCloudEnum `json:"supportedCloud,omitempty"` + // Severity - The severity to relate to the assessments generated by this assessment automation. Possible values include: 'SeverityEnumHigh', 'SeverityEnumMedium', 'SeverityEnumLow' + Severity SeverityEnum `json:"severity,omitempty"` + // DisplayName - The display name of the assessments generated by this assessment automation. DisplayName *string `json:"displayName,omitempty"` - // Description - READ-ONLY; The description of the custom alert. + // Description - The description to relate to the assessments generated by this assessment automation. 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 RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` + // RemediationDescription - The remediation description to relate to the assessments generated by this assessment automation. + RemediationDescription *string `json:"remediationDescription,omitempty"` + // AssessmentKey - The assessment metadata key used when an assessment is generated for this assessment automation. + AssessmentKey *string `json:"assessmentKey,omitempty"` } -// MarshalJSON is the custom marshaler for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) MarshalJSON() ([]byte, error) { - dcar.RuleType = RuleTypeDenylistCustomAlertRule +// CustomAssessmentAutomationRequest custom Assessment Automation request +type CustomAssessmentAutomationRequest struct { + // CustomAssessmentAutomationRequestProperties - describes Custom Assessment Automation request properties. + *CustomAssessmentAutomationRequestProperties `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 CustomAssessmentAutomationRequest. +func (caar CustomAssessmentAutomationRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dcar.DenylistValues != nil { - objectMap["denylistValues"] = dcar.DenylistValues - } - if dcar.IsEnabled != nil { - objectMap["isEnabled"] = dcar.IsEnabled - } - if dcar.RuleType != "" { - objectMap["ruleType"] = dcar.RuleType + if caar.CustomAssessmentAutomationRequestProperties != nil { + objectMap["properties"] = caar.CustomAssessmentAutomationRequestProperties } return json.Marshal(objectMap) } -// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { - return nil, false -} - -// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { - return nil, false -} - -// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { - return nil, false -} - -// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { - return nil, false -} - -// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { - return nil, false -} - -// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { - return nil, false -} - -// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { - return &dcar, true -} - -// AsListCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { - return nil, false -} - -// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { - return &dcar, true -} - -// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { - return nil, false -} - -// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { - return nil, false -} - -// AsProcessNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { - return nil, false -} - -// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { - return nil, false -} - -// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { - return nil, false -} - -// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { - return nil, false -} - -// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { - return nil, false -} - -// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { - return nil, false -} - -// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { - return nil, false -} - -// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { - return nil, false -} - -// AsCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsCustomAlertRule() (*CustomAlertRule, bool) { - return nil, false -} - -// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { - return &dcar, true -} - -// DeviceSecurityGroup the device security group resource -type DeviceSecurityGroup struct { - autorest.Response `json:"-"` - // DeviceSecurityGroupProperties - Device Security group data - *DeviceSecurityGroupProperties `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 DeviceSecurityGroup. -func (dsg DeviceSecurityGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dsg.DeviceSecurityGroupProperties != nil { - objectMap["properties"] = dsg.DeviceSecurityGroupProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DeviceSecurityGroup struct. -func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for CustomAssessmentAutomationRequest struct. +func (caar *CustomAssessmentAutomationRequest) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -6133,12 +6495,12 @@ func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var deviceSecurityGroupProperties DeviceSecurityGroupProperties - err = json.Unmarshal(*v, &deviceSecurityGroupProperties) + var customAssessmentAutomationRequestProperties CustomAssessmentAutomationRequestProperties + err = json.Unmarshal(*v, &customAssessmentAutomationRequestProperties) if err != nil { return err } - dsg.DeviceSecurityGroupProperties = &deviceSecurityGroupProperties + caar.CustomAssessmentAutomationRequestProperties = &customAssessmentAutomationRequestProperties } case "id": if v != nil { @@ -6147,7 +6509,7 @@ func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { if err != nil { return err } - dsg.ID = &ID + caar.ID = &ID } case "name": if v != nil { @@ -6156,7 +6518,7 @@ func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { if err != nil { return err } - dsg.Name = &name + caar.Name = &name } case "type": if v != nil { @@ -6165,7 +6527,7 @@ func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { if err != nil { return err } - dsg.Type = &typeVar + caar.Type = &typeVar } } } @@ -6173,35 +6535,52 @@ func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { return nil } -// DeviceSecurityGroupList list of device security groups -type DeviceSecurityGroupList struct { +// CustomAssessmentAutomationRequestProperties describes the Custom Assessment Automation properties +type CustomAssessmentAutomationRequestProperties struct { + // CompressedQuery - Base 64 encoded KQL query representing the assessment automation results required. + CompressedQuery *string `json:"compressedQuery,omitempty"` + // SupportedCloud - Relevant cloud for the custom assessment automation. Possible values include: 'SupportedCloudEnumAWS', 'SupportedCloudEnumGCP' + SupportedCloud SupportedCloudEnum `json:"supportedCloud,omitempty"` + // Severity - The severity to relate to the assessments generated by this assessment automation. Possible values include: 'SeverityEnumHigh', 'SeverityEnumMedium', 'SeverityEnumLow' + Severity SeverityEnum `json:"severity,omitempty"` + // DisplayName - The display name of the assessments generated by this assessment automation. + DisplayName *string `json:"displayName,omitempty"` + // Description - The description to relate to the assessments generated by this assessment automation. + Description *string `json:"description,omitempty"` + // RemediationDescription - The remediation description to relate to the assessments generated by this assessment automation. + RemediationDescription *string `json:"remediationDescription,omitempty"` +} + +// CustomAssessmentAutomationsListResult a list of Custom Assessment Automations +type CustomAssessmentAutomationsListResult struct { autorest.Response `json:"-"` - // Value - List of device security group objects - Value *[]DeviceSecurityGroup `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. + // Value - READ-ONLY; Collection of Custom Assessment Automations + Value *[]CustomAssessmentAutomation `json:"value,omitempty"` + // NextLink - The link used to get the next page of operations. NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for DeviceSecurityGroupList. -func (dsgl DeviceSecurityGroupList) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for CustomAssessmentAutomationsListResult. +func (caalr CustomAssessmentAutomationsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dsgl.Value != nil { - objectMap["value"] = dsgl.Value + if caalr.NextLink != nil { + objectMap["nextLink"] = caalr.NextLink } return json.Marshal(objectMap) } -// DeviceSecurityGroupListIterator provides access to a complete listing of DeviceSecurityGroup values. -type DeviceSecurityGroupListIterator struct { +// CustomAssessmentAutomationsListResultIterator provides access to a complete listing of +// CustomAssessmentAutomation values. +type CustomAssessmentAutomationsListResultIterator struct { i int - page DeviceSecurityGroupListPage + page CustomAssessmentAutomationsListResultPage } // 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 *DeviceSecurityGroupListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *CustomAssessmentAutomationsListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -6226,67 +6605,67 @@ func (iter *DeviceSecurityGroupListIterator) NextWithContext(ctx context.Context // 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 *DeviceSecurityGroupListIterator) Next() error { +func (iter *CustomAssessmentAutomationsListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DeviceSecurityGroupListIterator) NotDone() bool { +func (iter CustomAssessmentAutomationsListResultIterator) 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 DeviceSecurityGroupListIterator) Response() DeviceSecurityGroupList { +func (iter CustomAssessmentAutomationsListResultIterator) Response() CustomAssessmentAutomationsListResult { 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 DeviceSecurityGroupListIterator) Value() DeviceSecurityGroup { +func (iter CustomAssessmentAutomationsListResultIterator) Value() CustomAssessmentAutomation { if !iter.page.NotDone() { - return DeviceSecurityGroup{} + return CustomAssessmentAutomation{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the DeviceSecurityGroupListIterator type. -func NewDeviceSecurityGroupListIterator(page DeviceSecurityGroupListPage) DeviceSecurityGroupListIterator { - return DeviceSecurityGroupListIterator{page: page} +// Creates a new instance of the CustomAssessmentAutomationsListResultIterator type. +func NewCustomAssessmentAutomationsListResultIterator(page CustomAssessmentAutomationsListResultPage) CustomAssessmentAutomationsListResultIterator { + return CustomAssessmentAutomationsListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (dsgl DeviceSecurityGroupList) IsEmpty() bool { - return dsgl.Value == nil || len(*dsgl.Value) == 0 +func (caalr CustomAssessmentAutomationsListResult) IsEmpty() bool { + return caalr.Value == nil || len(*caalr.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (dsgl DeviceSecurityGroupList) hasNextLink() bool { - return dsgl.NextLink != nil && len(*dsgl.NextLink) != 0 +func (caalr CustomAssessmentAutomationsListResult) hasNextLink() bool { + return caalr.NextLink != nil && len(*caalr.NextLink) != 0 } -// deviceSecurityGroupListPreparer prepares a request to retrieve the next set of results. +// customAssessmentAutomationsListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (dsgl DeviceSecurityGroupList) deviceSecurityGroupListPreparer(ctx context.Context) (*http.Request, error) { - if !dsgl.hasNextLink() { +func (caalr CustomAssessmentAutomationsListResult) customAssessmentAutomationsListResultPreparer(ctx context.Context) (*http.Request, error) { + if !caalr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(dsgl.NextLink))) + autorest.WithBaseURL(to.String(caalr.NextLink))) } -// DeviceSecurityGroupListPage contains a page of DeviceSecurityGroup values. -type DeviceSecurityGroupListPage struct { - fn func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error) - dsgl DeviceSecurityGroupList +// CustomAssessmentAutomationsListResultPage contains a page of CustomAssessmentAutomation values. +type CustomAssessmentAutomationsListResultPage struct { + fn func(context.Context, CustomAssessmentAutomationsListResult) (CustomAssessmentAutomationsListResult, error) + caalr CustomAssessmentAutomationsListResult } // 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 *DeviceSecurityGroupListPage) NextWithContext(ctx context.Context) (err error) { +func (page *CustomAssessmentAutomationsListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -6296,11 +6675,11 @@ func (page *DeviceSecurityGroupListPage) NextWithContext(ctx context.Context) (e }() } for { - next, err := page.fn(ctx, page.dsgl) + next, err := page.fn(ctx, page.caalr) if err != nil { return err } - page.dsgl = next + page.caalr = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -6311,89 +6690,113 @@ func (page *DeviceSecurityGroupListPage) NextWithContext(ctx context.Context) (e // 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 *DeviceSecurityGroupListPage) Next() error { +func (page *CustomAssessmentAutomationsListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DeviceSecurityGroupListPage) NotDone() bool { - return !page.dsgl.IsEmpty() +func (page CustomAssessmentAutomationsListResultPage) NotDone() bool { + return !page.caalr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page DeviceSecurityGroupListPage) Response() DeviceSecurityGroupList { - return page.dsgl +func (page CustomAssessmentAutomationsListResultPage) Response() CustomAssessmentAutomationsListResult { + return page.caalr } // Values returns the slice of values for the current page or nil if there are no values. -func (page DeviceSecurityGroupListPage) Values() []DeviceSecurityGroup { - if page.dsgl.IsEmpty() { +func (page CustomAssessmentAutomationsListResultPage) Values() []CustomAssessmentAutomation { + if page.caalr.IsEmpty() { return nil } - return *page.dsgl.Value + return *page.caalr.Value } -// Creates a new instance of the DeviceSecurityGroupListPage type. -func NewDeviceSecurityGroupListPage(cur DeviceSecurityGroupList, getNextPage func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error)) DeviceSecurityGroupListPage { - return DeviceSecurityGroupListPage{ - fn: getNextPage, - dsgl: cur, +// Creates a new instance of the CustomAssessmentAutomationsListResultPage type. +func NewCustomAssessmentAutomationsListResultPage(cur CustomAssessmentAutomationsListResult, getNextPage func(context.Context, CustomAssessmentAutomationsListResult) (CustomAssessmentAutomationsListResult, error)) CustomAssessmentAutomationsListResultPage { + return CustomAssessmentAutomationsListResultPage{ + fn: getNextPage, + caalr: cur, } } -// DeviceSecurityGroupProperties describes properties of a security group. -type DeviceSecurityGroupProperties struct { - // ThresholdRules - The list of custom alert threshold rules. - ThresholdRules *[]BasicThresholdCustomAlertRule `json:"thresholdRules,omitempty"` - // TimeWindowRules - The list of custom alert time-window rules. - TimeWindowRules *[]BasicTimeWindowCustomAlertRule `json:"timeWindowRules,omitempty"` - // AllowlistRules - The allow-list custom alert rules. - AllowlistRules *[]BasicAllowlistCustomAlertRule `json:"allowlistRules,omitempty"` - // DenylistRules - The deny-list custom alert rules. - DenylistRules *[]DenylistCustomAlertRule `json:"denylistRules,omitempty"` +// CustomEntityStoreAssignment custom entity store assignment +type CustomEntityStoreAssignment struct { + autorest.Response `json:"-"` + // SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty"` + // CustomEntityStoreAssignmentProperties - describes custom entity store assignment properties. + *CustomEntityStoreAssignmentProperties `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"` } -// UnmarshalJSON is the custom unmarshaler for DeviceSecurityGroupProperties struct. -func (dsgp *DeviceSecurityGroupProperties) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) +// MarshalJSON is the custom marshaler for CustomEntityStoreAssignment. +func (cesa CustomEntityStoreAssignment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cesa.CustomEntityStoreAssignmentProperties != nil { + objectMap["properties"] = cesa.CustomEntityStoreAssignmentProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CustomEntityStoreAssignment struct. +func (cesa *CustomEntityStoreAssignment) 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 "thresholdRules": + case "systemData": if v != nil { - thresholdRules, err := unmarshalBasicThresholdCustomAlertRuleArray(*v) + var systemData SystemData + err = json.Unmarshal(*v, &systemData) if err != nil { return err } - dsgp.ThresholdRules = &thresholdRules + cesa.SystemData = &systemData } - case "timeWindowRules": + case "properties": if v != nil { - timeWindowRules, err := unmarshalBasicTimeWindowCustomAlertRuleArray(*v) + var customEntityStoreAssignmentProperties CustomEntityStoreAssignmentProperties + err = json.Unmarshal(*v, &customEntityStoreAssignmentProperties) if err != nil { return err } - dsgp.TimeWindowRules = &timeWindowRules + cesa.CustomEntityStoreAssignmentProperties = &customEntityStoreAssignmentProperties } - case "allowlistRules": + case "id": if v != nil { - allowlistRules, err := unmarshalBasicAllowlistCustomAlertRuleArray(*v) + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - dsgp.AllowlistRules = &allowlistRules + cesa.ID = &ID } - case "denylistRules": + case "name": if v != nil { - var denylistRules []DenylistCustomAlertRule - err = json.Unmarshal(*v, &denylistRules) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - dsgp.DenylistRules = &denylistRules + cesa.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cesa.Type = &typeVar } } } @@ -6401,221 +6804,298 @@ func (dsgp *DeviceSecurityGroupProperties) UnmarshalJSON(body []byte) error { return nil } -// DirectMethodInvokesNotInAllowedRange number of direct method invokes is not in allowed range. -type DirectMethodInvokesNotInAllowedRange struct { - // TimeWindowSize - The time window size in iso8601 format. - TimeWindowSize *string `json:"timeWindowSize,omitempty"` - // MinThreshold - The minimum threshold. - MinThreshold *int32 `json:"minThreshold,omitempty"` - // MaxThreshold - The maximum threshold. - MaxThreshold *int32 `json:"maxThreshold,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', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` +// CustomEntityStoreAssignmentProperties describes the custom entity store assignment properties +type CustomEntityStoreAssignmentProperties struct { + // Principal - The principal assigned with entity store. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId] + Principal *string `json:"principal,omitempty"` + // EntityStoreDatabaseLink - The link to entity store database. + EntityStoreDatabaseLink *string `json:"entityStoreDatabaseLink,omitempty"` } -// MarshalJSON is the custom marshaler for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) MarshalJSON() ([]byte, error) { - dminiar.RuleType = RuleTypeDirectMethodInvokesNotInAllowedRange +// CustomEntityStoreAssignmentRequest describes the custom entity store assignment request +type CustomEntityStoreAssignmentRequest struct { + *CustomEntityStoreAssignmentRequestProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CustomEntityStoreAssignmentRequest. +func (cesar CustomEntityStoreAssignmentRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dminiar.TimeWindowSize != nil { - objectMap["timeWindowSize"] = dminiar.TimeWindowSize - } - if dminiar.MinThreshold != nil { - objectMap["minThreshold"] = dminiar.MinThreshold - } - if dminiar.MaxThreshold != nil { - objectMap["maxThreshold"] = dminiar.MaxThreshold - } - if dminiar.IsEnabled != nil { - objectMap["isEnabled"] = dminiar.IsEnabled - } - if dminiar.RuleType != "" { - objectMap["ruleType"] = dminiar.RuleType + if cesar.CustomEntityStoreAssignmentRequestProperties != nil { + objectMap["properties"] = cesar.CustomEntityStoreAssignmentRequestProperties } return json.Marshal(objectMap) } -// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { - return nil, false -} +// UnmarshalJSON is the custom unmarshaler for CustomEntityStoreAssignmentRequest struct. +func (cesar *CustomEntityStoreAssignmentRequest) 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 customEntityStoreAssignmentRequestProperties CustomEntityStoreAssignmentRequestProperties + err = json.Unmarshal(*v, &customEntityStoreAssignmentRequestProperties) + if err != nil { + return err + } + cesar.CustomEntityStoreAssignmentRequestProperties = &customEntityStoreAssignmentRequestProperties + } + } + } -// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { - return &dminiar, true + return nil } -// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { - return nil, false +// CustomEntityStoreAssignmentRequestProperties describes properties of custom entity store assignment +// request +type CustomEntityStoreAssignmentRequestProperties struct { + // Principal - The principal assigned with entity store. If not provided, will use caller principal. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId] + Principal *string `json:"principal,omitempty"` } -// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { - return &dminiar, true +// CustomEntityStoreAssignmentsListResult a list of custom entity store assignments +type CustomEntityStoreAssignmentsListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Collection of custom entity store assignments + Value *[]CustomEntityStoreAssignment `json:"value,omitempty"` + // NextLink - The link used to get the next page of operations. + NextLink *string `json:"nextLink,omitempty"` } -// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { - return nil, false +// MarshalJSON is the custom marshaler for CustomEntityStoreAssignmentsListResult. +func (cesalr CustomEntityStoreAssignmentsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cesalr.NextLink != nil { + objectMap["nextLink"] = cesalr.NextLink + } + return json.Marshal(objectMap) } -// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { - return nil, false +// CustomEntityStoreAssignmentsListResultIterator provides access to a complete listing of +// CustomEntityStoreAssignment values. +type CustomEntityStoreAssignmentsListResultIterator struct { + i int + page CustomEntityStoreAssignmentsListResultPage } -// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { - return nil, false +// 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 *CustomEntityStoreAssignmentsListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsListResultIterator.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 } -// AsListCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { - return nil, false +// 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 *CustomEntityStoreAssignmentsListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) } -// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { - return nil, false +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CustomEntityStoreAssignmentsListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { - return nil, false +// Response returns the raw server response from the last page request. +func (iter CustomEntityStoreAssignmentsListResultIterator) Response() CustomEntityStoreAssignmentsListResult { + return iter.page.Response() } -// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { - return nil, false +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CustomEntityStoreAssignmentsListResultIterator) Value() CustomEntityStoreAssignment { + if !iter.page.NotDone() { + return CustomEntityStoreAssignment{} + } + return iter.page.Values()[iter.i] } -// AsProcessNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { - return nil, false +// Creates a new instance of the CustomEntityStoreAssignmentsListResultIterator type. +func NewCustomEntityStoreAssignmentsListResultIterator(page CustomEntityStoreAssignmentsListResultPage) CustomEntityStoreAssignmentsListResultIterator { + return CustomEntityStoreAssignmentsListResultIterator{page: page} } -// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { - return nil, false +// IsEmpty returns true if the ListResult contains no values. +func (cesalr CustomEntityStoreAssignmentsListResult) IsEmpty() bool { + return cesalr.Value == nil || len(*cesalr.Value) == 0 } -// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { - return nil, false +// hasNextLink returns true if the NextLink is not empty. +func (cesalr CustomEntityStoreAssignmentsListResult) hasNextLink() bool { + return cesalr.NextLink != nil && len(*cesalr.NextLink) != 0 } -// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { - return nil, false +// customEntityStoreAssignmentsListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cesalr CustomEntityStoreAssignmentsListResult) customEntityStoreAssignmentsListResultPreparer(ctx context.Context) (*http.Request, error) { + if !cesalr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cesalr.NextLink))) } -// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { - return nil, false +// CustomEntityStoreAssignmentsListResultPage contains a page of CustomEntityStoreAssignment values. +type CustomEntityStoreAssignmentsListResultPage struct { + fn func(context.Context, CustomEntityStoreAssignmentsListResult) (CustomEntityStoreAssignmentsListResult, error) + cesalr CustomEntityStoreAssignmentsListResult } -// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { - return nil, false +// 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 *CustomEntityStoreAssignmentsListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsListResultPage.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.cesalr) + if err != nil { + return err + } + page.cesalr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil } -// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { - return nil, false +// 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 *CustomEntityStoreAssignmentsListResultPage) Next() error { + return page.NextWithContext(context.Background()) } -// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { - return nil, false +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CustomEntityStoreAssignmentsListResultPage) NotDone() bool { + return !page.cesalr.IsEmpty() } -// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { - return nil, false +// Response returns the raw server response from the last page request. +func (page CustomEntityStoreAssignmentsListResultPage) Response() CustomEntityStoreAssignmentsListResult { + return page.cesalr } -// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { - return nil, false +// Values returns the slice of values for the current page or nil if there are no values. +func (page CustomEntityStoreAssignmentsListResultPage) Values() []CustomEntityStoreAssignment { + if page.cesalr.IsEmpty() { + return nil + } + return *page.cesalr.Value } -// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { - return nil, false +// Creates a new instance of the CustomEntityStoreAssignmentsListResultPage type. +func NewCustomEntityStoreAssignmentsListResultPage(cur CustomEntityStoreAssignmentsListResult, getNextPage func(context.Context, CustomEntityStoreAssignmentsListResult) (CustomEntityStoreAssignmentsListResult, error)) CustomEntityStoreAssignmentsListResultPage { + return CustomEntityStoreAssignmentsListResultPage{ + fn: getNextPage, + cesalr: cur, + } } -// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { - return &dminiar, true +// CVE CVE details +type CVE struct { + // Title - READ-ONLY; CVE title + Title *string `json:"title,omitempty"` + // Link - READ-ONLY; Link url + Link *string `json:"link,omitempty"` } -// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { - return nil, false +// MarshalJSON is the custom marshaler for CVE. +func (c CVE) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) } -// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { - return nil, false +// CVSS CVSS details +type CVSS struct { + // Base - READ-ONLY; CVSS base + Base *float64 `json:"base,omitempty"` } -// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { - return nil, false -} - -// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { - return nil, false -} - -// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { - return nil, false -} - -// AsCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { - return nil, false -} - -// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { - return &dminiar, true +// MarshalJSON is the custom marshaler for CVSS. +func (c CVSS) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) } -// DiscoveredSecuritySolution ... -type DiscoveredSecuritySolution struct { - autorest.Response `json:"-"` +// DataExportSetting represents a data export setting +type DataExportSetting struct { + // DataExportSettingProperties - Data export setting data + *DataExportSettingProperties `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"` - // Location - READ-ONLY; Location where the resource is stored - Location *string `json:"location,omitempty"` - *DiscoveredSecuritySolutionProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindSetting', 'KindDataExportSetting' + Kind KindEnum `json:"kind,omitempty"` } -// MarshalJSON is the custom marshaler for DiscoveredSecuritySolution. -func (dss DiscoveredSecuritySolution) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for DataExportSetting. +func (desVar DataExportSetting) MarshalJSON() ([]byte, error) { + desVar.Kind = KindDataExportSetting objectMap := make(map[string]interface{}) - if dss.DiscoveredSecuritySolutionProperties != nil { - objectMap["properties"] = dss.DiscoveredSecuritySolutionProperties + if desVar.DataExportSettingProperties != nil { + objectMap["properties"] = desVar.DataExportSettingProperties + } + if desVar.Kind != "" { + objectMap["kind"] = desVar.Kind } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for DiscoveredSecuritySolution struct. -func (dss *DiscoveredSecuritySolution) UnmarshalJSON(body []byte) error { +// AsDataExportSetting is the BasicSetting implementation for DataExportSetting. +func (desVar DataExportSetting) AsDataExportSetting() (*DataExportSetting, bool) { + return &desVar, true +} + +// AsSetting is the BasicSetting implementation for DataExportSetting. +func (desVar DataExportSetting) AsSetting() (*Setting, bool) { + return nil, false +} + +// AsBasicSetting is the BasicSetting implementation for DataExportSetting. +func (desVar DataExportSetting) AsBasicSetting() (BasicSetting, bool) { + return &desVar, true +} + +// UnmarshalJSON is the custom unmarshaler for DataExportSetting struct. +func (desVar *DataExportSetting) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -6623,50 +7103,50 @@ func (dss *DiscoveredSecuritySolution) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "id": + case "properties": if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) + var dataExportSettingProperties DataExportSettingProperties + err = json.Unmarshal(*v, &dataExportSettingProperties) if err != nil { return err } - dss.ID = &ID + desVar.DataExportSettingProperties = &dataExportSettingProperties } - case "name": + case "kind": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var kind KindEnum + err = json.Unmarshal(*v, &kind) if err != nil { return err } - dss.Name = &name + desVar.Kind = kind } - case "type": + case "id": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - dss.Type = &typeVar + desVar.ID = &ID } - case "location": + case "name": if v != nil { - var location string - err = json.Unmarshal(*v, &location) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - dss.Location = &location + desVar.Name = &name } - case "properties": + case "type": if v != nil { - var discoveredSecuritySolutionProperties DiscoveredSecuritySolutionProperties - err = json.Unmarshal(*v, &discoveredSecuritySolutionProperties) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - dss.DiscoveredSecuritySolutionProperties = &discoveredSecuritySolutionProperties + desVar.Type = &typeVar } } } @@ -6674,557 +7154,394 @@ func (dss *DiscoveredSecuritySolution) UnmarshalJSON(body []byte) error { return nil } -// DiscoveredSecuritySolutionList ... -type DiscoveredSecuritySolutionList struct { - autorest.Response `json:"-"` - Value *[]DiscoveredSecuritySolution `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` +// DataExportSettingProperties the data export setting properties +type DataExportSettingProperties struct { + // Enabled - Is the data export setting is enabled + Enabled *bool `json:"enabled,omitempty"` } -// MarshalJSON is the custom marshaler for DiscoveredSecuritySolutionList. -func (dssl DiscoveredSecuritySolutionList) MarshalJSON() ([]byte, error) { +// DefenderForContainersAwsOffering the Defender for Containers AWS offering configurations +type DefenderForContainersAwsOffering struct { + // KubernetesService - The kubernetes service connection configuration + KubernetesService *DefenderForContainersAwsOfferingKubernetesService `json:"kubernetesService,omitempty"` + // KubernetesScubaReader - The kubernetes to scuba connection configuration + KubernetesScubaReader *DefenderForContainersAwsOfferingKubernetesScubaReader `json:"kubernetesScubaReader,omitempty"` + // CloudWatchToKinesis - The cloudwatch to kinesis connection configuration + CloudWatchToKinesis *DefenderForContainersAwsOfferingCloudWatchToKinesis `json:"cloudWatchToKinesis,omitempty"` + // KinesisToS3 - The kinesis to s3 connection configuration + KinesisToS3 *DefenderForContainersAwsOfferingKinesisToS3 `json:"kinesisToS3,omitempty"` + // Description - READ-ONLY; The offering description. + Description *string `json:"description,omitempty"` + // OfferingType - Possible values include: 'OfferingTypeCloudOffering', 'OfferingTypeCspmMonitorAws', 'OfferingTypeDefenderForContainersAws', 'OfferingTypeDefenderForServersAws', 'OfferingTypeInformationProtectionAws' + OfferingType OfferingType `json:"offeringType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) MarshalJSON() ([]byte, error) { + dfcao.OfferingType = OfferingTypeDefenderForContainersAws objectMap := make(map[string]interface{}) - if dssl.Value != nil { - objectMap["value"] = dssl.Value + if dfcao.KubernetesService != nil { + objectMap["kubernetesService"] = dfcao.KubernetesService + } + if dfcao.KubernetesScubaReader != nil { + objectMap["kubernetesScubaReader"] = dfcao.KubernetesScubaReader + } + if dfcao.CloudWatchToKinesis != nil { + objectMap["cloudWatchToKinesis"] = dfcao.CloudWatchToKinesis + } + if dfcao.KinesisToS3 != nil { + objectMap["kinesisToS3"] = dfcao.KinesisToS3 + } + if dfcao.OfferingType != "" { + objectMap["offeringType"] = dfcao.OfferingType } return json.Marshal(objectMap) } -// DiscoveredSecuritySolutionListIterator provides access to a complete listing of -// DiscoveredSecuritySolution values. -type DiscoveredSecuritySolutionListIterator struct { - i int - page DiscoveredSecuritySolutionListPage +// AsCspmMonitorAwsOffering is the BasicCloudOffering implementation for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) { + return nil, false } -// 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 *DiscoveredSecuritySolutionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionListIterator.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 +// AsDefenderForContainersAwsOffering is the BasicCloudOffering implementation for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) { + return &dfcao, true } -// 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 *DiscoveredSecuritySolutionListIterator) Next() error { - return iter.NextWithContext(context.Background()) +// AsDefenderForServersAwsOffering is the BasicCloudOffering implementation for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) { + return nil, false } -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DiscoveredSecuritySolutionListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) +// AsInformationProtectionAwsOffering is the BasicCloudOffering implementation for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (iter DiscoveredSecuritySolutionListIterator) Response() DiscoveredSecuritySolutionList { - return iter.page.Response() +// AsCloudOffering is the BasicCloudOffering implementation for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) AsCloudOffering() (*CloudOffering, bool) { + return nil, false } -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter DiscoveredSecuritySolutionListIterator) Value() DiscoveredSecuritySolution { - if !iter.page.NotDone() { - return DiscoveredSecuritySolution{} - } - return iter.page.Values()[iter.i] +// AsBasicCloudOffering is the BasicCloudOffering implementation for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) AsBasicCloudOffering() (BasicCloudOffering, bool) { + return &dfcao, true } -// Creates a new instance of the DiscoveredSecuritySolutionListIterator type. -func NewDiscoveredSecuritySolutionListIterator(page DiscoveredSecuritySolutionListPage) DiscoveredSecuritySolutionListIterator { - return DiscoveredSecuritySolutionListIterator{page: page} +// DefenderForContainersAwsOfferingCloudWatchToKinesis the cloudwatch to kinesis connection configuration +type DefenderForContainersAwsOfferingCloudWatchToKinesis struct { + // CloudRoleArn - The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` } -// IsEmpty returns true if the ListResult contains no values. -func (dssl DiscoveredSecuritySolutionList) IsEmpty() bool { - return dssl.Value == nil || len(*dssl.Value) == 0 +// DefenderForContainersAwsOfferingKinesisToS3 the kinesis to s3 connection configuration +type DefenderForContainersAwsOfferingKinesisToS3 struct { + // CloudRoleArn - The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` } -// hasNextLink returns true if the NextLink is not empty. -func (dssl DiscoveredSecuritySolutionList) hasNextLink() bool { - return dssl.NextLink != nil && len(*dssl.NextLink) != 0 +// DefenderForContainersAwsOfferingKubernetesScubaReader the kubernetes to scuba connection configuration +type DefenderForContainersAwsOfferingKubernetesScubaReader struct { + // CloudRoleArn - The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` } -// discoveredSecuritySolutionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dssl DiscoveredSecuritySolutionList) discoveredSecuritySolutionListPreparer(ctx context.Context) (*http.Request, error) { - if !dssl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dssl.NextLink))) +// DefenderForContainersAwsOfferingKubernetesService the kubernetes service connection configuration +type DefenderForContainersAwsOfferingKubernetesService struct { + // CloudRoleArn - The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` } -// DiscoveredSecuritySolutionListPage contains a page of DiscoveredSecuritySolution values. -type DiscoveredSecuritySolutionListPage struct { - fn func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error) - dssl DiscoveredSecuritySolutionList +// DefenderForServersAwsOffering the Defender for Servers AWS offering configurations +type DefenderForServersAwsOffering struct { + // DefenderForServers - The Defender for servers connection configuration + DefenderForServers *DefenderForServersAwsOfferingDefenderForServers `json:"defenderForServers,omitempty"` + // ArcAutoProvisioning - The ARC autoprovisioning configuration + ArcAutoProvisioning *DefenderForServersAwsOfferingArcAutoProvisioning `json:"arcAutoProvisioning,omitempty"` + // Description - READ-ONLY; The offering description. + Description *string `json:"description,omitempty"` + // OfferingType - Possible values include: 'OfferingTypeCloudOffering', 'OfferingTypeCspmMonitorAws', 'OfferingTypeDefenderForContainersAws', 'OfferingTypeDefenderForServersAws', 'OfferingTypeInformationProtectionAws' + OfferingType OfferingType `json:"offeringType,omitempty"` } -// 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 *DiscoveredSecuritySolutionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() +// MarshalJSON is the custom marshaler for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) MarshalJSON() ([]byte, error) { + dfsao.OfferingType = OfferingTypeDefenderForServersAws + objectMap := make(map[string]interface{}) + if dfsao.DefenderForServers != nil { + objectMap["defenderForServers"] = dfsao.DefenderForServers } - for { - next, err := page.fn(ctx, page.dssl) - if err != nil { - return err - } - page.dssl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } + if dfsao.ArcAutoProvisioning != nil { + objectMap["arcAutoProvisioning"] = dfsao.ArcAutoProvisioning } - return nil + if dfsao.OfferingType != "" { + objectMap["offeringType"] = dfsao.OfferingType + } + return json.Marshal(objectMap) } -// 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 *DiscoveredSecuritySolutionListPage) Next() error { - return page.NextWithContext(context.Background()) +// AsCspmMonitorAwsOffering is the BasicCloudOffering implementation for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) { + return nil, false } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DiscoveredSecuritySolutionListPage) NotDone() bool { - return !page.dssl.IsEmpty() +// AsDefenderForContainersAwsOffering is the BasicCloudOffering implementation for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (page DiscoveredSecuritySolutionListPage) Response() DiscoveredSecuritySolutionList { - return page.dssl +// AsDefenderForServersAwsOffering is the BasicCloudOffering implementation for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) { + return &dfsao, true } -// Values returns the slice of values for the current page or nil if there are no values. -func (page DiscoveredSecuritySolutionListPage) Values() []DiscoveredSecuritySolution { - if page.dssl.IsEmpty() { - return nil - } - return *page.dssl.Value +// AsInformationProtectionAwsOffering is the BasicCloudOffering implementation for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) { + return nil, false } -// Creates a new instance of the DiscoveredSecuritySolutionListPage type. -func NewDiscoveredSecuritySolutionListPage(cur DiscoveredSecuritySolutionList, getNextPage func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error)) DiscoveredSecuritySolutionListPage { - return DiscoveredSecuritySolutionListPage{ - fn: getNextPage, - dssl: cur, - } +// AsCloudOffering is the BasicCloudOffering implementation for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) AsCloudOffering() (*CloudOffering, bool) { + return nil, false } -// DiscoveredSecuritySolutionProperties ... -type DiscoveredSecuritySolutionProperties struct { - // SecurityFamily - The security family of the discovered solution. Possible values include: 'Waf', 'Ngfw', 'SaasWaf', 'Va' - SecurityFamily Family `json:"securityFamily,omitempty"` - // Offer - The security solutions' image offer - Offer *string `json:"offer,omitempty"` - // Publisher - The security solutions' image publisher - Publisher *string `json:"publisher,omitempty"` - // Sku - The security solutions' image sku - Sku *string `json:"sku,omitempty"` +// AsBasicCloudOffering is the BasicCloudOffering implementation for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) AsBasicCloudOffering() (BasicCloudOffering, bool) { + return &dfsao, true } -// EffectiveNetworkSecurityGroups describes the Network Security Groups effective on a network interface -type EffectiveNetworkSecurityGroups struct { - // NetworkInterface - The Azure resource ID of the network interface - NetworkInterface *string `json:"networkInterface,omitempty"` - // NetworkSecurityGroups - The Network Security Groups effective on the network interface - NetworkSecurityGroups *[]string `json:"networkSecurityGroups,omitempty"` +// DefenderForServersAwsOfferingArcAutoProvisioning the ARC autoprovisioning configuration +type DefenderForServersAwsOfferingArcAutoProvisioning struct { + // Enabled - Is arc auto provisioning enabled + Enabled *bool `json:"enabled,omitempty"` + // ServicePrincipalSecretMetadata - Metadata of Service Principal secret for autoprovisioning + ServicePrincipalSecretMetadata *DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata `json:"servicePrincipalSecretMetadata,omitempty"` } -// 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. - Etag *string `json:"etag,omitempty"` +// DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata metadata of Service +// Principal secret for autoprovisioning +type DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata struct { + // ExpiryDate - expiration date of service principal secret + ExpiryDate *string `json:"expiryDate,omitempty"` + // ParameterStoreRegion - region of parameter store where secret is kept + ParameterStoreRegion *string `json:"parameterStoreRegion,omitempty"` + // ParameterNameInStore - name of secret resource in parameter store + ParameterNameInStore *string `json:"parameterNameInStore,omitempty"` } -// BasicExternalSecuritySolution represents a security solution external to Azure Security Center which sends -// information to an OMS workspace and whose data is displayed by Azure Security Center. -type BasicExternalSecuritySolution interface { - AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) - AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) - AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) - AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) +// DefenderForServersAwsOfferingDefenderForServers the Defender for servers connection configuration +type DefenderForServersAwsOfferingDefenderForServers struct { + // CloudRoleArn - The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` } -// ExternalSecuritySolution represents a security solution external to Azure Security Center which sends -// information to an OMS workspace and whose data is displayed by Azure Security Center. -type ExternalSecuritySolution struct { - autorest.Response `json:"-"` - // 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"` - // Location - READ-ONLY; Location where the resource is stored - Location *string `json:"location,omitempty"` - // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' - Kind KindEnum `json:"kind,omitempty"` +// DenylistCustomAlertRule a custom alert rule that checks if a value (depends on the custom alert type) is +// denied. +type DenylistCustomAlertRule struct { + // DenylistValues - The values to deny. The format of the values depends on the rule type. + DenylistValues *[]string `json:"denylistValues,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', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } -func unmarshalBasicExternalSecuritySolution(body []byte) (BasicExternalSecuritySolution, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err +// MarshalJSON is the custom marshaler for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) MarshalJSON() ([]byte, error) { + dcar.RuleType = RuleTypeDenylistCustomAlertRule + objectMap := make(map[string]interface{}) + if dcar.DenylistValues != nil { + objectMap["denylistValues"] = dcar.DenylistValues } - - switch m["kind"] { - case string(KindCEF): - var cess CefExternalSecuritySolution - err := json.Unmarshal(body, &cess) - return cess, err - case string(KindATA): - var aess AtaExternalSecuritySolution - err := json.Unmarshal(body, &aess) - return aess, err - case string(KindAAD): - var aess AadExternalSecuritySolution - err := json.Unmarshal(body, &aess) - return aess, err - default: - var ess ExternalSecuritySolution - err := json.Unmarshal(body, &ess) - return ess, err + if dcar.IsEnabled != nil { + objectMap["isEnabled"] = dcar.IsEnabled } -} -func unmarshalBasicExternalSecuritySolutionArray(body []byte) ([]BasicExternalSecuritySolution, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err + if dcar.RuleType != "" { + objectMap["ruleType"] = dcar.RuleType } + return json.Marshal(objectMap) +} - essArray := make([]BasicExternalSecuritySolution, len(rawMessages)) +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false +} - for index, rawMessage := range rawMessages { - ess, err := unmarshalBasicExternalSecuritySolution(*rawMessage) - if err != nil { - return nil, err - } - essArray[index] = ess - } - return essArray, nil +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for ExternalSecuritySolution. -func (ess ExternalSecuritySolution) MarshalJSON() ([]byte, error) { - ess.Kind = KindExternalSecuritySolution - objectMap := make(map[string]interface{}) - if ess.Kind != "" { - objectMap["kind"] = ess.Kind - } - return json.Marshal(objectMap) +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false } -// AsCefExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. -func (ess ExternalSecuritySolution) AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) { +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { return nil, false } -// AsAtaExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. -func (ess ExternalSecuritySolution) AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) { +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { return nil, false } -// AsAadExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. -func (ess ExternalSecuritySolution) AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) { +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { return nil, false } -// AsExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. -func (ess ExternalSecuritySolution) AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) { - return &ess, true +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return &dcar, true } -// AsBasicExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. -func (ess ExternalSecuritySolution) AsBasicExternalSecuritySolution() (BasicExternalSecuritySolution, bool) { - return &ess, true +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false } -// ExternalSecuritySolutionKind1 describes an Azure resource with kind -type ExternalSecuritySolutionKind1 struct { - // Kind - The kind of the external solution. Possible values include: 'CEF', 'ATA', 'AAD' - Kind ExternalSecuritySolutionKind `json:"kind,omitempty"` +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return &dcar, true } -// ExternalSecuritySolutionList ... -type ExternalSecuritySolutionList struct { - autorest.Response `json:"-"` - Value *[]BasicExternalSecuritySolution `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for ExternalSecuritySolutionList. -func (essl ExternalSecuritySolutionList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if essl.Value != nil { - objectMap["value"] = essl.Value - } - return json.Marshal(objectMap) +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false } -// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionList struct. -func (essl *ExternalSecuritySolutionList) 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 "value": - if v != nil { - value, err := unmarshalBasicExternalSecuritySolutionArray(*v) - if err != nil { - return err - } - essl.Value = &value - } - case "nextLink": - if v != nil { - var nextLink string - err = json.Unmarshal(*v, &nextLink) - if err != nil { - return err - } - essl.NextLink = &nextLink - } - } - } +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false +} - return nil +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false } -// ExternalSecuritySolutionListIterator provides access to a complete listing of ExternalSecuritySolution -// values. -type ExternalSecuritySolutionListIterator struct { - i int - page ExternalSecuritySolutionListPage +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// 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 *ExternalSecuritySolutionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionListIterator.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 +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// 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 *ExternalSecuritySolutionListIterator) Next() error { - return iter.NextWithContext(context.Background()) +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExternalSecuritySolutionListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (iter ExternalSecuritySolutionListIterator) Response() ExternalSecuritySolutionList { - return iter.page.Response() +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ExternalSecuritySolutionListIterator) Value() BasicExternalSecuritySolution { - if !iter.page.NotDone() { - return ExternalSecuritySolution{} - } - return iter.page.Values()[iter.i] +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// Creates a new instance of the ExternalSecuritySolutionListIterator type. -func NewExternalSecuritySolutionListIterator(page ExternalSecuritySolutionListPage) ExternalSecuritySolutionListIterator { - return ExternalSecuritySolutionListIterator{page: page} +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// IsEmpty returns true if the ListResult contains no values. -func (essl ExternalSecuritySolutionList) IsEmpty() bool { - return essl.Value == nil || len(*essl.Value) == 0 +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// hasNextLink returns true if the NextLink is not empty. -func (essl ExternalSecuritySolutionList) hasNextLink() bool { - return essl.NextLink != nil && len(*essl.NextLink) != 0 +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// externalSecuritySolutionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (essl ExternalSecuritySolutionList) externalSecuritySolutionListPreparer(ctx context.Context) (*http.Request, error) { - if !essl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(essl.NextLink))) +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false } -// ExternalSecuritySolutionListPage contains a page of BasicExternalSecuritySolution values. -type ExternalSecuritySolutionListPage struct { - fn func(context.Context, ExternalSecuritySolutionList) (ExternalSecuritySolutionList, error) - essl ExternalSecuritySolutionList +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false } -// 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 *ExternalSecuritySolutionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionListPage.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.essl) - if err != nil { - return err - } - page.essl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false } -// 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 *ExternalSecuritySolutionListPage) Next() error { - return page.NextWithContext(context.Background()) +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExternalSecuritySolutionListPage) NotDone() bool { - return !page.essl.IsEmpty() +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (page ExternalSecuritySolutionListPage) Response() ExternalSecuritySolutionList { - return page.essl +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false } -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExternalSecuritySolutionListPage) Values() []BasicExternalSecuritySolution { - if page.essl.IsEmpty() { - return nil - } - return *page.essl.Value +// AsCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false } -// Creates a new instance of the ExternalSecuritySolutionListPage type. -func NewExternalSecuritySolutionListPage(cur ExternalSecuritySolutionList, getNextPage func(context.Context, ExternalSecuritySolutionList) (ExternalSecuritySolutionList, error)) ExternalSecuritySolutionListPage { - return ExternalSecuritySolutionListPage{ - fn: getNextPage, - essl: cur, - } +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &dcar, true } -// ExternalSecuritySolutionModel ... -type ExternalSecuritySolutionModel struct { +// DeviceSecurityGroup the device security group resource +type DeviceSecurityGroup struct { autorest.Response `json:"-"` - Value BasicExternalSecuritySolution `json:"value,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionModel struct. -func (essm *ExternalSecuritySolutionModel) UnmarshalJSON(body []byte) error { - ess, err := unmarshalBasicExternalSecuritySolution(body) - if err != nil { - return err - } - essm.Value = ess - - return nil -} - -// ExternalSecuritySolutionProperties the solution properties (correspond to the solution kind) -type ExternalSecuritySolutionProperties struct { - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - DeviceVendor *string `json:"deviceVendor,omitempty"` - DeviceType *string `json:"deviceType,omitempty"` - Workspace *ConnectedWorkspace `json:"workspace,omitempty"` + // DeviceSecurityGroupProperties - Device Security group data + *DeviceSecurityGroupProperties `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 ExternalSecuritySolutionProperties. -func (essp ExternalSecuritySolutionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for DeviceSecurityGroup. +func (dsg DeviceSecurityGroup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if essp.DeviceVendor != nil { - objectMap["deviceVendor"] = essp.DeviceVendor - } - if essp.DeviceType != nil { - objectMap["deviceType"] = essp.DeviceType - } - if essp.Workspace != nil { - objectMap["workspace"] = essp.Workspace - } - for k, v := range essp.AdditionalProperties { - objectMap[k] = v + if dsg.DeviceSecurityGroupProperties != nil { + objectMap["properties"] = dsg.DeviceSecurityGroupProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionProperties struct. -func (essp *ExternalSecuritySolutionProperties) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for DeviceSecurityGroup struct. +func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -7232,44 +7549,41 @@ func (essp *ExternalSecuritySolutionProperties) UnmarshalJSON(body []byte) error } for k, v := range m { switch k { - default: + case "properties": if v != nil { - var additionalProperties interface{} - err = json.Unmarshal(*v, &additionalProperties) + var deviceSecurityGroupProperties DeviceSecurityGroupProperties + err = json.Unmarshal(*v, &deviceSecurityGroupProperties) if err != nil { return err } - if essp.AdditionalProperties == nil { - essp.AdditionalProperties = make(map[string]interface{}) - } - essp.AdditionalProperties[k] = additionalProperties + dsg.DeviceSecurityGroupProperties = &deviceSecurityGroupProperties } - case "deviceVendor": + case "id": if v != nil { - var deviceVendor string - err = json.Unmarshal(*v, &deviceVendor) + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - essp.DeviceVendor = &deviceVendor + dsg.ID = &ID } - case "deviceType": + case "name": if v != nil { - var deviceType string - err = json.Unmarshal(*v, &deviceType) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - essp.DeviceType = &deviceType + dsg.Name = &name } - case "workspace": + case "type": if v != nil { - var workspace ConnectedWorkspace - err = json.Unmarshal(*v, &workspace) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - essp.Workspace = &workspace + dsg.Type = &typeVar } } } @@ -7277,57 +7591,1175 @@ func (essp *ExternalSecuritySolutionProperties) UnmarshalJSON(body []byte) error return nil } -// FailedLocalLoginsNotInAllowedRange number of failed local logins is not in allowed range. -type FailedLocalLoginsNotInAllowedRange struct { - // TimeWindowSize - The time window size in iso8601 format. - TimeWindowSize *string `json:"timeWindowSize,omitempty"` - // MinThreshold - The minimum threshold. - MinThreshold *int32 `json:"minThreshold,omitempty"` - // MaxThreshold - The maximum threshold. - MaxThreshold *int32 `json:"maxThreshold,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', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` +// DeviceSecurityGroupList list of device security groups +type DeviceSecurityGroupList struct { + autorest.Response `json:"-"` + // Value - List of device security group objects + Value *[]DeviceSecurityGroup `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) MarshalJSON() ([]byte, error) { - fllniar.RuleType = RuleTypeFailedLocalLoginsNotInAllowedRange +// MarshalJSON is the custom marshaler for DeviceSecurityGroupList. +func (dsgl DeviceSecurityGroupList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if fllniar.TimeWindowSize != nil { - objectMap["timeWindowSize"] = fllniar.TimeWindowSize - } - if fllniar.MinThreshold != nil { - objectMap["minThreshold"] = fllniar.MinThreshold - } - if fllniar.MaxThreshold != nil { - objectMap["maxThreshold"] = fllniar.MaxThreshold - } - if fllniar.IsEnabled != nil { - objectMap["isEnabled"] = fllniar.IsEnabled - } - if fllniar.RuleType != "" { - objectMap["ruleType"] = fllniar.RuleType + if dsgl.Value != nil { + objectMap["value"] = dsgl.Value } return json.Marshal(objectMap) } -// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { - return nil, false -} - -// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { - return &fllniar, true +// DeviceSecurityGroupListIterator provides access to a complete listing of DeviceSecurityGroup values. +type DeviceSecurityGroupListIterator struct { + i int + page DeviceSecurityGroupListPage } -// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +// 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 *DeviceSecurityGroupListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupListIterator.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 *DeviceSecurityGroupListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DeviceSecurityGroupListIterator) 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 DeviceSecurityGroupListIterator) Response() DeviceSecurityGroupList { + 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 DeviceSecurityGroupListIterator) Value() DeviceSecurityGroup { + if !iter.page.NotDone() { + return DeviceSecurityGroup{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DeviceSecurityGroupListIterator type. +func NewDeviceSecurityGroupListIterator(page DeviceSecurityGroupListPage) DeviceSecurityGroupListIterator { + return DeviceSecurityGroupListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dsgl DeviceSecurityGroupList) IsEmpty() bool { + return dsgl.Value == nil || len(*dsgl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dsgl DeviceSecurityGroupList) hasNextLink() bool { + return dsgl.NextLink != nil && len(*dsgl.NextLink) != 0 +} + +// deviceSecurityGroupListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dsgl DeviceSecurityGroupList) deviceSecurityGroupListPreparer(ctx context.Context) (*http.Request, error) { + if !dsgl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dsgl.NextLink))) +} + +// DeviceSecurityGroupListPage contains a page of DeviceSecurityGroup values. +type DeviceSecurityGroupListPage struct { + fn func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error) + dsgl DeviceSecurityGroupList +} + +// 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 *DeviceSecurityGroupListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupListPage.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.dsgl) + if err != nil { + return err + } + page.dsgl = 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 *DeviceSecurityGroupListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DeviceSecurityGroupListPage) NotDone() bool { + return !page.dsgl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DeviceSecurityGroupListPage) Response() DeviceSecurityGroupList { + return page.dsgl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DeviceSecurityGroupListPage) Values() []DeviceSecurityGroup { + if page.dsgl.IsEmpty() { + return nil + } + return *page.dsgl.Value +} + +// Creates a new instance of the DeviceSecurityGroupListPage type. +func NewDeviceSecurityGroupListPage(cur DeviceSecurityGroupList, getNextPage func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error)) DeviceSecurityGroupListPage { + return DeviceSecurityGroupListPage{ + fn: getNextPage, + dsgl: cur, + } +} + +// DeviceSecurityGroupProperties describes properties of a security group. +type DeviceSecurityGroupProperties struct { + // ThresholdRules - The list of custom alert threshold rules. + ThresholdRules *[]BasicThresholdCustomAlertRule `json:"thresholdRules,omitempty"` + // TimeWindowRules - The list of custom alert time-window rules. + TimeWindowRules *[]BasicTimeWindowCustomAlertRule `json:"timeWindowRules,omitempty"` + // AllowlistRules - The allow-list custom alert rules. + AllowlistRules *[]BasicAllowlistCustomAlertRule `json:"allowlistRules,omitempty"` + // DenylistRules - The deny-list custom alert rules. + DenylistRules *[]DenylistCustomAlertRule `json:"denylistRules,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DeviceSecurityGroupProperties struct. +func (dsgp *DeviceSecurityGroupProperties) 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 "thresholdRules": + if v != nil { + thresholdRules, err := unmarshalBasicThresholdCustomAlertRuleArray(*v) + if err != nil { + return err + } + dsgp.ThresholdRules = &thresholdRules + } + case "timeWindowRules": + if v != nil { + timeWindowRules, err := unmarshalBasicTimeWindowCustomAlertRuleArray(*v) + if err != nil { + return err + } + dsgp.TimeWindowRules = &timeWindowRules + } + case "allowlistRules": + if v != nil { + allowlistRules, err := unmarshalBasicAllowlistCustomAlertRuleArray(*v) + if err != nil { + return err + } + dsgp.AllowlistRules = &allowlistRules + } + case "denylistRules": + if v != nil { + var denylistRules []DenylistCustomAlertRule + err = json.Unmarshal(*v, &denylistRules) + if err != nil { + return err + } + dsgp.DenylistRules = &denylistRules + } + } + } + + return nil +} + +// DirectMethodInvokesNotInAllowedRange number of direct method invokes is not in allowed range. +type DirectMethodInvokesNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,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', '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 DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) MarshalJSON() ([]byte, error) { + dminiar.RuleType = RuleTypeDirectMethodInvokesNotInAllowedRange + objectMap := make(map[string]interface{}) + if dminiar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = dminiar.TimeWindowSize + } + if dminiar.MinThreshold != nil { + objectMap["minThreshold"] = dminiar.MinThreshold + } + if dminiar.MaxThreshold != nil { + objectMap["maxThreshold"] = dminiar.MaxThreshold + } + if dminiar.IsEnabled != nil { + objectMap["isEnabled"] = dminiar.IsEnabled + } + if dminiar.RuleType != "" { + objectMap["ruleType"] = dminiar.RuleType + } + return json.Marshal(objectMap) +} + +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false +} + +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &dminiar, true +} + +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &dminiar, true +} + +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false +} + +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false +} + +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false +} + +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false +} + +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false +} + +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false +} + +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return &dminiar, true +} + +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false +} + +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false +} + +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false +} + +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false +} + +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false +} + +// AsCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false +} + +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &dminiar, true +} + +// DiscoveredSecuritySolution ... +type DiscoveredSecuritySolution struct { + autorest.Response `json:"-"` + // 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"` + // Location - READ-ONLY; Location where the resource is stored + Location *string `json:"location,omitempty"` + *DiscoveredSecuritySolutionProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiscoveredSecuritySolution. +func (dss DiscoveredSecuritySolution) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dss.DiscoveredSecuritySolutionProperties != nil { + objectMap["properties"] = dss.DiscoveredSecuritySolutionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DiscoveredSecuritySolution struct. +func (dss *DiscoveredSecuritySolution) 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 "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dss.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dss.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dss.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dss.Location = &location + } + case "properties": + if v != nil { + var discoveredSecuritySolutionProperties DiscoveredSecuritySolutionProperties + err = json.Unmarshal(*v, &discoveredSecuritySolutionProperties) + if err != nil { + return err + } + dss.DiscoveredSecuritySolutionProperties = &discoveredSecuritySolutionProperties + } + } + } + + return nil +} + +// DiscoveredSecuritySolutionList ... +type DiscoveredSecuritySolutionList struct { + autorest.Response `json:"-"` + Value *[]DiscoveredSecuritySolution `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiscoveredSecuritySolutionList. +func (dssl DiscoveredSecuritySolutionList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dssl.Value != nil { + objectMap["value"] = dssl.Value + } + return json.Marshal(objectMap) +} + +// DiscoveredSecuritySolutionListIterator provides access to a complete listing of +// DiscoveredSecuritySolution values. +type DiscoveredSecuritySolutionListIterator struct { + i int + page DiscoveredSecuritySolutionListPage +} + +// 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 *DiscoveredSecuritySolutionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionListIterator.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 *DiscoveredSecuritySolutionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DiscoveredSecuritySolutionListIterator) 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 DiscoveredSecuritySolutionListIterator) Response() DiscoveredSecuritySolutionList { + 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 DiscoveredSecuritySolutionListIterator) Value() DiscoveredSecuritySolution { + if !iter.page.NotDone() { + return DiscoveredSecuritySolution{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DiscoveredSecuritySolutionListIterator type. +func NewDiscoveredSecuritySolutionListIterator(page DiscoveredSecuritySolutionListPage) DiscoveredSecuritySolutionListIterator { + return DiscoveredSecuritySolutionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dssl DiscoveredSecuritySolutionList) IsEmpty() bool { + return dssl.Value == nil || len(*dssl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dssl DiscoveredSecuritySolutionList) hasNextLink() bool { + return dssl.NextLink != nil && len(*dssl.NextLink) != 0 +} + +// discoveredSecuritySolutionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dssl DiscoveredSecuritySolutionList) discoveredSecuritySolutionListPreparer(ctx context.Context) (*http.Request, error) { + if !dssl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dssl.NextLink))) +} + +// DiscoveredSecuritySolutionListPage contains a page of DiscoveredSecuritySolution values. +type DiscoveredSecuritySolutionListPage struct { + fn func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error) + dssl DiscoveredSecuritySolutionList +} + +// 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 *DiscoveredSecuritySolutionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionListPage.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.dssl) + if err != nil { + return err + } + page.dssl = 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 *DiscoveredSecuritySolutionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DiscoveredSecuritySolutionListPage) NotDone() bool { + return !page.dssl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DiscoveredSecuritySolutionListPage) Response() DiscoveredSecuritySolutionList { + return page.dssl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DiscoveredSecuritySolutionListPage) Values() []DiscoveredSecuritySolution { + if page.dssl.IsEmpty() { + return nil + } + return *page.dssl.Value +} + +// Creates a new instance of the DiscoveredSecuritySolutionListPage type. +func NewDiscoveredSecuritySolutionListPage(cur DiscoveredSecuritySolutionList, getNextPage func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error)) DiscoveredSecuritySolutionListPage { + return DiscoveredSecuritySolutionListPage{ + fn: getNextPage, + dssl: cur, + } +} + +// DiscoveredSecuritySolutionProperties ... +type DiscoveredSecuritySolutionProperties struct { + // SecurityFamily - The security family of the discovered solution. Possible values include: 'Waf', 'Ngfw', 'SaasWaf', 'Va' + SecurityFamily Family `json:"securityFamily,omitempty"` + // Offer - The security solutions' image offer + Offer *string `json:"offer,omitempty"` + // Publisher - The security solutions' image publisher + Publisher *string `json:"publisher,omitempty"` + // Sku - The security solutions' image sku + Sku *string `json:"sku,omitempty"` +} + +// EffectiveNetworkSecurityGroups describes the Network Security Groups effective on a network interface +type EffectiveNetworkSecurityGroups struct { + // NetworkInterface - The Azure resource ID of the network interface + NetworkInterface *string `json:"networkInterface,omitempty"` + // NetworkSecurityGroups - The Network Security Groups effective on the network interface + 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. + Etag *string `json:"etag,omitempty"` +} + +// BasicExternalSecuritySolution represents a security solution external to Microsoft Defender for Cloud which sends +// information to an OMS workspace and whose data is displayed by Microsoft Defender for Cloud. +type BasicExternalSecuritySolution interface { + AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) + AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) + AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) + AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) +} + +// ExternalSecuritySolution represents a security solution external to Microsoft Defender for Cloud which sends +// information to an OMS workspace and whose data is displayed by Microsoft Defender for Cloud. +type ExternalSecuritySolution struct { + autorest.Response `json:"-"` + // 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"` + // Location - READ-ONLY; Location where the resource is stored + Location *string `json:"location,omitempty"` + // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' + Kind KindEnum1 `json:"kind,omitempty"` +} + +func unmarshalBasicExternalSecuritySolution(body []byte) (BasicExternalSecuritySolution, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindCEF): + var cess CefExternalSecuritySolution + err := json.Unmarshal(body, &cess) + return cess, err + case string(KindATA): + var aess AtaExternalSecuritySolution + err := json.Unmarshal(body, &aess) + return aess, err + case string(KindAAD): + var aess AadExternalSecuritySolution + err := json.Unmarshal(body, &aess) + return aess, err + default: + var ess ExternalSecuritySolution + err := json.Unmarshal(body, &ess) + return ess, err + } +} +func unmarshalBasicExternalSecuritySolutionArray(body []byte) ([]BasicExternalSecuritySolution, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + essArray := make([]BasicExternalSecuritySolution, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ess, err := unmarshalBasicExternalSecuritySolution(*rawMessage) + if err != nil { + return nil, err + } + essArray[index] = ess + } + return essArray, nil +} + +// MarshalJSON is the custom marshaler for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) MarshalJSON() ([]byte, error) { + ess.Kind = KindExternalSecuritySolution + objectMap := make(map[string]interface{}) + if ess.Kind != "" { + objectMap["kind"] = ess.Kind + } + return json.Marshal(objectMap) +} + +// AsCefExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) { + return nil, false +} + +// AsAtaExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) { + return nil, false +} + +// AsAadExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) { + return nil, false +} + +// AsExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) { + return &ess, true +} + +// AsBasicExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) AsBasicExternalSecuritySolution() (BasicExternalSecuritySolution, bool) { + return &ess, true +} + +// ExternalSecuritySolutionKind1 describes an Azure resource with kind +type ExternalSecuritySolutionKind1 struct { + // Kind - The kind of the external solution. Possible values include: 'CEF', 'ATA', 'AAD' + Kind ExternalSecuritySolutionKind `json:"kind,omitempty"` +} + +// ExternalSecuritySolutionList ... +type ExternalSecuritySolutionList struct { + autorest.Response `json:"-"` + Value *[]BasicExternalSecuritySolution `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExternalSecuritySolutionList. +func (essl ExternalSecuritySolutionList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if essl.Value != nil { + objectMap["value"] = essl.Value + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionList struct. +func (essl *ExternalSecuritySolutionList) 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 "value": + if v != nil { + value, err := unmarshalBasicExternalSecuritySolutionArray(*v) + if err != nil { + return err + } + essl.Value = &value + } + case "nextLink": + if v != nil { + var nextLink string + err = json.Unmarshal(*v, &nextLink) + if err != nil { + return err + } + essl.NextLink = &nextLink + } + } + } + + return nil +} + +// ExternalSecuritySolutionListIterator provides access to a complete listing of ExternalSecuritySolution +// values. +type ExternalSecuritySolutionListIterator struct { + i int + page ExternalSecuritySolutionListPage +} + +// 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 *ExternalSecuritySolutionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionListIterator.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 *ExternalSecuritySolutionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ExternalSecuritySolutionListIterator) 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 ExternalSecuritySolutionListIterator) Response() ExternalSecuritySolutionList { + 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 ExternalSecuritySolutionListIterator) Value() BasicExternalSecuritySolution { + if !iter.page.NotDone() { + return ExternalSecuritySolution{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ExternalSecuritySolutionListIterator type. +func NewExternalSecuritySolutionListIterator(page ExternalSecuritySolutionListPage) ExternalSecuritySolutionListIterator { + return ExternalSecuritySolutionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (essl ExternalSecuritySolutionList) IsEmpty() bool { + return essl.Value == nil || len(*essl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (essl ExternalSecuritySolutionList) hasNextLink() bool { + return essl.NextLink != nil && len(*essl.NextLink) != 0 +} + +// externalSecuritySolutionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (essl ExternalSecuritySolutionList) externalSecuritySolutionListPreparer(ctx context.Context) (*http.Request, error) { + if !essl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(essl.NextLink))) +} + +// ExternalSecuritySolutionListPage contains a page of BasicExternalSecuritySolution values. +type ExternalSecuritySolutionListPage struct { + fn func(context.Context, ExternalSecuritySolutionList) (ExternalSecuritySolutionList, error) + essl ExternalSecuritySolutionList +} + +// 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 *ExternalSecuritySolutionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionListPage.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.essl) + if err != nil { + return err + } + page.essl = 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 *ExternalSecuritySolutionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ExternalSecuritySolutionListPage) NotDone() bool { + return !page.essl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ExternalSecuritySolutionListPage) Response() ExternalSecuritySolutionList { + return page.essl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ExternalSecuritySolutionListPage) Values() []BasicExternalSecuritySolution { + if page.essl.IsEmpty() { + return nil + } + return *page.essl.Value +} + +// Creates a new instance of the ExternalSecuritySolutionListPage type. +func NewExternalSecuritySolutionListPage(cur ExternalSecuritySolutionList, getNextPage func(context.Context, ExternalSecuritySolutionList) (ExternalSecuritySolutionList, error)) ExternalSecuritySolutionListPage { + return ExternalSecuritySolutionListPage{ + fn: getNextPage, + essl: cur, + } +} + +// ExternalSecuritySolutionModel ... +type ExternalSecuritySolutionModel struct { + autorest.Response `json:"-"` + Value BasicExternalSecuritySolution `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionModel struct. +func (essm *ExternalSecuritySolutionModel) UnmarshalJSON(body []byte) error { + ess, err := unmarshalBasicExternalSecuritySolution(body) + if err != nil { + return err + } + essm.Value = ess + + return nil +} + +// ExternalSecuritySolutionProperties the solution properties (correspond to the solution kind) +type ExternalSecuritySolutionProperties struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + DeviceVendor *string `json:"deviceVendor,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + Workspace *ConnectedWorkspace `json:"workspace,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExternalSecuritySolutionProperties. +func (essp ExternalSecuritySolutionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if essp.DeviceVendor != nil { + objectMap["deviceVendor"] = essp.DeviceVendor + } + if essp.DeviceType != nil { + objectMap["deviceType"] = essp.DeviceType + } + if essp.Workspace != nil { + objectMap["workspace"] = essp.Workspace + } + for k, v := range essp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionProperties struct. +func (essp *ExternalSecuritySolutionProperties) 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 essp.AdditionalProperties == nil { + essp.AdditionalProperties = make(map[string]interface{}) + } + essp.AdditionalProperties[k] = additionalProperties + } + case "deviceVendor": + if v != nil { + var deviceVendor string + err = json.Unmarshal(*v, &deviceVendor) + if err != nil { + return err + } + essp.DeviceVendor = &deviceVendor + } + case "deviceType": + if v != nil { + var deviceType string + err = json.Unmarshal(*v, &deviceType) + if err != nil { + return err + } + essp.DeviceType = &deviceType + } + case "workspace": + if v != nil { + var workspace ConnectedWorkspace + err = json.Unmarshal(*v, &workspace) + if err != nil { + return err + } + essp.Workspace = &workspace + } + } + } + + return nil +} + +// FailedLocalLoginsNotInAllowedRange number of failed local logins is not in allowed range. +type FailedLocalLoginsNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,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', '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 FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) MarshalJSON() ([]byte, error) { + fllniar.RuleType = RuleTypeFailedLocalLoginsNotInAllowedRange + objectMap := make(map[string]interface{}) + if fllniar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = fllniar.TimeWindowSize + } + if fllniar.MinThreshold != nil { + objectMap["minThreshold"] = fllniar.MinThreshold + } + if fllniar.MaxThreshold != nil { + objectMap["maxThreshold"] = fllniar.MaxThreshold + } + if fllniar.IsEnabled != nil { + objectMap["isEnabled"] = fllniar.IsEnabled + } + if fllniar.RuleType != "" { + objectMap["ruleType"] = fllniar.RuleType + } + return json.Marshal(objectMap) +} + +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false +} + +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &fllniar, true +} + +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. func (fllniar FailedLocalLoginsNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { return nil, false } @@ -8368,6 +9800,65 @@ func (hcsp HybridComputeSettingsProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// InformationProtectionAwsOffering the information protection for AWS offering configurations +type InformationProtectionAwsOffering struct { + // InformationProtection - The native cloud connection configuration + InformationProtection *InformationProtectionAwsOfferingInformationProtection `json:"informationProtection,omitempty"` + // Description - READ-ONLY; The offering description. + Description *string `json:"description,omitempty"` + // OfferingType - Possible values include: 'OfferingTypeCloudOffering', 'OfferingTypeCspmMonitorAws', 'OfferingTypeDefenderForContainersAws', 'OfferingTypeDefenderForServersAws', 'OfferingTypeInformationProtectionAws' + OfferingType OfferingType `json:"offeringType,omitempty"` +} + +// MarshalJSON is the custom marshaler for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) MarshalJSON() ([]byte, error) { + ipao.OfferingType = OfferingTypeInformationProtectionAws + objectMap := make(map[string]interface{}) + if ipao.InformationProtection != nil { + objectMap["informationProtection"] = ipao.InformationProtection + } + if ipao.OfferingType != "" { + objectMap["offeringType"] = ipao.OfferingType + } + return json.Marshal(objectMap) +} + +// AsCspmMonitorAwsOffering is the BasicCloudOffering implementation for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) { + return nil, false +} + +// AsDefenderForContainersAwsOffering is the BasicCloudOffering implementation for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) { + return nil, false +} + +// AsDefenderForServersAwsOffering is the BasicCloudOffering implementation for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) { + return nil, false +} + +// AsInformationProtectionAwsOffering is the BasicCloudOffering implementation for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) { + return &ipao, true +} + +// AsCloudOffering is the BasicCloudOffering implementation for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) AsCloudOffering() (*CloudOffering, bool) { + return nil, false +} + +// AsBasicCloudOffering is the BasicCloudOffering implementation for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) AsBasicCloudOffering() (BasicCloudOffering, bool) { + return &ipao, true +} + +// InformationProtectionAwsOfferingInformationProtection the native cloud connection configuration +type InformationProtectionAwsOfferingInformationProtection struct { + // CloudRoleArn - The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` +} + // InformationProtectionKeyword the information type keyword. type InformationProtectionKeyword struct { // Pattern - The keyword pattern. @@ -8664,6 +10155,222 @@ type InformationType struct { Keywords *[]InformationProtectionKeyword `json:"keywords,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 IngestionConnectionString. +func (ics IngestionConnectionString) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// 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"` +} + +// 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) +} + +// IngestionSettingList list of ingestion settings +type IngestionSettingList struct { + autorest.Response `json:"-"` + // 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"` +} + +// MarshalJSON is the custom marshaler for IngestionSettingList. +func (isl IngestionSettingList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// IngestionSettingListIterator provides access to a complete listing of IngestionSetting values. +type IngestionSettingListIterator struct { + i int + 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 *IngestionSettingListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IngestionSettingListIterator.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 *IngestionSettingListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +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 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 IngestionSettingListIterator) Value() IngestionSetting { + if !iter.page.NotDone() { + return IngestionSetting{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IngestionSettingListIterator type. +func NewIngestionSettingListIterator(page IngestionSettingListPage) IngestionSettingListIterator { + return IngestionSettingListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (isl IngestionSettingList) IsEmpty() bool { + return isl.Value == nil || len(*isl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (isl IngestionSettingList) hasNextLink() bool { + return isl.NextLink != nil && len(*isl.NextLink) != 0 +} + +// 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) +} + // IoTSecurityAggregatedAlert security Solution Aggregated Alert information type IoTSecurityAggregatedAlert struct { autorest.Response `json:"-"` @@ -10600,21 +12307,109 @@ func (luna LocalUserNotAllowed) AsCustomAlertRule() (*CustomAlertRule, bool) { return nil, false } -// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for LocalUserNotAllowed. -func (luna LocalUserNotAllowed) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { - return &luna, true +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &luna, true +} + +// Location describes an Azure resource with location +type Location struct { + // Location - READ-ONLY; Location where the resource is stored + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Location. +func (l Location) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MdeOnboardingData the resource of the configuration or data needed to onboard the machine to MDE +type MdeOnboardingData struct { + autorest.Response `json:"-"` + *MdeOnboardingDataProperties `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 MdeOnboardingData. +func (mod MdeOnboardingData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mod.MdeOnboardingDataProperties != nil { + objectMap["properties"] = mod.MdeOnboardingDataProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MdeOnboardingData struct. +func (mod *MdeOnboardingData) 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 mdeOnboardingDataProperties MdeOnboardingDataProperties + err = json.Unmarshal(*v, &mdeOnboardingDataProperties) + if err != nil { + return err + } + mod.MdeOnboardingDataProperties = &mdeOnboardingDataProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mod.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mod.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mod.Type = &typeVar + } + } + } + + return nil } -// Location describes an Azure resource with location -type Location struct { - // Location - READ-ONLY; Location where the resource is stored - Location *string `json:"location,omitempty"` +// MdeOnboardingDataList list of all MDE onboarding data resources +type MdeOnboardingDataList struct { + autorest.Response `json:"-"` + // Value - List of the resources of the configuration or data needed to onboard the machine to MDE + Value *[]MdeOnboardingData `json:"value,omitempty"` } -// MarshalJSON is the custom marshaler for Location. -func (l Location) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) +// MdeOnboardingDataProperties properties of the MDE configuration or data parameter needed to onboard the +// machine to MDE +type MdeOnboardingDataProperties struct { + // OnboardingPackageWindows - The onboarding package used to onboard Windows machines to MDE, coded in base64. This can also be used for onboarding using the dedicated VM Extension + OnboardingPackageWindows *[]byte `json:"onboardingPackageWindows,omitempty"` + // OnboardingPackageLinux - The onboarding package used to onboard Linux machines to MDE, coded in base64. This can also be used for onboarding using the dedicated VM Extension + OnboardingPackageLinux *[]byte `json:"onboardingPackageLinux,omitempty"` } // MqttC2DMessagesNotInAllowedRange number of cloud to device messages (MQTT protocol) is not in allowed @@ -11598,9 +13393,9 @@ type PathRecommendation struct { ConfigurationStatus ConfigurationStatus1 `json:"configurationStatus,omitempty"` } -// Pricing azure Security Center is provided in two pricing tiers: free and standard, with the standard -// tier available with a trial period. The standard tier offers advanced security capabilities, while the -// free tier offers basic security features. +// Pricing microsoft Defender for Cloud is provided in two pricing tiers: free and standard, with the +// standard tier available with a trial period. The standard tier offers advanced security capabilities, +// while the free tier offers basic security features. type Pricing struct { autorest.Response `json:"-"` // PricingProperties - Pricing data @@ -11682,7 +13477,7 @@ type PricingList struct { // PricingProperties pricing properties for the relevant scope type PricingProperties struct { - // PricingTier - The pricing tier value. Azure Security Center is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features. Possible values include: 'Free', 'Standard' + // PricingTier - The pricing tier value. Microsoft Defender for Cloud is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features. Possible values include: 'Free', 'Standard' PricingTier PricingTier `json:"pricingTier,omitempty"` // FreeTrialRemainingTime - READ-ONLY; The duration left for the subscriptions free trial period - in ISO 8601 format (e.g. P3Y6M4DT12H30M5S). FreeTrialRemainingTime *string `json:"freeTrialRemainingTime,omitempty"` @@ -13033,55 +14828,293 @@ func (rd ResourceDetails) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// AsOnPremiseSQLResourceDetails is the BasicResourceDetails implementation for ResourceDetails. -func (rd ResourceDetails) AsOnPremiseSQLResourceDetails() (*OnPremiseSQLResourceDetails, bool) { - return nil, false +// AsOnPremiseSQLResourceDetails is the BasicResourceDetails implementation for ResourceDetails. +func (rd ResourceDetails) AsOnPremiseSQLResourceDetails() (*OnPremiseSQLResourceDetails, bool) { + return nil, false +} + +// AsOnPremiseResourceDetails is the BasicResourceDetails implementation for ResourceDetails. +func (rd ResourceDetails) AsOnPremiseResourceDetails() (*OnPremiseResourceDetails, bool) { + return nil, false +} + +// AsBasicOnPremiseResourceDetails is the BasicResourceDetails implementation for ResourceDetails. +func (rd ResourceDetails) AsBasicOnPremiseResourceDetails() (BasicOnPremiseResourceDetails, bool) { + return nil, false +} + +// AsAzureResourceDetails is the BasicResourceDetails implementation for ResourceDetails. +func (rd ResourceDetails) AsAzureResourceDetails() (*AzureResourceDetails, bool) { + return nil, false +} + +// AsResourceDetails is the BasicResourceDetails implementation for ResourceDetails. +func (rd ResourceDetails) AsResourceDetails() (*ResourceDetails, bool) { + return &rd, true +} + +// AsBasicResourceDetails is the BasicResourceDetails implementation for ResourceDetails. +func (rd ResourceDetails) AsBasicResourceDetails() (BasicResourceDetails, bool) { + return &rd, true +} + +// Rule describes remote addresses that is recommended to communicate with the Azure resource on some +// (Protocol, Port, Direction). All other remote addresses are recommended to be blocked +type Rule struct { + // Name - The name of the rule + Name *string `json:"name,omitempty"` + // Direction - The rule's direction. Possible values include: 'Inbound', 'Outbound' + Direction Direction `json:"direction,omitempty"` + // DestinationPort - The rule's destination port + DestinationPort *int32 `json:"destinationPort,omitempty"` + // Protocols - The rule's transport protocols + Protocols *[]TransportProtocol `json:"protocols,omitempty"` + // IPAddresses - The remote IP addresses that should be able to communicate with the Azure resource on the rule's destination port and protocol + IPAddresses *[]string `json:"ipAddresses,omitempty"` +} + +// RuleResults rule results. +type RuleResults struct { + autorest.Response `json:"-"` + Properties *RuleResultsProperties `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 RuleResults. +func (rr RuleResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rr.Properties != nil { + objectMap["properties"] = rr.Properties + } + return json.Marshal(objectMap) +} + +// RuleResultsInput rule results input. +type RuleResultsInput struct { + // LatestScan - Take results from latest scan. + LatestScan *bool `json:"latestScan,omitempty"` + // Results - Expected results to be inserted into the baseline. + // Leave this field empty it LatestScan == true. + Results *[][]string `json:"results,omitempty"` +} + +// RuleResultsProperties rule results properties. +type RuleResultsProperties struct { + // Results - Expected results in the baseline. + Results *[][]string `json:"results,omitempty"` +} + +// RulesResults a list of rules results. +type RulesResults struct { + autorest.Response `json:"-"` + // Value - List of rule results. + Value *[]RuleResults `json:"value,omitempty"` +} + +// RulesResultsInput rules results input. +type RulesResultsInput struct { + // LatestScan - Take results from latest scan. + LatestScan *bool `json:"latestScan,omitempty"` + // Results - Expected results to be inserted into the baseline. + // Leave this field empty it LatestScan == true. + Results map[string][][]string `json:"results"` +} + +// MarshalJSON is the custom marshaler for RulesResultsInput. +func (rri RulesResultsInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rri.LatestScan != nil { + objectMap["latestScan"] = rri.LatestScan + } + if rri.Results != nil { + objectMap["results"] = rri.Results + } + return json.Marshal(objectMap) +} + +// Scan a vulnerability assessment scan record. +type Scan struct { + autorest.Response `json:"-"` + Properties *ScanProperties `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 Scan. +func (s Scan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.Properties != nil { + objectMap["properties"] = s.Properties + } + return json.Marshal(objectMap) +} + +// ScanProperties a vulnerability assessment scan record properties. +type ScanProperties struct { + // TriggerType - Possible values include: 'OnDemand', 'Recurring' + TriggerType ScanTriggerType `json:"triggerType,omitempty"` + // State - Possible values include: 'ScanStateFailed', 'ScanStateFailedToRun', 'ScanStateInProgress', 'ScanStatePassed' + State ScanState `json:"state,omitempty"` + // Server - The server name. + Server *string `json:"server,omitempty"` + // Database - The database name. + Database *string `json:"database,omitempty"` + // SQLVersion - The SQL version. + SQLVersion *string `json:"sqlVersion,omitempty"` + // StartTime - The scan start time (UTC). + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Scan results are valid until end time (UTC). + EndTime *date.Time `json:"endTime,omitempty"` + // HighSeverityFailedRulesCount - The number of failed rules with high severity. + HighSeverityFailedRulesCount *int32 `json:"highSeverityFailedRulesCount,omitempty"` + // MediumSeverityFailedRulesCount - The number of failed rules with medium severity. + MediumSeverityFailedRulesCount *int32 `json:"mediumSeverityFailedRulesCount,omitempty"` + // LowSeverityFailedRulesCount - The number of failed rules with low severity. + LowSeverityFailedRulesCount *int32 `json:"lowSeverityFailedRulesCount,omitempty"` + // TotalPassedRulesCount - The number of total passed rules. + TotalPassedRulesCount *int32 `json:"totalPassedRulesCount,omitempty"` + // TotalFailedRulesCount - The number of total failed rules. + TotalFailedRulesCount *int32 `json:"totalFailedRulesCount,omitempty"` + // TotalRulesCount - The number of total rules assessed. + TotalRulesCount *int32 `json:"totalRulesCount,omitempty"` + // IsBaselineApplied - Baseline created for this database, and has one or more rules. + IsBaselineApplied *bool `json:"isBaselineApplied,omitempty"` +} + +// ScanResult a vulnerability assessment scan result for a single rule. +type ScanResult struct { + autorest.Response `json:"-"` + Properties *ScanResultProperties `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 ScanResult. +func (sr ScanResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sr.Properties != nil { + objectMap["properties"] = sr.Properties + } + return json.Marshal(objectMap) +} + +// ScanResultProperties a vulnerability assessment scan result properties for a single rule. +type ScanResultProperties struct { + // RuleID - The rule Id. + RuleID *string `json:"ruleId,omitempty"` + // Status - Possible values include: 'NonFinding', 'Finding', 'InternalError' + Status RuleStatus `json:"status,omitempty"` + // IsTrimmed - Indicated whether the results specified here are trimmed. + IsTrimmed *bool `json:"isTrimmed,omitempty"` + // QueryResults - The results of the query that was run. + QueryResults *[][]string `json:"queryResults,omitempty"` + Remediation *Remediation `json:"remediation,omitempty"` + BaselineAdjustedResult *BaselineAdjustedResult `json:"baselineAdjustedResult,omitempty"` + RuleMetadata *VaRule `json:"ruleMetadata,omitempty"` +} + +// ScanResults a list of vulnerability assessment scan results. +type ScanResults struct { + autorest.Response `json:"-"` + // Value - List of vulnerability assessment scan results. + Value *[]ScanResult `json:"value,omitempty"` +} + +// Scans a list of vulnerability assessment scan records. +type Scans struct { + autorest.Response `json:"-"` + // Value - List of vulnerability assessment scan records. + Value *[]Scan `json:"value,omitempty"` } -// AsOnPremiseResourceDetails is the BasicResourceDetails implementation for ResourceDetails. -func (rd ResourceDetails) AsOnPremiseResourceDetails() (*OnPremiseResourceDetails, bool) { - return nil, false +// ScopeElement a more specific scope used to identify the alerts to suppress. +type ScopeElement struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Field - The alert entity type to suppress by. + Field *string `json:"field,omitempty"` } -// AsBasicOnPremiseResourceDetails is the BasicResourceDetails implementation for ResourceDetails. -func (rd ResourceDetails) AsBasicOnPremiseResourceDetails() (BasicOnPremiseResourceDetails, bool) { - return nil, false +// MarshalJSON is the custom marshaler for ScopeElement. +func (se ScopeElement) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if se.Field != nil { + objectMap["field"] = se.Field + } + for k, v := range se.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) } -// AsAzureResourceDetails is the BasicResourceDetails implementation for ResourceDetails. -func (rd ResourceDetails) AsAzureResourceDetails() (*AzureResourceDetails, bool) { - return nil, false -} +// UnmarshalJSON is the custom unmarshaler for ScopeElement struct. +func (se *ScopeElement) 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 se.AdditionalProperties == nil { + se.AdditionalProperties = make(map[string]interface{}) + } + se.AdditionalProperties[k] = additionalProperties + } + case "field": + if v != nil { + var field string + err = json.Unmarshal(*v, &field) + if err != nil { + return err + } + se.Field = &field + } + } + } -// AsResourceDetails is the BasicResourceDetails implementation for ResourceDetails. -func (rd ResourceDetails) AsResourceDetails() (*ResourceDetails, bool) { - return &rd, true + return nil } -// AsBasicResourceDetails is the BasicResourceDetails implementation for ResourceDetails. -func (rd ResourceDetails) AsBasicResourceDetails() (BasicResourceDetails, bool) { - return &rd, true +// ScoreDetails calculation result data +type ScoreDetails struct { + // Max - READ-ONLY; Maximum score available + Max *int32 `json:"max,omitempty"` + // Current - READ-ONLY; Current score + Current *float64 `json:"current,omitempty"` + // Percentage - READ-ONLY; Ratio of the current score divided by the maximum. Rounded to 4 digits after the decimal point + Percentage *float64 `json:"percentage,omitempty"` } -// Rule describes remote addresses that is recommended to communicate with the Azure resource on some -// (Protocol, Port, Direction). All other remote addresses are recommended to be blocked -type Rule struct { - // Name - The name of the rule - Name *string `json:"name,omitempty"` - // Direction - The rule's direction. Possible values include: 'Inbound', 'Outbound' - Direction Direction `json:"direction,omitempty"` - // DestinationPort - The rule's destination port - DestinationPort *int32 `json:"destinationPort,omitempty"` - // Protocols - The rule's transport protocols - Protocols *[]TransportProtocol `json:"protocols,omitempty"` - // IPAddresses - The remote IP addresses that should be able to communicate with the Azure resource on the rule's destination port and protocol - IPAddresses *[]string `json:"ipAddresses,omitempty"` +// MarshalJSON is the custom marshaler for ScoreDetails. +func (sd ScoreDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) } -// RuleResults rule results. -type RuleResults struct { - autorest.Response `json:"-"` - Properties *RuleResultsProperties `json:"properties,omitempty"` +// SecureScoreControlDefinitionItem information about the security control. +type SecureScoreControlDefinitionItem struct { + *SecureScoreControlDefinitionItemProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name @@ -13090,236 +15123,262 @@ type RuleResults struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for RuleResults. -func (rr RuleResults) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for SecureScoreControlDefinitionItem. +func (sscdi SecureScoreControlDefinitionItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if rr.Properties != nil { - objectMap["properties"] = rr.Properties + if sscdi.SecureScoreControlDefinitionItemProperties != nil { + objectMap["properties"] = sscdi.SecureScoreControlDefinitionItemProperties } return json.Marshal(objectMap) } -// RuleResultsInput rule results input. -type RuleResultsInput struct { - // LatestScan - Take results from latest scan. - LatestScan *bool `json:"latestScan,omitempty"` - // Results - Expected results to be inserted into the baseline. - // Leave this field empty it LatestScan == true. - Results *[][]string `json:"results,omitempty"` +// UnmarshalJSON is the custom unmarshaler for SecureScoreControlDefinitionItem struct. +func (sscdi *SecureScoreControlDefinitionItem) 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 secureScoreControlDefinitionItemProperties SecureScoreControlDefinitionItemProperties + err = json.Unmarshal(*v, &secureScoreControlDefinitionItemProperties) + if err != nil { + return err + } + sscdi.SecureScoreControlDefinitionItemProperties = &secureScoreControlDefinitionItemProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sscdi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sscdi.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sscdi.Type = &typeVar + } + } + } + + return nil } -// RuleResultsProperties rule results properties. -type RuleResultsProperties struct { - // Results - Expected results in the baseline. - Results *[][]string `json:"results,omitempty"` +// SecureScoreControlDefinitionItemProperties security Control Definition Properties. +type SecureScoreControlDefinitionItemProperties struct { + // DisplayName - READ-ONLY; User friendly display name of the control + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; User friendly description of the control + Description *string `json:"description,omitempty"` + // MaxScore - READ-ONLY; Maximum control score (0..10) + MaxScore *int32 `json:"maxScore,omitempty"` + // Source - READ-ONLY; Source object from which the control was created + Source *SecureScoreControlDefinitionSource `json:"source,omitempty"` + // AssessmentDefinitions - READ-ONLY; Array of assessments metadata IDs that are included in this security control + AssessmentDefinitions *[]AzureResourceLink `json:"assessmentDefinitions,omitempty"` } -// RulesResults a list of rules results. -type RulesResults struct { - autorest.Response `json:"-"` - // Value - List of rule results. - Value *[]RuleResults `json:"value,omitempty"` +// MarshalJSON is the custom marshaler for SecureScoreControlDefinitionItemProperties. +func (sscdip SecureScoreControlDefinitionItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) } -// RulesResultsInput rules results input. -type RulesResultsInput struct { - // LatestScan - Take results from latest scan. - LatestScan *bool `json:"latestScan,omitempty"` - // Results - Expected results to be inserted into the baseline. - // Leave this field empty it LatestScan == true. - Results map[string][][]string `json:"results"` +// SecureScoreControlDefinitionList list of security controls definition +type SecureScoreControlDefinitionList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Collection of security controls definition in this page + Value *[]SecureScoreControlDefinitionItem `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for RulesResultsInput. -func (rri RulesResultsInput) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for SecureScoreControlDefinitionList. +func (sscdl SecureScoreControlDefinitionList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if rri.LatestScan != nil { - objectMap["latestScan"] = rri.LatestScan - } - if rri.Results != nil { - objectMap["results"] = rri.Results - } return json.Marshal(objectMap) } -// Scan a vulnerability assessment scan record. -type Scan struct { - autorest.Response `json:"-"` - Properties *ScanProperties `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"` +// SecureScoreControlDefinitionListIterator provides access to a complete listing of +// SecureScoreControlDefinitionItem values. +type SecureScoreControlDefinitionListIterator struct { + i int + page SecureScoreControlDefinitionListPage +} + +// 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 *SecureScoreControlDefinitionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionListIterator.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 } -// MarshalJSON is the custom marshaler for Scan. -func (s Scan) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if s.Properties != nil { - objectMap["properties"] = s.Properties - } - return json.Marshal(objectMap) +// 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 *SecureScoreControlDefinitionListIterator) Next() error { + return iter.NextWithContext(context.Background()) } -// ScanProperties a vulnerability assessment scan record properties. -type ScanProperties struct { - // TriggerType - Possible values include: 'OnDemand', 'Recurring' - TriggerType ScanTriggerType `json:"triggerType,omitempty"` - // State - Possible values include: 'ScanStateFailed', 'ScanStateFailedToRun', 'ScanStateInProgress', 'ScanStatePassed' - State ScanState `json:"state,omitempty"` - // Server - The server name. - Server *string `json:"server,omitempty"` - // Database - The database name. - Database *string `json:"database,omitempty"` - // SQLVersion - The SQL version. - SQLVersion *string `json:"sqlVersion,omitempty"` - // StartTime - The scan start time (UTC). - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - Scan results are valid until end time (UTC). - EndTime *date.Time `json:"endTime,omitempty"` - // HighSeverityFailedRulesCount - The number of failed rules with high severity. - HighSeverityFailedRulesCount *int32 `json:"highSeverityFailedRulesCount,omitempty"` - // MediumSeverityFailedRulesCount - The number of failed rules with medium severity. - MediumSeverityFailedRulesCount *int32 `json:"mediumSeverityFailedRulesCount,omitempty"` - // LowSeverityFailedRulesCount - The number of failed rules with low severity. - LowSeverityFailedRulesCount *int32 `json:"lowSeverityFailedRulesCount,omitempty"` - // TotalPassedRulesCount - The number of total passed rules. - TotalPassedRulesCount *int32 `json:"totalPassedRulesCount,omitempty"` - // TotalFailedRulesCount - The number of total failed rules. - TotalFailedRulesCount *int32 `json:"totalFailedRulesCount,omitempty"` - // TotalRulesCount - The number of total rules assessed. - TotalRulesCount *int32 `json:"totalRulesCount,omitempty"` - // IsBaselineApplied - Baseline created for this database, and has one or more rules. - IsBaselineApplied *bool `json:"isBaselineApplied,omitempty"` +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SecureScoreControlDefinitionListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// ScanResult a vulnerability assessment scan result for a single rule. -type ScanResult struct { - autorest.Response `json:"-"` - Properties *ScanResultProperties `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"` +// Response returns the raw server response from the last page request. +func (iter SecureScoreControlDefinitionListIterator) Response() SecureScoreControlDefinitionList { + return iter.page.Response() } -// MarshalJSON is the custom marshaler for ScanResult. -func (sr ScanResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sr.Properties != nil { - objectMap["properties"] = sr.Properties +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SecureScoreControlDefinitionListIterator) Value() SecureScoreControlDefinitionItem { + if !iter.page.NotDone() { + return SecureScoreControlDefinitionItem{} } - return json.Marshal(objectMap) + return iter.page.Values()[iter.i] } -// ScanResultProperties a vulnerability assessment scan result properties for a single rule. -type ScanResultProperties struct { - // RuleID - The rule Id. - RuleID *string `json:"ruleId,omitempty"` - // Status - Possible values include: 'NonFinding', 'Finding', 'InternalError' - Status RuleStatus `json:"status,omitempty"` - // IsTrimmed - Indicated whether the results specified here are trimmed. - IsTrimmed *bool `json:"isTrimmed,omitempty"` - // QueryResults - The results of the query that was run. - QueryResults *[][]string `json:"queryResults,omitempty"` - Remediation *Remediation `json:"remediation,omitempty"` - BaselineAdjustedResult *BaselineAdjustedResult `json:"baselineAdjustedResult,omitempty"` - RuleMetadata *VaRule `json:"ruleMetadata,omitempty"` +// Creates a new instance of the SecureScoreControlDefinitionListIterator type. +func NewSecureScoreControlDefinitionListIterator(page SecureScoreControlDefinitionListPage) SecureScoreControlDefinitionListIterator { + return SecureScoreControlDefinitionListIterator{page: page} } -// ScanResults a list of vulnerability assessment scan results. -type ScanResults struct { - autorest.Response `json:"-"` - // Value - List of vulnerability assessment scan results. - Value *[]ScanResult `json:"value,omitempty"` +// IsEmpty returns true if the ListResult contains no values. +func (sscdl SecureScoreControlDefinitionList) IsEmpty() bool { + return sscdl.Value == nil || len(*sscdl.Value) == 0 } -// Scans a list of vulnerability assessment scan records. -type Scans struct { - autorest.Response `json:"-"` - // Value - List of vulnerability assessment scan records. - Value *[]Scan `json:"value,omitempty"` +// hasNextLink returns true if the NextLink is not empty. +func (sscdl SecureScoreControlDefinitionList) hasNextLink() bool { + return sscdl.NextLink != nil && len(*sscdl.NextLink) != 0 } -// ScopeElement a more specific scope used to identify the alerts to suppress. -type ScopeElement struct { - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - // Field - The alert entity type to suppress by. - Field *string `json:"field,omitempty"` +// secureScoreControlDefinitionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sscdl SecureScoreControlDefinitionList) secureScoreControlDefinitionListPreparer(ctx context.Context) (*http.Request, error) { + if !sscdl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sscdl.NextLink))) } -// MarshalJSON is the custom marshaler for ScopeElement. -func (se ScopeElement) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if se.Field != nil { - objectMap["field"] = se.Field - } - for k, v := range se.AdditionalProperties { - objectMap[k] = v - } - return json.Marshal(objectMap) +// SecureScoreControlDefinitionListPage contains a page of SecureScoreControlDefinitionItem values. +type SecureScoreControlDefinitionListPage struct { + fn func(context.Context, SecureScoreControlDefinitionList) (SecureScoreControlDefinitionList, error) + sscdl SecureScoreControlDefinitionList } -// UnmarshalJSON is the custom unmarshaler for ScopeElement struct. -func (se *ScopeElement) 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 se.AdditionalProperties == nil { - se.AdditionalProperties = make(map[string]interface{}) - } - se.AdditionalProperties[k] = additionalProperties - } - case "field": - if v != nil { - var field string - err = json.Unmarshal(*v, &field) - if err != nil { - return err - } - se.Field = &field +// 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 *SecureScoreControlDefinitionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionListPage.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.sscdl) + if err != nil { + return err + } + page.sscdl = next + if !next.hasNextLink() || !next.IsEmpty() { + break } } - return nil } -// ScoreDetails calculation result data -type ScoreDetails struct { - // Max - READ-ONLY; Maximum score available - Max *int32 `json:"max,omitempty"` - // Current - READ-ONLY; Current score - Current *float64 `json:"current,omitempty"` - // Percentage - READ-ONLY; Ratio of the current score divided by the maximum. Rounded to 4 digits after the decimal point - Percentage *float64 `json:"percentage,omitempty"` +// 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 *SecureScoreControlDefinitionListPage) Next() error { + return page.NextWithContext(context.Background()) } -// MarshalJSON is the custom marshaler for ScoreDetails. -func (sd ScoreDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SecureScoreControlDefinitionListPage) NotDone() bool { + return !page.sscdl.IsEmpty() } -// SecureScoreControlDefinitionItem information about the security control. -type SecureScoreControlDefinitionItem struct { - *SecureScoreControlDefinitionItemProperties `json:"properties,omitempty"` +// Response returns the raw server response from the last page request. +func (page SecureScoreControlDefinitionListPage) Response() SecureScoreControlDefinitionList { + return page.sscdl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SecureScoreControlDefinitionListPage) Values() []SecureScoreControlDefinitionItem { + if page.sscdl.IsEmpty() { + return nil + } + return *page.sscdl.Value +} + +// Creates a new instance of the SecureScoreControlDefinitionListPage type. +func NewSecureScoreControlDefinitionListPage(cur SecureScoreControlDefinitionList, getNextPage func(context.Context, SecureScoreControlDefinitionList) (SecureScoreControlDefinitionList, error)) SecureScoreControlDefinitionListPage { + return SecureScoreControlDefinitionListPage{ + fn: getNextPage, + sscdl: cur, + } +} + +// SecureScoreControlDefinitionSource the type of the security control (For example, BuiltIn) +type SecureScoreControlDefinitionSource struct { + // SourceType - The type of security control (for example, BuiltIn). Possible values include: 'BuiltIn', 'Custom' + SourceType ControlType `json:"sourceType,omitempty"` +} + +// SecureScoreControlDetails details of the security control, its score, and the health status of the +// relevant resources. +type SecureScoreControlDetails struct { + *SecureScoreControlScoreDetails `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name @@ -13328,17 +15387,17 @@ type SecureScoreControlDefinitionItem struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for SecureScoreControlDefinitionItem. -func (sscdi SecureScoreControlDefinitionItem) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for SecureScoreControlDetails. +func (sscd SecureScoreControlDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if sscdi.SecureScoreControlDefinitionItemProperties != nil { - objectMap["properties"] = sscdi.SecureScoreControlDefinitionItemProperties + if sscd.SecureScoreControlScoreDetails != nil { + objectMap["properties"] = sscd.SecureScoreControlScoreDetails } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for SecureScoreControlDefinitionItem struct. -func (sscdi *SecureScoreControlDefinitionItem) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for SecureScoreControlDetails struct. +func (sscd *SecureScoreControlDetails) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -13347,13 +15406,13 @@ func (sscdi *SecureScoreControlDefinitionItem) UnmarshalJSON(body []byte) error for k, v := range m { switch k { case "properties": - if v != nil { - var secureScoreControlDefinitionItemProperties SecureScoreControlDefinitionItemProperties - err = json.Unmarshal(*v, &secureScoreControlDefinitionItemProperties) + if v != nil { + var secureScoreControlScoreDetails SecureScoreControlScoreDetails + err = json.Unmarshal(*v, &secureScoreControlScoreDetails) if err != nil { return err } - sscdi.SecureScoreControlDefinitionItemProperties = &secureScoreControlDefinitionItemProperties + sscd.SecureScoreControlScoreDetails = &secureScoreControlScoreDetails } case "id": if v != nil { @@ -13362,7 +15421,7 @@ func (sscdi *SecureScoreControlDefinitionItem) UnmarshalJSON(body []byte) error if err != nil { return err } - sscdi.ID = &ID + sscd.ID = &ID } case "name": if v != nil { @@ -13371,7 +15430,7 @@ func (sscdi *SecureScoreControlDefinitionItem) UnmarshalJSON(body []byte) error if err != nil { return err } - sscdi.Name = &name + sscd.Name = &name } case "type": if v != nil { @@ -13380,7 +15439,7 @@ func (sscdi *SecureScoreControlDefinitionItem) UnmarshalJSON(body []byte) error if err != nil { return err } - sscdi.Type = &typeVar + sscd.Type = &typeVar } } } @@ -13388,53 +15447,33 @@ func (sscdi *SecureScoreControlDefinitionItem) UnmarshalJSON(body []byte) error return nil } -// SecureScoreControlDefinitionItemProperties security Control Definition Properties. -type SecureScoreControlDefinitionItemProperties struct { - // DisplayName - READ-ONLY; User friendly display name of the control - DisplayName *string `json:"displayName,omitempty"` - // Description - READ-ONLY; User friendly description of the control - Description *string `json:"description,omitempty"` - // MaxScore - READ-ONLY; Maximum control score (0..10) - MaxScore *int32 `json:"maxScore,omitempty"` - // Source - READ-ONLY; Source object from which the control was created - Source *SecureScoreControlDefinitionSource `json:"source,omitempty"` - // AssessmentDefinitions - READ-ONLY; Array of assessments metadata IDs that are included in this security control - AssessmentDefinitions *[]AzureResourceLink `json:"assessmentDefinitions,omitempty"` -} - -// MarshalJSON is the custom marshaler for SecureScoreControlDefinitionItemProperties. -func (sscdip SecureScoreControlDefinitionItemProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// SecureScoreControlDefinitionList list of security controls definition -type SecureScoreControlDefinitionList struct { +// SecureScoreControlList list of security controls +type SecureScoreControlList struct { autorest.Response `json:"-"` - // Value - READ-ONLY; Collection of security controls definition in this page - Value *[]SecureScoreControlDefinitionItem `json:"value,omitempty"` + // Value - READ-ONLY; Collection of security controls in this page + Value *[]SecureScoreControlDetails `json:"value,omitempty"` // NextLink - READ-ONLY; The URI to fetch the next page. NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for SecureScoreControlDefinitionList. -func (sscdl SecureScoreControlDefinitionList) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for SecureScoreControlList. +func (sscl SecureScoreControlList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) return json.Marshal(objectMap) } -// SecureScoreControlDefinitionListIterator provides access to a complete listing of -// SecureScoreControlDefinitionItem values. -type SecureScoreControlDefinitionListIterator struct { +// SecureScoreControlListIterator provides access to a complete listing of SecureScoreControlDetails +// values. +type SecureScoreControlListIterator struct { i int - page SecureScoreControlDefinitionListPage + page SecureScoreControlListPage } // 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 *SecureScoreControlDefinitionListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *SecureScoreControlListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -13459,67 +15498,67 @@ func (iter *SecureScoreControlDefinitionListIterator) NextWithContext(ctx contex // 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 *SecureScoreControlDefinitionListIterator) Next() error { +func (iter *SecureScoreControlListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SecureScoreControlDefinitionListIterator) NotDone() bool { +func (iter SecureScoreControlListIterator) 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 SecureScoreControlDefinitionListIterator) Response() SecureScoreControlDefinitionList { +func (iter SecureScoreControlListIterator) Response() SecureScoreControlList { 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 SecureScoreControlDefinitionListIterator) Value() SecureScoreControlDefinitionItem { +func (iter SecureScoreControlListIterator) Value() SecureScoreControlDetails { if !iter.page.NotDone() { - return SecureScoreControlDefinitionItem{} + return SecureScoreControlDetails{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the SecureScoreControlDefinitionListIterator type. -func NewSecureScoreControlDefinitionListIterator(page SecureScoreControlDefinitionListPage) SecureScoreControlDefinitionListIterator { - return SecureScoreControlDefinitionListIterator{page: page} +// Creates a new instance of the SecureScoreControlListIterator type. +func NewSecureScoreControlListIterator(page SecureScoreControlListPage) SecureScoreControlListIterator { + return SecureScoreControlListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (sscdl SecureScoreControlDefinitionList) IsEmpty() bool { - return sscdl.Value == nil || len(*sscdl.Value) == 0 +func (sscl SecureScoreControlList) IsEmpty() bool { + return sscl.Value == nil || len(*sscl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (sscdl SecureScoreControlDefinitionList) hasNextLink() bool { - return sscdl.NextLink != nil && len(*sscdl.NextLink) != 0 +func (sscl SecureScoreControlList) hasNextLink() bool { + return sscl.NextLink != nil && len(*sscl.NextLink) != 0 } -// secureScoreControlDefinitionListPreparer prepares a request to retrieve the next set of results. +// secureScoreControlListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (sscdl SecureScoreControlDefinitionList) secureScoreControlDefinitionListPreparer(ctx context.Context) (*http.Request, error) { - if !sscdl.hasNextLink() { +func (sscl SecureScoreControlList) secureScoreControlListPreparer(ctx context.Context) (*http.Request, error) { + if !sscl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(sscdl.NextLink))) + autorest.WithBaseURL(to.String(sscl.NextLink))) } -// SecureScoreControlDefinitionListPage contains a page of SecureScoreControlDefinitionItem values. -type SecureScoreControlDefinitionListPage struct { - fn func(context.Context, SecureScoreControlDefinitionList) (SecureScoreControlDefinitionList, error) - sscdl SecureScoreControlDefinitionList +// SecureScoreControlListPage contains a page of SecureScoreControlDetails values. +type SecureScoreControlListPage struct { + fn func(context.Context, SecureScoreControlList) (SecureScoreControlList, error) + sscl SecureScoreControlList } // 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 *SecureScoreControlDefinitionListPage) NextWithContext(ctx context.Context) (err error) { +func (page *SecureScoreControlListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -13529,11 +15568,11 @@ func (page *SecureScoreControlDefinitionListPage) NextWithContext(ctx context.Co }() } for { - next, err := page.fn(ctx, page.sscdl) + next, err := page.fn(ctx, page.sscl) if err != nil { return err } - page.sscdl = next + page.sscl = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -13544,46 +15583,164 @@ func (page *SecureScoreControlDefinitionListPage) NextWithContext(ctx context.Co // 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 *SecureScoreControlDefinitionListPage) Next() error { +func (page *SecureScoreControlListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SecureScoreControlDefinitionListPage) NotDone() bool { - return !page.sscdl.IsEmpty() +func (page SecureScoreControlListPage) NotDone() bool { + return !page.sscl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page SecureScoreControlDefinitionListPage) Response() SecureScoreControlDefinitionList { - return page.sscdl +func (page SecureScoreControlListPage) Response() SecureScoreControlList { + return page.sscl } // Values returns the slice of values for the current page or nil if there are no values. -func (page SecureScoreControlDefinitionListPage) Values() []SecureScoreControlDefinitionItem { - if page.sscdl.IsEmpty() { +func (page SecureScoreControlListPage) Values() []SecureScoreControlDetails { + if page.sscl.IsEmpty() { return nil } - return *page.sscdl.Value + return *page.sscl.Value } -// Creates a new instance of the SecureScoreControlDefinitionListPage type. -func NewSecureScoreControlDefinitionListPage(cur SecureScoreControlDefinitionList, getNextPage func(context.Context, SecureScoreControlDefinitionList) (SecureScoreControlDefinitionList, error)) SecureScoreControlDefinitionListPage { - return SecureScoreControlDefinitionListPage{ - fn: getNextPage, - sscdl: cur, +// Creates a new instance of the SecureScoreControlListPage type. +func NewSecureScoreControlListPage(cur SecureScoreControlList, getNextPage func(context.Context, SecureScoreControlList) (SecureScoreControlList, error)) SecureScoreControlListPage { + return SecureScoreControlListPage{ + fn: getNextPage, + sscl: cur, } } -// SecureScoreControlDefinitionSource the type of the security control (For example, BuiltIn) -type SecureScoreControlDefinitionSource struct { - // SourceType - The type of security control (for example, BuiltIn). Possible values include: 'BuiltIn', 'Custom' - SourceType ControlType `json:"sourceType,omitempty"` +// SecureScoreControlScore calculation result data +type SecureScoreControlScore struct { + // Max - READ-ONLY; Maximum control score (0..10) + Max *int32 `json:"max,omitempty"` + // Current - READ-ONLY; Actual score for the control = (achieved points / total points) * max score. if total points is zeroed, the return number is 0.00 + Current *float64 `json:"current,omitempty"` + // Percentage - READ-ONLY; Ratio of the current score divided by the maximum. Rounded to 4 digits after the decimal point + Percentage *float64 `json:"percentage,omitempty"` } -// SecureScoreControlDetails details of the security control, its score, and the health status of the -// relevant resources. -type SecureScoreControlDetails struct { - *SecureScoreControlScoreDetails `json:"properties,omitempty"` +// MarshalJSON is the custom marshaler for SecureScoreControlScore. +func (sscs SecureScoreControlScore) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SecureScoreControlScoreDetails calculation result data in control level +type SecureScoreControlScoreDetails struct { + // DisplayName - READ-ONLY; User friendly display name of the control + DisplayName *string `json:"displayName,omitempty"` + // ScoreDetails - Actual score object for the control + *ScoreDetails `json:"score,omitempty"` + // HealthyResourceCount - READ-ONLY; Number of healthy resources in the control + HealthyResourceCount *int32 `json:"healthyResourceCount,omitempty"` + // UnhealthyResourceCount - READ-ONLY; Number of unhealthy resources in the control + UnhealthyResourceCount *int32 `json:"unhealthyResourceCount,omitempty"` + // NotApplicableResourceCount - READ-ONLY; Number of not applicable resources in the control + NotApplicableResourceCount *int32 `json:"notApplicableResourceCount,omitempty"` + // Weight - READ-ONLY; The relative weight for this specific control in each of your subscriptions. Used when calculating an aggregated score for this control across all of your subscriptions. + Weight *int64 `json:"weight,omitempty"` + Definition *SecureScoreControlDefinitionItem `json:"definition,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecureScoreControlScoreDetails. +func (sscsd SecureScoreControlScoreDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sscsd.ScoreDetails != nil { + objectMap["score"] = sscsd.ScoreDetails + } + if sscsd.Definition != nil { + objectMap["definition"] = sscsd.Definition + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecureScoreControlScoreDetails struct. +func (sscsd *SecureScoreControlScoreDetails) 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 "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + sscsd.DisplayName = &displayName + } + case "score": + if v != nil { + var scoreDetails ScoreDetails + err = json.Unmarshal(*v, &scoreDetails) + if err != nil { + return err + } + sscsd.ScoreDetails = &scoreDetails + } + case "healthyResourceCount": + if v != nil { + var healthyResourceCount int32 + err = json.Unmarshal(*v, &healthyResourceCount) + if err != nil { + return err + } + sscsd.HealthyResourceCount = &healthyResourceCount + } + case "unhealthyResourceCount": + if v != nil { + var unhealthyResourceCount int32 + err = json.Unmarshal(*v, &unhealthyResourceCount) + if err != nil { + return err + } + sscsd.UnhealthyResourceCount = &unhealthyResourceCount + } + case "notApplicableResourceCount": + if v != nil { + var notApplicableResourceCount int32 + err = json.Unmarshal(*v, ¬ApplicableResourceCount) + if err != nil { + return err + } + sscsd.NotApplicableResourceCount = ¬ApplicableResourceCount + } + case "weight": + if v != nil { + var weight int64 + err = json.Unmarshal(*v, &weight) + if err != nil { + return err + } + sscsd.Weight = &weight + } + case "definition": + if v != nil { + var definition SecureScoreControlDefinitionItem + err = json.Unmarshal(*v, &definition) + if err != nil { + return err + } + sscsd.Definition = &definition + } + } + } + + return nil +} + +// SecureScoreItem secure score item data model +type SecureScoreItem struct { + autorest.Response `json:"-"` + // SecureScoreItemProperties - READ-ONLY; Secure score item + *SecureScoreItemProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name @@ -13592,17 +15749,14 @@ type SecureScoreControlDetails struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for SecureScoreControlDetails. -func (sscd SecureScoreControlDetails) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for SecureScoreItem. +func (ssi SecureScoreItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if sscd.SecureScoreControlScoreDetails != nil { - objectMap["properties"] = sscd.SecureScoreControlScoreDetails - } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for SecureScoreControlDetails struct. -func (sscd *SecureScoreControlDetails) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for SecureScoreItem struct. +func (ssi *SecureScoreItem) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -13612,12 +15766,12 @@ func (sscd *SecureScoreControlDetails) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var secureScoreControlScoreDetails SecureScoreControlScoreDetails - err = json.Unmarshal(*v, &secureScoreControlScoreDetails) + var secureScoreItemProperties SecureScoreItemProperties + err = json.Unmarshal(*v, &secureScoreItemProperties) if err != nil { return err } - sscd.SecureScoreControlScoreDetails = &secureScoreControlScoreDetails + ssi.SecureScoreItemProperties = &secureScoreItemProperties } case "id": if v != nil { @@ -13626,7 +15780,7 @@ func (sscd *SecureScoreControlDetails) UnmarshalJSON(body []byte) error { if err != nil { return err } - sscd.ID = &ID + ssi.ID = &ID } case "name": if v != nil { @@ -13635,7 +15789,7 @@ func (sscd *SecureScoreControlDetails) UnmarshalJSON(body []byte) error { if err != nil { return err } - sscd.Name = &name + ssi.Name = &name } case "type": if v != nil { @@ -13644,7 +15798,7 @@ func (sscd *SecureScoreControlDetails) UnmarshalJSON(body []byte) error { if err != nil { return err } - sscd.Type = &typeVar + ssi.Type = &typeVar } } } @@ -13652,33 +15806,90 @@ func (sscd *SecureScoreControlDetails) UnmarshalJSON(body []byte) error { return nil } -// SecureScoreControlList list of security controls -type SecureScoreControlList struct { +// SecureScoreItemProperties describes properties of a calculated secure score. +type SecureScoreItemProperties struct { + // DisplayName - READ-ONLY; The initiative’s name + DisplayName *string `json:"displayName,omitempty"` + // ScoreDetails - READ-ONLY; score object + *ScoreDetails `json:"score,omitempty"` + // Weight - READ-ONLY; The relative weight for each subscription. Used when calculating an aggregated secure score for multiple subscriptions. + Weight *int64 `json:"weight,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecureScoreItemProperties. +func (ssip SecureScoreItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecureScoreItemProperties struct. +func (ssip *SecureScoreItemProperties) 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 "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + ssip.DisplayName = &displayName + } + case "score": + if v != nil { + var scoreDetails ScoreDetails + err = json.Unmarshal(*v, &scoreDetails) + if err != nil { + return err + } + ssip.ScoreDetails = &scoreDetails + } + case "weight": + if v != nil { + var weight int64 + err = json.Unmarshal(*v, &weight) + if err != nil { + return err + } + ssip.Weight = &weight + } + } + } + + return nil +} + +// SecureScoresList list of secure scores +type SecureScoresList struct { autorest.Response `json:"-"` - // Value - READ-ONLY; Collection of security controls in this page - Value *[]SecureScoreControlDetails `json:"value,omitempty"` + // Value - READ-ONLY; Collection of secure scores in this page + Value *[]SecureScoreItem `json:"value,omitempty"` // NextLink - READ-ONLY; The URI to fetch the next page. NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for SecureScoreControlList. -func (sscl SecureScoreControlList) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for SecureScoresList. +func (ssl SecureScoresList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) return json.Marshal(objectMap) } -// SecureScoreControlListIterator provides access to a complete listing of SecureScoreControlDetails -// values. -type SecureScoreControlListIterator struct { +// SecureScoresListIterator provides access to a complete listing of SecureScoreItem values. +type SecureScoresListIterator struct { i int - page SecureScoreControlListPage + page SecureScoresListPage } // 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 *SecureScoreControlListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *SecureScoresListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -13703,67 +15914,67 @@ func (iter *SecureScoreControlListIterator) NextWithContext(ctx context.Context) // 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 *SecureScoreControlListIterator) Next() error { +func (iter *SecureScoresListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SecureScoreControlListIterator) NotDone() bool { +func (iter SecureScoresListIterator) 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 SecureScoreControlListIterator) Response() SecureScoreControlList { +func (iter SecureScoresListIterator) Response() SecureScoresList { 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 SecureScoreControlListIterator) Value() SecureScoreControlDetails { +func (iter SecureScoresListIterator) Value() SecureScoreItem { if !iter.page.NotDone() { - return SecureScoreControlDetails{} + return SecureScoreItem{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the SecureScoreControlListIterator type. -func NewSecureScoreControlListIterator(page SecureScoreControlListPage) SecureScoreControlListIterator { - return SecureScoreControlListIterator{page: page} +// Creates a new instance of the SecureScoresListIterator type. +func NewSecureScoresListIterator(page SecureScoresListPage) SecureScoresListIterator { + return SecureScoresListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (sscl SecureScoreControlList) IsEmpty() bool { - return sscl.Value == nil || len(*sscl.Value) == 0 +func (ssl SecureScoresList) IsEmpty() bool { + return ssl.Value == nil || len(*ssl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (sscl SecureScoreControlList) hasNextLink() bool { - return sscl.NextLink != nil && len(*sscl.NextLink) != 0 +func (ssl SecureScoresList) hasNextLink() bool { + return ssl.NextLink != nil && len(*ssl.NextLink) != 0 } -// secureScoreControlListPreparer prepares a request to retrieve the next set of results. +// secureScoresListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (sscl SecureScoreControlList) secureScoreControlListPreparer(ctx context.Context) (*http.Request, error) { - if !sscl.hasNextLink() { +func (ssl SecureScoresList) secureScoresListPreparer(ctx context.Context) (*http.Request, error) { + if !ssl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(sscl.NextLink))) + autorest.WithBaseURL(to.String(ssl.NextLink))) } -// SecureScoreControlListPage contains a page of SecureScoreControlDetails values. -type SecureScoreControlListPage struct { - fn func(context.Context, SecureScoreControlList) (SecureScoreControlList, error) - sscl SecureScoreControlList +// SecureScoresListPage contains a page of SecureScoreItem values. +type SecureScoresListPage struct { + fn func(context.Context, SecureScoresList) (SecureScoresList, error) + ssl SecureScoresList } // 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 *SecureScoreControlListPage) NextWithContext(ctx context.Context) (err error) { +func (page *SecureScoresListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -13773,11 +15984,11 @@ func (page *SecureScoreControlListPage) NextWithContext(ctx context.Context) (er }() } for { - next, err := page.fn(ctx, page.sscl) + next, err := page.fn(ctx, page.ssl) if err != nil { return err } - page.sscl = next + page.ssl = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -13788,164 +15999,124 @@ func (page *SecureScoreControlListPage) NextWithContext(ctx context.Context) (er // 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 *SecureScoreControlListPage) Next() error { +func (page *SecureScoresListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SecureScoreControlListPage) NotDone() bool { - return !page.sscl.IsEmpty() +func (page SecureScoresListPage) NotDone() bool { + return !page.ssl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page SecureScoreControlListPage) Response() SecureScoreControlList { - return page.sscl +func (page SecureScoresListPage) Response() SecureScoresList { + return page.ssl } // Values returns the slice of values for the current page or nil if there are no values. -func (page SecureScoreControlListPage) Values() []SecureScoreControlDetails { - if page.sscl.IsEmpty() { +func (page SecureScoresListPage) Values() []SecureScoreItem { + if page.ssl.IsEmpty() { return nil } - return *page.sscl.Value + return *page.ssl.Value } -// Creates a new instance of the SecureScoreControlListPage type. -func NewSecureScoreControlListPage(cur SecureScoreControlList, getNextPage func(context.Context, SecureScoreControlList) (SecureScoreControlList, error)) SecureScoreControlListPage { - return SecureScoreControlListPage{ - fn: getNextPage, - sscl: cur, +// Creates a new instance of the SecureScoresListPage type. +func NewSecureScoresListPage(cur SecureScoresList, getNextPage func(context.Context, SecureScoresList) (SecureScoresList, error)) SecureScoresListPage { + return SecureScoresListPage{ + fn: getNextPage, + ssl: cur, } } -// SecureScoreControlScore calculation result data -type SecureScoreControlScore struct { - // Max - READ-ONLY; Maximum control score (0..10) - Max *int32 `json:"max,omitempty"` - // Current - READ-ONLY; Actual score for the control = (achieved points / total points) * max score. if total points is zeroed, the return number is 0.00 - Current *float64 `json:"current,omitempty"` - // Percentage - READ-ONLY; Ratio of the current score divided by the maximum. Rounded to 4 digits after the decimal point - Percentage *float64 `json:"percentage,omitempty"` -} - -// MarshalJSON is the custom marshaler for SecureScoreControlScore. -func (sscs SecureScoreControlScore) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) +// SensitivityLabel the sensitivity label. +type SensitivityLabel struct { + // DisplayName - The name of the sensitivity label. + DisplayName *string `json:"displayName,omitempty"` + // Description - The description of the sensitivity label. + Description *string `json:"description,omitempty"` + // Rank - The rank of the sensitivity label. Possible values include: 'RankNone', 'RankLow', 'RankMedium', 'RankHigh', 'RankCritical' + Rank Rank `json:"rank,omitempty"` + // Order - The order of the sensitivity label. + Order *int32 `json:"order,omitempty"` + // Enabled - Indicates whether the label is enabled or not. + Enabled *bool `json:"enabled,omitempty"` } -// SecureScoreControlScoreDetails calculation result data in control level -type SecureScoreControlScoreDetails struct { - // DisplayName - READ-ONLY; User friendly display name of the control - DisplayName *string `json:"displayName,omitempty"` - // ScoreDetails - Actual score object for the control - *ScoreDetails `json:"score,omitempty"` - // HealthyResourceCount - READ-ONLY; Number of healthy resources in the control - HealthyResourceCount *int32 `json:"healthyResourceCount,omitempty"` - // UnhealthyResourceCount - READ-ONLY; Number of unhealthy resources in the control - UnhealthyResourceCount *int32 `json:"unhealthyResourceCount,omitempty"` - // NotApplicableResourceCount - READ-ONLY; Number of not applicable resources in the control - NotApplicableResourceCount *int32 `json:"notApplicableResourceCount,omitempty"` - // Weight - READ-ONLY; The relative weight for this specific control in each of your subscriptions. Used when calculating an aggregated score for this control across all of your subscriptions. - Weight *int64 `json:"weight,omitempty"` - Definition *SecureScoreControlDefinitionItem `json:"definition,omitempty"` +// ServerVulnerabilityProperties additional context fields for server vulnerability assessment +type ServerVulnerabilityProperties struct { + // Type - READ-ONLY; Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered + Type *string `json:"type,omitempty"` + // Cvss - READ-ONLY; Dictionary from cvss version to cvss details object + Cvss map[string]*CVSS `json:"cvss"` + // Patchable - READ-ONLY; Indicates whether a patch is available or not + Patchable *bool `json:"patchable,omitempty"` + // Cve - READ-ONLY; List of CVEs + Cve *[]CVE `json:"cve,omitempty"` + // Threat - READ-ONLY; Threat name + Threat *string `json:"threat,omitempty"` + // PublishedTime - READ-ONLY; Published time + PublishedTime *date.Time `json:"publishedTime,omitempty"` + // VendorReferences - READ-ONLY + VendorReferences *[]VendorReference `json:"vendorReferences,omitempty"` + // AssessedResourceType - Possible values include: 'AssessedResourceTypeAdditionalData', 'AssessedResourceTypeSQLServerVulnerability', 'AssessedResourceTypeContainerRegistryVulnerability', 'AssessedResourceTypeServerVulnerabilityAssessment' + AssessedResourceType AssessedResourceType `json:"assessedResourceType,omitempty"` } -// MarshalJSON is the custom marshaler for SecureScoreControlScoreDetails. -func (sscsd SecureScoreControlScoreDetails) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) MarshalJSON() ([]byte, error) { + svp.AssessedResourceType = AssessedResourceTypeServerVulnerabilityAssessment objectMap := make(map[string]interface{}) - if sscsd.ScoreDetails != nil { - objectMap["score"] = sscsd.ScoreDetails - } - if sscsd.Definition != nil { - objectMap["definition"] = sscsd.Definition + if svp.AssessedResourceType != "" { + objectMap["assessedResourceType"] = svp.AssessedResourceType } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for SecureScoreControlScoreDetails struct. -func (sscsd *SecureScoreControlScoreDetails) 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 "displayName": - if v != nil { - var displayName string - err = json.Unmarshal(*v, &displayName) - if err != nil { - return err - } - sscsd.DisplayName = &displayName - } - case "score": - if v != nil { - var scoreDetails ScoreDetails - err = json.Unmarshal(*v, &scoreDetails) - if err != nil { - return err - } - sscsd.ScoreDetails = &scoreDetails - } - case "healthyResourceCount": - if v != nil { - var healthyResourceCount int32 - err = json.Unmarshal(*v, &healthyResourceCount) - if err != nil { - return err - } - sscsd.HealthyResourceCount = &healthyResourceCount - } - case "unhealthyResourceCount": - if v != nil { - var unhealthyResourceCount int32 - err = json.Unmarshal(*v, &unhealthyResourceCount) - if err != nil { - return err - } - sscsd.UnhealthyResourceCount = &unhealthyResourceCount - } - case "notApplicableResourceCount": - if v != nil { - var notApplicableResourceCount int32 - err = json.Unmarshal(*v, ¬ApplicableResourceCount) - if err != nil { - return err - } - sscsd.NotApplicableResourceCount = ¬ApplicableResourceCount - } - case "weight": - if v != nil { - var weight int64 - err = json.Unmarshal(*v, &weight) - if err != nil { - return err - } - sscsd.Weight = &weight - } - case "definition": - if v != nil { - var definition SecureScoreControlDefinitionItem - err = json.Unmarshal(*v, &definition) - if err != nil { - return err - } - sscsd.Definition = &definition - } - } - } +// AsSQLServerVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) { + return nil, false +} - return nil +// AsContainerRegistryVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) { + return nil, false } -// SecureScoreItem secure score item data model -type SecureScoreItem struct { +// AsServerVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) { + return &svp, true +} + +// AsAdditionalData is the BasicAdditionalData implementation for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) AsAdditionalData() (*AdditionalData, bool) { + return nil, false +} + +// AsBasicAdditionalData is the BasicAdditionalData implementation for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) AsBasicAdditionalData() (BasicAdditionalData, bool) { + return &svp, true +} + +// ServicePrincipalProperties details of the service principal. +type ServicePrincipalProperties struct { + // ApplicationID - Application ID of service principal. + ApplicationID *string `json:"applicationId,omitempty"` + // Secret - A secret string that the application uses to prove its identity, also can be referred to as application password (write only). + Secret *string `json:"secret,omitempty"` +} + +// BasicSetting the kind of the security setting +type BasicSetting interface { + AsDataExportSetting() (*DataExportSetting, bool) + AsSetting() (*Setting, bool) +} + +// Setting the kind of the security setting +type Setting struct { autorest.Response `json:"-"` - // SecureScoreItemProperties - READ-ONLY; Secure score item - *SecureScoreItemProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindSetting', 'KindDataExportSetting' + Kind KindEnum `json:"kind,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name @@ -13954,81 +16125,105 @@ type SecureScoreItem struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for SecureScoreItem. -func (ssi SecureScoreItem) MarshalJSON() ([]byte, error) { +func unmarshalBasicSetting(body []byte) (BasicSetting, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindDataExportSetting): + var desVar DataExportSetting + err := json.Unmarshal(body, &desVar) + return desVar, err + default: + var s Setting + err := json.Unmarshal(body, &s) + return s, err + } +} +func unmarshalBasicSettingArray(body []byte) ([]BasicSetting, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sArray := make([]BasicSetting, len(rawMessages)) + + for index, rawMessage := range rawMessages { + s, err := unmarshalBasicSetting(*rawMessage) + if err != nil { + return nil, err + } + sArray[index] = s + } + return sArray, nil +} + +// MarshalJSON is the custom marshaler for Setting. +func (s Setting) MarshalJSON() ([]byte, error) { + s.Kind = KindSetting objectMap := make(map[string]interface{}) + if s.Kind != "" { + objectMap["kind"] = s.Kind + } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for SecureScoreItem struct. -func (ssi *SecureScoreItem) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) +// AsDataExportSetting is the BasicSetting implementation for Setting. +func (s Setting) AsDataExportSetting() (*DataExportSetting, bool) { + return nil, false +} + +// AsSetting is the BasicSetting implementation for Setting. +func (s Setting) AsSetting() (*Setting, bool) { + return &s, true +} + +// AsBasicSetting is the BasicSetting implementation for Setting. +func (s Setting) AsBasicSetting() (BasicSetting, bool) { + return &s, true +} + +// SettingModel ... +type SettingModel struct { + autorest.Response `json:"-"` + Value BasicSetting `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SettingModel struct. +func (sm *SettingModel) UnmarshalJSON(body []byte) error { + s, err := unmarshalBasicSetting(body) if err != nil { return err } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var secureScoreItemProperties SecureScoreItemProperties - err = json.Unmarshal(*v, &secureScoreItemProperties) - if err != nil { - return err - } - ssi.SecureScoreItemProperties = &secureScoreItemProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ssi.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ssi.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ssi.Type = &typeVar - } - } - } + sm.Value = s return nil } -// SecureScoreItemProperties describes properties of a calculated secure score. -type SecureScoreItemProperties struct { - // DisplayName - READ-ONLY; The initiative’s name - DisplayName *string `json:"displayName,omitempty"` - // ScoreDetails - READ-ONLY; score object - *ScoreDetails `json:"score,omitempty"` - // Weight - READ-ONLY; The relative weight for each subscription. Used when calculating an aggregated secure score for multiple subscriptions. - Weight *int64 `json:"weight,omitempty"` +// SettingsList subscription settings list. +type SettingsList struct { + autorest.Response `json:"-"` + // Value - The settings list. + Value *[]BasicSetting `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for SecureScoreItemProperties. -func (ssip SecureScoreItemProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for SettingsList. +func (sl SettingsList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if sl.Value != nil { + objectMap["value"] = sl.Value + } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for SecureScoreItemProperties struct. -func (ssip *SecureScoreItemProperties) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for SettingsList struct. +func (sl *SettingsList) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -14036,65 +16231,40 @@ func (ssip *SecureScoreItemProperties) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "displayName": - if v != nil { - var displayName string - err = json.Unmarshal(*v, &displayName) - if err != nil { - return err - } - ssip.DisplayName = &displayName - } - case "score": + case "value": if v != nil { - var scoreDetails ScoreDetails - err = json.Unmarshal(*v, &scoreDetails) + value, err := unmarshalBasicSettingArray(*v) if err != nil { return err } - ssip.ScoreDetails = &scoreDetails + sl.Value = &value } - case "weight": + case "nextLink": if v != nil { - var weight int64 - err = json.Unmarshal(*v, &weight) + var nextLink string + err = json.Unmarshal(*v, &nextLink) if err != nil { return err } - ssip.Weight = &weight + sl.NextLink = &nextLink } - } - } - - return nil -} - -// SecureScoresList list of secure scores -type SecureScoresList struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Collection of secure scores in this page - Value *[]SecureScoreItem `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` -} + } + } -// MarshalJSON is the custom marshaler for SecureScoresList. -func (ssl SecureScoresList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) + return nil } -// SecureScoresListIterator provides access to a complete listing of SecureScoreItem values. -type SecureScoresListIterator struct { +// SettingsListIterator provides access to a complete listing of Setting values. +type SettingsListIterator struct { i int - page SecureScoresListPage + page SettingsListPage } // 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 *SecureScoresListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *SettingsListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/SettingsListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -14119,67 +16289,67 @@ func (iter *SecureScoresListIterator) NextWithContext(ctx context.Context) (err // 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 *SecureScoresListIterator) Next() error { +func (iter *SettingsListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SecureScoresListIterator) NotDone() bool { +func (iter SettingsListIterator) 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 SecureScoresListIterator) Response() SecureScoresList { +func (iter SettingsListIterator) Response() SettingsList { 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 SecureScoresListIterator) Value() SecureScoreItem { +func (iter SettingsListIterator) Value() BasicSetting { if !iter.page.NotDone() { - return SecureScoreItem{} + return Setting{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the SecureScoresListIterator type. -func NewSecureScoresListIterator(page SecureScoresListPage) SecureScoresListIterator { - return SecureScoresListIterator{page: page} +// Creates a new instance of the SettingsListIterator type. +func NewSettingsListIterator(page SettingsListPage) SettingsListIterator { + return SettingsListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (ssl SecureScoresList) IsEmpty() bool { - return ssl.Value == nil || len(*ssl.Value) == 0 +func (sl SettingsList) IsEmpty() bool { + return sl.Value == nil || len(*sl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (ssl SecureScoresList) hasNextLink() bool { - return ssl.NextLink != nil && len(*ssl.NextLink) != 0 +func (sl SettingsList) hasNextLink() bool { + return sl.NextLink != nil && len(*sl.NextLink) != 0 } -// secureScoresListPreparer prepares a request to retrieve the next set of results. +// settingsListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (ssl SecureScoresList) secureScoresListPreparer(ctx context.Context) (*http.Request, error) { - if !ssl.hasNextLink() { +func (sl SettingsList) settingsListPreparer(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(ssl.NextLink))) + autorest.WithBaseURL(to.String(sl.NextLink))) } -// SecureScoresListPage contains a page of SecureScoreItem values. -type SecureScoresListPage struct { - fn func(context.Context, SecureScoresList) (SecureScoresList, error) - ssl SecureScoresList +// SettingsListPage contains a page of BasicSetting values. +type SettingsListPage struct { + fn func(context.Context, SettingsList) (SettingsList, error) + sl SettingsList } // 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 *SecureScoresListPage) NextWithContext(ctx context.Context) (err error) { +func (page *SettingsListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/SettingsListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -14189,11 +16359,11 @@ func (page *SecureScoresListPage) NextWithContext(ctx context.Context) (err erro }() } for { - next, err := page.fn(ctx, page.ssl) + next, err := page.fn(ctx, page.sl) if err != nil { return err } - page.ssl = next + page.sl = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -14204,118 +16374,41 @@ func (page *SecureScoresListPage) NextWithContext(ctx context.Context) (err erro // 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 *SecureScoresListPage) Next() error { +func (page *SettingsListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SecureScoresListPage) NotDone() bool { - return !page.ssl.IsEmpty() +func (page SettingsListPage) NotDone() bool { + return !page.sl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page SecureScoresListPage) Response() SecureScoresList { - return page.ssl +func (page SettingsListPage) Response() SettingsList { + return page.sl } // Values returns the slice of values for the current page or nil if there are no values. -func (page SecureScoresListPage) Values() []SecureScoreItem { - if page.ssl.IsEmpty() { +func (page SettingsListPage) Values() []BasicSetting { + if page.sl.IsEmpty() { return nil } - return *page.ssl.Value -} - -// Creates a new instance of the SecureScoresListPage type. -func NewSecureScoresListPage(cur SecureScoresList, getNextPage func(context.Context, SecureScoresList) (SecureScoresList, error)) SecureScoresListPage { - return SecureScoresListPage{ - fn: getNextPage, - ssl: cur, - } -} - -// SensitivityLabel the sensitivity label. -type SensitivityLabel struct { - // DisplayName - The name of the sensitivity label. - DisplayName *string `json:"displayName,omitempty"` - // Description - The description of the sensitivity label. - Description *string `json:"description,omitempty"` - // Rank - The rank of the sensitivity label. Possible values include: 'RankNone', 'RankLow', 'RankMedium', 'RankHigh', 'RankCritical' - Rank Rank `json:"rank,omitempty"` - // Order - The order of the sensitivity label. - Order *int32 `json:"order,omitempty"` - // Enabled - Indicates whether the label is enabled or not. - Enabled *bool `json:"enabled,omitempty"` -} - -// ServerVulnerabilityProperties additional context fields for server vulnerability assessment -type ServerVulnerabilityProperties struct { - // Type - READ-ONLY; Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered - Type *string `json:"type,omitempty"` - // Cvss - READ-ONLY; Dictionary from cvss version to cvss details object - Cvss map[string]*CVSS `json:"cvss"` - // Patchable - READ-ONLY; Indicates whether a patch is available or not - Patchable *bool `json:"patchable,omitempty"` - // Cve - READ-ONLY; List of CVEs - Cve *[]CVE `json:"cve,omitempty"` - // Threat - READ-ONLY; Threat name - Threat *string `json:"threat,omitempty"` - // PublishedTime - READ-ONLY; Published time - PublishedTime *date.Time `json:"publishedTime,omitempty"` - // VendorReferences - READ-ONLY - VendorReferences *[]VendorReference `json:"vendorReferences,omitempty"` - // AssessedResourceType - Possible values include: 'AssessedResourceTypeAdditionalData', 'AssessedResourceTypeSQLServerVulnerability', 'AssessedResourceTypeContainerRegistryVulnerability', 'AssessedResourceTypeServerVulnerabilityAssessment' - AssessedResourceType AssessedResourceType `json:"assessedResourceType,omitempty"` + return *page.sl.Value } -// MarshalJSON is the custom marshaler for ServerVulnerabilityProperties. -func (svp ServerVulnerabilityProperties) MarshalJSON() ([]byte, error) { - svp.AssessedResourceType = AssessedResourceTypeServerVulnerabilityAssessment - objectMap := make(map[string]interface{}) - if svp.AssessedResourceType != "" { - objectMap["assessedResourceType"] = svp.AssessedResourceType +// Creates a new instance of the SettingsListPage type. +func NewSettingsListPage(cur SettingsList, getNextPage func(context.Context, SettingsList) (SettingsList, error)) SettingsListPage { + return SettingsListPage{ + fn: getNextPage, + sl: cur, } - return json.Marshal(objectMap) -} - -// AsSQLServerVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. -func (svp ServerVulnerabilityProperties) AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) { - return nil, false -} - -// AsContainerRegistryVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. -func (svp ServerVulnerabilityProperties) AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) { - return nil, false -} - -// AsServerVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. -func (svp ServerVulnerabilityProperties) AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) { - return &svp, true -} - -// AsAdditionalData is the BasicAdditionalData implementation for ServerVulnerabilityProperties. -func (svp ServerVulnerabilityProperties) AsAdditionalData() (*AdditionalData, bool) { - return nil, false -} - -// AsBasicAdditionalData is the BasicAdditionalData implementation for ServerVulnerabilityProperties. -func (svp ServerVulnerabilityProperties) AsBasicAdditionalData() (BasicAdditionalData, bool) { - return &svp, true -} - -// ServicePrincipalProperties details of the service principal. -type ServicePrincipalProperties struct { - // ApplicationID - Application ID of service principal. - ApplicationID *string `json:"applicationId,omitempty"` - // Secret - A secret string that the application uses to prove its identity, also can be referred to as application password (write only). - Secret *string `json:"secret,omitempty"` } -// Setting represents a security setting in Azure Security Center. -type Setting struct { +// Software represents a software data +type Software struct { autorest.Response `json:"-"` - // Kind - the kind of the settings string (DataExportSetting). Possible values include: 'SettingKindDataExportSetting', 'SettingKindAlertSuppressionSetting' - Kind SettingKind `json:"kind,omitempty"` + // 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 @@ -14324,47 +16417,98 @@ type Setting struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for Setting. -func (s Setting) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for Software. +func (s Software) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if s.Kind != "" { - objectMap["kind"] = s.Kind + if s.SoftwareProperties != nil { + objectMap["properties"] = s.SoftwareProperties } return json.Marshal(objectMap) } -// SettingResource the kind of the security setting -type SettingResource struct { - // Kind - the kind of the settings string (DataExportSetting). Possible values include: 'SettingKindDataExportSetting', 'SettingKindAlertSuppressionSetting' - Kind SettingKind `json:"kind,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 SettingResource. -func (sr SettingResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sr.Kind != "" { - objectMap["kind"] = sr.Kind +// 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 } - return json.Marshal(objectMap) + 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 } -// SettingsList subscription settings list. -type SettingsList struct { +// 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 - The settings list. - Value *[]Setting `json:"value,omitempty"` + 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 SettingsList. -func (sl SettingsList) MarshalJSON() ([]byte, error) { +// 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 @@ -14372,17 +16516,17 @@ func (sl SettingsList) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// SettingsListIterator provides access to a complete listing of Setting values. -type SettingsListIterator struct { +// SoftwaresListIterator provides access to a complete listing of Software values. +type SoftwaresListIterator struct { i int - page SettingsListPage + 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 *SettingsListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *SoftwaresListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SettingsListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/SoftwaresListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -14407,47 +16551,47 @@ func (iter *SettingsListIterator) 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 *SettingsListIterator) Next() error { +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 SettingsListIterator) NotDone() bool { +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 SettingsListIterator) Response() SettingsList { +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 SettingsListIterator) Value() Setting { +func (iter SoftwaresListIterator) Value() Software { if !iter.page.NotDone() { - return Setting{} + return Software{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the SettingsListIterator type. -func NewSettingsListIterator(page SettingsListPage) SettingsListIterator { - return SettingsListIterator{page: page} +// 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 SettingsList) IsEmpty() bool { +func (sl SoftwaresList) IsEmpty() bool { return sl.Value == nil || len(*sl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (sl SettingsList) hasNextLink() bool { +func (sl SoftwaresList) hasNextLink() bool { return sl.NextLink != nil && len(*sl.NextLink) != 0 } -// settingsListPreparer prepares a request to retrieve the next set of results. +// softwaresListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (sl SettingsList) settingsListPreparer(ctx context.Context) (*http.Request, error) { +func (sl SoftwaresList) softwaresListPreparer(ctx context.Context) (*http.Request, error) { if !sl.hasNextLink() { return nil, nil } @@ -14457,17 +16601,17 @@ func (sl SettingsList) settingsListPreparer(ctx context.Context) (*http.Request, autorest.WithBaseURL(to.String(sl.NextLink))) } -// SettingsListPage contains a page of Setting values. -type SettingsListPage struct { - fn func(context.Context, SettingsList) (SettingsList, error) - sl SettingsList +// 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 *SettingsListPage) NextWithContext(ctx context.Context) (err error) { +func (page *SoftwaresListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SettingsListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/SoftwaresListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -14492,31 +16636,31 @@ func (page *SettingsListPage) NextWithContext(ctx context.Context) (err error) { // 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 *SettingsListPage) Next() error { +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 SettingsListPage) NotDone() bool { +func (page SoftwaresListPage) NotDone() bool { return !page.sl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page SettingsListPage) Response() SettingsList { +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 SettingsListPage) Values() []Setting { +func (page SoftwaresListPage) Values() []Software { if page.sl.IsEmpty() { return nil } return *page.sl.Value } -// Creates a new instance of the SettingsListPage type. -func NewSettingsListPage(cur SettingsList, getNextPage func(context.Context, SettingsList) (SettingsList, error)) SettingsListPage { - return SettingsListPage{ +// 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, } @@ -14963,6 +17107,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. diff --git a/services/preview/security/mgmt/v2.0/security/operations.go b/services/preview/security/mgmt/v2.0/security/operations.go index af10a5f55613..ddb59b6b17ec 100644 --- a/services/preview/security/mgmt/v2.0/security/operations.go +++ b/services/preview/security/mgmt/v2.0/security/operations.go @@ -20,14 +20,14 @@ type OperationsClient struct { } // NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID string, ascLocation string) OperationsClient { - return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewOperationsClientWithBaseURI creates an instance of the OperationsClient 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 NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) OperationsClient { - return OperationsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} } // List exposes all available operations for discovery purposes. diff --git a/services/preview/security/mgmt/v2.0/security/pricings.go b/services/preview/security/mgmt/v2.0/security/pricings.go index 1361d65dabef..229d4abcc67a 100644 --- a/services/preview/security/mgmt/v2.0/security/pricings.go +++ b/services/preview/security/mgmt/v2.0/security/pricings.go @@ -21,17 +21,17 @@ type PricingsClient struct { } // NewPricingsClient creates an instance of the PricingsClient client. -func NewPricingsClient(subscriptionID string, ascLocation string) PricingsClient { - return NewPricingsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewPricingsClient(subscriptionID string) PricingsClient { + return NewPricingsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewPricingsClientWithBaseURI creates an instance of the PricingsClient 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 NewPricingsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) PricingsClient { - return PricingsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewPricingsClientWithBaseURI(baseURI string, subscriptionID string) PricingsClient { + return PricingsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get gets a provided Security Center pricing configuration in the subscription. +// Get gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. // Parameters: // pricingName - name of the pricing configuration func (client PricingsClient) Get(ctx context.Context, pricingName string) (result Pricing, err error) { @@ -111,7 +111,7 @@ func (client PricingsClient) GetResponder(resp *http.Response) (result Pricing, return } -// List lists Security Center pricing configurations in the subscription. +// List lists Microsoft Defender for Cloud pricing configurations in the subscription. func (client PricingsClient) List(ctx context.Context) (result PricingList, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PricingsClient.List") @@ -188,7 +188,7 @@ func (client PricingsClient) ListResponder(resp *http.Response) (result PricingL return } -// Update updates a provided Security Center pricing configuration in the subscription. +// Update updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. // Parameters: // pricingName - name of the pricing configuration // pricing - pricing object diff --git a/services/preview/security/mgmt/v2.0/security/regulatorycomplianceassessments.go b/services/preview/security/mgmt/v2.0/security/regulatorycomplianceassessments.go index 7706ccb00bed..b9186c6a5562 100644 --- a/services/preview/security/mgmt/v2.0/security/regulatorycomplianceassessments.go +++ b/services/preview/security/mgmt/v2.0/security/regulatorycomplianceassessments.go @@ -22,15 +22,15 @@ type RegulatoryComplianceAssessmentsClient struct { } // NewRegulatoryComplianceAssessmentsClient creates an instance of the RegulatoryComplianceAssessmentsClient client. -func NewRegulatoryComplianceAssessmentsClient(subscriptionID string, ascLocation string) RegulatoryComplianceAssessmentsClient { - return NewRegulatoryComplianceAssessmentsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewRegulatoryComplianceAssessmentsClient(subscriptionID string) RegulatoryComplianceAssessmentsClient { + return NewRegulatoryComplianceAssessmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewRegulatoryComplianceAssessmentsClientWithBaseURI creates an instance of the RegulatoryComplianceAssessmentsClient // 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 NewRegulatoryComplianceAssessmentsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) RegulatoryComplianceAssessmentsClient { - return RegulatoryComplianceAssessmentsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewRegulatoryComplianceAssessmentsClientWithBaseURI(baseURI string, subscriptionID string) RegulatoryComplianceAssessmentsClient { + return RegulatoryComplianceAssessmentsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get supported regulatory compliance details and state for selected assessment diff --git a/services/preview/security/mgmt/v2.0/security/regulatorycompliancecontrols.go b/services/preview/security/mgmt/v2.0/security/regulatorycompliancecontrols.go index 54847e13b4ed..ae94c4b1cccf 100644 --- a/services/preview/security/mgmt/v2.0/security/regulatorycompliancecontrols.go +++ b/services/preview/security/mgmt/v2.0/security/regulatorycompliancecontrols.go @@ -21,15 +21,15 @@ type RegulatoryComplianceControlsClient struct { } // NewRegulatoryComplianceControlsClient creates an instance of the RegulatoryComplianceControlsClient client. -func NewRegulatoryComplianceControlsClient(subscriptionID string, ascLocation string) RegulatoryComplianceControlsClient { - return NewRegulatoryComplianceControlsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewRegulatoryComplianceControlsClient(subscriptionID string) RegulatoryComplianceControlsClient { + return NewRegulatoryComplianceControlsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewRegulatoryComplianceControlsClientWithBaseURI creates an instance of the RegulatoryComplianceControlsClient // 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 NewRegulatoryComplianceControlsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) RegulatoryComplianceControlsClient { - return RegulatoryComplianceControlsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewRegulatoryComplianceControlsClientWithBaseURI(baseURI string, subscriptionID string) RegulatoryComplianceControlsClient { + return RegulatoryComplianceControlsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get selected regulatory compliance control details and state diff --git a/services/preview/security/mgmt/v2.0/security/regulatorycompliancestandards.go b/services/preview/security/mgmt/v2.0/security/regulatorycompliancestandards.go index 32e0167c7ffa..02b59e4ea221 100644 --- a/services/preview/security/mgmt/v2.0/security/regulatorycompliancestandards.go +++ b/services/preview/security/mgmt/v2.0/security/regulatorycompliancestandards.go @@ -21,15 +21,15 @@ type RegulatoryComplianceStandardsClient struct { } // NewRegulatoryComplianceStandardsClient creates an instance of the RegulatoryComplianceStandardsClient client. -func NewRegulatoryComplianceStandardsClient(subscriptionID string, ascLocation string) RegulatoryComplianceStandardsClient { - return NewRegulatoryComplianceStandardsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewRegulatoryComplianceStandardsClient(subscriptionID string) RegulatoryComplianceStandardsClient { + return NewRegulatoryComplianceStandardsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewRegulatoryComplianceStandardsClientWithBaseURI creates an instance of the RegulatoryComplianceStandardsClient // 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 NewRegulatoryComplianceStandardsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) RegulatoryComplianceStandardsClient { - return RegulatoryComplianceStandardsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewRegulatoryComplianceStandardsClientWithBaseURI(baseURI string, subscriptionID string) RegulatoryComplianceStandardsClient { + return RegulatoryComplianceStandardsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get supported regulatory compliance details state for selected standard diff --git a/services/preview/security/mgmt/v2.0/security/securescorecontroldefinitions.go b/services/preview/security/mgmt/v2.0/security/securescorecontroldefinitions.go index 4da0f88bad68..b3cc63bac4d3 100644 --- a/services/preview/security/mgmt/v2.0/security/securescorecontroldefinitions.go +++ b/services/preview/security/mgmt/v2.0/security/securescorecontroldefinitions.go @@ -21,15 +21,15 @@ type SecureScoreControlDefinitionsClient struct { } // NewSecureScoreControlDefinitionsClient creates an instance of the SecureScoreControlDefinitionsClient client. -func NewSecureScoreControlDefinitionsClient(subscriptionID string, ascLocation string) SecureScoreControlDefinitionsClient { - return NewSecureScoreControlDefinitionsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSecureScoreControlDefinitionsClient(subscriptionID string) SecureScoreControlDefinitionsClient { + return NewSecureScoreControlDefinitionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSecureScoreControlDefinitionsClientWithBaseURI creates an instance of the SecureScoreControlDefinitionsClient // 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 NewSecureScoreControlDefinitionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SecureScoreControlDefinitionsClient { - return SecureScoreControlDefinitionsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSecureScoreControlDefinitionsClientWithBaseURI(baseURI string, subscriptionID string) SecureScoreControlDefinitionsClient { + return SecureScoreControlDefinitionsClient{NewWithBaseURI(baseURI, subscriptionID)} } // List list the available security controls, their assessments, and the max score diff --git a/services/preview/security/mgmt/v2.0/security/securescorecontrols.go b/services/preview/security/mgmt/v2.0/security/securescorecontrols.go index e24665b89ceb..717f3f32557e 100644 --- a/services/preview/security/mgmt/v2.0/security/securescorecontrols.go +++ b/services/preview/security/mgmt/v2.0/security/securescorecontrols.go @@ -21,15 +21,15 @@ type SecureScoreControlsClient struct { } // NewSecureScoreControlsClient creates an instance of the SecureScoreControlsClient client. -func NewSecureScoreControlsClient(subscriptionID string, ascLocation string) SecureScoreControlsClient { - return NewSecureScoreControlsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSecureScoreControlsClient(subscriptionID string) SecureScoreControlsClient { + return NewSecureScoreControlsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSecureScoreControlsClientWithBaseURI creates an instance of the SecureScoreControlsClient 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 NewSecureScoreControlsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SecureScoreControlsClient { - return SecureScoreControlsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSecureScoreControlsClientWithBaseURI(baseURI string, subscriptionID string) SecureScoreControlsClient { + return SecureScoreControlsClient{NewWithBaseURI(baseURI, subscriptionID)} } // List get all security controls within a scope diff --git a/services/preview/security/mgmt/v2.0/security/securescores.go b/services/preview/security/mgmt/v2.0/security/securescores.go index a9b7adc201df..bf8ac2b4e1c7 100644 --- a/services/preview/security/mgmt/v2.0/security/securescores.go +++ b/services/preview/security/mgmt/v2.0/security/securescores.go @@ -21,18 +21,18 @@ type SecureScoresClient struct { } // NewSecureScoresClient creates an instance of the SecureScoresClient client. -func NewSecureScoresClient(subscriptionID string, ascLocation string) SecureScoresClient { - return NewSecureScoresClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSecureScoresClient(subscriptionID string) SecureScoresClient { + return NewSecureScoresClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSecureScoresClientWithBaseURI creates an instance of the SecureScoresClient 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 NewSecureScoresClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SecureScoresClient { - return SecureScoresClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSecureScoresClientWithBaseURI(baseURI string, subscriptionID string) SecureScoresClient { + return SecureScoresClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get get secure score for a specific Security Center initiative within your current scope. For the ASC Default -// initiative, use 'ascScore'. +// Get get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC +// Default initiative, use 'ascScore'. // Parameters: // secureScoreName - the initiative name. For the ASC Default initiative, use 'ascScore' as in the sample // request below. @@ -113,7 +113,7 @@ func (client SecureScoresClient) GetResponder(resp *http.Response) (result Secur return } -// List list secure scores for all your Security Center initiatives within your current scope. +// List list secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. func (client SecureScoresClient) List(ctx context.Context) (result SecureScoresListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresClient.List") diff --git a/services/preview/security/mgmt/v2.0/security/securityapi/interfaces.go b/services/preview/security/mgmt/v2.0/security/securityapi/interfaces.go index 5f0989fa73eb..34b0309449e4 100644 --- a/services/preview/security/mgmt/v2.0/security/securityapi/interfaces.go +++ b/services/preview/security/mgmt/v2.0/security/securityapi/interfaces.go @@ -12,6 +12,65 @@ import ( "github.com/Azure/go-autorest/autorest" ) +// ConnectorsClientAPI contains the set of methods on the ConnectorsClient type. +type ConnectorsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector security.Connector) (result security.Connector, err error) + Delete(ctx context.Context, resourceGroupName string, securityConnectorName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, securityConnectorName string) (result security.Connector, err error) + List(ctx context.Context) (result security.ConnectorsListPage, err error) + ListComplete(ctx context.Context) (result security.ConnectorsListIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result security.ConnectorsListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result security.ConnectorsListIterator, err error) + Update(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector security.Connector) (result security.Connector, err error) +} + +var _ ConnectorsClientAPI = (*security.ConnectorsClient)(nil) + +// MdeOnboardingsClientAPI contains the set of methods on the MdeOnboardingsClient type. +type MdeOnboardingsClientAPI interface { + Get(ctx context.Context) (result security.MdeOnboardingData, err error) + List(ctx context.Context) (result security.MdeOnboardingDataList, err error) +} + +var _ MdeOnboardingsClientAPI = (*security.MdeOnboardingsClient)(nil) + +// CustomAssessmentAutomationsClientAPI contains the set of methods on the CustomAssessmentAutomationsClient type. +type CustomAssessmentAutomationsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string, customAssessmentAutomationBody security.CustomAssessmentAutomationRequest) (result security.CustomAssessmentAutomation, err error) + Delete(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string) (result security.CustomAssessmentAutomation, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result security.CustomAssessmentAutomationsListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result security.CustomAssessmentAutomationsListResultIterator, err error) + ListBySubscription(ctx context.Context) (result security.CustomAssessmentAutomationsListResultPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result security.CustomAssessmentAutomationsListResultIterator, err error) +} + +var _ CustomAssessmentAutomationsClientAPI = (*security.CustomAssessmentAutomationsClient)(nil) + +// CustomEntityStoreAssignmentsClientAPI contains the set of methods on the CustomEntityStoreAssignmentsClient type. +type CustomEntityStoreAssignmentsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string, customEntityStoreAssignmentRequestBody security.CustomEntityStoreAssignmentRequest) (result security.CustomEntityStoreAssignment, err error) + Delete(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string) (result security.CustomEntityStoreAssignment, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result security.CustomEntityStoreAssignmentsListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result security.CustomEntityStoreAssignmentsListResultIterator, err error) + ListBySubscription(ctx context.Context) (result security.CustomEntityStoreAssignmentsListResultPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result security.CustomEntityStoreAssignmentsListResultIterator, err error) +} + +var _ CustomEntityStoreAssignmentsClientAPI = (*security.CustomEntityStoreAssignmentsClient)(nil) + +// SoftwareInventoriesClientAPI contains the set of methods on the SoftwareInventoriesClient type. +type SoftwareInventoriesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, softwareName string) (result security.Software, err error) + ListByExtendedResource(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (result security.SoftwaresListPage, err error) + ListByExtendedResourceComplete(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (result security.SoftwaresListIterator, err error) + ListBySubscription(ctx context.Context) (result security.SoftwaresListPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result security.SoftwaresListIterator, err error) +} + +var _ SoftwareInventoriesClientAPI = (*security.SoftwareInventoriesClient)(nil) + // SQLVulnerabilityAssessmentScansClientAPI contains the set of methods on the SQLVulnerabilityAssessmentScansClient type. type SQLVulnerabilityAssessmentScansClientAPI interface { Get(ctx context.Context, scanID string, workspaceID string, APIVersion string, resourceID string) (result security.Scan, err error) @@ -68,8 +127,8 @@ type SecureScoreControlDefinitionsClientAPI interface { var _ SecureScoreControlDefinitionsClientAPI = (*security.SecureScoreControlDefinitionsClient)(nil) -// ConnectorsClientAPI contains the set of methods on the ConnectorsClient type. -type ConnectorsClientAPI interface { +// ConnectorsGroupClientAPI contains the set of methods on the ConnectorsGroupClient type. +type ConnectorsGroupClientAPI interface { CreateOrUpdate(ctx context.Context, connectorName string, connectorSetting security.ConnectorSetting) (result security.ConnectorSetting, err error) Delete(ctx context.Context, connectorName string) (result autorest.Response, err error) Get(ctx context.Context, connectorName string) (result security.ConnectorSetting, err error) @@ -77,7 +136,7 @@ type ConnectorsClientAPI interface { ListComplete(ctx context.Context) (result security.ConnectorSettingListIterator, err error) } -var _ ConnectorsClientAPI = (*security.ConnectorsClient)(nil) +var _ ConnectorsGroupClientAPI = (*security.ConnectorsGroupClient)(nil) // AutomationsClientAPI contains the set of methods on the AutomationsClient type. type AutomationsClientAPI interface { @@ -204,18 +263,18 @@ var _ DeviceSecurityGroupsClientAPI = (*security.DeviceSecurityGroupsClient)(nil // SettingsClientAPI contains the set of methods on the SettingsClient type. type SettingsClientAPI interface { - Get(ctx context.Context, settingName string) (result security.Setting, err error) + Get(ctx context.Context, settingName string) (result security.SettingModel, err error) List(ctx context.Context) (result security.SettingsListPage, err error) ListComplete(ctx context.Context) (result security.SettingsListIterator, err error) - Update(ctx context.Context, settingName string, setting security.Setting) (result security.Setting, err error) + Update(ctx context.Context, settingName string, setting security.BasicSetting) (result security.SettingModel, err error) } var _ SettingsClientAPI = (*security.SettingsClient)(nil) // InformationProtectionPoliciesClientAPI contains the set of methods on the InformationProtectionPoliciesClient type. type InformationProtectionPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, scope string, informationProtectionPolicyName string, informationProtectionPolicy security.InformationProtectionPolicy) (result security.InformationProtectionPolicy, err error) - Get(ctx context.Context, scope string, informationProtectionPolicyName string) (result security.InformationProtectionPolicy, err error) + CreateOrUpdate(ctx context.Context, scope string, informationProtectionPolicyName security.InformationProtectionPolicyName, informationProtectionPolicy security.InformationProtectionPolicy) (result security.InformationProtectionPolicy, err error) + Get(ctx context.Context, scope string, informationProtectionPolicyName security.InformationProtectionPolicyName) (result security.InformationProtectionPolicy, err error) List(ctx context.Context, scope string) (result security.InformationProtectionPolicyListPage, err error) ListComplete(ctx context.Context, scope string) (result security.InformationProtectionPolicyListIterator, err error) } @@ -297,7 +356,7 @@ var _ OperationsClientAPI = (*security.OperationsClient)(nil) // LocationsClientAPI contains the set of methods on the LocationsClient type. type LocationsClientAPI interface { - Get(ctx context.Context) (result security.AscLocation, err error) + Get(ctx context.Context, ascLocation string) (result security.AscLocation, err error) List(ctx context.Context) (result security.AscLocationListPage, err error) ListComplete(ctx context.Context) (result security.AscLocationListIterator, err error) } @@ -306,108 +365,108 @@ var _ LocationsClientAPI = (*security.LocationsClient)(nil) // TasksClientAPI contains the set of methods on the TasksClient type. type TasksClientAPI interface { - GetResourceGroupLevelTask(ctx context.Context, resourceGroupName string, taskName string) (result security.Task, err error) - GetSubscriptionLevelTask(ctx context.Context, taskName string) (result security.Task, err error) + GetResourceGroupLevelTask(ctx context.Context, resourceGroupName string, ascLocation string, taskName string) (result security.Task, err error) + GetSubscriptionLevelTask(ctx context.Context, ascLocation string, taskName string) (result security.Task, err error) List(ctx context.Context, filter string) (result security.TaskListPage, err error) ListComplete(ctx context.Context, filter string) (result security.TaskListIterator, err error) - ListByHomeRegion(ctx context.Context, filter string) (result security.TaskListPage, err error) - ListByHomeRegionComplete(ctx context.Context, filter string) (result security.TaskListIterator, err error) - ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string) (result security.TaskListPage, err error) - ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string) (result security.TaskListIterator, err error) - UpdateResourceGroupLevelTaskState(ctx context.Context, resourceGroupName string, taskName string, taskUpdateActionType string) (result autorest.Response, err error) - UpdateSubscriptionLevelTaskState(ctx context.Context, taskName string, taskUpdateActionType string) (result autorest.Response, err error) + ListByHomeRegion(ctx context.Context, ascLocation string, filter string) (result security.TaskListPage, err error) + ListByHomeRegionComplete(ctx context.Context, ascLocation string, filter string) (result security.TaskListIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string, ascLocation string, filter string) (result security.TaskListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, ascLocation string, filter string) (result security.TaskListIterator, err error) + UpdateResourceGroupLevelTaskState(ctx context.Context, resourceGroupName string, ascLocation string, taskName string, taskUpdateActionType security.TaskUpdateActionType) (result autorest.Response, err error) + UpdateSubscriptionLevelTaskState(ctx context.Context, ascLocation string, taskName string, taskUpdateActionType security.TaskUpdateActionType) (result autorest.Response, err error) } var _ TasksClientAPI = (*security.TasksClient)(nil) // AlertsClientAPI contains the set of methods on the AlertsClient type. type AlertsClientAPI interface { - GetResourceGroupLevelAlerts(ctx context.Context, alertName string, resourceGroupName string) (result security.Alert, err error) - GetSubscriptionLevelAlert(ctx context.Context, alertName string) (result security.Alert, err error) + GetResourceGroupLevelAlerts(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (result security.Alert, err error) + GetSubscriptionLevelAlert(ctx context.Context, ascLocation string, alertName string) (result security.Alert, err error) List(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListPage, err error) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListIterator, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListPage, err error) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListIterator, err error) - ListResourceGroupLevelAlertsByRegion(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListPage, err error) - ListResourceGroupLevelAlertsByRegionComplete(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListIterator, err error) - ListSubscriptionLevelAlertsByRegion(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListPage, err error) - ListSubscriptionLevelAlertsByRegionComplete(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListIterator, err error) - UpdateResourceGroupLevelAlertStateToDismiss(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) - UpdateResourceGroupLevelAlertStateToReactivate(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) - UpdateSubscriptionLevelAlertStateToDismiss(ctx context.Context, alertName string) (result autorest.Response, err error) - UpdateSubscriptionLevelAlertStateToReactivate(ctx context.Context, alertName string) (result autorest.Response, err error) + ListResourceGroupLevelAlertsByRegion(ctx context.Context, ascLocation string, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListPage, err error) + ListResourceGroupLevelAlertsByRegionComplete(ctx context.Context, ascLocation string, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListIterator, err error) + ListSubscriptionLevelAlertsByRegion(ctx context.Context, ascLocation string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListPage, err error) + ListSubscriptionLevelAlertsByRegionComplete(ctx context.Context, ascLocation string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListIterator, err error) + UpdateResourceGroupLevelAlertStateToDismiss(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (result autorest.Response, err error) + UpdateResourceGroupLevelAlertStateToReactivate(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (result autorest.Response, err error) + UpdateSubscriptionLevelAlertStateToDismiss(ctx context.Context, ascLocation string, alertName string) (result autorest.Response, err error) + UpdateSubscriptionLevelAlertStateToReactivate(ctx context.Context, ascLocation string, alertName string) (result autorest.Response, err error) } var _ AlertsClientAPI = (*security.AlertsClient)(nil) // DiscoveredSecuritySolutionsClientAPI contains the set of methods on the DiscoveredSecuritySolutionsClient type. type DiscoveredSecuritySolutionsClientAPI interface { - Get(ctx context.Context, resourceGroupName string, discoveredSecuritySolutionName string) (result security.DiscoveredSecuritySolution, err error) + Get(ctx context.Context, resourceGroupName string, ascLocation string, discoveredSecuritySolutionName string) (result security.DiscoveredSecuritySolution, err error) List(ctx context.Context) (result security.DiscoveredSecuritySolutionListPage, err error) ListComplete(ctx context.Context) (result security.DiscoveredSecuritySolutionListIterator, err error) - ListByHomeRegion(ctx context.Context) (result security.DiscoveredSecuritySolutionListPage, err error) - ListByHomeRegionComplete(ctx context.Context) (result security.DiscoveredSecuritySolutionListIterator, err error) + ListByHomeRegion(ctx context.Context, ascLocation string) (result security.DiscoveredSecuritySolutionListPage, err error) + ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result security.DiscoveredSecuritySolutionListIterator, err error) } var _ DiscoveredSecuritySolutionsClientAPI = (*security.DiscoveredSecuritySolutionsClient)(nil) // JitNetworkAccessPoliciesClientAPI contains the set of methods on the JitNetworkAccessPoliciesClient type. type JitNetworkAccessPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string, body security.JitNetworkAccessPolicy) (result security.JitNetworkAccessPolicy, err error) - Delete(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string) (result security.JitNetworkAccessPolicy, err error) - Initiate(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string, body security.JitNetworkAccessPolicyInitiateRequest) (result security.JitNetworkAccessRequest, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body security.JitNetworkAccessPolicy) (result security.JitNetworkAccessPolicy, err error) + Delete(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string) (result security.JitNetworkAccessPolicy, err error) + Initiate(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body security.JitNetworkAccessPolicyInitiateRequest) (result security.JitNetworkAccessRequest, err error) List(ctx context.Context) (result security.JitNetworkAccessPoliciesListPage, err error) ListComplete(ctx context.Context) (result security.JitNetworkAccessPoliciesListIterator, err error) - ListByRegion(ctx context.Context) (result security.JitNetworkAccessPoliciesListPage, err error) - ListByRegionComplete(ctx context.Context) (result security.JitNetworkAccessPoliciesListIterator, err error) + ListByRegion(ctx context.Context, ascLocation string) (result security.JitNetworkAccessPoliciesListPage, err error) + ListByRegionComplete(ctx context.Context, ascLocation string) (result security.JitNetworkAccessPoliciesListIterator, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result security.JitNetworkAccessPoliciesListPage, err error) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result security.JitNetworkAccessPoliciesListIterator, err error) - ListByResourceGroupAndRegion(ctx context.Context, resourceGroupName string) (result security.JitNetworkAccessPoliciesListPage, err error) - ListByResourceGroupAndRegionComplete(ctx context.Context, resourceGroupName string) (result security.JitNetworkAccessPoliciesListIterator, err error) + ListByResourceGroupAndRegion(ctx context.Context, resourceGroupName string, ascLocation string) (result security.JitNetworkAccessPoliciesListPage, err error) + ListByResourceGroupAndRegionComplete(ctx context.Context, resourceGroupName string, ascLocation string) (result security.JitNetworkAccessPoliciesListIterator, err error) } var _ JitNetworkAccessPoliciesClientAPI = (*security.JitNetworkAccessPoliciesClient)(nil) // AdaptiveApplicationControlsClientAPI contains the set of methods on the AdaptiveApplicationControlsClient type. type AdaptiveApplicationControlsClientAPI interface { - Delete(ctx context.Context, groupName string) (result autorest.Response, err error) - Get(ctx context.Context, groupName string) (result security.AppWhitelistingGroup, err error) + Delete(ctx context.Context, ascLocation string, groupName string) (result autorest.Response, err error) + Get(ctx context.Context, ascLocation string, groupName string) (result security.AppWhitelistingGroup, err error) List(ctx context.Context, includePathRecommendations *bool, summary *bool) (result security.AppWhitelistingGroups, err error) - Put(ctx context.Context, groupName string, body security.AppWhitelistingPutGroupData) (result security.AppWhitelistingGroup, err error) + Put(ctx context.Context, ascLocation string, groupName string, body security.AppWhitelistingPutGroupData) (result security.AppWhitelistingGroup, err error) } var _ AdaptiveApplicationControlsClientAPI = (*security.AdaptiveApplicationControlsClient)(nil) // ExternalSecuritySolutionsClientAPI contains the set of methods on the ExternalSecuritySolutionsClient type. type ExternalSecuritySolutionsClientAPI interface { - Get(ctx context.Context, resourceGroupName string, externalSecuritySolutionsName string) (result security.ExternalSecuritySolutionModel, err error) + Get(ctx context.Context, resourceGroupName string, ascLocation string, externalSecuritySolutionsName string) (result security.ExternalSecuritySolutionModel, err error) List(ctx context.Context) (result security.ExternalSecuritySolutionListPage, err error) ListComplete(ctx context.Context) (result security.ExternalSecuritySolutionListIterator, err error) - ListByHomeRegion(ctx context.Context) (result security.ExternalSecuritySolutionListPage, err error) - ListByHomeRegionComplete(ctx context.Context) (result security.ExternalSecuritySolutionListIterator, err error) + ListByHomeRegion(ctx context.Context, ascLocation string) (result security.ExternalSecuritySolutionListPage, err error) + ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result security.ExternalSecuritySolutionListIterator, err error) } var _ ExternalSecuritySolutionsClientAPI = (*security.ExternalSecuritySolutionsClient)(nil) // TopologyClientAPI contains the set of methods on the TopologyClient type. type TopologyClientAPI interface { - Get(ctx context.Context, resourceGroupName string, topologyResourceName string) (result security.TopologyResource, err error) + Get(ctx context.Context, resourceGroupName string, ascLocation string, topologyResourceName string) (result security.TopologyResource, err error) List(ctx context.Context) (result security.TopologyListPage, err error) ListComplete(ctx context.Context) (result security.TopologyListIterator, err error) - ListByHomeRegion(ctx context.Context) (result security.TopologyListPage, err error) - ListByHomeRegionComplete(ctx context.Context) (result security.TopologyListIterator, err error) + ListByHomeRegion(ctx context.Context, ascLocation string) (result security.TopologyListPage, err error) + ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result security.TopologyListIterator, err error) } var _ TopologyClientAPI = (*security.TopologyClient)(nil) // AllowedConnectionsClientAPI contains the set of methods on the AllowedConnectionsClient type. type AllowedConnectionsClientAPI interface { - Get(ctx context.Context, resourceGroupName string, connectionType security.ConnectionType) (result security.AllowedConnectionsResource, err error) + Get(ctx context.Context, resourceGroupName string, ascLocation string, connectionType security.ConnectionType) (result security.AllowedConnectionsResource, err error) List(ctx context.Context) (result security.AllowedConnectionsListPage, err error) ListComplete(ctx context.Context) (result security.AllowedConnectionsListIterator, err error) - ListByHomeRegion(ctx context.Context) (result security.AllowedConnectionsListPage, err error) - ListByHomeRegionComplete(ctx context.Context) (result security.AllowedConnectionsListIterator, err error) + ListByHomeRegion(ctx context.Context, ascLocation string) (result security.AllowedConnectionsListPage, err error) + ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result security.AllowedConnectionsListIterator, err error) } var _ AllowedConnectionsClientAPI = (*security.AllowedConnectionsClient)(nil) @@ -432,3 +491,16 @@ type AlertsSuppressionRulesClientAPI interface { } var _ AlertsSuppressionRulesClientAPI = (*security.AlertsSuppressionRulesClient)(nil) + +// IngestionSettingsClientAPI contains the set of methods on the IngestionSettingsClient type. +type IngestionSettingsClientAPI interface { + Create(ctx context.Context, ingestionSettingName string, ingestionSetting security.IngestionSetting) (result security.IngestionSetting, err error) + Delete(ctx context.Context, ingestionSettingName string) (result autorest.Response, err error) + Get(ctx context.Context, ingestionSettingName string) (result security.IngestionSetting, err error) + List(ctx context.Context) (result security.IngestionSettingListPage, err error) + ListComplete(ctx context.Context) (result security.IngestionSettingListIterator, err error) + ListConnectionStrings(ctx context.Context, ingestionSettingName string) (result security.ConnectionStrings, err error) + ListTokens(ctx context.Context, ingestionSettingName string) (result security.IngestionSettingToken, err error) +} + +var _ IngestionSettingsClientAPI = (*security.IngestionSettingsClient)(nil) diff --git a/services/preview/security/mgmt/v2.0/security/settings.go b/services/preview/security/mgmt/v2.0/security/settings.go index 5d87a8857e37..44a0e480242b 100644 --- a/services/preview/security/mgmt/v2.0/security/settings.go +++ b/services/preview/security/mgmt/v2.0/security/settings.go @@ -21,20 +21,20 @@ type SettingsClient struct { } // NewSettingsClient creates an instance of the SettingsClient client. -func NewSettingsClient(subscriptionID string, ascLocation string) SettingsClient { - return NewSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSettingsClient(subscriptionID string) SettingsClient { + return NewSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSettingsClientWithBaseURI creates an instance of the SettingsClient 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 NewSettingsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SettingsClient { - return SettingsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSettingsClientWithBaseURI(baseURI string, subscriptionID string) SettingsClient { + return SettingsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get settings of different configurations in security center +// Get settings of different configurations in Microsoft Defender for Cloud // Parameters: // settingName - name of setting: (MCAS/WDATP) -func (client SettingsClient) Get(ctx context.Context, settingName string) (result Setting, err error) { +func (client SettingsClient) Get(ctx context.Context, settingName string) (result SettingModel, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SettingsClient.Get") defer func() { @@ -101,7 +101,7 @@ func (client SettingsClient) GetSender(req *http.Request) (*http.Response, error // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client SettingsClient) GetResponder(resp *http.Response) (result Setting, err error) { +func (client SettingsClient) GetResponder(resp *http.Response) (result SettingModel, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -111,7 +111,7 @@ func (client SettingsClient) GetResponder(resp *http.Response) (result Setting, return } -// List settings about different configurations in security center +// List settings about different configurations in Microsoft Defender for Cloud func (client SettingsClient) List(ctx context.Context) (result SettingsListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SettingsClient.List") @@ -230,11 +230,11 @@ func (client SettingsClient) ListComplete(ctx context.Context) (result SettingsL return } -// Update updating settings about different configurations in security center +// Update updating settings about different configurations in Microsoft Defender for Cloud // Parameters: // settingName - name of setting: (MCAS/WDATP) // setting - setting object -func (client SettingsClient) Update(ctx context.Context, settingName string, setting Setting) (result Setting, err error) { +func (client SettingsClient) Update(ctx context.Context, settingName string, setting BasicSetting) (result SettingModel, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SettingsClient.Update") defer func() { @@ -274,7 +274,7 @@ func (client SettingsClient) Update(ctx context.Context, settingName string, set } // UpdatePreparer prepares the Update request. -func (client SettingsClient) UpdatePreparer(ctx context.Context, settingName string, setting Setting) (*http.Request, error) { +func (client SettingsClient) UpdatePreparer(ctx context.Context, settingName string, setting BasicSetting) (*http.Request, error) { pathParameters := map[string]interface{}{ "settingName": autorest.Encode("path", settingName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -303,7 +303,7 @@ func (client SettingsClient) UpdateSender(req *http.Request) (*http.Response, er // UpdateResponder handles the response to the Update request. The method always // closes the http.Response Body. -func (client SettingsClient) UpdateResponder(resp *http.Response) (result Setting, err error) { +func (client SettingsClient) UpdateResponder(resp *http.Response) (result SettingModel, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/services/preview/security/mgmt/v2.0/security/softwareinventories.go b/services/preview/security/mgmt/v2.0/security/softwareinventories.go new file mode 100644 index 000000000000..352d7a173dd7 --- /dev/null +++ b/services/preview/security/mgmt/v2.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) SoftwareInventoriesClient { + return NewSoftwareInventoriesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// 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) SoftwareInventoriesClient { + return SoftwareInventoriesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// 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/services/preview/security/mgmt/v2.0/security/sqlvulnerabilityassessmentbaselinerules.go b/services/preview/security/mgmt/v2.0/security/sqlvulnerabilityassessmentbaselinerules.go index dac36e6f0626..fca9c4dc4938 100644 --- a/services/preview/security/mgmt/v2.0/security/sqlvulnerabilityassessmentbaselinerules.go +++ b/services/preview/security/mgmt/v2.0/security/sqlvulnerabilityassessmentbaselinerules.go @@ -22,15 +22,15 @@ type SQLVulnerabilityAssessmentBaselineRulesClient struct { // NewSQLVulnerabilityAssessmentBaselineRulesClient creates an instance of the // SQLVulnerabilityAssessmentBaselineRulesClient client. -func NewSQLVulnerabilityAssessmentBaselineRulesClient(subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentBaselineRulesClient { - return NewSQLVulnerabilityAssessmentBaselineRulesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSQLVulnerabilityAssessmentBaselineRulesClient(subscriptionID string) SQLVulnerabilityAssessmentBaselineRulesClient { + return NewSQLVulnerabilityAssessmentBaselineRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSQLVulnerabilityAssessmentBaselineRulesClientWithBaseURI creates an instance of the // SQLVulnerabilityAssessmentBaselineRulesClient 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 NewSQLVulnerabilityAssessmentBaselineRulesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentBaselineRulesClient { - return SQLVulnerabilityAssessmentBaselineRulesClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSQLVulnerabilityAssessmentBaselineRulesClientWithBaseURI(baseURI string, subscriptionID string) SQLVulnerabilityAssessmentBaselineRulesClient { + return SQLVulnerabilityAssessmentBaselineRulesClient{NewWithBaseURI(baseURI, subscriptionID)} } // Add sends the add request. diff --git a/services/preview/security/mgmt/v2.0/security/sqlvulnerabilityassessmentscanresults.go b/services/preview/security/mgmt/v2.0/security/sqlvulnerabilityassessmentscanresults.go index 6310b4f1014b..1f1b3740d3e1 100644 --- a/services/preview/security/mgmt/v2.0/security/sqlvulnerabilityassessmentscanresults.go +++ b/services/preview/security/mgmt/v2.0/security/sqlvulnerabilityassessmentscanresults.go @@ -22,15 +22,15 @@ type SQLVulnerabilityAssessmentScanResultsClient struct { // NewSQLVulnerabilityAssessmentScanResultsClient creates an instance of the // SQLVulnerabilityAssessmentScanResultsClient client. -func NewSQLVulnerabilityAssessmentScanResultsClient(subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentScanResultsClient { - return NewSQLVulnerabilityAssessmentScanResultsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSQLVulnerabilityAssessmentScanResultsClient(subscriptionID string) SQLVulnerabilityAssessmentScanResultsClient { + return NewSQLVulnerabilityAssessmentScanResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSQLVulnerabilityAssessmentScanResultsClientWithBaseURI creates an instance of the // SQLVulnerabilityAssessmentScanResultsClient 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 NewSQLVulnerabilityAssessmentScanResultsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentScanResultsClient { - return SQLVulnerabilityAssessmentScanResultsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSQLVulnerabilityAssessmentScanResultsClientWithBaseURI(baseURI string, subscriptionID string) SQLVulnerabilityAssessmentScanResultsClient { + return SQLVulnerabilityAssessmentScanResultsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get sends the get request. diff --git a/services/preview/security/mgmt/v2.0/security/sqlvulnerabilityassessmentscans.go b/services/preview/security/mgmt/v2.0/security/sqlvulnerabilityassessmentscans.go index 1b2f59ba954b..c7507a2d53be 100644 --- a/services/preview/security/mgmt/v2.0/security/sqlvulnerabilityassessmentscans.go +++ b/services/preview/security/mgmt/v2.0/security/sqlvulnerabilityassessmentscans.go @@ -21,15 +21,15 @@ type SQLVulnerabilityAssessmentScansClient struct { } // NewSQLVulnerabilityAssessmentScansClient creates an instance of the SQLVulnerabilityAssessmentScansClient client. -func NewSQLVulnerabilityAssessmentScansClient(subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentScansClient { - return NewSQLVulnerabilityAssessmentScansClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSQLVulnerabilityAssessmentScansClient(subscriptionID string) SQLVulnerabilityAssessmentScansClient { + return NewSQLVulnerabilityAssessmentScansClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSQLVulnerabilityAssessmentScansClientWithBaseURI creates an instance of the SQLVulnerabilityAssessmentScansClient // 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 NewSQLVulnerabilityAssessmentScansClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentScansClient { - return SQLVulnerabilityAssessmentScansClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSQLVulnerabilityAssessmentScansClientWithBaseURI(baseURI string, subscriptionID string) SQLVulnerabilityAssessmentScansClient { + return SQLVulnerabilityAssessmentScansClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get sends the get request. diff --git a/services/preview/security/mgmt/v2.0/security/subassessments.go b/services/preview/security/mgmt/v2.0/security/subassessments.go index d767fbbc6b05..a2440cb9293f 100644 --- a/services/preview/security/mgmt/v2.0/security/subassessments.go +++ b/services/preview/security/mgmt/v2.0/security/subassessments.go @@ -20,14 +20,14 @@ type SubAssessmentsClient struct { } // NewSubAssessmentsClient creates an instance of the SubAssessmentsClient client. -func NewSubAssessmentsClient(subscriptionID string, ascLocation string) SubAssessmentsClient { - return NewSubAssessmentsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSubAssessmentsClient(subscriptionID string) SubAssessmentsClient { + return NewSubAssessmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSubAssessmentsClientWithBaseURI creates an instance of the SubAssessmentsClient 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 NewSubAssessmentsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SubAssessmentsClient { - return SubAssessmentsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSubAssessmentsClientWithBaseURI(baseURI string, subscriptionID string) SubAssessmentsClient { + return SubAssessmentsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get get a security sub-assessment on your scanned resource diff --git a/services/preview/security/mgmt/v2.0/security/tasks.go b/services/preview/security/mgmt/v2.0/security/tasks.go index cd9940c935b8..f0c6ec950e9c 100644 --- a/services/preview/security/mgmt/v2.0/security/tasks.go +++ b/services/preview/security/mgmt/v2.0/security/tasks.go @@ -21,22 +21,24 @@ type TasksClient struct { } // NewTasksClient creates an instance of the TasksClient client. -func NewTasksClient(subscriptionID string, ascLocation string) TasksClient { - return NewTasksClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewTasksClient(subscriptionID string) TasksClient { + return NewTasksClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewTasksClientWithBaseURI creates an instance of the TasksClient 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 NewTasksClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) TasksClient { - return TasksClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewTasksClientWithBaseURI(baseURI string, subscriptionID string) TasksClient { + return TasksClient{NewWithBaseURI(baseURI, subscriptionID)} } // GetResourceGroupLevelTask recommended tasks that will help improve the security of the subscription proactively // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // taskName - name of the task object, will be a GUID -func (client TasksClient) GetResourceGroupLevelTask(ctx context.Context, resourceGroupName string, taskName string) (result Task, err error) { +func (client TasksClient) GetResourceGroupLevelTask(ctx context.Context, resourceGroupName string, ascLocation string, taskName string) (result Task, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.GetResourceGroupLevelTask") defer func() { @@ -57,7 +59,7 @@ func (client TasksClient) GetResourceGroupLevelTask(ctx context.Context, resourc return result, validation.NewError("security.TasksClient", "GetResourceGroupLevelTask", err.Error()) } - req, err := client.GetResourceGroupLevelTaskPreparer(ctx, resourceGroupName, taskName) + req, err := client.GetResourceGroupLevelTaskPreparer(ctx, resourceGroupName, ascLocation, taskName) if err != nil { err = autorest.NewErrorWithError(err, "security.TasksClient", "GetResourceGroupLevelTask", nil, "Failure preparing request") return @@ -80,9 +82,9 @@ func (client TasksClient) GetResourceGroupLevelTask(ctx context.Context, resourc } // GetResourceGroupLevelTaskPreparer prepares the GetResourceGroupLevelTask request. -func (client TasksClient) GetResourceGroupLevelTaskPreparer(ctx context.Context, resourceGroupName string, taskName string) (*http.Request, error) { +func (client TasksClient) GetResourceGroupLevelTaskPreparer(ctx context.Context, resourceGroupName string, ascLocation string, taskName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "taskName": autorest.Encode("path", taskName), @@ -121,8 +123,10 @@ func (client TasksClient) GetResourceGroupLevelTaskResponder(resp *http.Response // GetSubscriptionLevelTask recommended tasks that will help improve the security of the subscription proactively // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // taskName - name of the task object, will be a GUID -func (client TasksClient) GetSubscriptionLevelTask(ctx context.Context, taskName string) (result Task, err error) { +func (client TasksClient) GetSubscriptionLevelTask(ctx context.Context, ascLocation string, taskName string) (result Task, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.GetSubscriptionLevelTask") defer func() { @@ -139,7 +143,7 @@ func (client TasksClient) GetSubscriptionLevelTask(ctx context.Context, taskName return result, validation.NewError("security.TasksClient", "GetSubscriptionLevelTask", err.Error()) } - req, err := client.GetSubscriptionLevelTaskPreparer(ctx, taskName) + req, err := client.GetSubscriptionLevelTaskPreparer(ctx, ascLocation, taskName) if err != nil { err = autorest.NewErrorWithError(err, "security.TasksClient", "GetSubscriptionLevelTask", nil, "Failure preparing request") return @@ -162,9 +166,9 @@ func (client TasksClient) GetSubscriptionLevelTask(ctx context.Context, taskName } // GetSubscriptionLevelTaskPreparer prepares the GetSubscriptionLevelTask request. -func (client TasksClient) GetSubscriptionLevelTaskPreparer(ctx context.Context, taskName string) (*http.Request, error) { +func (client TasksClient) GetSubscriptionLevelTaskPreparer(ctx context.Context, ascLocation string, taskName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "taskName": autorest.Encode("path", taskName), } @@ -326,8 +330,10 @@ func (client TasksClient) ListComplete(ctx context.Context, filter string) (resu // ListByHomeRegion recommended tasks that will help improve the security of the subscription proactively // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // filter - oData filter. Optional. -func (client TasksClient) ListByHomeRegion(ctx context.Context, filter string) (result TaskListPage, err error) { +func (client TasksClient) ListByHomeRegion(ctx context.Context, ascLocation string, filter string) (result TaskListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.ListByHomeRegion") defer func() { @@ -345,7 +351,7 @@ func (client TasksClient) ListByHomeRegion(ctx context.Context, filter string) ( } result.fn = client.listByHomeRegionNextResults - req, err := client.ListByHomeRegionPreparer(ctx, filter) + req, err := client.ListByHomeRegionPreparer(ctx, ascLocation, filter) if err != nil { err = autorest.NewErrorWithError(err, "security.TasksClient", "ListByHomeRegion", nil, "Failure preparing request") return @@ -372,9 +378,9 @@ func (client TasksClient) ListByHomeRegion(ctx context.Context, filter string) ( } // ListByHomeRegionPreparer prepares the ListByHomeRegion request. -func (client TasksClient) ListByHomeRegionPreparer(ctx context.Context, filter string) (*http.Request, error) { +func (client TasksClient) ListByHomeRegionPreparer(ctx context.Context, ascLocation string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -434,7 +440,7 @@ func (client TasksClient) listByHomeRegionNextResults(ctx context.Context, lastR } // ListByHomeRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client TasksClient) ListByHomeRegionComplete(ctx context.Context, filter string) (result TaskListIterator, err error) { +func (client TasksClient) ListByHomeRegionComplete(ctx context.Context, ascLocation string, filter string) (result TaskListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.ListByHomeRegion") defer func() { @@ -445,7 +451,7 @@ func (client TasksClient) ListByHomeRegionComplete(ctx context.Context, filter s tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByHomeRegion(ctx, filter) + result.page, err = client.ListByHomeRegion(ctx, ascLocation, filter) return } @@ -453,8 +459,10 @@ func (client TasksClient) ListByHomeRegionComplete(ctx context.Context, filter s // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // filter - oData filter. Optional. -func (client TasksClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string) (result TaskListPage, err error) { +func (client TasksClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, ascLocation string, filter string) (result TaskListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.ListByResourceGroup") defer func() { @@ -476,7 +484,7 @@ func (client TasksClient) ListByResourceGroup(ctx context.Context, resourceGroup } result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, filter) + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, ascLocation, filter) if err != nil { err = autorest.NewErrorWithError(err, "security.TasksClient", "ListByResourceGroup", nil, "Failure preparing request") return @@ -503,9 +511,9 @@ func (client TasksClient) ListByResourceGroup(ctx context.Context, resourceGroup } // ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client TasksClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string) (*http.Request, error) { +func (client TasksClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, ascLocation string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -566,7 +574,7 @@ func (client TasksClient) listByResourceGroupNextResults(ctx context.Context, la } // ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client TasksClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string) (result TaskListIterator, err error) { +func (client TasksClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, ascLocation string, filter string) (result TaskListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.ListByResourceGroup") defer func() { @@ -577,7 +585,7 @@ func (client TasksClient) ListByResourceGroupComplete(ctx context.Context, resou tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, filter) + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, ascLocation, filter) return } @@ -586,9 +594,11 @@ func (client TasksClient) ListByResourceGroupComplete(ctx context.Context, resou // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // taskName - name of the task object, will be a GUID // taskUpdateActionType - type of the action to do on the task -func (client TasksClient) UpdateResourceGroupLevelTaskState(ctx context.Context, resourceGroupName string, taskName string, taskUpdateActionType string) (result autorest.Response, err error) { +func (client TasksClient) UpdateResourceGroupLevelTaskState(ctx context.Context, resourceGroupName string, ascLocation string, taskName string, taskUpdateActionType TaskUpdateActionType) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.UpdateResourceGroupLevelTaskState") defer func() { @@ -609,7 +619,7 @@ func (client TasksClient) UpdateResourceGroupLevelTaskState(ctx context.Context, return result, validation.NewError("security.TasksClient", "UpdateResourceGroupLevelTaskState", err.Error()) } - req, err := client.UpdateResourceGroupLevelTaskStatePreparer(ctx, resourceGroupName, taskName, taskUpdateActionType) + req, err := client.UpdateResourceGroupLevelTaskStatePreparer(ctx, resourceGroupName, ascLocation, taskName, taskUpdateActionType) if err != nil { err = autorest.NewErrorWithError(err, "security.TasksClient", "UpdateResourceGroupLevelTaskState", nil, "Failure preparing request") return @@ -632,9 +642,9 @@ func (client TasksClient) UpdateResourceGroupLevelTaskState(ctx context.Context, } // UpdateResourceGroupLevelTaskStatePreparer prepares the UpdateResourceGroupLevelTaskState request. -func (client TasksClient) UpdateResourceGroupLevelTaskStatePreparer(ctx context.Context, resourceGroupName string, taskName string, taskUpdateActionType string) (*http.Request, error) { +func (client TasksClient) UpdateResourceGroupLevelTaskStatePreparer(ctx context.Context, resourceGroupName string, ascLocation string, taskName string, taskUpdateActionType TaskUpdateActionType) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "taskName": autorest.Encode("path", taskName), @@ -674,9 +684,11 @@ func (client TasksClient) UpdateResourceGroupLevelTaskStateResponder(resp *http. // UpdateSubscriptionLevelTaskState recommended tasks that will help improve the security of the subscription // proactively // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // taskName - name of the task object, will be a GUID // taskUpdateActionType - type of the action to do on the task -func (client TasksClient) UpdateSubscriptionLevelTaskState(ctx context.Context, taskName string, taskUpdateActionType string) (result autorest.Response, err error) { +func (client TasksClient) UpdateSubscriptionLevelTaskState(ctx context.Context, ascLocation string, taskName string, taskUpdateActionType TaskUpdateActionType) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.UpdateSubscriptionLevelTaskState") defer func() { @@ -693,7 +705,7 @@ func (client TasksClient) UpdateSubscriptionLevelTaskState(ctx context.Context, return result, validation.NewError("security.TasksClient", "UpdateSubscriptionLevelTaskState", err.Error()) } - req, err := client.UpdateSubscriptionLevelTaskStatePreparer(ctx, taskName, taskUpdateActionType) + req, err := client.UpdateSubscriptionLevelTaskStatePreparer(ctx, ascLocation, taskName, taskUpdateActionType) if err != nil { err = autorest.NewErrorWithError(err, "security.TasksClient", "UpdateSubscriptionLevelTaskState", nil, "Failure preparing request") return @@ -716,9 +728,9 @@ func (client TasksClient) UpdateSubscriptionLevelTaskState(ctx context.Context, } // UpdateSubscriptionLevelTaskStatePreparer prepares the UpdateSubscriptionLevelTaskState request. -func (client TasksClient) UpdateSubscriptionLevelTaskStatePreparer(ctx context.Context, taskName string, taskUpdateActionType string) (*http.Request, error) { +func (client TasksClient) UpdateSubscriptionLevelTaskStatePreparer(ctx context.Context, ascLocation string, taskName string, taskUpdateActionType TaskUpdateActionType) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "taskName": autorest.Encode("path", taskName), "taskUpdateActionType": autorest.Encode("path", taskUpdateActionType), diff --git a/services/preview/security/mgmt/v2.0/security/topology.go b/services/preview/security/mgmt/v2.0/security/topology.go index ef1277abeb37..f0779ad4d394 100644 --- a/services/preview/security/mgmt/v2.0/security/topology.go +++ b/services/preview/security/mgmt/v2.0/security/topology.go @@ -21,22 +21,24 @@ type TopologyClient struct { } // NewTopologyClient creates an instance of the TopologyClient client. -func NewTopologyClient(subscriptionID string, ascLocation string) TopologyClient { - return NewTopologyClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewTopologyClient(subscriptionID string) TopologyClient { + return NewTopologyClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewTopologyClientWithBaseURI creates an instance of the TopologyClient 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 NewTopologyClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) TopologyClient { - return TopologyClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewTopologyClientWithBaseURI(baseURI string, subscriptionID string) TopologyClient { + return TopologyClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets a specific topology component. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // topologyResourceName - name of a topology resources collection. -func (client TopologyClient) Get(ctx context.Context, resourceGroupName string, topologyResourceName string) (result TopologyResource, err error) { +func (client TopologyClient) Get(ctx context.Context, resourceGroupName string, ascLocation string, topologyResourceName string) (result TopologyResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TopologyClient.Get") defer func() { @@ -57,7 +59,7 @@ func (client TopologyClient) Get(ctx context.Context, resourceGroupName string, return result, validation.NewError("security.TopologyClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, topologyResourceName) + req, err := client.GetPreparer(ctx, resourceGroupName, ascLocation, topologyResourceName) if err != nil { err = autorest.NewErrorWithError(err, "security.TopologyClient", "Get", nil, "Failure preparing request") return @@ -80,9 +82,9 @@ func (client TopologyClient) Get(ctx context.Context, resourceGroupName string, } // GetPreparer prepares the Get request. -func (client TopologyClient) GetPreparer(ctx context.Context, resourceGroupName string, topologyResourceName string) (*http.Request, error) { +func (client TopologyClient) GetPreparer(ctx context.Context, resourceGroupName string, ascLocation string, topologyResourceName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "topologyResourceName": autorest.Encode("path", topologyResourceName), @@ -239,7 +241,10 @@ func (client TopologyClient) ListComplete(ctx context.Context) (result TopologyL } // ListByHomeRegion gets a list that allows to build a topology view of a subscription and location. -func (client TopologyClient) ListByHomeRegion(ctx context.Context) (result TopologyListPage, err error) { +// Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations +func (client TopologyClient) ListByHomeRegion(ctx context.Context, ascLocation string) (result TopologyListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TopologyClient.ListByHomeRegion") defer func() { @@ -257,7 +262,7 @@ func (client TopologyClient) ListByHomeRegion(ctx context.Context) (result Topol } result.fn = client.listByHomeRegionNextResults - req, err := client.ListByHomeRegionPreparer(ctx) + req, err := client.ListByHomeRegionPreparer(ctx, ascLocation) if err != nil { err = autorest.NewErrorWithError(err, "security.TopologyClient", "ListByHomeRegion", nil, "Failure preparing request") return @@ -284,9 +289,9 @@ func (client TopologyClient) ListByHomeRegion(ctx context.Context) (result Topol } // ListByHomeRegionPreparer prepares the ListByHomeRegion request. -func (client TopologyClient) ListByHomeRegionPreparer(ctx context.Context) (*http.Request, error) { +func (client TopologyClient) ListByHomeRegionPreparer(ctx context.Context, ascLocation string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -343,7 +348,7 @@ func (client TopologyClient) listByHomeRegionNextResults(ctx context.Context, la } // ListByHomeRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client TopologyClient) ListByHomeRegionComplete(ctx context.Context) (result TopologyListIterator, err error) { +func (client TopologyClient) ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result TopologyListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TopologyClient.ListByHomeRegion") defer func() { @@ -354,6 +359,6 @@ func (client TopologyClient) ListByHomeRegionComplete(ctx context.Context) (resu tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByHomeRegion(ctx) + result.page, err = client.ListByHomeRegion(ctx, ascLocation) return } diff --git a/services/preview/security/mgmt/v2.0/security/workspacesettings.go b/services/preview/security/mgmt/v2.0/security/workspacesettings.go index 8b402a5755ec..8d7642baf7e0 100644 --- a/services/preview/security/mgmt/v2.0/security/workspacesettings.go +++ b/services/preview/security/mgmt/v2.0/security/workspacesettings.go @@ -21,15 +21,15 @@ type WorkspaceSettingsClient struct { } // NewWorkspaceSettingsClient creates an instance of the WorkspaceSettingsClient client. -func NewWorkspaceSettingsClient(subscriptionID string, ascLocation string) WorkspaceSettingsClient { - return NewWorkspaceSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewWorkspaceSettingsClient(subscriptionID string) WorkspaceSettingsClient { + return NewWorkspaceSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewWorkspaceSettingsClientWithBaseURI creates an instance of the WorkspaceSettingsClient 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 NewWorkspaceSettingsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) WorkspaceSettingsClient { - return WorkspaceSettingsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewWorkspaceSettingsClientWithBaseURI(baseURI string, subscriptionID string) WorkspaceSettingsClient { + return WorkspaceSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Create creating settings about where we should store your security data and logs diff --git a/services/preview/security/mgmt/v3.0/security/CHANGELOG.md b/services/preview/security/mgmt/v3.0/security/CHANGELOG.md index 52911e4cc5e4..1f8e184c8465 100644 --- a/services/preview/security/mgmt/v3.0/security/CHANGELOG.md +++ b/services/preview/security/mgmt/v3.0/security/CHANGELOG.md @@ -1,2 +1,1691 @@ -# Change History +# Unreleased +## Breaking Changes + +### Removed Constants + +1. AlertIntent.CommandAndControl +1. AlertIntent.Exploitation +1. AlertIntent.PreAttack +1. AlertIntent.Probing +1. AuthorizationState.Authorized +1. AuthorizationState.Unauthorized +1. DeviceCriticality.Important +1. DeviceStatus.DeviceStatusActive +1. DeviceStatus.DeviceStatusRemoved +1. EnforcementSupport.EnforcementSupportNotSupported +1. EnforcementSupport.EnforcementSupportSupported +1. EnforcementSupport.EnforcementSupportUnknown +1. MacSignificance.Primary +1. MacSignificance.Secondary +1. ManagementState.Managed +1. ManagementState.Unmanaged +1. OnboardingKind.Default +1. OnboardingKind.Evaluation +1. OnboardingKind.MigratedToAzure +1. OnboardingKind.Purchased +1. PricingTier.PricingTierFree +1. PricingTier.PricingTierStandard +1. ProgrammingState.NotProgrammingDevice +1. ProgrammingState.ProgrammingDevice +1. PurdueLevel.Enterprise +1. PurdueLevel.ProcessControl +1. PurdueLevel.Supervisory +1. RecommendationSeverity.RecommendationSeverityHealthy +1. RecommendationSeverity.RecommendationSeverityHigh +1. RecommendationSeverity.RecommendationSeverityLow +1. RecommendationSeverity.RecommendationSeverityMedium +1. RecommendationSeverity.RecommendationSeverityNotApplicable +1. RecommendationSeverity.RecommendationSeverityOffByPolicy +1. RecommendationSeverity.RecommendationSeverityUnknown +1. RelationToIPStatus.Certain +1. RelationToIPStatus.Guess +1. ScanningFunctionality.NotScannerDevice +1. ScanningFunctionality.ScannerDevice +1. SensorStatus.Disconnected +1. SensorStatus.Ok +1. SensorStatus.Unavailable +1. SensorType.SensorTypeEnterprise +1. SensorType.SensorTypeOt +1. TiStatus.TiStatusFailed +1. TiStatus.TiStatusInProgress +1. TiStatus.TiStatusOk +1. TiStatus.TiStatusUpdateAvailable +1. VersionKind.Latest +1. VersionKind.Preview +1. VersionKind.Previous + +### Removed Funcs + +1. *AlertsSimulateFuture.UnmarshalJSON([]byte) error +1. *AssessmentMetadataListIterator.Next() error +1. *AssessmentMetadataListIterator.NextWithContext(context.Context) error +1. *AssessmentMetadataListPage.Next() error +1. *AssessmentMetadataListPage.NextWithContext(context.Context) error +1. *Device.UnmarshalJSON([]byte) error +1. *DeviceListIterator.Next() error +1. *DeviceListIterator.NextWithContext(context.Context) error +1. *DeviceListPage.Next() error +1. *DeviceListPage.NextWithContext(context.Context) error +1. *IotAlertListModelIterator.Next() error +1. *IotAlertListModelIterator.NextWithContext(context.Context) error +1. *IotAlertListModelPage.Next() error +1. *IotAlertListModelPage.NextWithContext(context.Context) error +1. *IotAlertModel.UnmarshalJSON([]byte) error +1. *IotAlertType.UnmarshalJSON([]byte) error +1. *IotDefenderSettingsModel.UnmarshalJSON([]byte) error +1. *IotRecommendationListModelIterator.Next() error +1. *IotRecommendationListModelIterator.NextWithContext(context.Context) error +1. *IotRecommendationListModelPage.Next() error +1. *IotRecommendationListModelPage.NextWithContext(context.Context) error +1. *IotRecommendationModel.UnmarshalJSON([]byte) error +1. *IotRecommendationType.UnmarshalJSON([]byte) error +1. *IotSensorsModel.UnmarshalJSON([]byte) error +1. *IotSitesModel.UnmarshalJSON([]byte) error +1. AssessmentMetadataList.IsEmpty() bool +1. AssessmentMetadataList.MarshalJSON() ([]byte, error) +1. AssessmentMetadataListIterator.NotDone() bool +1. AssessmentMetadataListIterator.Response() AssessmentMetadataList +1. AssessmentMetadataListIterator.Value() AssessmentMetadata +1. AssessmentMetadataListPage.NotDone() bool +1. AssessmentMetadataListPage.Response() AssessmentMetadataList +1. AssessmentMetadataListPage.Values() []AssessmentMetadata +1. Device.MarshalJSON() ([]byte, error) +1. DeviceClient.Get(context.Context, string, string) (Device, error) +1. DeviceClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. DeviceClient.GetResponder(*http.Response) (Device, error) +1. DeviceClient.GetSender(*http.Request) (*http.Response, error) +1. DeviceList.IsEmpty() bool +1. DeviceList.MarshalJSON() ([]byte, error) +1. DeviceListIterator.NotDone() bool +1. DeviceListIterator.Response() DeviceList +1. DeviceListIterator.Value() Device +1. DeviceListPage.NotDone() bool +1. DeviceListPage.Response() DeviceList +1. DeviceListPage.Values() []Device +1. DeviceProperties.MarshalJSON() ([]byte, error) +1. DevicesForHubClient.List(context.Context, string, *int32, string, ManagementState) (DeviceListPage, error) +1. DevicesForHubClient.ListComplete(context.Context, string, *int32, string, ManagementState) (DeviceListIterator, error) +1. DevicesForHubClient.ListPreparer(context.Context, string, *int32, string, ManagementState) (*http.Request, error) +1. DevicesForHubClient.ListResponder(*http.Response) (DeviceList, error) +1. DevicesForHubClient.ListSender(*http.Request) (*http.Response, error) +1. DevicesForSubscriptionClient.List(context.Context, *int32, string, ManagementState) (DeviceListPage, error) +1. DevicesForSubscriptionClient.ListComplete(context.Context, *int32, string, ManagementState) (DeviceListIterator, error) +1. DevicesForSubscriptionClient.ListPreparer(context.Context, *int32, string, ManagementState) (*http.Request, error) +1. DevicesForSubscriptionClient.ListResponder(*http.Response) (DeviceList, error) +1. DevicesForSubscriptionClient.ListSender(*http.Request) (*http.Response, error) +1. Firmware.MarshalJSON() ([]byte, error) +1. IPAddress.MarshalJSON() ([]byte, error) +1. IotAlertListModel.IsEmpty() bool +1. IotAlertListModel.MarshalJSON() ([]byte, error) +1. IotAlertListModelIterator.NotDone() bool +1. IotAlertListModelIterator.Response() IotAlertListModel +1. IotAlertListModelIterator.Value() IotAlertModel +1. IotAlertListModelPage.NotDone() bool +1. IotAlertListModelPage.Response() IotAlertListModel +1. IotAlertListModelPage.Values() []IotAlertModel +1. IotAlertModel.MarshalJSON() ([]byte, error) +1. IotAlertPropertiesModel.MarshalJSON() ([]byte, error) +1. IotAlertType.MarshalJSON() ([]byte, error) +1. IotAlertTypeProperties.MarshalJSON() ([]byte, error) +1. IotAlertTypesClient.Get(context.Context, string) (IotAlertType, error) +1. IotAlertTypesClient.GetPreparer(context.Context, string) (*http.Request, error) +1. IotAlertTypesClient.GetResponder(*http.Response) (IotAlertType, error) +1. IotAlertTypesClient.GetSender(*http.Request) (*http.Response, error) +1. IotAlertTypesClient.List(context.Context) (IotAlertTypeList, error) +1. IotAlertTypesClient.ListPreparer(context.Context) (*http.Request, error) +1. IotAlertTypesClient.ListResponder(*http.Response) (IotAlertTypeList, error) +1. IotAlertTypesClient.ListSender(*http.Request) (*http.Response, error) +1. IotAlertsClient.Get(context.Context, string, string) (IotAlertModel, error) +1. IotAlertsClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. IotAlertsClient.GetResponder(*http.Response) (IotAlertModel, error) +1. IotAlertsClient.GetSender(*http.Request) (*http.Response, error) +1. IotAlertsClient.List(context.Context, string, string, string, string, ManagementState, string, *int32, string) (IotAlertListModelPage, error) +1. IotAlertsClient.ListComplete(context.Context, string, string, string, string, ManagementState, string, *int32, string) (IotAlertListModelIterator, error) +1. IotAlertsClient.ListPreparer(context.Context, string, string, string, string, ManagementState, string, *int32, string) (*http.Request, error) +1. IotAlertsClient.ListResponder(*http.Response) (IotAlertListModel, error) +1. IotAlertsClient.ListSender(*http.Request) (*http.Response, error) +1. IotDefenderSettingsClient.CreateOrUpdate(context.Context, IotDefenderSettingsModel) (IotDefenderSettingsModel, error) +1. IotDefenderSettingsClient.CreateOrUpdatePreparer(context.Context, IotDefenderSettingsModel) (*http.Request, error) +1. IotDefenderSettingsClient.CreateOrUpdateResponder(*http.Response) (IotDefenderSettingsModel, error) +1. IotDefenderSettingsClient.CreateOrUpdateSender(*http.Request) (*http.Response, error) +1. IotDefenderSettingsClient.Delete(context.Context) (autorest.Response, error) +1. IotDefenderSettingsClient.DeletePreparer(context.Context) (*http.Request, error) +1. IotDefenderSettingsClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. IotDefenderSettingsClient.DeleteSender(*http.Request) (*http.Response, error) +1. IotDefenderSettingsClient.DownloadManagerActivation(context.Context) (ReadCloser, error) +1. IotDefenderSettingsClient.DownloadManagerActivationPreparer(context.Context) (*http.Request, error) +1. IotDefenderSettingsClient.DownloadManagerActivationResponder(*http.Response) (ReadCloser, error) +1. IotDefenderSettingsClient.DownloadManagerActivationSender(*http.Request) (*http.Response, error) +1. IotDefenderSettingsClient.Get(context.Context) (IotDefenderSettingsModel, error) +1. IotDefenderSettingsClient.GetPreparer(context.Context) (*http.Request, error) +1. IotDefenderSettingsClient.GetResponder(*http.Response) (IotDefenderSettingsModel, error) +1. IotDefenderSettingsClient.GetSender(*http.Request) (*http.Response, error) +1. IotDefenderSettingsClient.List(context.Context) (IotDefenderSettingsList, error) +1. IotDefenderSettingsClient.ListPreparer(context.Context) (*http.Request, error) +1. IotDefenderSettingsClient.ListResponder(*http.Response) (IotDefenderSettingsList, error) +1. IotDefenderSettingsClient.ListSender(*http.Request) (*http.Response, error) +1. IotDefenderSettingsClient.PackageDownloadsMethod(context.Context) (PackageDownloads, error) +1. IotDefenderSettingsClient.PackageDownloadsMethodPreparer(context.Context) (*http.Request, error) +1. IotDefenderSettingsClient.PackageDownloadsMethodResponder(*http.Response) (PackageDownloads, error) +1. IotDefenderSettingsClient.PackageDownloadsMethodSender(*http.Request) (*http.Response, error) +1. IotDefenderSettingsList.MarshalJSON() ([]byte, error) +1. IotDefenderSettingsModel.MarshalJSON() ([]byte, error) +1. IotDefenderSettingsProperties.MarshalJSON() ([]byte, error) +1. IotRecommendationListModel.IsEmpty() bool +1. IotRecommendationListModel.MarshalJSON() ([]byte, error) +1. IotRecommendationListModelIterator.NotDone() bool +1. IotRecommendationListModelIterator.Response() IotRecommendationListModel +1. IotRecommendationListModelIterator.Value() IotRecommendationModel +1. IotRecommendationListModelPage.NotDone() bool +1. IotRecommendationListModelPage.Response() IotRecommendationListModel +1. IotRecommendationListModelPage.Values() []IotRecommendationModel +1. IotRecommendationModel.MarshalJSON() ([]byte, error) +1. IotRecommendationPropertiesModel.MarshalJSON() ([]byte, error) +1. IotRecommendationType.MarshalJSON() ([]byte, error) +1. IotRecommendationTypeProperties.MarshalJSON() ([]byte, error) +1. IotRecommendationTypesClient.Get(context.Context, string) (IotRecommendationType, error) +1. IotRecommendationTypesClient.GetPreparer(context.Context, string) (*http.Request, error) +1. IotRecommendationTypesClient.GetResponder(*http.Response) (IotRecommendationType, error) +1. IotRecommendationTypesClient.GetSender(*http.Request) (*http.Response, error) +1. IotRecommendationTypesClient.List(context.Context) (IotRecommendationTypeList, error) +1. IotRecommendationTypesClient.ListPreparer(context.Context) (*http.Request, error) +1. IotRecommendationTypesClient.ListResponder(*http.Response) (IotRecommendationTypeList, error) +1. IotRecommendationTypesClient.ListSender(*http.Request) (*http.Response, error) +1. IotRecommendationsClient.Get(context.Context, string, string) (IotRecommendationModel, error) +1. IotRecommendationsClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. IotRecommendationsClient.GetResponder(*http.Response) (IotRecommendationModel, error) +1. IotRecommendationsClient.GetSender(*http.Request) (*http.Response, error) +1. IotRecommendationsClient.List(context.Context, string, string, string, *int32, string) (IotRecommendationListModelPage, error) +1. IotRecommendationsClient.ListComplete(context.Context, string, string, string, *int32, string) (IotRecommendationListModelIterator, error) +1. IotRecommendationsClient.ListPreparer(context.Context, string, string, string, *int32, string) (*http.Request, error) +1. IotRecommendationsClient.ListResponder(*http.Response) (IotRecommendationListModel, error) +1. IotRecommendationsClient.ListSender(*http.Request) (*http.Response, error) +1. IotSensorProperties.MarshalJSON() ([]byte, error) +1. IotSensorsClient.CreateOrUpdate(context.Context, string, string, IotSensorsModel) (IotSensorsModel, error) +1. IotSensorsClient.CreateOrUpdatePreparer(context.Context, string, string, IotSensorsModel) (*http.Request, error) +1. IotSensorsClient.CreateOrUpdateResponder(*http.Response) (IotSensorsModel, error) +1. IotSensorsClient.CreateOrUpdateSender(*http.Request) (*http.Response, error) +1. IotSensorsClient.Delete(context.Context, string, string) (autorest.Response, error) +1. IotSensorsClient.DeletePreparer(context.Context, string, string) (*http.Request, error) +1. IotSensorsClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. IotSensorsClient.DeleteSender(*http.Request) (*http.Response, error) +1. IotSensorsClient.DownloadActivation(context.Context, string, string) (ReadCloser, error) +1. IotSensorsClient.DownloadActivationPreparer(context.Context, string, string) (*http.Request, error) +1. IotSensorsClient.DownloadActivationResponder(*http.Response) (ReadCloser, error) +1. IotSensorsClient.DownloadActivationSender(*http.Request) (*http.Response, error) +1. IotSensorsClient.DownloadResetPassword(context.Context, string, string, ResetPasswordInput) (ReadCloser, error) +1. IotSensorsClient.DownloadResetPasswordPreparer(context.Context, string, string, ResetPasswordInput) (*http.Request, error) +1. IotSensorsClient.DownloadResetPasswordResponder(*http.Response) (ReadCloser, error) +1. IotSensorsClient.DownloadResetPasswordSender(*http.Request) (*http.Response, error) +1. IotSensorsClient.Get(context.Context, string, string) (IotSensorsModel, error) +1. IotSensorsClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. IotSensorsClient.GetResponder(*http.Response) (IotSensorsModel, error) +1. IotSensorsClient.GetSender(*http.Request) (*http.Response, error) +1. IotSensorsClient.List(context.Context, string) (IotSensorsList, error) +1. IotSensorsClient.ListPreparer(context.Context, string) (*http.Request, error) +1. IotSensorsClient.ListResponder(*http.Response) (IotSensorsList, error) +1. IotSensorsClient.ListSender(*http.Request) (*http.Response, error) +1. IotSensorsClient.TriggerTiPackageUpdate(context.Context, string, string) (autorest.Response, error) +1. IotSensorsClient.TriggerTiPackageUpdatePreparer(context.Context, string, string) (*http.Request, error) +1. IotSensorsClient.TriggerTiPackageUpdateResponder(*http.Response) (autorest.Response, error) +1. IotSensorsClient.TriggerTiPackageUpdateSender(*http.Request) (*http.Response, error) +1. IotSensorsList.MarshalJSON() ([]byte, error) +1. IotSensorsModel.MarshalJSON() ([]byte, error) +1. IotSiteProperties.MarshalJSON() ([]byte, error) +1. IotSitesClient.CreateOrUpdate(context.Context, string, IotSitesModel) (IotSitesModel, error) +1. IotSitesClient.CreateOrUpdatePreparer(context.Context, string, IotSitesModel) (*http.Request, error) +1. IotSitesClient.CreateOrUpdateResponder(*http.Response) (IotSitesModel, error) +1. IotSitesClient.CreateOrUpdateSender(*http.Request) (*http.Response, error) +1. IotSitesClient.Delete(context.Context, string) (autorest.Response, error) +1. IotSitesClient.DeletePreparer(context.Context, string) (*http.Request, error) +1. IotSitesClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. IotSitesClient.DeleteSender(*http.Request) (*http.Response, error) +1. IotSitesClient.Get(context.Context, string) (IotSitesModel, error) +1. IotSitesClient.GetPreparer(context.Context, string) (*http.Request, error) +1. IotSitesClient.GetResponder(*http.Response) (IotSitesModel, error) +1. IotSitesClient.GetSender(*http.Request) (*http.Response, error) +1. IotSitesClient.List(context.Context, string) (IotSitesList, error) +1. IotSitesClient.ListPreparer(context.Context, string) (*http.Request, error) +1. IotSitesClient.ListResponder(*http.Response) (IotSitesList, error) +1. IotSitesClient.ListSender(*http.Request) (*http.Response, error) +1. IotSitesList.MarshalJSON() ([]byte, error) +1. IotSitesModel.MarshalJSON() ([]byte, error) +1. MacAddress.MarshalJSON() ([]byte, error) +1. NetworkInterface.MarshalJSON() ([]byte, error) +1. NewAssessmentMetadataListIterator(AssessmentMetadataListPage) AssessmentMetadataListIterator +1. NewAssessmentMetadataListPage(AssessmentMetadataList, func(context.Context, AssessmentMetadataList) (AssessmentMetadataList, error)) AssessmentMetadataListPage +1. NewDeviceClient(string, string) DeviceClient +1. NewDeviceClientWithBaseURI(string, string, string) DeviceClient +1. NewDeviceListIterator(DeviceListPage) DeviceListIterator +1. NewDeviceListPage(DeviceList, func(context.Context, DeviceList) (DeviceList, error)) DeviceListPage +1. NewDevicesForHubClient(string, string) DevicesForHubClient +1. NewDevicesForHubClientWithBaseURI(string, string, string) DevicesForHubClient +1. NewDevicesForSubscriptionClient(string, string) DevicesForSubscriptionClient +1. NewDevicesForSubscriptionClientWithBaseURI(string, string, string) DevicesForSubscriptionClient +1. NewIotAlertListModelIterator(IotAlertListModelPage) IotAlertListModelIterator +1. NewIotAlertListModelPage(IotAlertListModel, func(context.Context, IotAlertListModel) (IotAlertListModel, error)) IotAlertListModelPage +1. NewIotAlertTypesClient(string, string) IotAlertTypesClient +1. NewIotAlertTypesClientWithBaseURI(string, string, string) IotAlertTypesClient +1. NewIotAlertsClient(string, string) IotAlertsClient +1. NewIotAlertsClientWithBaseURI(string, string, string) IotAlertsClient +1. NewIotDefenderSettingsClient(string, string) IotDefenderSettingsClient +1. NewIotDefenderSettingsClientWithBaseURI(string, string, string) IotDefenderSettingsClient +1. NewIotRecommendationListModelIterator(IotRecommendationListModelPage) IotRecommendationListModelIterator +1. NewIotRecommendationListModelPage(IotRecommendationListModel, func(context.Context, IotRecommendationListModel) (IotRecommendationListModel, error)) IotRecommendationListModelPage +1. NewIotRecommendationTypesClient(string, string) IotRecommendationTypesClient +1. NewIotRecommendationTypesClientWithBaseURI(string, string, string) IotRecommendationTypesClient +1. NewIotRecommendationsClient(string, string) IotRecommendationsClient +1. NewIotRecommendationsClientWithBaseURI(string, string, string) IotRecommendationsClient +1. NewIotSensorsClient(string, string) IotSensorsClient +1. NewIotSensorsClientWithBaseURI(string, string, string) IotSensorsClient +1. NewIotSitesClient(string, string) IotSitesClient +1. NewIotSitesClientWithBaseURI(string, string, string) IotSitesClient +1. NewOnPremiseIotSensorsClient(string, string) OnPremiseIotSensorsClient +1. NewOnPremiseIotSensorsClientWithBaseURI(string, string, string) OnPremiseIotSensorsClient +1. OnPremiseIotSensor.MarshalJSON() ([]byte, error) +1. OnPremiseIotSensorsClient.CreateOrUpdate(context.Context, string) (OnPremiseIotSensor, error) +1. OnPremiseIotSensorsClient.CreateOrUpdatePreparer(context.Context, string) (*http.Request, error) +1. OnPremiseIotSensorsClient.CreateOrUpdateResponder(*http.Response) (OnPremiseIotSensor, error) +1. OnPremiseIotSensorsClient.CreateOrUpdateSender(*http.Request) (*http.Response, error) +1. OnPremiseIotSensorsClient.Delete(context.Context, string) (autorest.Response, error) +1. OnPremiseIotSensorsClient.DeletePreparer(context.Context, string) (*http.Request, error) +1. OnPremiseIotSensorsClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. OnPremiseIotSensorsClient.DeleteSender(*http.Request) (*http.Response, error) +1. OnPremiseIotSensorsClient.DownloadActivation(context.Context, string) (ReadCloser, error) +1. OnPremiseIotSensorsClient.DownloadActivationPreparer(context.Context, string) (*http.Request, error) +1. OnPremiseIotSensorsClient.DownloadActivationResponder(*http.Response) (ReadCloser, error) +1. OnPremiseIotSensorsClient.DownloadActivationSender(*http.Request) (*http.Response, error) +1. OnPremiseIotSensorsClient.DownloadResetPassword(context.Context, string, ResetPasswordInput) (ReadCloser, error) +1. OnPremiseIotSensorsClient.DownloadResetPasswordPreparer(context.Context, string, ResetPasswordInput) (*http.Request, error) +1. OnPremiseIotSensorsClient.DownloadResetPasswordResponder(*http.Response) (ReadCloser, error) +1. OnPremiseIotSensorsClient.DownloadResetPasswordSender(*http.Request) (*http.Response, error) +1. OnPremiseIotSensorsClient.Get(context.Context, string) (OnPremiseIotSensor, error) +1. OnPremiseIotSensorsClient.GetPreparer(context.Context, string) (*http.Request, error) +1. OnPremiseIotSensorsClient.GetResponder(*http.Response) (OnPremiseIotSensor, error) +1. OnPremiseIotSensorsClient.GetSender(*http.Request) (*http.Response, error) +1. OnPremiseIotSensorsClient.List(context.Context) (OnPremiseIotSensorsList, error) +1. OnPremiseIotSensorsClient.ListPreparer(context.Context) (*http.Request, error) +1. OnPremiseIotSensorsClient.ListResponder(*http.Response) (OnPremiseIotSensorsList, error) +1. OnPremiseIotSensorsClient.ListSender(*http.Request) (*http.Response, error) +1. OnPremiseIotSensorsList.MarshalJSON() ([]byte, error) +1. PackageDownloadInfo.MarshalJSON() ([]byte, error) +1. PackageDownloads.MarshalJSON() ([]byte, error) +1. PackageDownloadsCentralManager.MarshalJSON() ([]byte, error) +1. PackageDownloadsCentralManagerFull.MarshalJSON() ([]byte, error) +1. PackageDownloadsCentralManagerFullOvf.MarshalJSON() ([]byte, error) +1. PackageDownloadsSensor.MarshalJSON() ([]byte, error) +1. PackageDownloadsSensorFull.MarshalJSON() ([]byte, error) +1. PackageDownloadsSensorFullOvf.MarshalJSON() ([]byte, error) +1. PossibleAlertIntentValues() []AlertIntent +1. PossibleAuthorizationStateValues() []AuthorizationState +1. PossibleDeviceCriticalityValues() []DeviceCriticality +1. PossibleDeviceStatusValues() []DeviceStatus +1. PossibleMacSignificanceValues() []MacSignificance +1. PossibleManagementStateValues() []ManagementState +1. PossibleOnboardingKindValues() []OnboardingKind +1. PossibleProgrammingStateValues() []ProgrammingState +1. PossiblePurdueLevelValues() []PurdueLevel +1. PossibleRecommendationSeverityValues() []RecommendationSeverity +1. PossibleRelationToIPStatusValues() []RelationToIPStatus +1. PossibleScanningFunctionalityValues() []ScanningFunctionality +1. PossibleSensorStatusValues() []SensorStatus +1. PossibleSensorTypeValues() []SensorType +1. PossibleTiStatusValues() []TiStatus +1. PossibleVersionKindValues() []VersionKind +1. Protocol1.MarshalJSON() ([]byte, error) +1. Sensor.MarshalJSON() ([]byte, error) +1. Site.MarshalJSON() ([]byte, error) +1. UpgradePackageDownloadInfo.MarshalJSON() ([]byte, error) + +### Struct Changes + +#### Removed Structs + +1. AlertsSimulateFuture +1. AssessmentMetadataList +1. AssessmentMetadataListIterator +1. AssessmentMetadataListPage +1. Device +1. DeviceClient +1. DeviceList +1. DeviceListIterator +1. DeviceListPage +1. DeviceProperties +1. DevicesForHubClient +1. DevicesForSubscriptionClient +1. Firmware +1. IPAddress +1. IotAlertListModel +1. IotAlertListModelIterator +1. IotAlertListModelPage +1. IotAlertModel +1. IotAlertPropertiesModel +1. IotAlertType +1. IotAlertTypeList +1. IotAlertTypeProperties +1. IotAlertTypesClient +1. IotAlertsClient +1. IotDefenderSettingsClient +1. IotDefenderSettingsList +1. IotDefenderSettingsModel +1. IotDefenderSettingsProperties +1. IotRecommendationListModel +1. IotRecommendationListModelIterator +1. IotRecommendationListModelPage +1. IotRecommendationModel +1. IotRecommendationPropertiesModel +1. IotRecommendationType +1. IotRecommendationTypeList +1. IotRecommendationTypeProperties +1. IotRecommendationTypesClient +1. IotRecommendationsClient +1. IotSensorProperties +1. IotSensorsClient +1. IotSensorsList +1. IotSensorsModel +1. IotSiteProperties +1. IotSitesClient +1. IotSitesList +1. IotSitesModel +1. MacAddress +1. NetworkInterface +1. OnPremiseIotSensor +1. OnPremiseIotSensorsClient +1. OnPremiseIotSensorsList +1. PackageDownloadInfo +1. PackageDownloads +1. PackageDownloadsCentralManager +1. PackageDownloadsCentralManagerFull +1. PackageDownloadsCentralManagerFullOvf +1. PackageDownloadsSensor +1. PackageDownloadsSensorFull +1. PackageDownloadsSensorFullOvf +1. Protocol1 +1. ReadCloser +1. ResetPasswordInput +1. Sensor +1. Site +1. UpgradePackageDownloadInfo + +#### Removed Struct Fields + +1. Assessment.autorest.Response +1. AssessmentMetadata.autorest.Response +1. BaseClient.AscLocation + +### Signature Changes + +#### Const Types + +1. Collection changed type from AlertIntent to Tactics +1. CredentialAccess changed type from AlertIntent to Tactics +1. DefenseEvasion changed type from AlertIntent to Tactics +1. Discovery changed type from AlertIntent to Tactics +1. Execution changed type from AlertIntent to Tactics +1. Exfiltration changed type from AlertIntent to Tactics +1. Impact changed type from AlertIntent to Tactics +1. InitialAccess changed type from AlertIntent to Tactics +1. LateralMovement changed type from AlertIntent to Tactics +1. Persistence changed type from AlertIntent to Tactics +1. PrivilegeEscalation changed type from AlertIntent to Tactics +1. Standard changed type from DeviceCriticality to PricingTier +1. Unknown changed type from AlertIntent to EnforcementSupport + +#### Funcs + +1. AdaptiveApplicationControlsClient.Delete + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AdaptiveApplicationControlsClient.DeletePreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AdaptiveApplicationControlsClient.Get + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AdaptiveApplicationControlsClient.GetPreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AdaptiveApplicationControlsClient.Put + - Params + - From: context.Context, string, AdaptiveApplicationControlGroup + - To: context.Context, string, string, AdaptiveApplicationControlGroup +1. AdaptiveApplicationControlsClient.PutPreparer + - Params + - From: context.Context, string, AdaptiveApplicationControlGroup + - To: context.Context, string, string, AdaptiveApplicationControlGroup +1. AlertsClient.GetResourceGroupLevel + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. AlertsClient.GetResourceGroupLevelPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. AlertsClient.GetSubscriptionLevel + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AlertsClient.GetSubscriptionLevelPreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AlertsClient.ListResourceGroupLevelByRegion + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AlertsClient.ListResourceGroupLevelByRegionComplete + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AlertsClient.ListResourceGroupLevelByRegionPreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AlertsClient.ListSubscriptionLevelByRegion + - Params + - From: context.Context + - To: context.Context, string +1. AlertsClient.ListSubscriptionLevelByRegionComplete + - Params + - From: context.Context + - To: context.Context, string +1. AlertsClient.ListSubscriptionLevelByRegionPreparer + - Params + - From: context.Context + - To: context.Context, string +1. AlertsClient.Simulate + - Params + - From: context.Context, AlertSimulatorRequestBody + - To: context.Context, string, AlertSimulatorRequestBody + - Returns + - From: AlertsSimulateFuture, error + - To: autorest.Response, error +1. AlertsClient.SimulatePreparer + - Params + - From: context.Context, AlertSimulatorRequestBody + - To: context.Context, string, AlertSimulatorRequestBody +1. AlertsClient.SimulateSender + - Returns + - From: AlertsSimulateFuture, error + - To: *http.Response, error +1. AlertsClient.UpdateResourceGroupLevelStateToActivate + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. AlertsClient.UpdateResourceGroupLevelStateToActivatePreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. AlertsClient.UpdateResourceGroupLevelStateToDismiss + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. AlertsClient.UpdateResourceGroupLevelStateToDismissPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. AlertsClient.UpdateResourceGroupLevelStateToResolve + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. AlertsClient.UpdateResourceGroupLevelStateToResolvePreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. AlertsClient.UpdateSubscriptionLevelStateToActivate + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AlertsClient.UpdateSubscriptionLevelStateToActivatePreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AlertsClient.UpdateSubscriptionLevelStateToDismiss + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AlertsClient.UpdateSubscriptionLevelStateToDismissPreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AlertsClient.UpdateSubscriptionLevelStateToResolve + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AlertsClient.UpdateSubscriptionLevelStateToResolvePreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. AllowedConnectionsClient.Get + - Params + - From: context.Context, string, ConnectionType + - To: context.Context, string, string, ConnectionType +1. AllowedConnectionsClient.GetPreparer + - Params + - From: context.Context, string, ConnectionType + - To: context.Context, string, string, ConnectionType +1. AllowedConnectionsClient.ListByHomeRegion + - Params + - From: context.Context + - To: context.Context, string +1. AllowedConnectionsClient.ListByHomeRegionComplete + - Params + - From: context.Context + - To: context.Context, string +1. AllowedConnectionsClient.ListByHomeRegionPreparer + - Params + - From: context.Context + - To: context.Context, string +1. AssessmentListIterator.Value + - Returns + - From: Assessment + - To: AssessmentResponse +1. AssessmentListPage.Values + - Returns + - From: []Assessment + - To: []AssessmentResponse +1. AssessmentsClient.CreateOrUpdate + - Returns + - From: Assessment, error + - To: AssessmentResponse, error +1. AssessmentsClient.CreateOrUpdateResponder + - Returns + - From: Assessment, error + - To: AssessmentResponse, error +1. AssessmentsClient.Get + - Returns + - From: Assessment, error + - To: AssessmentResponse, error +1. AssessmentsClient.GetResponder + - Returns + - From: Assessment, error + - To: AssessmentResponse, error +1. AssessmentsMetadataClient.CreateInSubscription + - Params + - From: context.Context, string, AssessmentMetadata + - To: context.Context, string, AssessmentMetadataResponse + - Returns + - From: AssessmentMetadata, error + - To: AssessmentMetadataResponse, error +1. AssessmentsMetadataClient.CreateInSubscriptionPreparer + - Params + - From: context.Context, string, AssessmentMetadata + - To: context.Context, string, AssessmentMetadataResponse +1. AssessmentsMetadataClient.CreateInSubscriptionResponder + - Returns + - From: AssessmentMetadata, error + - To: AssessmentMetadataResponse, error +1. AssessmentsMetadataClient.Get + - Returns + - From: AssessmentMetadata, error + - To: AssessmentMetadataResponse, error +1. AssessmentsMetadataClient.GetInSubscription + - Returns + - From: AssessmentMetadata, error + - To: AssessmentMetadataResponse, error +1. AssessmentsMetadataClient.GetInSubscriptionResponder + - Returns + - From: AssessmentMetadata, error + - To: AssessmentMetadataResponse, error +1. AssessmentsMetadataClient.GetResponder + - Returns + - From: AssessmentMetadata, error + - To: AssessmentMetadataResponse, error +1. AssessmentsMetadataClient.List + - Returns + - From: AssessmentMetadataListPage, error + - To: AssessmentMetadataResponseListPage, error +1. AssessmentsMetadataClient.ListBySubscription + - Returns + - From: AssessmentMetadataListPage, error + - To: AssessmentMetadataResponseListPage, error +1. AssessmentsMetadataClient.ListBySubscriptionComplete + - Returns + - From: AssessmentMetadataListIterator, error + - To: AssessmentMetadataResponseListIterator, error +1. AssessmentsMetadataClient.ListBySubscriptionResponder + - Returns + - From: AssessmentMetadataList, error + - To: AssessmentMetadataResponseList, error +1. AssessmentsMetadataClient.ListComplete + - Returns + - From: AssessmentMetadataListIterator, error + - To: AssessmentMetadataResponseListIterator, error +1. AssessmentsMetadataClient.ListResponder + - Returns + - From: AssessmentMetadataList, error + - To: AssessmentMetadataResponseList, error +1. DiscoveredSecuritySolutionsClient.Get + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. DiscoveredSecuritySolutionsClient.GetPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. DiscoveredSecuritySolutionsClient.ListByHomeRegion + - Params + - From: context.Context + - To: context.Context, string +1. DiscoveredSecuritySolutionsClient.ListByHomeRegionComplete + - Params + - From: context.Context + - To: context.Context, string +1. DiscoveredSecuritySolutionsClient.ListByHomeRegionPreparer + - Params + - From: context.Context + - To: context.Context, string +1. ExternalSecuritySolutionsClient.Get + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. ExternalSecuritySolutionsClient.GetPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. ExternalSecuritySolutionsClient.ListByHomeRegion + - Params + - From: context.Context + - To: context.Context, string +1. ExternalSecuritySolutionsClient.ListByHomeRegionComplete + - Params + - From: context.Context + - To: context.Context, string +1. ExternalSecuritySolutionsClient.ListByHomeRegionPreparer + - Params + - From: context.Context + - To: context.Context, string +1. InformationProtectionPoliciesClient.CreateOrUpdate + - Params + - From: context.Context, string, string, InformationProtectionPolicy + - To: context.Context, string, InformationProtectionPolicyName, InformationProtectionPolicy +1. InformationProtectionPoliciesClient.CreateOrUpdatePreparer + - Params + - From: context.Context, string, string, InformationProtectionPolicy + - To: context.Context, string, InformationProtectionPolicyName, InformationProtectionPolicy +1. InformationProtectionPoliciesClient.Get + - Params + - From: context.Context, string, string + - To: context.Context, string, InformationProtectionPolicyName +1. InformationProtectionPoliciesClient.GetPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, InformationProtectionPolicyName +1. JitNetworkAccessPoliciesClient.CreateOrUpdate + - Params + - From: context.Context, string, string, JitNetworkAccessPolicy + - To: context.Context, string, string, string, JitNetworkAccessPolicy +1. JitNetworkAccessPoliciesClient.CreateOrUpdatePreparer + - Params + - From: context.Context, string, string, JitNetworkAccessPolicy + - To: context.Context, string, string, string, JitNetworkAccessPolicy +1. JitNetworkAccessPoliciesClient.Delete + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. JitNetworkAccessPoliciesClient.DeletePreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. JitNetworkAccessPoliciesClient.Get + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. JitNetworkAccessPoliciesClient.GetPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. JitNetworkAccessPoliciesClient.Initiate + - Params + - From: context.Context, string, string, JitNetworkAccessPolicyInitiateRequest + - To: context.Context, string, string, string, JitNetworkAccessPolicyInitiateRequest +1. JitNetworkAccessPoliciesClient.InitiatePreparer + - Params + - From: context.Context, string, string, JitNetworkAccessPolicyInitiateRequest + - To: context.Context, string, string, string, JitNetworkAccessPolicyInitiateRequest +1. JitNetworkAccessPoliciesClient.ListByRegion + - Params + - From: context.Context + - To: context.Context, string +1. JitNetworkAccessPoliciesClient.ListByRegionComplete + - Params + - From: context.Context + - To: context.Context, string +1. JitNetworkAccessPoliciesClient.ListByRegionPreparer + - Params + - From: context.Context + - To: context.Context, string +1. JitNetworkAccessPoliciesClient.ListByResourceGroupAndRegion + - Params + - From: context.Context, string + - To: context.Context, string, string +1. JitNetworkAccessPoliciesClient.ListByResourceGroupAndRegionComplete + - Params + - From: context.Context, string + - To: context.Context, string, string +1. JitNetworkAccessPoliciesClient.ListByResourceGroupAndRegionPreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. LocationsClient.Get + - Params + - From: context.Context + - To: context.Context, string +1. LocationsClient.GetPreparer + - Params + - From: context.Context + - To: context.Context, string +1. New + - Params + - From: string, string + - To: string +1. NewAdaptiveApplicationControlsClient + - Params + - From: string, string + - To: string +1. NewAdaptiveApplicationControlsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewAdaptiveNetworkHardeningsClient + - Params + - From: string, string + - To: string +1. NewAdaptiveNetworkHardeningsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewAdvancedThreatProtectionClient + - Params + - From: string, string + - To: string +1. NewAdvancedThreatProtectionClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewAlertsClient + - Params + - From: string, string + - To: string +1. NewAlertsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewAlertsSuppressionRulesClient + - Params + - From: string, string + - To: string +1. NewAlertsSuppressionRulesClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewAllowedConnectionsClient + - Params + - From: string, string + - To: string +1. NewAllowedConnectionsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewAssessmentsClient + - Params + - From: string, string + - To: string +1. NewAssessmentsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewAssessmentsMetadataClient + - Params + - From: string, string + - To: string +1. NewAssessmentsMetadataClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewAutoProvisioningSettingsClient + - Params + - From: string, string + - To: string +1. NewAutoProvisioningSettingsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewAutomationsClient + - Params + - From: string, string + - To: string +1. NewAutomationsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewComplianceResultsClient + - Params + - From: string, string + - To: string +1. NewComplianceResultsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewCompliancesClient + - Params + - From: string, string + - To: string +1. NewCompliancesClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewConnectorsClient + - Params + - From: string, string + - To: string +1. NewConnectorsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewContactsClient + - Params + - From: string, string + - To: string +1. NewContactsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewDeviceSecurityGroupsClient + - Params + - From: string, string + - To: string +1. NewDeviceSecurityGroupsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewDiscoveredSecuritySolutionsClient + - Params + - From: string, string + - To: string +1. NewDiscoveredSecuritySolutionsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewExternalSecuritySolutionsClient + - Params + - From: string, string + - To: string +1. NewExternalSecuritySolutionsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewInformationProtectionPoliciesClient + - Params + - From: string, string + - To: string +1. NewInformationProtectionPoliciesClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewIngestionSettingsClient + - Params + - From: string, string + - To: string +1. NewIngestionSettingsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewIotSecuritySolutionAnalyticsClient + - Params + - From: string, string + - To: string +1. NewIotSecuritySolutionAnalyticsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewIotSecuritySolutionClient + - Params + - From: string, string + - To: string +1. NewIotSecuritySolutionClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewIotSecuritySolutionsAnalyticsAggregatedAlertClient + - Params + - From: string, string + - To: string +1. NewIotSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewIotSecuritySolutionsAnalyticsRecommendationClient + - Params + - From: string, string + - To: string +1. NewIotSecuritySolutionsAnalyticsRecommendationClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewJitNetworkAccessPoliciesClient + - Params + - From: string, string + - To: string +1. NewJitNetworkAccessPoliciesClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewLocationsClient + - Params + - From: string, string + - To: string +1. NewLocationsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewOperationsClient + - Params + - From: string, string + - To: string +1. NewOperationsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewPricingsClient + - Params + - From: string, string + - To: string +1. NewPricingsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewRegulatoryComplianceAssessmentsClient + - Params + - From: string, string + - To: string +1. NewRegulatoryComplianceAssessmentsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewRegulatoryComplianceControlsClient + - Params + - From: string, string + - To: string +1. NewRegulatoryComplianceControlsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewRegulatoryComplianceStandardsClient + - Params + - From: string, string + - To: string +1. NewRegulatoryComplianceStandardsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSQLVulnerabilityAssessmentBaselineRulesClient + - Params + - From: string, string + - To: string +1. NewSQLVulnerabilityAssessmentBaselineRulesClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSQLVulnerabilityAssessmentScanResultsClient + - Params + - From: string, string + - To: string +1. NewSQLVulnerabilityAssessmentScanResultsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSQLVulnerabilityAssessmentScansClient + - Params + - From: string, string + - To: string +1. NewSQLVulnerabilityAssessmentScansClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSecureScoreControlDefinitionsClient + - Params + - From: string, string + - To: string +1. NewSecureScoreControlDefinitionsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSecureScoreControlsClient + - Params + - From: string, string + - To: string +1. NewSecureScoreControlsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSecureScoresClient + - Params + - From: string, string + - To: string +1. NewSecureScoresClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewServerVulnerabilityAssessmentClient + - Params + - From: string, string + - To: string +1. NewServerVulnerabilityAssessmentClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSettingsClient + - Params + - From: string, string + - To: string +1. NewSettingsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSoftwareInventoriesClient + - Params + - From: string, string + - To: string +1. NewSoftwareInventoriesClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSolutionsClient + - Params + - From: string, string + - To: string +1. NewSolutionsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSolutionsReferenceDataClient + - Params + - From: string, string + - To: string +1. NewSolutionsReferenceDataClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewSubAssessmentsClient + - Params + - From: string, string + - To: string +1. NewSubAssessmentsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewTasksClient + - Params + - From: string, string + - To: string +1. NewTasksClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewTopologyClient + - Params + - From: string, string + - To: string +1. NewTopologyClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. NewWorkspaceSettingsClient + - Params + - From: string, string + - To: string +1. NewWorkspaceSettingsClientWithBaseURI + - Params + - From: string, string, string + - To: string, string +1. SettingsClient.Get + - Params + - From: context.Context, string + - To: context.Context, SettingName4 +1. SettingsClient.GetPreparer + - Params + - From: context.Context, string + - To: context.Context, SettingName4 +1. SettingsClient.Update + - Params + - From: context.Context, string, BasicSetting + - To: context.Context, SettingName5, BasicSetting +1. SettingsClient.UpdatePreparer + - Params + - From: context.Context, string, BasicSetting + - To: context.Context, SettingName5, BasicSetting +1. SolutionsClient.Get + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. SolutionsClient.GetPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. SolutionsReferenceDataClient.ListByHomeRegion + - Params + - From: context.Context + - To: context.Context, string +1. SolutionsReferenceDataClient.ListByHomeRegionPreparer + - Params + - From: context.Context + - To: context.Context, string +1. TasksClient.GetResourceGroupLevelTask + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. TasksClient.GetResourceGroupLevelTaskPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. TasksClient.GetSubscriptionLevelTask + - Params + - From: context.Context, string + - To: context.Context, string, string +1. TasksClient.GetSubscriptionLevelTaskPreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. TasksClient.ListByHomeRegion + - Params + - From: context.Context, string + - To: context.Context, string, string +1. TasksClient.ListByHomeRegionComplete + - Params + - From: context.Context, string + - To: context.Context, string, string +1. TasksClient.ListByHomeRegionPreparer + - Params + - From: context.Context, string + - To: context.Context, string, string +1. TasksClient.ListByResourceGroup + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. TasksClient.ListByResourceGroupComplete + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. TasksClient.ListByResourceGroupPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. TasksClient.UpdateResourceGroupLevelTaskState + - Params + - From: context.Context, string, string, string + - To: context.Context, string, string, string, TaskUpdateActionType +1. TasksClient.UpdateResourceGroupLevelTaskStatePreparer + - Params + - From: context.Context, string, string, string + - To: context.Context, string, string, string, TaskUpdateActionType +1. TasksClient.UpdateSubscriptionLevelTaskState + - Params + - From: context.Context, string, string + - To: context.Context, string, string, TaskUpdateActionType +1. TasksClient.UpdateSubscriptionLevelTaskStatePreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, TaskUpdateActionType +1. TopologyClient.Get + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. TopologyClient.GetPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, string +1. TopologyClient.ListByHomeRegion + - Params + - From: context.Context + - To: context.Context, string +1. TopologyClient.ListByHomeRegionComplete + - Params + - From: context.Context + - To: context.Context, string +1. TopologyClient.ListByHomeRegionPreparer + - Params + - From: context.Context + - To: context.Context, string + +#### Struct Fields + +1. AssessmentList.Value changed type from *[]Assessment to *[]AssessmentResponse + +## Additive Changes + +### New Constants + +1. CloudName.AWS +1. CloudName.Azure +1. CloudName.GCP +1. EnforcementSupport.NotSupported +1. EnforcementSupport.Supported +1. EventSource.EventSourceAssessmentsSnapshot +1. EventSource.EventSourceSubAssessmentsSnapshot +1. InformationProtectionPolicyName.Custom +1. InformationProtectionPolicyName.Effective +1. OfferingType.OfferingTypeCloudOffering +1. OfferingType.OfferingTypeCspmMonitorAws +1. OfferingType.OfferingTypeDefenderForContainersAws +1. OfferingType.OfferingTypeDefenderForServersAws +1. OfferingType.OfferingTypeInformationProtectionAws +1. OrganizationMembershipType.Member +1. OrganizationMembershipType.Organization +1. PricingTier.Free +1. SettingName2.SettingName2MCAS +1. SettingName2.SettingName2Sentinel +1. SettingName2.SettingName2WDATP +1. SettingName2.SettingName2WDATPEXCLUDELINUXPUBLICPREVIEW +1. SettingName2.SettingName2WDATPUNIFIEDSOLUTION +1. SettingName4.SettingName4MCAS +1. SettingName4.SettingName4Sentinel +1. SettingName4.SettingName4WDATP +1. SettingName4.SettingName4WDATPEXCLUDELINUXPUBLICPREVIEW +1. SettingName4.SettingName4WDATPUNIFIEDSOLUTION +1. SettingName5.SettingName5MCAS +1. SettingName5.SettingName5Sentinel +1. SettingName5.SettingName5WDATP +1. SettingName5.SettingName5WDATPEXCLUDELINUXPUBLICPREVIEW +1. SettingName5.SettingName5WDATPUNIFIEDSOLUTION +1. SeverityEnum.SeverityEnumHigh +1. SeverityEnum.SeverityEnumLow +1. SeverityEnum.SeverityEnumMedium +1. SupportedCloudEnum.SupportedCloudEnumAWS +1. SupportedCloudEnum.SupportedCloudEnumGCP +1. Tactics.CommandandControl +1. Tactics.Reconnaissance +1. Tactics.ResourceDevelopment +1. TaskUpdateActionType.Activate +1. TaskUpdateActionType.Close +1. TaskUpdateActionType.Dismiss +1. TaskUpdateActionType.Resolve +1. TaskUpdateActionType.Start +1. Techniques.AbuseElevationControlMechanism +1. Techniques.AccessTokenManipulation +1. Techniques.AccountDiscovery +1. Techniques.AccountManipulation +1. Techniques.ActiveScanning +1. Techniques.ApplicationLayerProtocol +1. Techniques.AudioCapture +1. Techniques.BootorLogonAutostartExecution +1. Techniques.BootorLogonInitializationScripts +1. Techniques.BruteForce +1. Techniques.CloudInfrastructureDiscovery +1. Techniques.CloudServiceDashboard +1. Techniques.CloudServiceDiscovery +1. Techniques.CommandandScriptingInterpreter +1. Techniques.CompromiseClientSoftwareBinary +1. Techniques.CompromiseInfrastructure +1. Techniques.ContainerandResourceDiscovery +1. Techniques.CreateAccount +1. Techniques.CreateorModifySystemProcess +1. Techniques.CredentialsfromPasswordStores +1. Techniques.DataDestruction +1. Techniques.DataEncryptedforImpact +1. Techniques.DataManipulation +1. Techniques.DataStaged +1. Techniques.DatafromCloudStorageObject +1. Techniques.DatafromConfigurationRepository +1. Techniques.DatafromInformationRepositories +1. Techniques.DatafromLocalSystem +1. Techniques.Defacement +1. Techniques.DeobfuscateDecodeFilesorInformation +1. Techniques.DiskWipe +1. Techniques.DomainTrustDiscovery +1. Techniques.DriveByCompromise +1. Techniques.DynamicResolution +1. Techniques.EndpointDenialofService +1. Techniques.EventTriggeredExecution +1. Techniques.ExfiltrationOverAlternativeProtocol +1. Techniques.ExploitPublicFacingApplication +1. Techniques.ExploitationforClientExecution +1. Techniques.ExploitationforCredentialAccess +1. Techniques.ExploitationforDefenseEvasion +1. Techniques.ExploitationforPrivilegeEscalation +1. Techniques.ExploitationofRemoteServices +1. Techniques.ExternalRemoteServices +1. Techniques.FallbackChannels +1. Techniques.FileandDirectoryDiscovery +1. Techniques.FileandDirectoryPermissionsModification +1. Techniques.GatherVictimNetworkInformation +1. Techniques.HideArtifacts +1. Techniques.HijackExecutionFlow +1. Techniques.ImpairDefenses +1. Techniques.ImplantContainerImage +1. Techniques.IndicatorRemovalonHost +1. Techniques.IndirectCommandExecution +1. Techniques.IngressToolTransfer +1. Techniques.InputCapture +1. Techniques.InterProcessCommunication +1. Techniques.LateralToolTransfer +1. Techniques.ManInTheMiddle +1. Techniques.Masquerading +1. Techniques.ModifyAuthenticationProcess +1. Techniques.ModifyRegistry +1. Techniques.NetworkDenialofService +1. Techniques.NetworkServiceScanning +1. Techniques.NetworkSniffing +1. Techniques.NonApplicationLayerProtocol +1. Techniques.NonStandardPort +1. Techniques.OSCredentialDumping +1. Techniques.ObfuscatedFilesorInformation +1. Techniques.ObtainCapabilities +1. Techniques.OfficeApplicationStartup +1. Techniques.PermissionGroupsDiscovery +1. Techniques.Phishing +1. Techniques.PreOSBoot +1. Techniques.ProcessDiscovery +1. Techniques.ProcessInjection +1. Techniques.ProtocolTunneling +1. Techniques.Proxy +1. Techniques.QueryRegistry +1. Techniques.RemoteAccessSoftware +1. Techniques.RemoteServiceSessionHijacking +1. Techniques.RemoteServices +1. Techniques.RemoteSystemDiscovery +1. Techniques.ResourceHijacking +1. Techniques.SQLStoredProcedures +1. Techniques.ScheduledTaskJob +1. Techniques.ScreenCapture +1. Techniques.SearchVictimOwnedWebsites +1. Techniques.ServerSoftwareComponent +1. Techniques.ServiceStop +1. Techniques.SignedBinaryProxyExecution +1. Techniques.SoftwareDeploymentTools +1. Techniques.StealorForgeKerberosTickets +1. Techniques.SubvertTrustControls +1. Techniques.SupplyChainCompromise +1. Techniques.SystemInformationDiscovery +1. Techniques.TaintSharedContent +1. Techniques.TrafficSignaling +1. Techniques.TransferDatatoCloudAccount +1. Techniques.TrustedRelationship +1. Techniques.UnsecuredCredentials +1. Techniques.UserExecution +1. Techniques.ValidAccounts +1. Techniques.WindowsManagementInstrumentation + +### New Funcs + +1. *AssessmentMetadataResponse.UnmarshalJSON([]byte) error +1. *AssessmentMetadataResponseListIterator.Next() error +1. *AssessmentMetadataResponseListIterator.NextWithContext(context.Context) error +1. *AssessmentMetadataResponseListPage.Next() error +1. *AssessmentMetadataResponseListPage.NextWithContext(context.Context) error +1. *AssessmentPropertiesBase.UnmarshalJSON([]byte) error +1. *AssessmentPropertiesResponse.UnmarshalJSON([]byte) error +1. *AssessmentResponse.UnmarshalJSON([]byte) error +1. *Connector.UnmarshalJSON([]byte) error +1. *ConnectorProperties.UnmarshalJSON([]byte) error +1. *ConnectorsListIterator.Next() error +1. *ConnectorsListIterator.NextWithContext(context.Context) error +1. *ConnectorsListPage.Next() error +1. *ConnectorsListPage.NextWithContext(context.Context) error +1. *CustomAssessmentAutomation.UnmarshalJSON([]byte) error +1. *CustomAssessmentAutomationRequest.UnmarshalJSON([]byte) error +1. *CustomAssessmentAutomationsListResultIterator.Next() error +1. *CustomAssessmentAutomationsListResultIterator.NextWithContext(context.Context) error +1. *CustomAssessmentAutomationsListResultPage.Next() error +1. *CustomAssessmentAutomationsListResultPage.NextWithContext(context.Context) error +1. *CustomEntityStoreAssignment.UnmarshalJSON([]byte) error +1. *CustomEntityStoreAssignmentRequest.UnmarshalJSON([]byte) error +1. *CustomEntityStoreAssignmentsListResultIterator.Next() error +1. *CustomEntityStoreAssignmentsListResultIterator.NextWithContext(context.Context) error +1. *CustomEntityStoreAssignmentsListResultPage.Next() error +1. *CustomEntityStoreAssignmentsListResultPage.NextWithContext(context.Context) error +1. *MdeOnboardingData.UnmarshalJSON([]byte) error +1. AssessmentMetadataPropertiesResponse.MarshalJSON() ([]byte, error) +1. AssessmentMetadataResponse.MarshalJSON() ([]byte, error) +1. AssessmentMetadataResponseList.IsEmpty() bool +1. AssessmentMetadataResponseList.MarshalJSON() ([]byte, error) +1. AssessmentMetadataResponseListIterator.NotDone() bool +1. AssessmentMetadataResponseListIterator.Response() AssessmentMetadataResponseList +1. AssessmentMetadataResponseListIterator.Value() AssessmentMetadataResponse +1. AssessmentMetadataResponseListPage.NotDone() bool +1. AssessmentMetadataResponseListPage.Response() AssessmentMetadataResponseList +1. AssessmentMetadataResponseListPage.Values() []AssessmentMetadataResponse +1. AssessmentPropertiesBase.MarshalJSON() ([]byte, error) +1. AssessmentPropertiesResponse.MarshalJSON() ([]byte, error) +1. AssessmentResponse.MarshalJSON() ([]byte, error) +1. AssessmentStatusResponse.MarshalJSON() ([]byte, error) +1. CloudOffering.AsBasicCloudOffering() (BasicCloudOffering, bool) +1. CloudOffering.AsCloudOffering() (*CloudOffering, bool) +1. CloudOffering.AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) +1. CloudOffering.AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) +1. CloudOffering.AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) +1. CloudOffering.AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) +1. CloudOffering.MarshalJSON() ([]byte, error) +1. Connector.MarshalJSON() ([]byte, error) +1. ConnectorsGroupClient.CreateOrUpdate(context.Context, string, string, Connector) (Connector, error) +1. ConnectorsGroupClient.CreateOrUpdatePreparer(context.Context, string, string, Connector) (*http.Request, error) +1. ConnectorsGroupClient.CreateOrUpdateResponder(*http.Response) (Connector, error) +1. ConnectorsGroupClient.CreateOrUpdateSender(*http.Request) (*http.Response, error) +1. ConnectorsGroupClient.Delete(context.Context, string, string) (autorest.Response, error) +1. ConnectorsGroupClient.DeletePreparer(context.Context, string, string) (*http.Request, error) +1. ConnectorsGroupClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. ConnectorsGroupClient.DeleteSender(*http.Request) (*http.Response, error) +1. ConnectorsGroupClient.Get(context.Context, string, string) (Connector, error) +1. ConnectorsGroupClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. ConnectorsGroupClient.GetResponder(*http.Response) (Connector, error) +1. ConnectorsGroupClient.GetSender(*http.Request) (*http.Response, error) +1. ConnectorsGroupClient.List(context.Context) (ConnectorsListPage, error) +1. ConnectorsGroupClient.ListByResourceGroup(context.Context, string) (ConnectorsListPage, error) +1. ConnectorsGroupClient.ListByResourceGroupComplete(context.Context, string) (ConnectorsListIterator, error) +1. ConnectorsGroupClient.ListByResourceGroupPreparer(context.Context, string) (*http.Request, error) +1. ConnectorsGroupClient.ListByResourceGroupResponder(*http.Response) (ConnectorsList, error) +1. ConnectorsGroupClient.ListByResourceGroupSender(*http.Request) (*http.Response, error) +1. ConnectorsGroupClient.ListComplete(context.Context) (ConnectorsListIterator, error) +1. ConnectorsGroupClient.ListPreparer(context.Context) (*http.Request, error) +1. ConnectorsGroupClient.ListResponder(*http.Response) (ConnectorsList, error) +1. ConnectorsGroupClient.ListSender(*http.Request) (*http.Response, error) +1. ConnectorsGroupClient.Update(context.Context, string, string, Connector) (Connector, error) +1. ConnectorsGroupClient.UpdatePreparer(context.Context, string, string, Connector) (*http.Request, error) +1. ConnectorsGroupClient.UpdateResponder(*http.Response) (Connector, error) +1. ConnectorsGroupClient.UpdateSender(*http.Request) (*http.Response, error) +1. ConnectorsList.IsEmpty() bool +1. ConnectorsList.MarshalJSON() ([]byte, error) +1. ConnectorsListIterator.NotDone() bool +1. ConnectorsListIterator.Response() ConnectorsList +1. ConnectorsListIterator.Value() Connector +1. ConnectorsListPage.NotDone() bool +1. ConnectorsListPage.Response() ConnectorsList +1. ConnectorsListPage.Values() []Connector +1. CspmMonitorAwsOffering.AsBasicCloudOffering() (BasicCloudOffering, bool) +1. CspmMonitorAwsOffering.AsCloudOffering() (*CloudOffering, bool) +1. CspmMonitorAwsOffering.AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) +1. CspmMonitorAwsOffering.AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) +1. CspmMonitorAwsOffering.AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) +1. CspmMonitorAwsOffering.AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) +1. CspmMonitorAwsOffering.MarshalJSON() ([]byte, error) +1. CustomAssessmentAutomation.MarshalJSON() ([]byte, error) +1. CustomAssessmentAutomationRequest.MarshalJSON() ([]byte, error) +1. CustomAssessmentAutomationsClient.Create(context.Context, string, string, CustomAssessmentAutomationRequest) (CustomAssessmentAutomation, error) +1. CustomAssessmentAutomationsClient.CreatePreparer(context.Context, string, string, CustomAssessmentAutomationRequest) (*http.Request, error) +1. CustomAssessmentAutomationsClient.CreateResponder(*http.Response) (CustomAssessmentAutomation, error) +1. CustomAssessmentAutomationsClient.CreateSender(*http.Request) (*http.Response, error) +1. CustomAssessmentAutomationsClient.Delete(context.Context, string, string) (autorest.Response, error) +1. CustomAssessmentAutomationsClient.DeletePreparer(context.Context, string, string) (*http.Request, error) +1. CustomAssessmentAutomationsClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. CustomAssessmentAutomationsClient.DeleteSender(*http.Request) (*http.Response, error) +1. CustomAssessmentAutomationsClient.Get(context.Context, string, string) (CustomAssessmentAutomation, error) +1. CustomAssessmentAutomationsClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. CustomAssessmentAutomationsClient.GetResponder(*http.Response) (CustomAssessmentAutomation, error) +1. CustomAssessmentAutomationsClient.GetSender(*http.Request) (*http.Response, error) +1. CustomAssessmentAutomationsClient.ListByResourceGroup(context.Context, string) (CustomAssessmentAutomationsListResultPage, error) +1. CustomAssessmentAutomationsClient.ListByResourceGroupComplete(context.Context, string) (CustomAssessmentAutomationsListResultIterator, error) +1. CustomAssessmentAutomationsClient.ListByResourceGroupPreparer(context.Context, string) (*http.Request, error) +1. CustomAssessmentAutomationsClient.ListByResourceGroupResponder(*http.Response) (CustomAssessmentAutomationsListResult, error) +1. CustomAssessmentAutomationsClient.ListByResourceGroupSender(*http.Request) (*http.Response, error) +1. CustomAssessmentAutomationsClient.ListBySubscription(context.Context) (CustomAssessmentAutomationsListResultPage, error) +1. CustomAssessmentAutomationsClient.ListBySubscriptionComplete(context.Context) (CustomAssessmentAutomationsListResultIterator, error) +1. CustomAssessmentAutomationsClient.ListBySubscriptionPreparer(context.Context) (*http.Request, error) +1. CustomAssessmentAutomationsClient.ListBySubscriptionResponder(*http.Response) (CustomAssessmentAutomationsListResult, error) +1. CustomAssessmentAutomationsClient.ListBySubscriptionSender(*http.Request) (*http.Response, error) +1. CustomAssessmentAutomationsListResult.IsEmpty() bool +1. CustomAssessmentAutomationsListResult.MarshalJSON() ([]byte, error) +1. CustomAssessmentAutomationsListResultIterator.NotDone() bool +1. CustomAssessmentAutomationsListResultIterator.Response() CustomAssessmentAutomationsListResult +1. CustomAssessmentAutomationsListResultIterator.Value() CustomAssessmentAutomation +1. CustomAssessmentAutomationsListResultPage.NotDone() bool +1. CustomAssessmentAutomationsListResultPage.Response() CustomAssessmentAutomationsListResult +1. CustomAssessmentAutomationsListResultPage.Values() []CustomAssessmentAutomation +1. CustomEntityStoreAssignment.MarshalJSON() ([]byte, error) +1. CustomEntityStoreAssignmentRequest.MarshalJSON() ([]byte, error) +1. CustomEntityStoreAssignmentsClient.Create(context.Context, string, string, CustomEntityStoreAssignmentRequest) (CustomEntityStoreAssignment, error) +1. CustomEntityStoreAssignmentsClient.CreatePreparer(context.Context, string, string, CustomEntityStoreAssignmentRequest) (*http.Request, error) +1. CustomEntityStoreAssignmentsClient.CreateResponder(*http.Response) (CustomEntityStoreAssignment, error) +1. CustomEntityStoreAssignmentsClient.CreateSender(*http.Request) (*http.Response, error) +1. CustomEntityStoreAssignmentsClient.Delete(context.Context, string, string) (autorest.Response, error) +1. CustomEntityStoreAssignmentsClient.DeletePreparer(context.Context, string, string) (*http.Request, error) +1. CustomEntityStoreAssignmentsClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. CustomEntityStoreAssignmentsClient.DeleteSender(*http.Request) (*http.Response, error) +1. CustomEntityStoreAssignmentsClient.Get(context.Context, string, string) (CustomEntityStoreAssignment, error) +1. CustomEntityStoreAssignmentsClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. CustomEntityStoreAssignmentsClient.GetResponder(*http.Response) (CustomEntityStoreAssignment, error) +1. CustomEntityStoreAssignmentsClient.GetSender(*http.Request) (*http.Response, error) +1. CustomEntityStoreAssignmentsClient.ListByResourceGroup(context.Context, string) (CustomEntityStoreAssignmentsListResultPage, error) +1. CustomEntityStoreAssignmentsClient.ListByResourceGroupComplete(context.Context, string) (CustomEntityStoreAssignmentsListResultIterator, error) +1. CustomEntityStoreAssignmentsClient.ListByResourceGroupPreparer(context.Context, string) (*http.Request, error) +1. CustomEntityStoreAssignmentsClient.ListByResourceGroupResponder(*http.Response) (CustomEntityStoreAssignmentsListResult, error) +1. CustomEntityStoreAssignmentsClient.ListByResourceGroupSender(*http.Request) (*http.Response, error) +1. CustomEntityStoreAssignmentsClient.ListBySubscription(context.Context) (CustomEntityStoreAssignmentsListResultPage, error) +1. CustomEntityStoreAssignmentsClient.ListBySubscriptionComplete(context.Context) (CustomEntityStoreAssignmentsListResultIterator, error) +1. CustomEntityStoreAssignmentsClient.ListBySubscriptionPreparer(context.Context) (*http.Request, error) +1. CustomEntityStoreAssignmentsClient.ListBySubscriptionResponder(*http.Response) (CustomEntityStoreAssignmentsListResult, error) +1. CustomEntityStoreAssignmentsClient.ListBySubscriptionSender(*http.Request) (*http.Response, error) +1. CustomEntityStoreAssignmentsListResult.IsEmpty() bool +1. CustomEntityStoreAssignmentsListResult.MarshalJSON() ([]byte, error) +1. CustomEntityStoreAssignmentsListResultIterator.NotDone() bool +1. CustomEntityStoreAssignmentsListResultIterator.Response() CustomEntityStoreAssignmentsListResult +1. CustomEntityStoreAssignmentsListResultIterator.Value() CustomEntityStoreAssignment +1. CustomEntityStoreAssignmentsListResultPage.NotDone() bool +1. CustomEntityStoreAssignmentsListResultPage.Response() CustomEntityStoreAssignmentsListResult +1. CustomEntityStoreAssignmentsListResultPage.Values() []CustomEntityStoreAssignment +1. DefenderForContainersAwsOffering.AsBasicCloudOffering() (BasicCloudOffering, bool) +1. DefenderForContainersAwsOffering.AsCloudOffering() (*CloudOffering, bool) +1. DefenderForContainersAwsOffering.AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) +1. DefenderForContainersAwsOffering.AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) +1. DefenderForContainersAwsOffering.AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) +1. DefenderForContainersAwsOffering.AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) +1. DefenderForContainersAwsOffering.MarshalJSON() ([]byte, error) +1. DefenderForServersAwsOffering.AsBasicCloudOffering() (BasicCloudOffering, bool) +1. DefenderForServersAwsOffering.AsCloudOffering() (*CloudOffering, bool) +1. DefenderForServersAwsOffering.AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) +1. DefenderForServersAwsOffering.AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) +1. DefenderForServersAwsOffering.AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) +1. DefenderForServersAwsOffering.AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) +1. DefenderForServersAwsOffering.MarshalJSON() ([]byte, error) +1. InformationProtectionAwsOffering.AsBasicCloudOffering() (BasicCloudOffering, bool) +1. InformationProtectionAwsOffering.AsCloudOffering() (*CloudOffering, bool) +1. InformationProtectionAwsOffering.AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) +1. InformationProtectionAwsOffering.AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) +1. InformationProtectionAwsOffering.AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) +1. InformationProtectionAwsOffering.AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) +1. InformationProtectionAwsOffering.MarshalJSON() ([]byte, error) +1. MdeOnboardingData.MarshalJSON() ([]byte, error) +1. MdeOnboardingsClient.Get(context.Context) (MdeOnboardingData, error) +1. MdeOnboardingsClient.GetPreparer(context.Context) (*http.Request, error) +1. MdeOnboardingsClient.GetResponder(*http.Response) (MdeOnboardingData, error) +1. MdeOnboardingsClient.GetSender(*http.Request) (*http.Response, error) +1. MdeOnboardingsClient.List(context.Context) (MdeOnboardingDataList, error) +1. MdeOnboardingsClient.ListPreparer(context.Context) (*http.Request, error) +1. MdeOnboardingsClient.ListResponder(*http.Response) (MdeOnboardingDataList, error) +1. MdeOnboardingsClient.ListSender(*http.Request) (*http.Response, error) +1. NewAssessmentMetadataResponseListIterator(AssessmentMetadataResponseListPage) AssessmentMetadataResponseListIterator +1. NewAssessmentMetadataResponseListPage(AssessmentMetadataResponseList, func(context.Context, AssessmentMetadataResponseList) (AssessmentMetadataResponseList, error)) AssessmentMetadataResponseListPage +1. NewConnectorsGroupClient(string) ConnectorsGroupClient +1. NewConnectorsGroupClientWithBaseURI(string, string) ConnectorsGroupClient +1. NewConnectorsListIterator(ConnectorsListPage) ConnectorsListIterator +1. NewConnectorsListPage(ConnectorsList, func(context.Context, ConnectorsList) (ConnectorsList, error)) ConnectorsListPage +1. NewCustomAssessmentAutomationsClient(string) CustomAssessmentAutomationsClient +1. NewCustomAssessmentAutomationsClientWithBaseURI(string, string) CustomAssessmentAutomationsClient +1. NewCustomAssessmentAutomationsListResultIterator(CustomAssessmentAutomationsListResultPage) CustomAssessmentAutomationsListResultIterator +1. NewCustomAssessmentAutomationsListResultPage(CustomAssessmentAutomationsListResult, func(context.Context, CustomAssessmentAutomationsListResult) (CustomAssessmentAutomationsListResult, error)) CustomAssessmentAutomationsListResultPage +1. NewCustomEntityStoreAssignmentsClient(string) CustomEntityStoreAssignmentsClient +1. NewCustomEntityStoreAssignmentsClientWithBaseURI(string, string) CustomEntityStoreAssignmentsClient +1. NewCustomEntityStoreAssignmentsListResultIterator(CustomEntityStoreAssignmentsListResultPage) CustomEntityStoreAssignmentsListResultIterator +1. NewCustomEntityStoreAssignmentsListResultPage(CustomEntityStoreAssignmentsListResult, func(context.Context, CustomEntityStoreAssignmentsListResult) (CustomEntityStoreAssignmentsListResult, error)) CustomEntityStoreAssignmentsListResultPage +1. NewMdeOnboardingsClient(string) MdeOnboardingsClient +1. NewMdeOnboardingsClientWithBaseURI(string, string) MdeOnboardingsClient +1. PossibleCloudNameValues() []CloudName +1. PossibleInformationProtectionPolicyNameValues() []InformationProtectionPolicyName +1. PossibleOfferingTypeValues() []OfferingType +1. PossibleOrganizationMembershipTypeValues() []OrganizationMembershipType +1. PossibleSettingName2Values() []SettingName2 +1. PossibleSettingName4Values() []SettingName4 +1. PossibleSettingName5Values() []SettingName5 +1. PossibleSeverityEnumValues() []SeverityEnum +1. PossibleSupportedCloudEnumValues() []SupportedCloudEnum +1. PossibleTacticsValues() []Tactics +1. PossibleTaskUpdateActionTypeValues() []TaskUpdateActionType +1. PossibleTechniquesValues() []Techniques + +### Struct Changes + +#### New Structs + +1. AssessmentMetadataPropertiesResponse +1. AssessmentMetadataPropertiesResponsePublishDates +1. AssessmentMetadataResponse +1. AssessmentMetadataResponseList +1. AssessmentMetadataResponseListIterator +1. AssessmentMetadataResponseListPage +1. AssessmentPropertiesBase +1. AssessmentPropertiesResponse +1. AssessmentResponse +1. AssessmentStatusResponse +1. CloudOffering +1. Connector +1. ConnectorProperties +1. ConnectorPropertiesOrganizationalData +1. ConnectorsGroupClient +1. ConnectorsList +1. ConnectorsListIterator +1. ConnectorsListPage +1. CspmMonitorAwsOffering +1. CspmMonitorAwsOfferingNativeCloudConnection +1. CustomAssessmentAutomation +1. CustomAssessmentAutomationProperties +1. CustomAssessmentAutomationRequest +1. CustomAssessmentAutomationRequestProperties +1. CustomAssessmentAutomationsClient +1. CustomAssessmentAutomationsListResult +1. CustomAssessmentAutomationsListResultIterator +1. CustomAssessmentAutomationsListResultPage +1. CustomEntityStoreAssignment +1. CustomEntityStoreAssignmentProperties +1. CustomEntityStoreAssignmentRequest +1. CustomEntityStoreAssignmentRequestProperties +1. CustomEntityStoreAssignmentsClient +1. CustomEntityStoreAssignmentsListResult +1. CustomEntityStoreAssignmentsListResultIterator +1. CustomEntityStoreAssignmentsListResultPage +1. DefenderForContainersAwsOffering +1. DefenderForContainersAwsOfferingCloudWatchToKinesis +1. DefenderForContainersAwsOfferingKinesisToS3 +1. DefenderForContainersAwsOfferingKubernetesScubaReader +1. DefenderForContainersAwsOfferingKubernetesService +1. DefenderForServersAwsOffering +1. DefenderForServersAwsOfferingArcAutoProvisioning +1. DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata +1. DefenderForServersAwsOfferingDefenderForServers +1. InformationProtectionAwsOffering +1. InformationProtectionAwsOfferingInformationProtection +1. MdeOnboardingData +1. MdeOnboardingDataList +1. MdeOnboardingDataProperties +1. MdeOnboardingsClient + +#### New Struct Fields + +1. PricingProperties.SubPlan diff --git a/services/preview/security/mgmt/v3.0/security/_meta.json b/services/preview/security/mgmt/v3.0/security/_meta.json index 59c7bc2945a0..ac1c78d7f986 100644 --- a/services/preview/security/mgmt/v3.0/security/_meta.json +++ b/services/preview/security/mgmt/v3.0/security/_meta.json @@ -1,5 +1,5 @@ { - "commit": "e3980786418c280ecd7ed2e141407ed0f63cd493", + "commit": "1fcd59731c6317078adb20e3cb954e073ab2de40", "readme": "/_/azure-rest-api-specs/specification/security/resource-manager/readme.md", "tag": "package-composite-v3", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/security/mgmt/v3.0/security/adaptiveapplicationcontrols.go b/services/preview/security/mgmt/v3.0/security/adaptiveapplicationcontrols.go index 5584d767ccb6..653543c827dd 100644 --- a/services/preview/security/mgmt/v3.0/security/adaptiveapplicationcontrols.go +++ b/services/preview/security/mgmt/v3.0/security/adaptiveapplicationcontrols.go @@ -21,21 +21,23 @@ type AdaptiveApplicationControlsClient struct { } // NewAdaptiveApplicationControlsClient creates an instance of the AdaptiveApplicationControlsClient client. -func NewAdaptiveApplicationControlsClient(subscriptionID string, ascLocation string) AdaptiveApplicationControlsClient { - return NewAdaptiveApplicationControlsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAdaptiveApplicationControlsClient(subscriptionID string) AdaptiveApplicationControlsClient { + return NewAdaptiveApplicationControlsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAdaptiveApplicationControlsClientWithBaseURI creates an instance of the AdaptiveApplicationControlsClient 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 NewAdaptiveApplicationControlsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AdaptiveApplicationControlsClient { - return AdaptiveApplicationControlsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAdaptiveApplicationControlsClientWithBaseURI(baseURI string, subscriptionID string) AdaptiveApplicationControlsClient { + return AdaptiveApplicationControlsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Delete delete an application control machine group // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // groupName - name of an application control machine group -func (client AdaptiveApplicationControlsClient) Delete(ctx context.Context, groupName string) (result autorest.Response, err error) { +func (client AdaptiveApplicationControlsClient) Delete(ctx context.Context, ascLocation string, groupName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveApplicationControlsClient.Delete") defer func() { @@ -52,7 +54,7 @@ func (client AdaptiveApplicationControlsClient) Delete(ctx context.Context, grou return result, validation.NewError("security.AdaptiveApplicationControlsClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, groupName) + req, err := client.DeletePreparer(ctx, ascLocation, groupName) if err != nil { err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Delete", nil, "Failure preparing request") return @@ -75,9 +77,9 @@ func (client AdaptiveApplicationControlsClient) Delete(ctx context.Context, grou } // DeletePreparer prepares the Delete request. -func (client AdaptiveApplicationControlsClient) DeletePreparer(ctx context.Context, groupName string) (*http.Request, error) { +func (client AdaptiveApplicationControlsClient) DeletePreparer(ctx context.Context, ascLocation string, groupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "groupName": autorest.Encode("path", groupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -114,8 +116,10 @@ func (client AdaptiveApplicationControlsClient) DeleteResponder(resp *http.Respo // Get gets an application control VM/server group. // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // groupName - name of an application control machine group -func (client AdaptiveApplicationControlsClient) Get(ctx context.Context, groupName string) (result AdaptiveApplicationControlGroup, err error) { +func (client AdaptiveApplicationControlsClient) Get(ctx context.Context, ascLocation string, groupName string) (result AdaptiveApplicationControlGroup, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveApplicationControlsClient.Get") defer func() { @@ -132,7 +136,7 @@ func (client AdaptiveApplicationControlsClient) Get(ctx context.Context, groupNa return result, validation.NewError("security.AdaptiveApplicationControlsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, groupName) + req, err := client.GetPreparer(ctx, ascLocation, groupName) if err != nil { err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Get", nil, "Failure preparing request") return @@ -155,9 +159,9 @@ func (client AdaptiveApplicationControlsClient) Get(ctx context.Context, groupNa } // GetPreparer prepares the Get request. -func (client AdaptiveApplicationControlsClient) GetPreparer(ctx context.Context, groupName string) (*http.Request, error) { +func (client AdaptiveApplicationControlsClient) GetPreparer(ctx context.Context, ascLocation string, groupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "groupName": autorest.Encode("path", groupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -281,8 +285,10 @@ func (client AdaptiveApplicationControlsClient) ListResponder(resp *http.Respons // Put update an application control machine group // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // groupName - name of an application control machine group -func (client AdaptiveApplicationControlsClient) Put(ctx context.Context, groupName string, body AdaptiveApplicationControlGroup) (result AdaptiveApplicationControlGroup, err error) { +func (client AdaptiveApplicationControlsClient) Put(ctx context.Context, ascLocation string, groupName string, body AdaptiveApplicationControlGroup) (result AdaptiveApplicationControlGroup, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveApplicationControlsClient.Put") defer func() { @@ -301,7 +307,7 @@ func (client AdaptiveApplicationControlsClient) Put(ctx context.Context, groupNa return result, validation.NewError("security.AdaptiveApplicationControlsClient", "Put", err.Error()) } - req, err := client.PutPreparer(ctx, groupName, body) + req, err := client.PutPreparer(ctx, ascLocation, groupName, body) if err != nil { err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Put", nil, "Failure preparing request") return @@ -324,9 +330,9 @@ func (client AdaptiveApplicationControlsClient) Put(ctx context.Context, groupNa } // PutPreparer prepares the Put request. -func (client AdaptiveApplicationControlsClient) PutPreparer(ctx context.Context, groupName string, body AdaptiveApplicationControlGroup) (*http.Request, error) { +func (client AdaptiveApplicationControlsClient) PutPreparer(ctx context.Context, ascLocation string, groupName string, body AdaptiveApplicationControlGroup) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "groupName": autorest.Encode("path", groupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } diff --git a/services/preview/security/mgmt/v3.0/security/adaptivenetworkhardenings.go b/services/preview/security/mgmt/v3.0/security/adaptivenetworkhardenings.go index dc570d770c2e..ede3aa6af8b6 100644 --- a/services/preview/security/mgmt/v3.0/security/adaptivenetworkhardenings.go +++ b/services/preview/security/mgmt/v3.0/security/adaptivenetworkhardenings.go @@ -21,15 +21,15 @@ type AdaptiveNetworkHardeningsClient struct { } // NewAdaptiveNetworkHardeningsClient creates an instance of the AdaptiveNetworkHardeningsClient client. -func NewAdaptiveNetworkHardeningsClient(subscriptionID string, ascLocation string) AdaptiveNetworkHardeningsClient { - return NewAdaptiveNetworkHardeningsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAdaptiveNetworkHardeningsClient(subscriptionID string) AdaptiveNetworkHardeningsClient { + return NewAdaptiveNetworkHardeningsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAdaptiveNetworkHardeningsClientWithBaseURI creates an instance of the AdaptiveNetworkHardeningsClient 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 NewAdaptiveNetworkHardeningsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AdaptiveNetworkHardeningsClient { - return AdaptiveNetworkHardeningsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAdaptiveNetworkHardeningsClientWithBaseURI(baseURI string, subscriptionID string) AdaptiveNetworkHardeningsClient { + return AdaptiveNetworkHardeningsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Enforce enforces the given rules on the NSG(s) listed in the request diff --git a/services/preview/security/mgmt/v3.0/security/advancedthreatprotection.go b/services/preview/security/mgmt/v3.0/security/advancedthreatprotection.go index 517401933a6c..57936306279e 100644 --- a/services/preview/security/mgmt/v3.0/security/advancedthreatprotection.go +++ b/services/preview/security/mgmt/v3.0/security/advancedthreatprotection.go @@ -20,15 +20,15 @@ type AdvancedThreatProtectionClient struct { } // NewAdvancedThreatProtectionClient creates an instance of the AdvancedThreatProtectionClient client. -func NewAdvancedThreatProtectionClient(subscriptionID string, ascLocation string) AdvancedThreatProtectionClient { - return NewAdvancedThreatProtectionClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAdvancedThreatProtectionClient(subscriptionID string) AdvancedThreatProtectionClient { + return NewAdvancedThreatProtectionClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAdvancedThreatProtectionClientWithBaseURI creates an instance of the AdvancedThreatProtectionClient 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 NewAdvancedThreatProtectionClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AdvancedThreatProtectionClient { - return AdvancedThreatProtectionClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAdvancedThreatProtectionClientWithBaseURI(baseURI string, subscriptionID string) AdvancedThreatProtectionClient { + return AdvancedThreatProtectionClient{NewWithBaseURI(baseURI, subscriptionID)} } // Create creates or updates the Advanced Threat Protection settings on a specified resource. diff --git a/services/preview/security/mgmt/v3.0/security/alerts.go b/services/preview/security/mgmt/v3.0/security/alerts.go index d5bd0a1c0d7f..93e0b5a57eeb 100644 --- a/services/preview/security/mgmt/v3.0/security/alerts.go +++ b/services/preview/security/mgmt/v3.0/security/alerts.go @@ -21,22 +21,24 @@ type AlertsClient struct { } // NewAlertsClient creates an instance of the AlertsClient client. -func NewAlertsClient(subscriptionID string, ascLocation string) AlertsClient { - return NewAlertsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAlertsClient(subscriptionID string) AlertsClient { + return NewAlertsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAlertsClientWithBaseURI creates an instance of the AlertsClient 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 NewAlertsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AlertsClient { - return AlertsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAlertsClientWithBaseURI(baseURI string, subscriptionID string) AlertsClient { + return AlertsClient{NewWithBaseURI(baseURI, subscriptionID)} } // GetResourceGroupLevel get an alert that is associated a resource group or a resource in a resource group // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // 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) GetResourceGroupLevel(ctx context.Context, alertName string, resourceGroupName string) (result Alert, err error) { +func (client AlertsClient) GetResourceGroupLevel(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (result Alert, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.GetResourceGroupLevel") defer func() { @@ -57,7 +59,7 @@ func (client AlertsClient) GetResourceGroupLevel(ctx context.Context, alertName return result, validation.NewError("security.AlertsClient", "GetResourceGroupLevel", err.Error()) } - req, err := client.GetResourceGroupLevelPreparer(ctx, alertName, resourceGroupName) + req, err := client.GetResourceGroupLevelPreparer(ctx, ascLocation, alertName, resourceGroupName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetResourceGroupLevel", nil, "Failure preparing request") return @@ -80,15 +82,15 @@ func (client AlertsClient) GetResourceGroupLevel(ctx context.Context, alertName } // GetResourceGroupLevelPreparer prepares the GetResourceGroupLevel request. -func (client AlertsClient) GetResourceGroupLevelPreparer(ctx context.Context, alertName string, resourceGroupName string) (*http.Request, error) { +func (client AlertsClient) GetResourceGroupLevelPreparer(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-01-01" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -121,8 +123,10 @@ func (client AlertsClient) GetResourceGroupLevelResponder(resp *http.Response) ( // GetSubscriptionLevel get an alert that is associated with a subscription // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // alertName - name of the alert object -func (client AlertsClient) GetSubscriptionLevel(ctx context.Context, alertName string) (result Alert, err error) { +func (client AlertsClient) GetSubscriptionLevel(ctx context.Context, ascLocation string, alertName string) (result Alert, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.GetSubscriptionLevel") defer func() { @@ -139,7 +143,7 @@ func (client AlertsClient) GetSubscriptionLevel(ctx context.Context, alertName s return result, validation.NewError("security.AlertsClient", "GetSubscriptionLevel", err.Error()) } - req, err := client.GetSubscriptionLevelPreparer(ctx, alertName) + req, err := client.GetSubscriptionLevelPreparer(ctx, ascLocation, alertName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetSubscriptionLevel", nil, "Failure preparing request") return @@ -162,14 +166,14 @@ func (client AlertsClient) GetSubscriptionLevel(ctx context.Context, alertName s } // GetSubscriptionLevelPreparer prepares the GetSubscriptionLevel request. -func (client AlertsClient) GetSubscriptionLevelPreparer(ctx context.Context, alertName string) (*http.Request, error) { +func (client AlertsClient) GetSubscriptionLevelPreparer(ctx context.Context, ascLocation string, alertName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-01-01" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -251,7 +255,7 @@ func (client AlertsClient) ListPreparer(ctx context.Context) (*http.Request, err "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-01-01" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -378,7 +382,7 @@ func (client AlertsClient) ListByResourceGroupPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-01-01" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -449,9 +453,11 @@ func (client AlertsClient) ListByResourceGroupComplete(ctx context.Context, reso // ListResourceGroupLevelByRegion list all the alerts that are associated with the resource group that are stored in a // specific location // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. -func (client AlertsClient) ListResourceGroupLevelByRegion(ctx context.Context, resourceGroupName string) (result AlertListPage, err error) { +func (client AlertsClient) ListResourceGroupLevelByRegion(ctx context.Context, ascLocation string, resourceGroupName string) (result AlertListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListResourceGroupLevelByRegion") defer func() { @@ -473,7 +479,7 @@ func (client AlertsClient) ListResourceGroupLevelByRegion(ctx context.Context, r } result.fn = client.listResourceGroupLevelByRegionNextResults - req, err := client.ListResourceGroupLevelByRegionPreparer(ctx, resourceGroupName) + req, err := client.ListResourceGroupLevelByRegionPreparer(ctx, ascLocation, resourceGroupName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListResourceGroupLevelByRegion", nil, "Failure preparing request") return @@ -500,14 +506,14 @@ func (client AlertsClient) ListResourceGroupLevelByRegion(ctx context.Context, r } // ListResourceGroupLevelByRegionPreparer prepares the ListResourceGroupLevelByRegion request. -func (client AlertsClient) ListResourceGroupLevelByRegionPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { +func (client AlertsClient) ListResourceGroupLevelByRegionPreparer(ctx context.Context, ascLocation string, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-01-01" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -560,7 +566,7 @@ func (client AlertsClient) listResourceGroupLevelByRegionNextResults(ctx context } // ListResourceGroupLevelByRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AlertsClient) ListResourceGroupLevelByRegionComplete(ctx context.Context, resourceGroupName string) (result AlertListIterator, err error) { +func (client AlertsClient) ListResourceGroupLevelByRegionComplete(ctx context.Context, ascLocation string, resourceGroupName string) (result AlertListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListResourceGroupLevelByRegion") defer func() { @@ -571,13 +577,16 @@ func (client AlertsClient) ListResourceGroupLevelByRegionComplete(ctx context.Co tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListResourceGroupLevelByRegion(ctx, resourceGroupName) + result.page, err = client.ListResourceGroupLevelByRegion(ctx, ascLocation, resourceGroupName) return } // 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) { +// Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations +func (client AlertsClient) ListSubscriptionLevelByRegion(ctx context.Context, ascLocation string) (result AlertListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListSubscriptionLevelByRegion") defer func() { @@ -595,7 +604,7 @@ func (client AlertsClient) ListSubscriptionLevelByRegion(ctx context.Context) (r } result.fn = client.listSubscriptionLevelByRegionNextResults - req, err := client.ListSubscriptionLevelByRegionPreparer(ctx) + req, err := client.ListSubscriptionLevelByRegionPreparer(ctx, ascLocation) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListSubscriptionLevelByRegion", nil, "Failure preparing request") return @@ -622,13 +631,13 @@ func (client AlertsClient) ListSubscriptionLevelByRegion(ctx context.Context) (r } // ListSubscriptionLevelByRegionPreparer prepares the ListSubscriptionLevelByRegion request. -func (client AlertsClient) ListSubscriptionLevelByRegionPreparer(ctx context.Context) (*http.Request, error) { +func (client AlertsClient) ListSubscriptionLevelByRegionPreparer(ctx context.Context, ascLocation string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-01-01" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -681,7 +690,7 @@ func (client AlertsClient) listSubscriptionLevelByRegionNextResults(ctx context. } // ListSubscriptionLevelByRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AlertsClient) ListSubscriptionLevelByRegionComplete(ctx context.Context) (result AlertListIterator, err error) { +func (client AlertsClient) ListSubscriptionLevelByRegionComplete(ctx context.Context, ascLocation string) (result AlertListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListSubscriptionLevelByRegion") defer func() { @@ -692,20 +701,22 @@ func (client AlertsClient) ListSubscriptionLevelByRegionComplete(ctx context.Con tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListSubscriptionLevelByRegion(ctx) + result.page, err = client.ListSubscriptionLevelByRegion(ctx, ascLocation) return } // Simulate simulate security alerts // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // alertSimulatorRequestBody - alert Simulator Request Properties -func (client AlertsClient) Simulate(ctx context.Context, alertSimulatorRequestBody AlertSimulatorRequestBody) (result AlertsSimulateFuture, err error) { +func (client AlertsClient) Simulate(ctx context.Context, ascLocation string, alertSimulatorRequestBody AlertSimulatorRequestBody) (result autorest.Response, 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 + if result.Response != nil { + sc = result.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -716,15 +727,22 @@ func (client AlertsClient) Simulate(ctx context.Context, alertSimulatorRequestBo return result, validation.NewError("security.AlertsClient", "Simulate", err.Error()) } - req, err := client.SimulatePreparer(ctx, alertSimulatorRequestBody) + req, err := client.SimulatePreparer(ctx, ascLocation, alertSimulatorRequestBody) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "Simulate", nil, "Failure preparing request") return } - result, err = client.SimulateSender(req) + resp, err := client.SimulateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.AlertsClient", "Simulate", resp, "Failure sending request") + return + } + + result, err = client.SimulateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "Simulate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "Simulate", resp, "Failure responding to request") return } @@ -732,13 +750,13 @@ func (client AlertsClient) Simulate(ctx context.Context, alertSimulatorRequestBo } // SimulatePreparer prepares the Simulate request. -func (client AlertsClient) SimulatePreparer(ctx context.Context, alertSimulatorRequestBody AlertSimulatorRequestBody) (*http.Request, error) { +func (client AlertsClient) SimulatePreparer(ctx context.Context, ascLocation string, alertSimulatorRequestBody AlertSimulatorRequestBody) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-01-01" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -755,18 +773,8 @@ func (client AlertsClient) SimulatePreparer(ctx context.Context, alertSimulatorR // 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 - future.FutureAPI = &azure.Future{} - 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 +func (client AlertsClient) SimulateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // SimulateResponder handles the response to the Simulate request. The method always @@ -774,7 +782,7 @@ func (client AlertsClient) SimulateSender(req *http.Request) (future AlertsSimul func (client AlertsClient) SimulateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return @@ -782,10 +790,12 @@ func (client AlertsClient) SimulateResponder(resp *http.Response) (result autore // UpdateResourceGroupLevelStateToActivate update the alert's state // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // 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) UpdateResourceGroupLevelStateToActivate(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) { +func (client AlertsClient) UpdateResourceGroupLevelStateToActivate(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateResourceGroupLevelStateToActivate") defer func() { @@ -806,7 +816,7 @@ func (client AlertsClient) UpdateResourceGroupLevelStateToActivate(ctx context.C return result, validation.NewError("security.AlertsClient", "UpdateResourceGroupLevelStateToActivate", err.Error()) } - req, err := client.UpdateResourceGroupLevelStateToActivatePreparer(ctx, alertName, resourceGroupName) + req, err := client.UpdateResourceGroupLevelStateToActivatePreparer(ctx, ascLocation, alertName, resourceGroupName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelStateToActivate", nil, "Failure preparing request") return @@ -829,15 +839,15 @@ func (client AlertsClient) UpdateResourceGroupLevelStateToActivate(ctx context.C } // UpdateResourceGroupLevelStateToActivatePreparer prepares the UpdateResourceGroupLevelStateToActivate request. -func (client AlertsClient) UpdateResourceGroupLevelStateToActivatePreparer(ctx context.Context, alertName string, resourceGroupName string) (*http.Request, error) { +func (client AlertsClient) UpdateResourceGroupLevelStateToActivatePreparer(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-01-01" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -869,10 +879,12 @@ func (client AlertsClient) UpdateResourceGroupLevelStateToActivateResponder(resp // UpdateResourceGroupLevelStateToDismiss update the alert's state // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // 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) UpdateResourceGroupLevelStateToDismiss(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) { +func (client AlertsClient) UpdateResourceGroupLevelStateToDismiss(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateResourceGroupLevelStateToDismiss") defer func() { @@ -893,7 +905,7 @@ func (client AlertsClient) UpdateResourceGroupLevelStateToDismiss(ctx context.Co return result, validation.NewError("security.AlertsClient", "UpdateResourceGroupLevelStateToDismiss", err.Error()) } - req, err := client.UpdateResourceGroupLevelStateToDismissPreparer(ctx, alertName, resourceGroupName) + req, err := client.UpdateResourceGroupLevelStateToDismissPreparer(ctx, ascLocation, alertName, resourceGroupName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelStateToDismiss", nil, "Failure preparing request") return @@ -916,15 +928,15 @@ func (client AlertsClient) UpdateResourceGroupLevelStateToDismiss(ctx context.Co } // UpdateResourceGroupLevelStateToDismissPreparer prepares the UpdateResourceGroupLevelStateToDismiss request. -func (client AlertsClient) UpdateResourceGroupLevelStateToDismissPreparer(ctx context.Context, alertName string, resourceGroupName string) (*http.Request, error) { +func (client AlertsClient) UpdateResourceGroupLevelStateToDismissPreparer(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-01-01" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -956,10 +968,12 @@ func (client AlertsClient) UpdateResourceGroupLevelStateToDismissResponder(resp // UpdateResourceGroupLevelStateToResolve update the alert's state // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // 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) UpdateResourceGroupLevelStateToResolve(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) { +func (client AlertsClient) UpdateResourceGroupLevelStateToResolve(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateResourceGroupLevelStateToResolve") defer func() { @@ -980,7 +994,7 @@ func (client AlertsClient) UpdateResourceGroupLevelStateToResolve(ctx context.Co return result, validation.NewError("security.AlertsClient", "UpdateResourceGroupLevelStateToResolve", err.Error()) } - req, err := client.UpdateResourceGroupLevelStateToResolvePreparer(ctx, alertName, resourceGroupName) + req, err := client.UpdateResourceGroupLevelStateToResolvePreparer(ctx, ascLocation, alertName, resourceGroupName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelStateToResolve", nil, "Failure preparing request") return @@ -1003,15 +1017,15 @@ func (client AlertsClient) UpdateResourceGroupLevelStateToResolve(ctx context.Co } // UpdateResourceGroupLevelStateToResolvePreparer prepares the UpdateResourceGroupLevelStateToResolve request. -func (client AlertsClient) UpdateResourceGroupLevelStateToResolvePreparer(ctx context.Context, alertName string, resourceGroupName string) (*http.Request, error) { +func (client AlertsClient) UpdateResourceGroupLevelStateToResolvePreparer(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-01-01" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1043,8 +1057,10 @@ func (client AlertsClient) UpdateResourceGroupLevelStateToResolveResponder(resp // UpdateSubscriptionLevelStateToActivate update the alert's state // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // alertName - name of the alert object -func (client AlertsClient) UpdateSubscriptionLevelStateToActivate(ctx context.Context, alertName string) (result autorest.Response, err error) { +func (client AlertsClient) UpdateSubscriptionLevelStateToActivate(ctx context.Context, ascLocation string, alertName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateSubscriptionLevelStateToActivate") defer func() { @@ -1061,7 +1077,7 @@ func (client AlertsClient) UpdateSubscriptionLevelStateToActivate(ctx context.Co return result, validation.NewError("security.AlertsClient", "UpdateSubscriptionLevelStateToActivate", err.Error()) } - req, err := client.UpdateSubscriptionLevelStateToActivatePreparer(ctx, alertName) + req, err := client.UpdateSubscriptionLevelStateToActivatePreparer(ctx, ascLocation, alertName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelStateToActivate", nil, "Failure preparing request") return @@ -1084,14 +1100,14 @@ func (client AlertsClient) UpdateSubscriptionLevelStateToActivate(ctx context.Co } // UpdateSubscriptionLevelStateToActivatePreparer prepares the UpdateSubscriptionLevelStateToActivate request. -func (client AlertsClient) UpdateSubscriptionLevelStateToActivatePreparer(ctx context.Context, alertName string) (*http.Request, error) { +func (client AlertsClient) UpdateSubscriptionLevelStateToActivatePreparer(ctx context.Context, ascLocation string, alertName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-01-01" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1123,8 +1139,10 @@ func (client AlertsClient) UpdateSubscriptionLevelStateToActivateResponder(resp // UpdateSubscriptionLevelStateToDismiss update the alert's state // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // alertName - name of the alert object -func (client AlertsClient) UpdateSubscriptionLevelStateToDismiss(ctx context.Context, alertName string) (result autorest.Response, err error) { +func (client AlertsClient) UpdateSubscriptionLevelStateToDismiss(ctx context.Context, ascLocation string, alertName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateSubscriptionLevelStateToDismiss") defer func() { @@ -1141,7 +1159,7 @@ func (client AlertsClient) UpdateSubscriptionLevelStateToDismiss(ctx context.Con return result, validation.NewError("security.AlertsClient", "UpdateSubscriptionLevelStateToDismiss", err.Error()) } - req, err := client.UpdateSubscriptionLevelStateToDismissPreparer(ctx, alertName) + req, err := client.UpdateSubscriptionLevelStateToDismissPreparer(ctx, ascLocation, alertName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelStateToDismiss", nil, "Failure preparing request") return @@ -1164,14 +1182,14 @@ func (client AlertsClient) UpdateSubscriptionLevelStateToDismiss(ctx context.Con } // UpdateSubscriptionLevelStateToDismissPreparer prepares the UpdateSubscriptionLevelStateToDismiss request. -func (client AlertsClient) UpdateSubscriptionLevelStateToDismissPreparer(ctx context.Context, alertName string) (*http.Request, error) { +func (client AlertsClient) UpdateSubscriptionLevelStateToDismissPreparer(ctx context.Context, ascLocation string, alertName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-01-01" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1203,8 +1221,10 @@ func (client AlertsClient) UpdateSubscriptionLevelStateToDismissResponder(resp * // UpdateSubscriptionLevelStateToResolve update the alert's state // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // alertName - name of the alert object -func (client AlertsClient) UpdateSubscriptionLevelStateToResolve(ctx context.Context, alertName string) (result autorest.Response, err error) { +func (client AlertsClient) UpdateSubscriptionLevelStateToResolve(ctx context.Context, ascLocation string, alertName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateSubscriptionLevelStateToResolve") defer func() { @@ -1221,7 +1241,7 @@ func (client AlertsClient) UpdateSubscriptionLevelStateToResolve(ctx context.Con return result, validation.NewError("security.AlertsClient", "UpdateSubscriptionLevelStateToResolve", err.Error()) } - req, err := client.UpdateSubscriptionLevelStateToResolvePreparer(ctx, alertName) + req, err := client.UpdateSubscriptionLevelStateToResolvePreparer(ctx, ascLocation, alertName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelStateToResolve", nil, "Failure preparing request") return @@ -1244,14 +1264,14 @@ func (client AlertsClient) UpdateSubscriptionLevelStateToResolve(ctx context.Con } // UpdateSubscriptionLevelStateToResolvePreparer prepares the UpdateSubscriptionLevelStateToResolve request. -func (client AlertsClient) UpdateSubscriptionLevelStateToResolvePreparer(ctx context.Context, alertName string) (*http.Request, error) { +func (client AlertsClient) UpdateSubscriptionLevelStateToResolvePreparer(ctx context.Context, ascLocation string, alertName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-01-01" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/security/mgmt/v3.0/security/alertssuppressionrules.go b/services/preview/security/mgmt/v3.0/security/alertssuppressionrules.go index 6b7c70e4f188..4ff181fc65c9 100644 --- a/services/preview/security/mgmt/v3.0/security/alertssuppressionrules.go +++ b/services/preview/security/mgmt/v3.0/security/alertssuppressionrules.go @@ -21,15 +21,15 @@ type AlertsSuppressionRulesClient struct { } // NewAlertsSuppressionRulesClient creates an instance of the AlertsSuppressionRulesClient client. -func NewAlertsSuppressionRulesClient(subscriptionID string, ascLocation string) AlertsSuppressionRulesClient { - return NewAlertsSuppressionRulesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAlertsSuppressionRulesClient(subscriptionID string) AlertsSuppressionRulesClient { + return NewAlertsSuppressionRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAlertsSuppressionRulesClientWithBaseURI creates an instance of the AlertsSuppressionRulesClient 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 NewAlertsSuppressionRulesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AlertsSuppressionRulesClient { - return AlertsSuppressionRulesClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAlertsSuppressionRulesClientWithBaseURI(baseURI string, subscriptionID string) AlertsSuppressionRulesClient { + return AlertsSuppressionRulesClient{NewWithBaseURI(baseURI, subscriptionID)} } // Delete delete dismiss alert rule for this subscription. diff --git a/services/preview/security/mgmt/v3.0/security/allowedconnections.go b/services/preview/security/mgmt/v3.0/security/allowedconnections.go index 5ee905a83512..b184cff80572 100644 --- a/services/preview/security/mgmt/v3.0/security/allowedconnections.go +++ b/services/preview/security/mgmt/v3.0/security/allowedconnections.go @@ -21,15 +21,15 @@ type AllowedConnectionsClient struct { } // NewAllowedConnectionsClient creates an instance of the AllowedConnectionsClient client. -func NewAllowedConnectionsClient(subscriptionID string, ascLocation string) AllowedConnectionsClient { - return NewAllowedConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAllowedConnectionsClient(subscriptionID string) AllowedConnectionsClient { + return NewAllowedConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAllowedConnectionsClientWithBaseURI creates an instance of the AllowedConnectionsClient 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 NewAllowedConnectionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AllowedConnectionsClient { - return AllowedConnectionsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAllowedConnectionsClientWithBaseURI(baseURI string, subscriptionID string) AllowedConnectionsClient { + return AllowedConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets the list of all possible traffic between resources for the subscription and location, based on connection @@ -37,8 +37,10 @@ func NewAllowedConnectionsClientWithBaseURI(baseURI string, subscriptionID strin // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // connectionType - the type of allowed connections (Internal, External) -func (client AllowedConnectionsClient) Get(ctx context.Context, resourceGroupName string, connectionType ConnectionType) (result AllowedConnectionsResource, err error) { +func (client AllowedConnectionsClient) Get(ctx context.Context, resourceGroupName string, ascLocation string, connectionType ConnectionType) (result AllowedConnectionsResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AllowedConnectionsClient.Get") defer func() { @@ -59,7 +61,7 @@ func (client AllowedConnectionsClient) Get(ctx context.Context, resourceGroupNam return result, validation.NewError("security.AllowedConnectionsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, connectionType) + req, err := client.GetPreparer(ctx, resourceGroupName, ascLocation, connectionType) if err != nil { err = autorest.NewErrorWithError(err, "security.AllowedConnectionsClient", "Get", nil, "Failure preparing request") return @@ -82,9 +84,9 @@ func (client AllowedConnectionsClient) Get(ctx context.Context, resourceGroupNam } // GetPreparer prepares the Get request. -func (client AllowedConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, connectionType ConnectionType) (*http.Request, error) { +func (client AllowedConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, ascLocation string, connectionType ConnectionType) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "connectionType": autorest.Encode("path", connectionType), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -241,7 +243,10 @@ func (client AllowedConnectionsClient) ListComplete(ctx context.Context) (result } // ListByHomeRegion gets the list of all possible traffic between resources for the subscription and location. -func (client AllowedConnectionsClient) ListByHomeRegion(ctx context.Context) (result AllowedConnectionsListPage, err error) { +// Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations +func (client AllowedConnectionsClient) ListByHomeRegion(ctx context.Context, ascLocation string) (result AllowedConnectionsListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AllowedConnectionsClient.ListByHomeRegion") defer func() { @@ -259,7 +264,7 @@ func (client AllowedConnectionsClient) ListByHomeRegion(ctx context.Context) (re } result.fn = client.listByHomeRegionNextResults - req, err := client.ListByHomeRegionPreparer(ctx) + req, err := client.ListByHomeRegionPreparer(ctx, ascLocation) if err != nil { err = autorest.NewErrorWithError(err, "security.AllowedConnectionsClient", "ListByHomeRegion", nil, "Failure preparing request") return @@ -286,9 +291,9 @@ func (client AllowedConnectionsClient) ListByHomeRegion(ctx context.Context) (re } // ListByHomeRegionPreparer prepares the ListByHomeRegion request. -func (client AllowedConnectionsClient) ListByHomeRegionPreparer(ctx context.Context) (*http.Request, error) { +func (client AllowedConnectionsClient) ListByHomeRegionPreparer(ctx context.Context, ascLocation string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -345,7 +350,7 @@ func (client AllowedConnectionsClient) listByHomeRegionNextResults(ctx context.C } // ListByHomeRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AllowedConnectionsClient) ListByHomeRegionComplete(ctx context.Context) (result AllowedConnectionsListIterator, err error) { +func (client AllowedConnectionsClient) ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result AllowedConnectionsListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AllowedConnectionsClient.ListByHomeRegion") defer func() { @@ -356,6 +361,6 @@ func (client AllowedConnectionsClient) ListByHomeRegionComplete(ctx context.Cont tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByHomeRegion(ctx) + result.page, err = client.ListByHomeRegion(ctx, ascLocation) return } diff --git a/services/preview/security/mgmt/v3.0/security/assessments.go b/services/preview/security/mgmt/v3.0/security/assessments.go index 65f4d466da55..1cc399c22ba9 100644 --- a/services/preview/security/mgmt/v3.0/security/assessments.go +++ b/services/preview/security/mgmt/v3.0/security/assessments.go @@ -21,14 +21,14 @@ type AssessmentsClient struct { } // NewAssessmentsClient creates an instance of the AssessmentsClient client. -func NewAssessmentsClient(subscriptionID string, ascLocation string) AssessmentsClient { - return NewAssessmentsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAssessmentsClient(subscriptionID string) AssessmentsClient { + return NewAssessmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAssessmentsClientWithBaseURI creates an instance of the AssessmentsClient 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 NewAssessmentsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AssessmentsClient { - return AssessmentsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAssessmentsClientWithBaseURI(baseURI string, subscriptionID string) AssessmentsClient { + return AssessmentsClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate create a security assessment on your resource. An assessment metadata that describes this assessment @@ -37,7 +37,7 @@ func NewAssessmentsClientWithBaseURI(baseURI string, subscriptionID string, ascL // resourceID - the identifier of the resource. // assessmentName - the Assessment Key - Unique key for the assessment type // assessment - calculated assessment on a pre-defined assessment metadata -func (client AssessmentsClient) CreateOrUpdate(ctx context.Context, resourceID string, assessmentName string, assessment Assessment) (result Assessment, err error) { +func (client AssessmentsClient) CreateOrUpdate(ctx context.Context, resourceID string, assessmentName string, assessment Assessment) (result AssessmentResponse, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsClient.CreateOrUpdate") defer func() { @@ -51,19 +51,7 @@ func (client AssessmentsClient) CreateOrUpdate(ctx context.Context, resourceID s if err := validation.Validate([]validation.Validation{ {TargetValue: assessment, Constraints: []validation.Constraint{{Target: "assessment.AssessmentProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "assessment.AssessmentProperties.Status", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "assessment.AssessmentProperties.Metadata", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "assessment.AssessmentProperties.Metadata.DisplayName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "assessment.AssessmentProperties.Metadata.PartnerData", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "assessment.AssessmentProperties.Metadata.PartnerData.PartnerName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "assessment.AssessmentProperties.Metadata.PartnerData.Secret", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - {Target: "assessment.AssessmentProperties.PartnersData", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "assessment.AssessmentProperties.PartnersData.PartnerName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "assessment.AssessmentProperties.PartnersData.Secret", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}}); err != nil { + Chain: []validation.Constraint{{Target: "assessment.AssessmentProperties.Status", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("security.AssessmentsClient", "CreateOrUpdate", err.Error()) } @@ -96,7 +84,7 @@ func (client AssessmentsClient) CreateOrUpdatePreparer(ctx context.Context, reso "resourceId": resourceID, } - const APIVersion = "2020-01-01" + const APIVersion = "2021-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -119,7 +107,7 @@ func (client AssessmentsClient) CreateOrUpdateSender(req *http.Request) (*http.R // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client AssessmentsClient) CreateOrUpdateResponder(resp *http.Response) (result Assessment, err error) { +func (client AssessmentsClient) CreateOrUpdateResponder(resp *http.Response) (result AssessmentResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), @@ -174,7 +162,7 @@ func (client AssessmentsClient) DeletePreparer(ctx context.Context, resourceID s "resourceId": resourceID, } - const APIVersion = "2020-01-01" + const APIVersion = "2021-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -209,7 +197,7 @@ func (client AssessmentsClient) DeleteResponder(resp *http.Response) (result aut // resourceID - the identifier of the resource. // assessmentName - the Assessment Key - Unique key for the assessment type // expand - oData expand. Optional. -func (client AssessmentsClient) Get(ctx context.Context, resourceID string, assessmentName string, expand ExpandEnum) (result Assessment, err error) { +func (client AssessmentsClient) Get(ctx context.Context, resourceID string, assessmentName string, expand ExpandEnum) (result AssessmentResponse, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsClient.Get") defer func() { @@ -249,7 +237,7 @@ func (client AssessmentsClient) GetPreparer(ctx context.Context, resourceID stri "resourceId": resourceID, } - const APIVersion = "2020-01-01" + const APIVersion = "2021-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -273,7 +261,7 @@ func (client AssessmentsClient) GetSender(req *http.Request) (*http.Response, er // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client AssessmentsClient) GetResponder(resp *http.Response) (result Assessment, err error) { +func (client AssessmentsClient) GetResponder(resp *http.Response) (result AssessmentResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -331,7 +319,7 @@ func (client AssessmentsClient) ListPreparer(ctx context.Context, scope string) "scope": scope, } - const APIVersion = "2020-01-01" + const APIVersion = "2021-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/security/mgmt/v3.0/security/assessmentsmetadata.go b/services/preview/security/mgmt/v3.0/security/assessmentsmetadata.go index 0cbfcd89ad55..37d4f9f62444 100644 --- a/services/preview/security/mgmt/v3.0/security/assessmentsmetadata.go +++ b/services/preview/security/mgmt/v3.0/security/assessmentsmetadata.go @@ -21,22 +21,22 @@ type AssessmentsMetadataClient struct { } // NewAssessmentsMetadataClient creates an instance of the AssessmentsMetadataClient client. -func NewAssessmentsMetadataClient(subscriptionID string, ascLocation string) AssessmentsMetadataClient { - return NewAssessmentsMetadataClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAssessmentsMetadataClient(subscriptionID string) AssessmentsMetadataClient { + return NewAssessmentsMetadataClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAssessmentsMetadataClientWithBaseURI creates an instance of the AssessmentsMetadataClient 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 NewAssessmentsMetadataClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AssessmentsMetadataClient { - return AssessmentsMetadataClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAssessmentsMetadataClientWithBaseURI(baseURI string, subscriptionID string) AssessmentsMetadataClient { + return AssessmentsMetadataClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateInSubscription create metadata information on an assessment type in a specific subscription // Parameters: // assessmentMetadataName - the Assessment Key - Unique key for the assessment type // assessmentMetadata - assessmentMetadata object -func (client AssessmentsMetadataClient) CreateInSubscription(ctx context.Context, assessmentMetadataName string, assessmentMetadata AssessmentMetadata) (result AssessmentMetadata, err error) { +func (client AssessmentsMetadataClient) CreateInSubscription(ctx context.Context, assessmentMetadataName string, assessmentMetadata AssessmentMetadataResponse) (result AssessmentMetadataResponse, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.CreateInSubscription") defer func() { @@ -51,12 +51,15 @@ func (client AssessmentsMetadataClient) CreateInSubscription(ctx context.Context {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: assessmentMetadata, - Constraints: []validation.Constraint{{Target: "assessmentMetadata.AssessmentMetadataProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "assessmentMetadata.AssessmentMetadataProperties.DisplayName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "assessmentMetadata.AssessmentMetadataProperties.PartnerData", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "assessmentMetadata.AssessmentMetadataProperties.PartnerData.PartnerName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "assessmentMetadata.AssessmentMetadataProperties.PartnerData.Secret", Name: validation.Null, Rule: true, Chain: nil}, - }}, + Constraints: []validation.Constraint{{Target: "assessmentMetadata.AssessmentMetadataPropertiesResponse", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "assessmentMetadata.AssessmentMetadataPropertiesResponse.PublishDates", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "assessmentMetadata.AssessmentMetadataPropertiesResponse.PublishDates.GA", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "assessmentMetadata.AssessmentMetadataPropertiesResponse.PublishDates.GA", Name: validation.Pattern, Rule: `^([0-9]{2}/){2}[0-9]{4}$`, Chain: nil}}}, + {Target: "assessmentMetadata.AssessmentMetadataPropertiesResponse.PublishDates.Public", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "assessmentMetadata.AssessmentMetadataPropertiesResponse.PublishDates.Public", Name: validation.Pattern, Rule: `^([0-9]{2}/){2}[0-9]{4}$`, Chain: nil}}}, + }}, + {Target: "assessmentMetadata.AssessmentMetadataPropertiesResponse.PlannedDeprecationDate", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "assessmentMetadata.AssessmentMetadataPropertiesResponse.PlannedDeprecationDate", Name: validation.Pattern, Rule: `^[0-9]{2}/[0-9]{4}$`, Chain: nil}}}, }}}}}); err != nil { return result, validation.NewError("security.AssessmentsMetadataClient", "CreateInSubscription", err.Error()) } @@ -84,13 +87,13 @@ func (client AssessmentsMetadataClient) CreateInSubscription(ctx context.Context } // CreateInSubscriptionPreparer prepares the CreateInSubscription request. -func (client AssessmentsMetadataClient) CreateInSubscriptionPreparer(ctx context.Context, assessmentMetadataName string, assessmentMetadata AssessmentMetadata) (*http.Request, error) { +func (client AssessmentsMetadataClient) CreateInSubscriptionPreparer(ctx context.Context, assessmentMetadataName string, assessmentMetadata AssessmentMetadataResponse) (*http.Request, error) { pathParameters := map[string]interface{}{ "assessmentMetadataName": autorest.Encode("path", assessmentMetadataName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01" + const APIVersion = "2021-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -113,7 +116,7 @@ func (client AssessmentsMetadataClient) CreateInSubscriptionSender(req *http.Req // CreateInSubscriptionResponder handles the response to the CreateInSubscription request. The method always // closes the http.Response Body. -func (client AssessmentsMetadataClient) CreateInSubscriptionResponder(resp *http.Response) (result AssessmentMetadata, err error) { +func (client AssessmentsMetadataClient) CreateInSubscriptionResponder(resp *http.Response) (result AssessmentMetadataResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -173,7 +176,7 @@ func (client AssessmentsMetadataClient) DeleteInSubscriptionPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01" + const APIVersion = "2021-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -206,7 +209,7 @@ func (client AssessmentsMetadataClient) DeleteInSubscriptionResponder(resp *http // Get get metadata information on an assessment type // Parameters: // assessmentMetadataName - the Assessment Key - Unique key for the assessment type -func (client AssessmentsMetadataClient) Get(ctx context.Context, assessmentMetadataName string) (result AssessmentMetadata, err error) { +func (client AssessmentsMetadataClient) Get(ctx context.Context, assessmentMetadataName string) (result AssessmentMetadataResponse, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.Get") defer func() { @@ -245,7 +248,7 @@ func (client AssessmentsMetadataClient) GetPreparer(ctx context.Context, assessm "assessmentMetadataName": autorest.Encode("path", assessmentMetadataName), } - const APIVersion = "2020-01-01" + const APIVersion = "2021-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -266,7 +269,7 @@ func (client AssessmentsMetadataClient) GetSender(req *http.Request) (*http.Resp // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client AssessmentsMetadataClient) GetResponder(resp *http.Response) (result AssessmentMetadata, err error) { +func (client AssessmentsMetadataClient) GetResponder(resp *http.Response) (result AssessmentMetadataResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -279,7 +282,7 @@ func (client AssessmentsMetadataClient) GetResponder(resp *http.Response) (resul // GetInSubscription get metadata information on an assessment type in a specific subscription // Parameters: // assessmentMetadataName - the Assessment Key - Unique key for the assessment type -func (client AssessmentsMetadataClient) GetInSubscription(ctx context.Context, assessmentMetadataName string) (result AssessmentMetadata, err error) { +func (client AssessmentsMetadataClient) GetInSubscription(ctx context.Context, assessmentMetadataName string) (result AssessmentMetadataResponse, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.GetInSubscription") defer func() { @@ -325,7 +328,7 @@ func (client AssessmentsMetadataClient) GetInSubscriptionPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01" + const APIVersion = "2021-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -346,7 +349,7 @@ func (client AssessmentsMetadataClient) GetInSubscriptionSender(req *http.Reques // GetInSubscriptionResponder handles the response to the GetInSubscription request. The method always // closes the http.Response Body. -func (client AssessmentsMetadataClient) GetInSubscriptionResponder(resp *http.Response) (result AssessmentMetadata, err error) { +func (client AssessmentsMetadataClient) GetInSubscriptionResponder(resp *http.Response) (result AssessmentMetadataResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -357,13 +360,13 @@ func (client AssessmentsMetadataClient) GetInSubscriptionResponder(resp *http.Re } // List get metadata information on all assessment types -func (client AssessmentsMetadataClient) List(ctx context.Context) (result AssessmentMetadataListPage, err error) { +func (client AssessmentsMetadataClient) List(ctx context.Context) (result AssessmentMetadataResponseListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.List") defer func() { sc := -1 - if result.aml.Response.Response != nil { - sc = result.aml.Response.Response.StatusCode + if result.amrl.Response.Response != nil { + sc = result.amrl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -377,17 +380,17 @@ func (client AssessmentsMetadataClient) List(ctx context.Context) (result Assess resp, err := client.ListSender(req) if err != nil { - result.aml.Response = autorest.Response{Response: resp} + result.amrl.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "List", resp, "Failure sending request") return } - result.aml, err = client.ListResponder(resp) + result.amrl, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "List", resp, "Failure responding to request") return } - if result.aml.hasNextLink() && result.aml.IsEmpty() { + if result.amrl.hasNextLink() && result.amrl.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -397,7 +400,7 @@ func (client AssessmentsMetadataClient) List(ctx context.Context) (result Assess // ListPreparer prepares the List request. func (client AssessmentsMetadataClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2020-01-01" + const APIVersion = "2021-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -418,7 +421,7 @@ func (client AssessmentsMetadataClient) ListSender(req *http.Request) (*http.Res // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client AssessmentsMetadataClient) ListResponder(resp *http.Response) (result AssessmentMetadataList, err error) { +func (client AssessmentsMetadataClient) ListResponder(resp *http.Response) (result AssessmentMetadataResponseList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -429,8 +432,8 @@ func (client AssessmentsMetadataClient) ListResponder(resp *http.Response) (resu } // listNextResults retrieves the next set of results, if any. -func (client AssessmentsMetadataClient) listNextResults(ctx context.Context, lastResults AssessmentMetadataList) (result AssessmentMetadataList, err error) { - req, err := lastResults.assessmentMetadataListPreparer(ctx) +func (client AssessmentsMetadataClient) listNextResults(ctx context.Context, lastResults AssessmentMetadataResponseList) (result AssessmentMetadataResponseList, err error) { + req, err := lastResults.assessmentMetadataResponseListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "listNextResults", nil, "Failure preparing next results request") } @@ -450,7 +453,7 @@ func (client AssessmentsMetadataClient) listNextResults(ctx context.Context, las } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AssessmentsMetadataClient) ListComplete(ctx context.Context) (result AssessmentMetadataListIterator, err error) { +func (client AssessmentsMetadataClient) ListComplete(ctx context.Context) (result AssessmentMetadataResponseListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.List") defer func() { @@ -466,13 +469,13 @@ func (client AssessmentsMetadataClient) ListComplete(ctx context.Context) (resul } // ListBySubscription get metadata information on all assessment types in a specific subscription -func (client AssessmentsMetadataClient) ListBySubscription(ctx context.Context) (result AssessmentMetadataListPage, err error) { +func (client AssessmentsMetadataClient) ListBySubscription(ctx context.Context) (result AssessmentMetadataResponseListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.ListBySubscription") defer func() { sc := -1 - if result.aml.Response.Response != nil { - sc = result.aml.Response.Response.StatusCode + if result.amrl.Response.Response != nil { + sc = result.amrl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -492,17 +495,17 @@ func (client AssessmentsMetadataClient) ListBySubscription(ctx context.Context) resp, err := client.ListBySubscriptionSender(req) if err != nil { - result.aml.Response = autorest.Response{Response: resp} + result.amrl.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "ListBySubscription", resp, "Failure sending request") return } - result.aml, err = client.ListBySubscriptionResponder(resp) + result.amrl, err = client.ListBySubscriptionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "ListBySubscription", resp, "Failure responding to request") return } - if result.aml.hasNextLink() && result.aml.IsEmpty() { + if result.amrl.hasNextLink() && result.amrl.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -516,7 +519,7 @@ func (client AssessmentsMetadataClient) ListBySubscriptionPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01" + const APIVersion = "2021-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -537,7 +540,7 @@ func (client AssessmentsMetadataClient) ListBySubscriptionSender(req *http.Reque // ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always // closes the http.Response Body. -func (client AssessmentsMetadataClient) ListBySubscriptionResponder(resp *http.Response) (result AssessmentMetadataList, err error) { +func (client AssessmentsMetadataClient) ListBySubscriptionResponder(resp *http.Response) (result AssessmentMetadataResponseList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -548,8 +551,8 @@ func (client AssessmentsMetadataClient) ListBySubscriptionResponder(resp *http.R } // listBySubscriptionNextResults retrieves the next set of results, if any. -func (client AssessmentsMetadataClient) listBySubscriptionNextResults(ctx context.Context, lastResults AssessmentMetadataList) (result AssessmentMetadataList, err error) { - req, err := lastResults.assessmentMetadataListPreparer(ctx) +func (client AssessmentsMetadataClient) listBySubscriptionNextResults(ctx context.Context, lastResults AssessmentMetadataResponseList) (result AssessmentMetadataResponseList, err error) { + req, err := lastResults.assessmentMetadataResponseListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") } @@ -569,7 +572,7 @@ func (client AssessmentsMetadataClient) listBySubscriptionNextResults(ctx contex } // ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AssessmentsMetadataClient) ListBySubscriptionComplete(ctx context.Context) (result AssessmentMetadataListIterator, err error) { +func (client AssessmentsMetadataClient) ListBySubscriptionComplete(ctx context.Context) (result AssessmentMetadataResponseListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.ListBySubscription") defer func() { diff --git a/services/preview/security/mgmt/v3.0/security/automations.go b/services/preview/security/mgmt/v3.0/security/automations.go index e7011a9534d3..1a586996bcaf 100644 --- a/services/preview/security/mgmt/v3.0/security/automations.go +++ b/services/preview/security/mgmt/v3.0/security/automations.go @@ -21,14 +21,14 @@ type AutomationsClient struct { } // NewAutomationsClient creates an instance of the AutomationsClient client. -func NewAutomationsClient(subscriptionID string, ascLocation string) AutomationsClient { - return NewAutomationsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAutomationsClient(subscriptionID string) AutomationsClient { + return NewAutomationsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAutomationsClientWithBaseURI creates an instance of the AutomationsClient 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 NewAutomationsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AutomationsClient { - return AutomationsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAutomationsClientWithBaseURI(baseURI string, subscriptionID string) AutomationsClient { + return AutomationsClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate creates or updates a security automation. If a security automation is already created and a diff --git a/services/preview/security/mgmt/v3.0/security/autoprovisioningsettings.go b/services/preview/security/mgmt/v3.0/security/autoprovisioningsettings.go index 0fed155d0347..5abc636c42ab 100644 --- a/services/preview/security/mgmt/v3.0/security/autoprovisioningsettings.go +++ b/services/preview/security/mgmt/v3.0/security/autoprovisioningsettings.go @@ -21,15 +21,15 @@ type AutoProvisioningSettingsClient struct { } // NewAutoProvisioningSettingsClient creates an instance of the AutoProvisioningSettingsClient client. -func NewAutoProvisioningSettingsClient(subscriptionID string, ascLocation string) AutoProvisioningSettingsClient { - return NewAutoProvisioningSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewAutoProvisioningSettingsClient(subscriptionID string) AutoProvisioningSettingsClient { + return NewAutoProvisioningSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAutoProvisioningSettingsClientWithBaseURI creates an instance of the AutoProvisioningSettingsClient 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 NewAutoProvisioningSettingsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AutoProvisioningSettingsClient { - return AutoProvisioningSettingsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewAutoProvisioningSettingsClientWithBaseURI(baseURI string, subscriptionID string) AutoProvisioningSettingsClient { + return AutoProvisioningSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Create details of a specific setting diff --git a/services/preview/security/mgmt/v3.0/security/client.go b/services/preview/security/mgmt/v3.0/security/client.go index 586d9c1a0478..8d050f3fc301 100644 --- a/services/preview/security/mgmt/v3.0/security/client.go +++ b/services/preview/security/mgmt/v3.0/security/client.go @@ -23,21 +23,19 @@ type BaseClient struct { autorest.Client BaseURI string SubscriptionID string - AscLocation string } // New creates an instance of the BaseClient client. -func New(subscriptionID string, ascLocation string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) } // NewWithBaseURI creates an instance of the BaseClient 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 NewWithBaseURI(baseURI string, subscriptionID string, ascLocation string) BaseClient { +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return BaseClient{ Client: autorest.NewClientWithUserAgent(UserAgent()), BaseURI: baseURI, SubscriptionID: subscriptionID, - AscLocation: ascLocation, } } diff --git a/services/preview/security/mgmt/v3.0/security/complianceresults.go b/services/preview/security/mgmt/v3.0/security/complianceresults.go index 57776b381e90..dd5053d992e7 100644 --- a/services/preview/security/mgmt/v3.0/security/complianceresults.go +++ b/services/preview/security/mgmt/v3.0/security/complianceresults.go @@ -20,15 +20,15 @@ type ComplianceResultsClient struct { } // NewComplianceResultsClient creates an instance of the ComplianceResultsClient client. -func NewComplianceResultsClient(subscriptionID string, ascLocation string) ComplianceResultsClient { - return NewComplianceResultsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewComplianceResultsClient(subscriptionID string) ComplianceResultsClient { + return NewComplianceResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewComplianceResultsClientWithBaseURI creates an instance of the ComplianceResultsClient 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 NewComplianceResultsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) ComplianceResultsClient { - return ComplianceResultsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewComplianceResultsClientWithBaseURI(baseURI string, subscriptionID string) ComplianceResultsClient { + return ComplianceResultsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get security Compliance Result diff --git a/services/preview/security/mgmt/v3.0/security/compliances.go b/services/preview/security/mgmt/v3.0/security/compliances.go index 742bf3ad09b1..b5e7ad8314a3 100644 --- a/services/preview/security/mgmt/v3.0/security/compliances.go +++ b/services/preview/security/mgmt/v3.0/security/compliances.go @@ -20,14 +20,14 @@ type CompliancesClient struct { } // NewCompliancesClient creates an instance of the CompliancesClient client. -func NewCompliancesClient(subscriptionID string, ascLocation string) CompliancesClient { - return NewCompliancesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewCompliancesClient(subscriptionID string) CompliancesClient { + return NewCompliancesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewCompliancesClientWithBaseURI creates an instance of the CompliancesClient 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 NewCompliancesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) CompliancesClient { - return CompliancesClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewCompliancesClientWithBaseURI(baseURI string, subscriptionID string) CompliancesClient { + return CompliancesClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get details of a specific Compliance. diff --git a/services/preview/security/mgmt/v3.0/security/connectors.go b/services/preview/security/mgmt/v3.0/security/connectors.go index 0dd69473fe13..e2e1aed7176c 100644 --- a/services/preview/security/mgmt/v3.0/security/connectors.go +++ b/services/preview/security/mgmt/v3.0/security/connectors.go @@ -21,14 +21,14 @@ type ConnectorsClient struct { } // NewConnectorsClient creates an instance of the ConnectorsClient client. -func NewConnectorsClient(subscriptionID string, ascLocation string) ConnectorsClient { - return NewConnectorsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewConnectorsClient(subscriptionID string) ConnectorsClient { + return NewConnectorsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewConnectorsClientWithBaseURI creates an instance of the ConnectorsClient 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 NewConnectorsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) ConnectorsClient { - return ConnectorsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewConnectorsClientWithBaseURI(baseURI string, subscriptionID string) ConnectorsClient { + return ConnectorsClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, diff --git a/services/preview/security/mgmt/v3.0/security/connectorsgroup.go b/services/preview/security/mgmt/v3.0/security/connectorsgroup.go new file mode 100644 index 000000000000..92b89b1213c6 --- /dev/null +++ b/services/preview/security/mgmt/v3.0/security/connectorsgroup.go @@ -0,0 +1,636 @@ +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" +) + +// ConnectorsGroupClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type ConnectorsGroupClient struct { + BaseClient +} + +// NewConnectorsGroupClient creates an instance of the ConnectorsGroupClient client. +func NewConnectorsGroupClient(subscriptionID string) ConnectorsGroupClient { + return NewConnectorsGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewConnectorsGroupClientWithBaseURI creates an instance of the ConnectorsGroupClient 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 NewConnectorsGroupClientWithBaseURI(baseURI string, subscriptionID string) ConnectorsGroupClient { + return ConnectorsGroupClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a security connector. If a security connector is already created and a subsequent +// request is issued for the same security connector id, then it will be updated. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// securityConnectorName - the security connector name. +// securityConnector - the security connector resource +func (client ConnectorsGroupClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector Connector) (result Connector, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsGroupClient.CreateOrUpdate") + 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.ConnectorsGroupClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, securityConnectorName, securityConnector) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ConnectorsGroupClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector Connector) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "securityConnectorName": autorest.Encode("path", securityConnectorName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + securityConnector.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}", pathParameters), + autorest.WithJSON(securityConnector), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectorsGroupClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ConnectorsGroupClient) CreateOrUpdateResponder(resp *http.Response) (result Connector, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a security connector. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// securityConnectorName - the security connector name. +func (client ConnectorsGroupClient) Delete(ctx context.Context, resourceGroupName string, securityConnectorName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsGroupClient.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}}}, + {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.ConnectorsGroupClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, securityConnectorName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ConnectorsGroupClient) DeletePreparer(ctx context.Context, resourceGroupName string, securityConnectorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "securityConnectorName": autorest.Encode("path", securityConnectorName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}", 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 ConnectorsGroupClient) 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 ConnectorsGroupClient) 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 retrieves details of a specific security connector +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// securityConnectorName - the security connector name. +func (client ConnectorsGroupClient) Get(ctx context.Context, resourceGroupName string, securityConnectorName string) (result Connector, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsGroupClient.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.ConnectorsGroupClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, securityConnectorName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "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.ConnectorsGroupClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ConnectorsGroupClient) GetPreparer(ctx context.Context, resourceGroupName string, securityConnectorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "securityConnectorName": autorest.Encode("path", securityConnectorName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-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/Microsoft.Security/securityConnectors/{securityConnectorName}", 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 ConnectorsGroupClient) 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 ConnectorsGroupClient) GetResponder(resp *http.Response) (result Connector, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to +// get the next page of security connectors for the specified subscription. +func (client ConnectorsGroupClient) List(ctx context.Context) (result ConnectorsListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsGroupClient.List") + defer func() { + sc := -1 + if result.cl.Response.Response != nil { + sc = result.cl.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.ConnectorsGroupClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.cl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "List", resp, "Failure sending request") + return + } + + result.cl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "List", resp, "Failure responding to request") + return + } + if result.cl.hasNextLink() && result.cl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ConnectorsGroupClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-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/securityConnectors", 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 ConnectorsGroupClient) 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 ConnectorsGroupClient) ListResponder(resp *http.Response) (result ConnectorsList, 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 ConnectorsGroupClient) listNextResults(ctx context.Context, lastResults ConnectorsList) (result ConnectorsList, err error) { + req, err := lastResults.connectorsListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "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.ConnectorsGroupClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ConnectorsGroupClient) ListComplete(ctx context.Context) (result ConnectorsListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsGroupClient.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 +} + +// ListByResourceGroup lists all the security connectors in the specified resource group. Use the 'nextLink' property +// in the response to get the next page of security connectors for the specified resource group. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +func (client ConnectorsGroupClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ConnectorsListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsGroupClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.cl.Response.Response != nil { + sc = result.cl.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.ConnectorsGroupClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.cl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.cl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.cl.hasNextLink() && result.cl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ConnectorsGroupClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-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/Microsoft.Security/securityConnectors", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectorsGroupClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client ConnectorsGroupClient) ListByResourceGroupResponder(resp *http.Response) (result ConnectorsList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client ConnectorsGroupClient) listByResourceGroupNextResults(ctx context.Context, lastResults ConnectorsList) (result ConnectorsList, err error) { + req, err := lastResults.connectorsListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ConnectorsGroupClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ConnectorsListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsGroupClient.ListByResourceGroup") + 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.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// Update updates a security connector +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// securityConnectorName - the security connector name. +// securityConnector - the security connector resource +func (client ConnectorsGroupClient) Update(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector Connector) (result Connector, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsGroupClient.Update") + 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.ConnectorsGroupClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, securityConnectorName, securityConnector) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.ConnectorsGroupClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ConnectorsGroupClient) UpdatePreparer(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector Connector) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "securityConnectorName": autorest.Encode("path", securityConnectorName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + securityConnector.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}", pathParameters), + autorest.WithJSON(securityConnector), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectorsGroupClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ConnectorsGroupClient) UpdateResponder(resp *http.Response) (result Connector, 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/services/preview/security/mgmt/v3.0/security/contacts.go b/services/preview/security/mgmt/v3.0/security/contacts.go index ccadbb870f93..6a36aef82c4f 100644 --- a/services/preview/security/mgmt/v3.0/security/contacts.go +++ b/services/preview/security/mgmt/v3.0/security/contacts.go @@ -21,14 +21,14 @@ type ContactsClient struct { } // NewContactsClient creates an instance of the ContactsClient client. -func NewContactsClient(subscriptionID string, ascLocation string) ContactsClient { - return NewContactsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewContactsClient(subscriptionID string) ContactsClient { + return NewContactsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewContactsClientWithBaseURI creates an instance of the ContactsClient 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 NewContactsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) ContactsClient { - return ContactsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewContactsClientWithBaseURI(baseURI string, subscriptionID string) ContactsClient { + return ContactsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Create security contact configurations for the subscription diff --git a/services/preview/security/mgmt/v3.0/security/customassessmentautomations.go b/services/preview/security/mgmt/v3.0/security/customassessmentautomations.go new file mode 100644 index 000000000000..178c8ec50cfb --- /dev/null +++ b/services/preview/security/mgmt/v3.0/security/customassessmentautomations.go @@ -0,0 +1,543 @@ +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" +) + +// CustomAssessmentAutomationsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type CustomAssessmentAutomationsClient struct { + BaseClient +} + +// NewCustomAssessmentAutomationsClient creates an instance of the CustomAssessmentAutomationsClient client. +func NewCustomAssessmentAutomationsClient(subscriptionID string) CustomAssessmentAutomationsClient { + return NewCustomAssessmentAutomationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCustomAssessmentAutomationsClientWithBaseURI creates an instance of the CustomAssessmentAutomationsClient 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 NewCustomAssessmentAutomationsClientWithBaseURI(baseURI string, subscriptionID string) CustomAssessmentAutomationsClient { + return CustomAssessmentAutomationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates or updates a custom assessment automation for the provided subscription. Please note that providing +// an existing custom assessment automation will replace the existing record. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// customAssessmentAutomationName - name of the Custom Assessment Automation. +// customAssessmentAutomationBody - custom Assessment Automation body +func (client CustomAssessmentAutomationsClient) Create(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string, customAssessmentAutomationBody CustomAssessmentAutomationRequest) (result CustomAssessmentAutomation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsClient.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}}}, + {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.CustomAssessmentAutomationsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, customAssessmentAutomationName, customAssessmentAutomationBody) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "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.CustomAssessmentAutomationsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client CustomAssessmentAutomationsClient) CreatePreparer(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string, customAssessmentAutomationBody CustomAssessmentAutomationRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customAssessmentAutomationName": autorest.Encode("path", customAssessmentAutomationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-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}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}", pathParameters), + autorest.WithJSON(customAssessmentAutomationBody), + 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 CustomAssessmentAutomationsClient) 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 CustomAssessmentAutomationsClient) CreateResponder(resp *http.Response) (result CustomAssessmentAutomation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a custom assessment automation by name for a provided subscription +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// customAssessmentAutomationName - name of the Custom Assessment Automation. +func (client CustomAssessmentAutomationsClient) Delete(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsClient.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}}}, + {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.CustomAssessmentAutomationsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, customAssessmentAutomationName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CustomAssessmentAutomationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customAssessmentAutomationName": autorest.Encode("path", customAssessmentAutomationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}", 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 CustomAssessmentAutomationsClient) 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 CustomAssessmentAutomationsClient) 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 gets a single custom assessment automation by name for the provided subscription and resource group. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// customAssessmentAutomationName - name of the Custom Assessment Automation. +func (client CustomAssessmentAutomationsClient) Get(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string) (result CustomAssessmentAutomation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsClient.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.CustomAssessmentAutomationsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, customAssessmentAutomationName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "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.CustomAssessmentAutomationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client CustomAssessmentAutomationsClient) GetPreparer(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customAssessmentAutomationName": autorest.Encode("path", customAssessmentAutomationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-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/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}", 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 CustomAssessmentAutomationsClient) 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 CustomAssessmentAutomationsClient) GetResponder(resp *http.Response) (result CustomAssessmentAutomation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup list custom assessment automations by provided subscription and resource group +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +func (client CustomAssessmentAutomationsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result CustomAssessmentAutomationsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.caalr.Response.Response != nil { + sc = result.caalr.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.CustomAssessmentAutomationsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.caalr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.caalr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.caalr.hasNextLink() && result.caalr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client CustomAssessmentAutomationsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-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/Microsoft.Security/customAssessmentAutomations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client CustomAssessmentAutomationsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client CustomAssessmentAutomationsClient) ListByResourceGroupResponder(resp *http.Response) (result CustomAssessmentAutomationsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client CustomAssessmentAutomationsClient) listByResourceGroupNextResults(ctx context.Context, lastResults CustomAssessmentAutomationsListResult) (result CustomAssessmentAutomationsListResult, err error) { + req, err := lastResults.customAssessmentAutomationsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client CustomAssessmentAutomationsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result CustomAssessmentAutomationsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsClient.ListByResourceGroup") + 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.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListBySubscription list custom assessment automations by provided subscription +func (client CustomAssessmentAutomationsClient) ListBySubscription(ctx context.Context) (result CustomAssessmentAutomationsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsClient.ListBySubscription") + defer func() { + sc := -1 + if result.caalr.Response.Response != nil { + sc = result.caalr.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.CustomAssessmentAutomationsClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.caalr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.caalr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.caalr.hasNextLink() && result.caalr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client CustomAssessmentAutomationsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-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/customAssessmentAutomations", 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 CustomAssessmentAutomationsClient) 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 CustomAssessmentAutomationsClient) ListBySubscriptionResponder(resp *http.Response) (result CustomAssessmentAutomationsListResult, 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 CustomAssessmentAutomationsClient) listBySubscriptionNextResults(ctx context.Context, lastResults CustomAssessmentAutomationsListResult) (result CustomAssessmentAutomationsListResult, err error) { + req, err := lastResults.customAssessmentAutomationsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "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.CustomAssessmentAutomationsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomAssessmentAutomationsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client CustomAssessmentAutomationsClient) ListBySubscriptionComplete(ctx context.Context) (result CustomAssessmentAutomationsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsClient.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/services/preview/security/mgmt/v3.0/security/customentitystoreassignments.go b/services/preview/security/mgmt/v3.0/security/customentitystoreassignments.go new file mode 100644 index 000000000000..615aa495c152 --- /dev/null +++ b/services/preview/security/mgmt/v3.0/security/customentitystoreassignments.go @@ -0,0 +1,542 @@ +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" +) + +// CustomEntityStoreAssignmentsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type CustomEntityStoreAssignmentsClient struct { + BaseClient +} + +// NewCustomEntityStoreAssignmentsClient creates an instance of the CustomEntityStoreAssignmentsClient client. +func NewCustomEntityStoreAssignmentsClient(subscriptionID string) CustomEntityStoreAssignmentsClient { + return NewCustomEntityStoreAssignmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCustomEntityStoreAssignmentsClientWithBaseURI creates an instance of the CustomEntityStoreAssignmentsClient +// 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 NewCustomEntityStoreAssignmentsClientWithBaseURI(baseURI string, subscriptionID string) CustomEntityStoreAssignmentsClient { + return CustomEntityStoreAssignmentsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a custom entity store assignment for the provided subscription, if not already exists. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// customEntityStoreAssignmentName - name of the custom entity store assignment. Generated name is GUID. +// customEntityStoreAssignmentRequestBody - custom entity store assignment body +func (client CustomEntityStoreAssignmentsClient) Create(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string, customEntityStoreAssignmentRequestBody CustomEntityStoreAssignmentRequest) (result CustomEntityStoreAssignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsClient.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}}}, + {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.CustomEntityStoreAssignmentsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, customEntityStoreAssignmentName, customEntityStoreAssignmentRequestBody) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "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.CustomEntityStoreAssignmentsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client CustomEntityStoreAssignmentsClient) CreatePreparer(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string, customEntityStoreAssignmentRequestBody CustomEntityStoreAssignmentRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customEntityStoreAssignmentName": autorest.Encode("path", customEntityStoreAssignmentName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-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}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}", pathParameters), + autorest.WithJSON(customEntityStoreAssignmentRequestBody), + 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 CustomEntityStoreAssignmentsClient) 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 CustomEntityStoreAssignmentsClient) CreateResponder(resp *http.Response) (result CustomEntityStoreAssignment, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a custom entity store assignment by name for a provided subscription +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// customEntityStoreAssignmentName - name of the custom entity store assignment. Generated name is GUID. +func (client CustomEntityStoreAssignmentsClient) Delete(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsClient.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}}}, + {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.CustomEntityStoreAssignmentsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, customEntityStoreAssignmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CustomEntityStoreAssignmentsClient) DeletePreparer(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customEntityStoreAssignmentName": autorest.Encode("path", customEntityStoreAssignmentName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}", 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 CustomEntityStoreAssignmentsClient) 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 CustomEntityStoreAssignmentsClient) 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 gets a single custom entity store assignment by name for the provided subscription and resource group. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// customEntityStoreAssignmentName - name of the custom entity store assignment. Generated name is GUID. +func (client CustomEntityStoreAssignmentsClient) Get(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string) (result CustomEntityStoreAssignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsClient.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.CustomEntityStoreAssignmentsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, customEntityStoreAssignmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "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.CustomEntityStoreAssignmentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client CustomEntityStoreAssignmentsClient) GetPreparer(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customEntityStoreAssignmentName": autorest.Encode("path", customEntityStoreAssignmentName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-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/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}", 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 CustomEntityStoreAssignmentsClient) 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 CustomEntityStoreAssignmentsClient) GetResponder(resp *http.Response) (result CustomEntityStoreAssignment, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup list custom entity store assignments by a provided subscription and resource group +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +func (client CustomEntityStoreAssignmentsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result CustomEntityStoreAssignmentsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.cesalr.Response.Response != nil { + sc = result.cesalr.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.CustomEntityStoreAssignmentsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.cesalr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.cesalr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.cesalr.hasNextLink() && result.cesalr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client CustomEntityStoreAssignmentsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-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/Microsoft.Security/customEntityStoreAssignments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client CustomEntityStoreAssignmentsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client CustomEntityStoreAssignmentsClient) ListByResourceGroupResponder(resp *http.Response) (result CustomEntityStoreAssignmentsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client CustomEntityStoreAssignmentsClient) listByResourceGroupNextResults(ctx context.Context, lastResults CustomEntityStoreAssignmentsListResult) (result CustomEntityStoreAssignmentsListResult, err error) { + req, err := lastResults.customEntityStoreAssignmentsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client CustomEntityStoreAssignmentsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result CustomEntityStoreAssignmentsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsClient.ListByResourceGroup") + 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.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListBySubscription list custom entity store assignments by provided subscription +func (client CustomEntityStoreAssignmentsClient) ListBySubscription(ctx context.Context) (result CustomEntityStoreAssignmentsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsClient.ListBySubscription") + defer func() { + sc := -1 + if result.cesalr.Response.Response != nil { + sc = result.cesalr.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.CustomEntityStoreAssignmentsClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.cesalr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.cesalr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.cesalr.hasNextLink() && result.cesalr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client CustomEntityStoreAssignmentsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-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/customEntityStoreAssignments", 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 CustomEntityStoreAssignmentsClient) 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 CustomEntityStoreAssignmentsClient) ListBySubscriptionResponder(resp *http.Response) (result CustomEntityStoreAssignmentsListResult, 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 CustomEntityStoreAssignmentsClient) listBySubscriptionNextResults(ctx context.Context, lastResults CustomEntityStoreAssignmentsListResult) (result CustomEntityStoreAssignmentsListResult, err error) { + req, err := lastResults.customEntityStoreAssignmentsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "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.CustomEntityStoreAssignmentsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.CustomEntityStoreAssignmentsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client CustomEntityStoreAssignmentsClient) ListBySubscriptionComplete(ctx context.Context) (result CustomEntityStoreAssignmentsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsClient.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/services/preview/security/mgmt/v3.0/security/device.go b/services/preview/security/mgmt/v3.0/security/device.go deleted file mode 100644 index 1c2be34eee7c..000000000000 --- a/services/preview/security/mgmt/v3.0/security/device.go +++ /dev/null @@ -1,106 +0,0 @@ -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/tracing" - "net/http" -) - -// DeviceClient is the API spec for Microsoft.Security (Azure Security Center) resource provider -type DeviceClient struct { - BaseClient -} - -// NewDeviceClient creates an instance of the DeviceClient client. -func NewDeviceClient(subscriptionID string, ascLocation string) DeviceClient { - return NewDeviceClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewDeviceClientWithBaseURI creates an instance of the DeviceClient 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 NewDeviceClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) DeviceClient { - return DeviceClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// Get get device. -// Parameters: -// resourceID - the identifier of the resource. -// deviceID - identifier of the device. -func (client DeviceClient) Get(ctx context.Context, resourceID string, deviceID string) (result Device, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DeviceClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceID, deviceID) - if err != nil { - err = autorest.NewErrorWithError(err, "security.DeviceClient", "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.DeviceClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.DeviceClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DeviceClient) GetPreparer(ctx context.Context, resourceID string, deviceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "deviceId": autorest.Encode("path", deviceID), - "resourceId": resourceID, - } - - const APIVersion = "2020-08-06-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{resourceId}/providers/Microsoft.Security/devices/{deviceId}", 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 DeviceClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DeviceClient) GetResponder(resp *http.Response) (result Device, 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/services/preview/security/mgmt/v3.0/security/devicesecuritygroups.go b/services/preview/security/mgmt/v3.0/security/devicesecuritygroups.go index 31fb9f7f32bc..f84c09a1ebe6 100644 --- a/services/preview/security/mgmt/v3.0/security/devicesecuritygroups.go +++ b/services/preview/security/mgmt/v3.0/security/devicesecuritygroups.go @@ -20,15 +20,15 @@ type DeviceSecurityGroupsClient struct { } // NewDeviceSecurityGroupsClient creates an instance of the DeviceSecurityGroupsClient client. -func NewDeviceSecurityGroupsClient(subscriptionID string, ascLocation string) DeviceSecurityGroupsClient { - return NewDeviceSecurityGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewDeviceSecurityGroupsClient(subscriptionID string) DeviceSecurityGroupsClient { + return NewDeviceSecurityGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewDeviceSecurityGroupsClientWithBaseURI creates an instance of the DeviceSecurityGroupsClient 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 NewDeviceSecurityGroupsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) DeviceSecurityGroupsClient { - return DeviceSecurityGroupsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewDeviceSecurityGroupsClientWithBaseURI(baseURI string, subscriptionID string) DeviceSecurityGroupsClient { + return DeviceSecurityGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate use this method to creates or updates the device security group on a specified IoT Hub resource. diff --git a/services/preview/security/mgmt/v3.0/security/devicesforhub.go b/services/preview/security/mgmt/v3.0/security/devicesforhub.go deleted file mode 100644 index ef202a24c8d9..000000000000 --- a/services/preview/security/mgmt/v3.0/security/devicesforhub.go +++ /dev/null @@ -1,158 +0,0 @@ -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/tracing" - "net/http" -) - -// DevicesForHubClient is the API spec for Microsoft.Security (Azure Security Center) resource provider -type DevicesForHubClient struct { - BaseClient -} - -// NewDevicesForHubClient creates an instance of the DevicesForHubClient client. -func NewDevicesForHubClient(subscriptionID string, ascLocation string) DevicesForHubClient { - return NewDevicesForHubClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewDevicesForHubClientWithBaseURI creates an instance of the DevicesForHubClient 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 NewDevicesForHubClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) DevicesForHubClient { - return DevicesForHubClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// List get list of the devices for the specified IoT Hub resource. -// Parameters: -// resourceID - the identifier of the resource. -// limit - limit the number of items returned in a single page -// skipToken - skip token used for pagination -// deviceManagementType - get devices only from specific type, Managed or Unmanaged. -func (client DevicesForHubClient) List(ctx context.Context, resourceID string, limit *int32, skipToken string, deviceManagementType ManagementState) (result DeviceListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DevicesForHubClient.List") - defer func() { - sc := -1 - if result.dl.Response.Response != nil { - sc = result.dl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceID, limit, skipToken, deviceManagementType) - if err != nil { - err = autorest.NewErrorWithError(err, "security.DevicesForHubClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.dl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.DevicesForHubClient", "List", resp, "Failure sending request") - return - } - - result.dl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.DevicesForHubClient", "List", resp, "Failure responding to request") - return - } - if result.dl.hasNextLink() && result.dl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client DevicesForHubClient) ListPreparer(ctx context.Context, resourceID string, limit *int32, skipToken string, deviceManagementType ManagementState) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceId": resourceID, - } - - const APIVersion = "2020-08-06-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if limit != nil { - queryParameters["$limit"] = autorest.Encode("query", *limit) - } - if len(skipToken) > 0 { - queryParameters["$skipToken"] = autorest.Encode("query", skipToken) - } - if len(string(deviceManagementType)) > 0 { - queryParameters["deviceManagementType"] = autorest.Encode("query", deviceManagementType) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{resourceId}/providers/Microsoft.Security/devices", 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 DevicesForHubClient) ListSender(req *http.Request) (*http.Response, error) { - 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 DevicesForHubClient) ListResponder(resp *http.Response) (result DeviceList, 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 DevicesForHubClient) listNextResults(ctx context.Context, lastResults DeviceList) (result DeviceList, err error) { - req, err := lastResults.deviceListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "security.DevicesForHubClient", "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.DevicesForHubClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.DevicesForHubClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client DevicesForHubClient) ListComplete(ctx context.Context, resourceID string, limit *int32, skipToken string, deviceManagementType ManagementState) (result DeviceListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DevicesForHubClient.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, resourceID, limit, skipToken, deviceManagementType) - return -} diff --git a/services/preview/security/mgmt/v3.0/security/devicesforsubscription.go b/services/preview/security/mgmt/v3.0/security/devicesforsubscription.go deleted file mode 100644 index c9e07735bddf..000000000000 --- a/services/preview/security/mgmt/v3.0/security/devicesforsubscription.go +++ /dev/null @@ -1,165 +0,0 @@ -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" -) - -// DevicesForSubscriptionClient is the API spec for Microsoft.Security (Azure Security Center) resource provider -type DevicesForSubscriptionClient struct { - BaseClient -} - -// NewDevicesForSubscriptionClient creates an instance of the DevicesForSubscriptionClient client. -func NewDevicesForSubscriptionClient(subscriptionID string, ascLocation string) DevicesForSubscriptionClient { - return NewDevicesForSubscriptionClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewDevicesForSubscriptionClientWithBaseURI creates an instance of the DevicesForSubscriptionClient 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 NewDevicesForSubscriptionClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) DevicesForSubscriptionClient { - return DevicesForSubscriptionClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// List get list of the devices by their subscription. -// Parameters: -// limit - limit the number of items returned in a single page -// skipToken - skip token used for pagination -// deviceManagementType - get devices only from specific type, Managed or Unmanaged. -func (client DevicesForSubscriptionClient) List(ctx context.Context, limit *int32, skipToken string, deviceManagementType ManagementState) (result DeviceListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DevicesForSubscriptionClient.List") - defer func() { - sc := -1 - if result.dl.Response.Response != nil { - sc = result.dl.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.DevicesForSubscriptionClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, limit, skipToken, deviceManagementType) - if err != nil { - err = autorest.NewErrorWithError(err, "security.DevicesForSubscriptionClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.dl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.DevicesForSubscriptionClient", "List", resp, "Failure sending request") - return - } - - result.dl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.DevicesForSubscriptionClient", "List", resp, "Failure responding to request") - return - } - if result.dl.hasNextLink() && result.dl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client DevicesForSubscriptionClient) ListPreparer(ctx context.Context, limit *int32, skipToken string, deviceManagementType ManagementState) (*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, - } - if limit != nil { - queryParameters["$limit"] = autorest.Encode("query", *limit) - } - if len(skipToken) > 0 { - queryParameters["$skipToken"] = autorest.Encode("query", skipToken) - } - if len(string(deviceManagementType)) > 0 { - queryParameters["deviceManagementType"] = autorest.Encode("query", deviceManagementType) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/devices", 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 DevicesForSubscriptionClient) 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 DevicesForSubscriptionClient) ListResponder(resp *http.Response) (result DeviceList, 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 DevicesForSubscriptionClient) listNextResults(ctx context.Context, lastResults DeviceList) (result DeviceList, err error) { - req, err := lastResults.deviceListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "security.DevicesForSubscriptionClient", "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.DevicesForSubscriptionClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.DevicesForSubscriptionClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client DevicesForSubscriptionClient) ListComplete(ctx context.Context, limit *int32, skipToken string, deviceManagementType ManagementState) (result DeviceListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DevicesForSubscriptionClient.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, limit, skipToken, deviceManagementType) - return -} diff --git a/services/preview/security/mgmt/v3.0/security/discoveredsecuritysolutions.go b/services/preview/security/mgmt/v3.0/security/discoveredsecuritysolutions.go index e621c320b810..4a215e2ab4af 100644 --- a/services/preview/security/mgmt/v3.0/security/discoveredsecuritysolutions.go +++ b/services/preview/security/mgmt/v3.0/security/discoveredsecuritysolutions.go @@ -21,23 +21,25 @@ type DiscoveredSecuritySolutionsClient struct { } // NewDiscoveredSecuritySolutionsClient creates an instance of the DiscoveredSecuritySolutionsClient client. -func NewDiscoveredSecuritySolutionsClient(subscriptionID string, ascLocation string) DiscoveredSecuritySolutionsClient { - return NewDiscoveredSecuritySolutionsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewDiscoveredSecuritySolutionsClient(subscriptionID string) DiscoveredSecuritySolutionsClient { + return NewDiscoveredSecuritySolutionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewDiscoveredSecuritySolutionsClientWithBaseURI creates an instance of the DiscoveredSecuritySolutionsClient 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 NewDiscoveredSecuritySolutionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) DiscoveredSecuritySolutionsClient { - return DiscoveredSecuritySolutionsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewDiscoveredSecuritySolutionsClientWithBaseURI(baseURI string, subscriptionID string) DiscoveredSecuritySolutionsClient { + return DiscoveredSecuritySolutionsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets a specific discovered Security Solution. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // discoveredSecuritySolutionName - name of a discovered security solution. -func (client DiscoveredSecuritySolutionsClient) Get(ctx context.Context, resourceGroupName string, discoveredSecuritySolutionName string) (result DiscoveredSecuritySolution, err error) { +func (client DiscoveredSecuritySolutionsClient) Get(ctx context.Context, resourceGroupName string, ascLocation string, discoveredSecuritySolutionName string) (result DiscoveredSecuritySolution, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionsClient.Get") defer func() { @@ -58,7 +60,7 @@ func (client DiscoveredSecuritySolutionsClient) Get(ctx context.Context, resourc return result, validation.NewError("security.DiscoveredSecuritySolutionsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, discoveredSecuritySolutionName) + req, err := client.GetPreparer(ctx, resourceGroupName, ascLocation, discoveredSecuritySolutionName) if err != nil { err = autorest.NewErrorWithError(err, "security.DiscoveredSecuritySolutionsClient", "Get", nil, "Failure preparing request") return @@ -81,9 +83,9 @@ func (client DiscoveredSecuritySolutionsClient) Get(ctx context.Context, resourc } // GetPreparer prepares the Get request. -func (client DiscoveredSecuritySolutionsClient) GetPreparer(ctx context.Context, resourceGroupName string, discoveredSecuritySolutionName string) (*http.Request, error) { +func (client DiscoveredSecuritySolutionsClient) GetPreparer(ctx context.Context, resourceGroupName string, ascLocation string, discoveredSecuritySolutionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "discoveredSecuritySolutionName": autorest.Encode("path", discoveredSecuritySolutionName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -240,7 +242,10 @@ func (client DiscoveredSecuritySolutionsClient) ListComplete(ctx context.Context } // ListByHomeRegion gets a list of discovered Security Solutions for the subscription and location. -func (client DiscoveredSecuritySolutionsClient) ListByHomeRegion(ctx context.Context) (result DiscoveredSecuritySolutionListPage, err error) { +// Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations +func (client DiscoveredSecuritySolutionsClient) ListByHomeRegion(ctx context.Context, ascLocation string) (result DiscoveredSecuritySolutionListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionsClient.ListByHomeRegion") defer func() { @@ -258,7 +263,7 @@ func (client DiscoveredSecuritySolutionsClient) ListByHomeRegion(ctx context.Con } result.fn = client.listByHomeRegionNextResults - req, err := client.ListByHomeRegionPreparer(ctx) + req, err := client.ListByHomeRegionPreparer(ctx, ascLocation) if err != nil { err = autorest.NewErrorWithError(err, "security.DiscoveredSecuritySolutionsClient", "ListByHomeRegion", nil, "Failure preparing request") return @@ -285,9 +290,9 @@ func (client DiscoveredSecuritySolutionsClient) ListByHomeRegion(ctx context.Con } // ListByHomeRegionPreparer prepares the ListByHomeRegion request. -func (client DiscoveredSecuritySolutionsClient) ListByHomeRegionPreparer(ctx context.Context) (*http.Request, error) { +func (client DiscoveredSecuritySolutionsClient) ListByHomeRegionPreparer(ctx context.Context, ascLocation string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -344,7 +349,7 @@ func (client DiscoveredSecuritySolutionsClient) listByHomeRegionNextResults(ctx } // ListByHomeRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiscoveredSecuritySolutionsClient) ListByHomeRegionComplete(ctx context.Context) (result DiscoveredSecuritySolutionListIterator, err error) { +func (client DiscoveredSecuritySolutionsClient) ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result DiscoveredSecuritySolutionListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionsClient.ListByHomeRegion") defer func() { @@ -355,6 +360,6 @@ func (client DiscoveredSecuritySolutionsClient) ListByHomeRegionComplete(ctx con tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByHomeRegion(ctx) + result.page, err = client.ListByHomeRegion(ctx, ascLocation) return } diff --git a/services/preview/security/mgmt/v3.0/security/enums.go b/services/preview/security/mgmt/v3.0/security/enums.go index 4cc6ec11eb72..59f9d1fdcef7 100644 --- a/services/preview/security/mgmt/v3.0/security/enums.go +++ b/services/preview/security/mgmt/v3.0/security/enums.go @@ -87,49 +87,6 @@ func PossibleAdditionalWorkspaceTypeValues() []AdditionalWorkspaceType { return []AdditionalWorkspaceType{Sentinel} } -// AlertIntent enumerates the values for alert intent. -type AlertIntent string - -const ( - // Collection ... - Collection AlertIntent = "Collection" - // CommandAndControl ... - CommandAndControl AlertIntent = "CommandAndControl" - // CredentialAccess ... - CredentialAccess AlertIntent = "CredentialAccess" - // DefenseEvasion ... - DefenseEvasion AlertIntent = "DefenseEvasion" - // Discovery ... - Discovery AlertIntent = "Discovery" - // Execution ... - Execution AlertIntent = "Execution" - // Exfiltration ... - Exfiltration AlertIntent = "Exfiltration" - // Exploitation ... - Exploitation AlertIntent = "Exploitation" - // Impact ... - Impact AlertIntent = "Impact" - // InitialAccess ... - InitialAccess AlertIntent = "InitialAccess" - // LateralMovement ... - LateralMovement AlertIntent = "LateralMovement" - // Persistence ... - Persistence AlertIntent = "Persistence" - // PreAttack ... - PreAttack AlertIntent = "PreAttack" - // PrivilegeEscalation ... - PrivilegeEscalation AlertIntent = "PrivilegeEscalation" - // Probing ... - Probing AlertIntent = "Probing" - // Unknown ... - Unknown AlertIntent = "Unknown" -) - -// PossibleAlertIntentValues returns an array of possible values for the AlertIntent const type. -func PossibleAlertIntentValues() []AlertIntent { - return []AlertIntent{Collection, CommandAndControl, CredentialAccess, DefenseEvasion, Discovery, Execution, Exfiltration, Exploitation, Impact, InitialAccess, LateralMovement, Persistence, PreAttack, PrivilegeEscalation, Probing, Unknown} -} - // AlertNotifications enumerates the values for alert notifications. type AlertNotifications string @@ -149,13 +106,13 @@ func PossibleAlertNotificationsValues() []AlertNotifications { type AlertSeverity string const ( - // High ... + // High High High AlertSeverity = "High" - // Informational ... + // Informational Informational Informational AlertSeverity = "Informational" - // Low ... + // Low Low Low AlertSeverity = "Low" - // Medium ... + // Medium Medium Medium AlertSeverity = "Medium" ) @@ -236,13 +193,13 @@ func PossibleAssessmentStatusCodeValues() []AssessmentStatusCode { type AssessmentType string const ( - // BuiltIn Azure Security Center managed assessments + // BuiltIn Microsoft Defender for Cloud managed assessments BuiltIn AssessmentType = "BuiltIn" - // CustomerManaged User assessments pushed directly by the user or other third party to Azure Security - // Center + // CustomerManaged User assessments pushed directly by the user or other third party to Microsoft Defender + // for Cloud CustomerManaged AssessmentType = "CustomerManaged" - // CustomPolicy User defined policies that are automatically ingested from Azure Policy to Azure Security - // Center + // CustomPolicy User defined policies that are automatically ingested from Azure Policy to Microsoft + // Defender for Cloud CustomPolicy AssessmentType = "CustomPolicy" // VerifiedPartner An assessment that was created by a verified 3rd party if the user connected it to ASC VerifiedPartner AssessmentType = "VerifiedPartner" @@ -291,21 +248,6 @@ func PossibleAuthenticationTypeValues() []AuthenticationType { return []AuthenticationType{AuthenticationTypeAuthenticationDetailsProperties, AuthenticationTypeAwsAssumeRole, AuthenticationTypeAwsCreds, AuthenticationTypeGcpCredentials} } -// AuthorizationState enumerates the values for authorization state. -type AuthorizationState string - -const ( - // Authorized ... - Authorized AuthorizationState = "Authorized" - // Unauthorized ... - Unauthorized AuthorizationState = "Unauthorized" -) - -// PossibleAuthorizationStateValues returns an array of possible values for the AuthorizationState const type. -func PossibleAuthorizationStateValues() []AuthorizationState { - return []AuthorizationState{Authorized, Unauthorized} -} - // AutoProvision enumerates the values for auto provision. type AutoProvision string @@ -369,6 +311,23 @@ func PossibleCategoriesValues() []Categories { return []Categories{Compute, Data, IdentityAndAccess, IoT, Networking} } +// CloudName enumerates the values for cloud name. +type CloudName string + +const ( + // AWS ... + AWS CloudName = "AWS" + // Azure ... + Azure CloudName = "Azure" + // GCP ... + GCP CloudName = "GCP" +) + +// PossibleCloudNameValues returns an array of possible values for the CloudName const type. +func PossibleCloudNameValues() []CloudName { + return []CloudName{AWS, Azure, GCP} +} + // ConfigurationStatus enumerates the values for configuration status. type ConfigurationStatus string @@ -451,9 +410,9 @@ func PossibleConnectionTypeValues() []ConnectionType { type ControlType string const ( - // ControlTypeBuiltIn Azure Security Center managed assessments + // ControlTypeBuiltIn Microsoft Defender for Cloud managed assessments ControlTypeBuiltIn ControlType = "BuiltIn" - // ControlTypeCustom Non Azure Security Center managed assessments + // ControlTypeCustom Non Microsoft Defender for Cloud managed assessments ControlTypeCustom ControlType = "Custom" ) @@ -494,36 +453,6 @@ func PossibleDataSourceValues() []DataSource { return []DataSource{TwinData} } -// DeviceCriticality enumerates the values for device criticality. -type DeviceCriticality string - -const ( - // Important ... - Important DeviceCriticality = "Important" - // Standard ... - Standard DeviceCriticality = "Standard" -) - -// PossibleDeviceCriticalityValues returns an array of possible values for the DeviceCriticality const type. -func PossibleDeviceCriticalityValues() []DeviceCriticality { - return []DeviceCriticality{Important, Standard} -} - -// DeviceStatus enumerates the values for device status. -type DeviceStatus string - -const ( - // DeviceStatusActive ... - DeviceStatusActive DeviceStatus = "Active" - // DeviceStatusRemoved ... - DeviceStatusRemoved DeviceStatus = "Removed" -) - -// PossibleDeviceStatusValues returns an array of possible values for the DeviceStatus const type. -func PossibleDeviceStatusValues() []DeviceStatus { - return []DeviceStatus{DeviceStatusActive, DeviceStatusRemoved} -} - // Direction enumerates the values for direction. type Direction string @@ -581,17 +510,17 @@ func PossibleEnforcementModeValues() []EnforcementMode { type EnforcementSupport string const ( - // EnforcementSupportNotSupported ... - EnforcementSupportNotSupported EnforcementSupport = "NotSupported" - // EnforcementSupportSupported ... - EnforcementSupportSupported EnforcementSupport = "Supported" - // EnforcementSupportUnknown ... - EnforcementSupportUnknown EnforcementSupport = "Unknown" + // NotSupported ... + NotSupported EnforcementSupport = "NotSupported" + // Supported ... + Supported EnforcementSupport = "Supported" + // Unknown ... + Unknown EnforcementSupport = "Unknown" ) // PossibleEnforcementSupportValues returns an array of possible values for the EnforcementSupport const type. func PossibleEnforcementSupportValues() []EnforcementSupport { - return []EnforcementSupport{EnforcementSupportNotSupported, EnforcementSupportSupported, EnforcementSupportUnknown} + return []EnforcementSupport{NotSupported, Supported, Unknown} } // EventSource enumerates the values for event source. @@ -602,6 +531,8 @@ const ( EventSourceAlerts EventSource = "Alerts" // EventSourceAssessments ... EventSourceAssessments EventSource = "Assessments" + // EventSourceAssessmentsSnapshot ... + EventSourceAssessmentsSnapshot EventSource = "AssessmentsSnapshot" // EventSourceRegulatoryComplianceAssessment ... EventSourceRegulatoryComplianceAssessment EventSource = "RegulatoryComplianceAssessment" // EventSourceRegulatoryComplianceAssessmentSnapshot ... @@ -616,11 +547,13 @@ const ( EventSourceSecureScoresSnapshot EventSource = "SecureScoresSnapshot" // EventSourceSubAssessments ... EventSourceSubAssessments EventSource = "SubAssessments" + // EventSourceSubAssessmentsSnapshot ... + EventSourceSubAssessmentsSnapshot EventSource = "SubAssessmentsSnapshot" ) // PossibleEventSourceValues returns an array of possible values for the EventSource const type. func PossibleEventSourceValues() []EventSource { - return []EventSource{EventSourceAlerts, EventSourceAssessments, EventSourceRegulatoryComplianceAssessment, EventSourceRegulatoryComplianceAssessmentSnapshot, EventSourceSecureScoreControls, EventSourceSecureScoreControlsSnapshot, EventSourceSecureScores, EventSourceSecureScoresSnapshot, EventSourceSubAssessments} + return []EventSource{EventSourceAlerts, EventSourceAssessments, EventSourceAssessmentsSnapshot, EventSourceRegulatoryComplianceAssessment, EventSourceRegulatoryComplianceAssessmentSnapshot, EventSourceSecureScoreControls, EventSourceSecureScoreControlsSnapshot, EventSourceSecureScores, EventSourceSecureScoresSnapshot, EventSourceSubAssessments, EventSourceSubAssessmentsSnapshot} } // Exe enumerates the values for exe. @@ -791,6 +724,21 @@ func PossibleImplementationEffortValues() []ImplementationEffort { return []ImplementationEffort{ImplementationEffortHigh, ImplementationEffortLow, ImplementationEffortModerate} } +// InformationProtectionPolicyName enumerates the values for information protection policy name. +type InformationProtectionPolicyName string + +const ( + // Custom ... + Custom InformationProtectionPolicyName = "custom" + // Effective ... + Effective InformationProtectionPolicyName = "effective" +) + +// PossibleInformationProtectionPolicyNameValues returns an array of possible values for the InformationProtectionPolicyName const type. +func PossibleInformationProtectionPolicyNameValues() []InformationProtectionPolicyName { + return []InformationProtectionPolicyName{Custom, Effective} +} + // Intent enumerates the values for intent. type Intent string @@ -929,36 +877,6 @@ func PossibleKindEnum2Values() []KindEnum2 { return []KindEnum2{KindAlertSyncSettings, KindDataExportSettings, KindSetting} } -// MacSignificance enumerates the values for mac significance. -type MacSignificance string - -const ( - // Primary ... - Primary MacSignificance = "Primary" - // Secondary ... - Secondary MacSignificance = "Secondary" -) - -// PossibleMacSignificanceValues returns an array of possible values for the MacSignificance const type. -func PossibleMacSignificanceValues() []MacSignificance { - return []MacSignificance{Primary, Secondary} -} - -// ManagementState enumerates the values for management state. -type ManagementState string - -const ( - // Managed ... - Managed ManagementState = "Managed" - // Unmanaged ... - Unmanaged ManagementState = "Unmanaged" -) - -// PossibleManagementStateValues returns an array of possible values for the ManagementState const type. -func PossibleManagementStateValues() []ManagementState { - return []ManagementState{Managed, Unmanaged} -} - // Msi enumerates the values for msi. type Msi string @@ -976,23 +894,25 @@ func PossibleMsiValues() []Msi { return []Msi{MsiAudit, MsiEnforce, MsiNone} } -// OnboardingKind enumerates the values for onboarding kind. -type OnboardingKind string +// OfferingType enumerates the values for offering type. +type OfferingType string const ( - // Default ... - Default OnboardingKind = "Default" - // Evaluation ... - Evaluation OnboardingKind = "Evaluation" - // MigratedToAzure ... - MigratedToAzure OnboardingKind = "MigratedToAzure" - // Purchased ... - Purchased OnboardingKind = "Purchased" + // OfferingTypeCloudOffering ... + OfferingTypeCloudOffering OfferingType = "cloudOffering" + // OfferingTypeCspmMonitorAws ... + OfferingTypeCspmMonitorAws OfferingType = "CspmMonitorAws" + // OfferingTypeDefenderForContainersAws ... + OfferingTypeDefenderForContainersAws OfferingType = "DefenderForContainersAws" + // OfferingTypeDefenderForServersAws ... + OfferingTypeDefenderForServersAws OfferingType = "DefenderForServersAws" + // OfferingTypeInformationProtectionAws ... + OfferingTypeInformationProtectionAws OfferingType = "InformationProtectionAws" ) -// PossibleOnboardingKindValues returns an array of possible values for the OnboardingKind const type. -func PossibleOnboardingKindValues() []OnboardingKind { - return []OnboardingKind{Default, Evaluation, MigratedToAzure, Purchased} +// PossibleOfferingTypeValues returns an array of possible values for the OfferingType const type. +func PossibleOfferingTypeValues() []OfferingType { + return []OfferingType{OfferingTypeCloudOffering, OfferingTypeCspmMonitorAws, OfferingTypeDefenderForContainersAws, OfferingTypeDefenderForServersAws, OfferingTypeInformationProtectionAws} } // Operator enumerates the values for operator. @@ -1024,6 +944,21 @@ func PossibleOperatorValues() []Operator { return []Operator{Contains, EndsWith, Equals, GreaterThan, GreaterThanOrEqualTo, LesserThan, LesserThanOrEqualTo, NotEquals, StartsWith} } +// OrganizationMembershipType enumerates the values for organization membership type. +type OrganizationMembershipType string + +const ( + // Member ... + Member OrganizationMembershipType = "Member" + // Organization ... + Organization OrganizationMembershipType = "Organization" +) + +// PossibleOrganizationMembershipTypeValues returns an array of possible values for the OrganizationMembershipType const type. +func PossibleOrganizationMembershipTypeValues() []OrganizationMembershipType { + return []OrganizationMembershipType{Member, Organization} +} + // PermissionProperty enumerates the values for permission property. type PermissionProperty string @@ -1048,30 +983,15 @@ func PossiblePermissionPropertyValues() []PermissionProperty { type PricingTier string const ( - // PricingTierFree Get free Azure security center experience with basic security features - PricingTierFree PricingTier = "Free" - // PricingTierStandard Get the standard Azure security center experience with advanced security features - PricingTierStandard PricingTier = "Standard" + // Free Get free Microsoft Defender for Cloud experience with basic security features + Free PricingTier = "Free" + // Standard Get the standard Microsoft Defender for Cloud experience with advanced security features + Standard PricingTier = "Standard" ) // PossiblePricingTierValues returns an array of possible values for the PricingTier const type. func PossiblePricingTierValues() []PricingTier { - return []PricingTier{PricingTierFree, PricingTierStandard} -} - -// ProgrammingState enumerates the values for programming state. -type ProgrammingState string - -const ( - // NotProgrammingDevice ... - NotProgrammingDevice ProgrammingState = "NotProgrammingDevice" - // ProgrammingDevice ... - ProgrammingDevice ProgrammingState = "ProgrammingDevice" -) - -// PossibleProgrammingStateValues returns an array of possible values for the ProgrammingState const type. -func PossibleProgrammingStateValues() []ProgrammingState { - return []ProgrammingState{NotProgrammingDevice, ProgrammingDevice} + return []PricingTier{Free, Standard} } // PropertyType enumerates the values for property type. @@ -1148,23 +1068,6 @@ func PossibleProvisioningState1Values() []ProvisioningState1 { return []ProvisioningState1{ProvisioningState1Canceled, ProvisioningState1Deprovisioning, ProvisioningState1Failed, ProvisioningState1Provisioning, ProvisioningState1Succeeded} } -// PurdueLevel enumerates the values for purdue level. -type PurdueLevel string - -const ( - // Enterprise ... - Enterprise PurdueLevel = "Enterprise" - // ProcessControl ... - ProcessControl PurdueLevel = "ProcessControl" - // Supervisory ... - Supervisory PurdueLevel = "Supervisory" -) - -// PossiblePurdueLevelValues returns an array of possible values for the PurdueLevel const type. -func PossiblePurdueLevelValues() []PurdueLevel { - return []PurdueLevel{Enterprise, ProcessControl, Supervisory} -} - // Rank enumerates the values for rank. type Rank string @@ -1235,31 +1138,6 @@ func PossibleRecommendationConfigStatusValues() []RecommendationConfigStatus { return []RecommendationConfigStatus{Disabled, Enabled} } -// RecommendationSeverity enumerates the values for recommendation severity. -type RecommendationSeverity string - -const ( - // RecommendationSeverityHealthy ... - RecommendationSeverityHealthy RecommendationSeverity = "Healthy" - // RecommendationSeverityHigh ... - RecommendationSeverityHigh RecommendationSeverity = "High" - // RecommendationSeverityLow ... - RecommendationSeverityLow RecommendationSeverity = "Low" - // RecommendationSeverityMedium ... - RecommendationSeverityMedium RecommendationSeverity = "Medium" - // RecommendationSeverityNotApplicable ... - RecommendationSeverityNotApplicable RecommendationSeverity = "NotApplicable" - // RecommendationSeverityOffByPolicy ... - RecommendationSeverityOffByPolicy RecommendationSeverity = "OffByPolicy" - // RecommendationSeverityUnknown ... - RecommendationSeverityUnknown RecommendationSeverity = "Unknown" -) - -// PossibleRecommendationSeverityValues returns an array of possible values for the RecommendationSeverity const type. -func PossibleRecommendationSeverityValues() []RecommendationSeverity { - return []RecommendationSeverity{RecommendationSeverityHealthy, RecommendationSeverityHigh, RecommendationSeverityLow, RecommendationSeverityMedium, RecommendationSeverityNotApplicable, RecommendationSeverityOffByPolicy, RecommendationSeverityUnknown} -} - // RecommendationStatus enumerates the values for recommendation status. type RecommendationStatus string @@ -1334,21 +1212,6 @@ func PossibleRecommendationTypeValues() []RecommendationType { return []RecommendationType{IoTACRAuthentication, IoTAgentSendsUnutilizedMessages, IoTBaseline, IoTEdgeHubMemOptimize, IoTEdgeLoggingOptions, IoTInconsistentModuleSettings, IoTInstallAgent, IoTIPFilterDenyAll, IoTIPFilterPermissiveRule, IoTOpenPorts, IoTPermissiveFirewallPolicy, IoTPermissiveInputFirewallRules, IoTPermissiveOutputFirewallRules, IoTPrivilegedDockerOptions, IoTSharedCredentials, IoTVulnerableTLSCipherSuite} } -// RelationToIPStatus enumerates the values for relation to ip status. -type RelationToIPStatus string - -const ( - // Certain ... - Certain RelationToIPStatus = "Certain" - // Guess ... - Guess RelationToIPStatus = "Guess" -) - -// PossibleRelationToIPStatusValues returns an array of possible values for the RelationToIPStatus const type. -func PossibleRelationToIPStatusValues() []RelationToIPStatus { - return []RelationToIPStatus{Certain, Guess} -} - // ReportedSeverity enumerates the values for reported severity. type ReportedSeverity string @@ -1524,21 +1387,6 @@ func PossibleRuleTypeBasicCustomAlertRuleValues() []RuleTypeBasicCustomAlertRule 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. -type ScanningFunctionality string - -const ( - // NotScannerDevice ... - NotScannerDevice ScanningFunctionality = "NotScannerDevice" - // ScannerDevice ... - ScannerDevice ScanningFunctionality = "ScannerDevice" -) - -// PossibleScanningFunctionalityValues returns an array of possible values for the ScanningFunctionality const type. -func PossibleScanningFunctionalityValues() []ScanningFunctionality { - return []ScanningFunctionality{NotScannerDevice, ScannerDevice} -} - // ScanState enumerates the values for scan state. type ScanState string @@ -1590,36 +1438,67 @@ func PossibleScriptValues() []Script { return []Script{ScriptAudit, ScriptEnforce, ScriptNone} } -// SensorStatus enumerates the values for sensor status. -type SensorStatus string +// SettingName2 enumerates the values for setting name 2. +type SettingName2 string + +const ( + // SettingName2MCAS ... + SettingName2MCAS SettingName2 = "MCAS" + // SettingName2Sentinel ... + SettingName2Sentinel SettingName2 = "Sentinel" + // SettingName2WDATP ... + SettingName2WDATP SettingName2 = "WDATP" + // SettingName2WDATPEXCLUDELINUXPUBLICPREVIEW ... + SettingName2WDATPEXCLUDELINUXPUBLICPREVIEW SettingName2 = "WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW" + // SettingName2WDATPUNIFIEDSOLUTION ... + SettingName2WDATPUNIFIEDSOLUTION SettingName2 = "WDATP_UNIFIED_SOLUTION" +) + +// PossibleSettingName2Values returns an array of possible values for the SettingName2 const type. +func PossibleSettingName2Values() []SettingName2 { + return []SettingName2{SettingName2MCAS, SettingName2Sentinel, SettingName2WDATP, SettingName2WDATPEXCLUDELINUXPUBLICPREVIEW, SettingName2WDATPUNIFIEDSOLUTION} +} + +// SettingName4 enumerates the values for setting name 4. +type SettingName4 string const ( - // Disconnected ... - Disconnected SensorStatus = "Disconnected" - // Ok ... - Ok SensorStatus = "Ok" - // Unavailable ... - Unavailable SensorStatus = "Unavailable" + // SettingName4MCAS ... + SettingName4MCAS SettingName4 = "MCAS" + // SettingName4Sentinel ... + SettingName4Sentinel SettingName4 = "Sentinel" + // SettingName4WDATP ... + SettingName4WDATP SettingName4 = "WDATP" + // SettingName4WDATPEXCLUDELINUXPUBLICPREVIEW ... + SettingName4WDATPEXCLUDELINUXPUBLICPREVIEW SettingName4 = "WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW" + // SettingName4WDATPUNIFIEDSOLUTION ... + SettingName4WDATPUNIFIEDSOLUTION SettingName4 = "WDATP_UNIFIED_SOLUTION" ) -// PossibleSensorStatusValues returns an array of possible values for the SensorStatus const type. -func PossibleSensorStatusValues() []SensorStatus { - return []SensorStatus{Disconnected, Ok, Unavailable} +// PossibleSettingName4Values returns an array of possible values for the SettingName4 const type. +func PossibleSettingName4Values() []SettingName4 { + return []SettingName4{SettingName4MCAS, SettingName4Sentinel, SettingName4WDATP, SettingName4WDATPEXCLUDELINUXPUBLICPREVIEW, SettingName4WDATPUNIFIEDSOLUTION} } -// SensorType enumerates the values for sensor type. -type SensorType string +// SettingName5 enumerates the values for setting name 5. +type SettingName5 string const ( - // SensorTypeEnterprise ... - SensorTypeEnterprise SensorType = "Enterprise" - // SensorTypeOt ... - SensorTypeOt SensorType = "Ot" + // SettingName5MCAS ... + SettingName5MCAS SettingName5 = "MCAS" + // SettingName5Sentinel ... + SettingName5Sentinel SettingName5 = "Sentinel" + // SettingName5WDATP ... + SettingName5WDATP SettingName5 = "WDATP" + // SettingName5WDATPEXCLUDELINUXPUBLICPREVIEW ... + SettingName5WDATPEXCLUDELINUXPUBLICPREVIEW SettingName5 = "WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW" + // SettingName5WDATPUNIFIEDSOLUTION ... + SettingName5WDATPUNIFIEDSOLUTION SettingName5 = "WDATP_UNIFIED_SOLUTION" ) -// PossibleSensorTypeValues returns an array of possible values for the SensorType const type. -func PossibleSensorTypeValues() []SensorType { - return []SensorType{SensorTypeEnterprise, SensorTypeOt} +// PossibleSettingName5Values returns an array of possible values for the SettingName5 const type. +func PossibleSettingName5Values() []SettingName5 { + return []SettingName5{SettingName5MCAS, SettingName5Sentinel, SettingName5WDATP, SettingName5WDATPEXCLUDELINUXPUBLICPREVIEW, SettingName5WDATPUNIFIEDSOLUTION} } // Severity enumerates the values for severity. @@ -1639,6 +1518,23 @@ func PossibleSeverityValues() []Severity { return []Severity{SeverityHigh, SeverityLow, SeverityMedium} } +// SeverityEnum enumerates the values for severity enum. +type SeverityEnum string + +const ( + // SeverityEnumHigh ... + SeverityEnumHigh SeverityEnum = "High" + // SeverityEnumLow ... + SeverityEnumLow SeverityEnum = "Low" + // SeverityEnumMedium ... + SeverityEnumMedium SeverityEnum = "Medium" +) + +// PossibleSeverityEnumValues returns an array of possible values for the SeverityEnum const type. +func PossibleSeverityEnumValues() []SeverityEnum { + return []SeverityEnum{SeverityEnumHigh, SeverityEnumLow, SeverityEnumMedium} +} + // SolutionStatus enumerates the values for solution status. type SolutionStatus string @@ -1763,6 +1659,300 @@ func PossibleSubAssessmentStatusCodeValues() []SubAssessmentStatusCode { return []SubAssessmentStatusCode{SubAssessmentStatusCodeHealthy, SubAssessmentStatusCodeNotApplicable, SubAssessmentStatusCodeUnhealthy} } +// SupportedCloudEnum enumerates the values for supported cloud enum. +type SupportedCloudEnum string + +const ( + // SupportedCloudEnumAWS ... + SupportedCloudEnumAWS SupportedCloudEnum = "AWS" + // SupportedCloudEnumGCP ... + SupportedCloudEnumGCP SupportedCloudEnum = "GCP" +) + +// PossibleSupportedCloudEnumValues returns an array of possible values for the SupportedCloudEnum const type. +func PossibleSupportedCloudEnumValues() []SupportedCloudEnum { + return []SupportedCloudEnum{SupportedCloudEnumAWS, SupportedCloudEnumGCP} +} + +// Tactics enumerates the values for tactics. +type Tactics string + +const ( + // Collection ... + Collection Tactics = "Collection" + // CommandandControl ... + CommandandControl Tactics = "Command and Control" + // CredentialAccess ... + CredentialAccess Tactics = "Credential Access" + // DefenseEvasion ... + DefenseEvasion Tactics = "Defense Evasion" + // Discovery ... + Discovery Tactics = "Discovery" + // Execution ... + Execution Tactics = "Execution" + // Exfiltration ... + Exfiltration Tactics = "Exfiltration" + // Impact ... + Impact Tactics = "Impact" + // InitialAccess ... + InitialAccess Tactics = "Initial Access" + // LateralMovement ... + LateralMovement Tactics = "Lateral Movement" + // Persistence ... + Persistence Tactics = "Persistence" + // PrivilegeEscalation ... + PrivilegeEscalation Tactics = "Privilege Escalation" + // Reconnaissance ... + Reconnaissance Tactics = "Reconnaissance" + // ResourceDevelopment ... + ResourceDevelopment Tactics = "Resource Development" +) + +// PossibleTacticsValues returns an array of possible values for the Tactics const type. +func PossibleTacticsValues() []Tactics { + return []Tactics{Collection, CommandandControl, CredentialAccess, DefenseEvasion, Discovery, Execution, Exfiltration, Impact, InitialAccess, LateralMovement, Persistence, PrivilegeEscalation, Reconnaissance, ResourceDevelopment} +} + +// TaskUpdateActionType enumerates the values for task update action type. +type TaskUpdateActionType string + +const ( + // Activate ... + Activate TaskUpdateActionType = "Activate" + // Close ... + Close TaskUpdateActionType = "Close" + // Dismiss ... + Dismiss TaskUpdateActionType = "Dismiss" + // Resolve ... + Resolve TaskUpdateActionType = "Resolve" + // Start ... + Start TaskUpdateActionType = "Start" +) + +// PossibleTaskUpdateActionTypeValues returns an array of possible values for the TaskUpdateActionType const type. +func PossibleTaskUpdateActionTypeValues() []TaskUpdateActionType { + return []TaskUpdateActionType{Activate, Close, Dismiss, Resolve, Start} +} + +// Techniques enumerates the values for techniques. +type Techniques string + +const ( + // AbuseElevationControlMechanism ... + AbuseElevationControlMechanism Techniques = "Abuse Elevation Control Mechanism" + // AccessTokenManipulation ... + AccessTokenManipulation Techniques = "Access Token Manipulation" + // AccountDiscovery ... + AccountDiscovery Techniques = "Account Discovery" + // AccountManipulation ... + AccountManipulation Techniques = "Account Manipulation" + // ActiveScanning ... + ActiveScanning Techniques = "Active Scanning" + // ApplicationLayerProtocol ... + ApplicationLayerProtocol Techniques = "Application Layer Protocol" + // AudioCapture ... + AudioCapture Techniques = "Audio Capture" + // BootorLogonAutostartExecution ... + BootorLogonAutostartExecution Techniques = "Boot or Logon Autostart Execution" + // BootorLogonInitializationScripts ... + BootorLogonInitializationScripts Techniques = "Boot or Logon Initialization Scripts" + // BruteForce ... + BruteForce Techniques = "Brute Force" + // CloudInfrastructureDiscovery ... + CloudInfrastructureDiscovery Techniques = "Cloud Infrastructure Discovery" + // CloudServiceDashboard ... + CloudServiceDashboard Techniques = "Cloud Service Dashboard" + // CloudServiceDiscovery ... + CloudServiceDiscovery Techniques = "Cloud Service Discovery" + // CommandandScriptingInterpreter ... + CommandandScriptingInterpreter Techniques = "Command and Scripting Interpreter" + // CompromiseClientSoftwareBinary ... + CompromiseClientSoftwareBinary Techniques = "Compromise Client Software Binary" + // CompromiseInfrastructure ... + CompromiseInfrastructure Techniques = "Compromise Infrastructure" + // ContainerandResourceDiscovery ... + ContainerandResourceDiscovery Techniques = "Container and Resource Discovery" + // CreateAccount ... + CreateAccount Techniques = "Create Account" + // CreateorModifySystemProcess ... + CreateorModifySystemProcess Techniques = "Create or Modify System Process" + // CredentialsfromPasswordStores ... + CredentialsfromPasswordStores Techniques = "Credentials from Password Stores" + // DataDestruction ... + DataDestruction Techniques = "Data Destruction" + // DataEncryptedforImpact ... + DataEncryptedforImpact Techniques = "Data Encrypted for Impact" + // DatafromCloudStorageObject ... + DatafromCloudStorageObject Techniques = "Data from Cloud Storage Object" + // DatafromConfigurationRepository ... + DatafromConfigurationRepository Techniques = "Data from Configuration Repository" + // DatafromInformationRepositories ... + DatafromInformationRepositories Techniques = "Data from Information Repositories" + // DatafromLocalSystem ... + DatafromLocalSystem Techniques = "Data from Local System" + // DataManipulation ... + DataManipulation Techniques = "Data Manipulation" + // DataStaged ... + DataStaged Techniques = "Data Staged" + // Defacement ... + Defacement Techniques = "Defacement" + // DeobfuscateDecodeFilesorInformation ... + DeobfuscateDecodeFilesorInformation Techniques = "Deobfuscate/Decode Files or Information" + // DiskWipe ... + DiskWipe Techniques = "Disk Wipe" + // DomainTrustDiscovery ... + DomainTrustDiscovery Techniques = "Domain Trust Discovery" + // DriveByCompromise ... + DriveByCompromise Techniques = "Drive-by Compromise" + // DynamicResolution ... + DynamicResolution Techniques = "Dynamic Resolution" + // EndpointDenialofService ... + EndpointDenialofService Techniques = "Endpoint Denial of Service" + // EventTriggeredExecution ... + EventTriggeredExecution Techniques = "Event Triggered Execution" + // ExfiltrationOverAlternativeProtocol ... + ExfiltrationOverAlternativeProtocol Techniques = "Exfiltration Over Alternative Protocol" + // ExploitationforClientExecution ... + ExploitationforClientExecution Techniques = "Exploitation for Client Execution" + // ExploitationforCredentialAccess ... + ExploitationforCredentialAccess Techniques = "Exploitation for Credential Access" + // ExploitationforDefenseEvasion ... + ExploitationforDefenseEvasion Techniques = "Exploitation for Defense Evasion" + // ExploitationforPrivilegeEscalation ... + ExploitationforPrivilegeEscalation Techniques = "Exploitation for Privilege Escalation" + // ExploitationofRemoteServices ... + ExploitationofRemoteServices Techniques = "Exploitation of Remote Services" + // ExploitPublicFacingApplication ... + ExploitPublicFacingApplication Techniques = "Exploit Public-Facing Application" + // ExternalRemoteServices ... + ExternalRemoteServices Techniques = "External Remote Services" + // FallbackChannels ... + FallbackChannels Techniques = "Fallback Channels" + // FileandDirectoryDiscovery ... + FileandDirectoryDiscovery Techniques = "File and Directory Discovery" + // FileandDirectoryPermissionsModification ... + FileandDirectoryPermissionsModification Techniques = "File and Directory Permissions Modification" + // GatherVictimNetworkInformation ... + GatherVictimNetworkInformation Techniques = "Gather Victim Network Information" + // HideArtifacts ... + HideArtifacts Techniques = "Hide Artifacts" + // HijackExecutionFlow ... + HijackExecutionFlow Techniques = "Hijack Execution Flow" + // ImpairDefenses ... + ImpairDefenses Techniques = "Impair Defenses" + // ImplantContainerImage ... + ImplantContainerImage Techniques = "Implant Container Image" + // IndicatorRemovalonHost ... + IndicatorRemovalonHost Techniques = "Indicator Removal on Host" + // IndirectCommandExecution ... + IndirectCommandExecution Techniques = "Indirect Command Execution" + // IngressToolTransfer ... + IngressToolTransfer Techniques = "Ingress Tool Transfer" + // InputCapture ... + InputCapture Techniques = "Input Capture" + // InterProcessCommunication ... + InterProcessCommunication Techniques = "Inter-Process Communication" + // LateralToolTransfer ... + LateralToolTransfer Techniques = "Lateral Tool Transfer" + // ManInTheMiddle ... + ManInTheMiddle Techniques = "Man-in-the-Middle" + // Masquerading ... + Masquerading Techniques = "Masquerading" + // ModifyAuthenticationProcess ... + ModifyAuthenticationProcess Techniques = "Modify Authentication Process" + // ModifyRegistry ... + ModifyRegistry Techniques = "Modify Registry" + // NetworkDenialofService ... + NetworkDenialofService Techniques = "Network Denial of Service" + // NetworkServiceScanning ... + NetworkServiceScanning Techniques = "Network Service Scanning" + // NetworkSniffing ... + NetworkSniffing Techniques = "Network Sniffing" + // NonApplicationLayerProtocol ... + NonApplicationLayerProtocol Techniques = "Non-Application Layer Protocol" + // NonStandardPort ... + NonStandardPort Techniques = "Non-Standard Port" + // ObfuscatedFilesorInformation ... + ObfuscatedFilesorInformation Techniques = "Obfuscated Files or Information" + // ObtainCapabilities ... + ObtainCapabilities Techniques = "Obtain Capabilities" + // OfficeApplicationStartup ... + OfficeApplicationStartup Techniques = "Office Application Startup" + // OSCredentialDumping ... + OSCredentialDumping Techniques = "OS Credential Dumping" + // PermissionGroupsDiscovery ... + PermissionGroupsDiscovery Techniques = "Permission Groups Discovery" + // Phishing ... + Phishing Techniques = "Phishing" + // PreOSBoot ... + PreOSBoot Techniques = "Pre-OS Boot" + // ProcessDiscovery ... + ProcessDiscovery Techniques = "Process Discovery" + // ProcessInjection ... + ProcessInjection Techniques = "Process Injection" + // ProtocolTunneling ... + ProtocolTunneling Techniques = "Protocol Tunneling" + // Proxy ... + Proxy Techniques = "Proxy" + // QueryRegistry ... + QueryRegistry Techniques = "Query Registry" + // RemoteAccessSoftware ... + RemoteAccessSoftware Techniques = "Remote Access Software" + // RemoteServices ... + RemoteServices Techniques = "Remote Services" + // RemoteServiceSessionHijacking ... + RemoteServiceSessionHijacking Techniques = "Remote Service Session Hijacking" + // RemoteSystemDiscovery ... + RemoteSystemDiscovery Techniques = "Remote System Discovery" + // ResourceHijacking ... + ResourceHijacking Techniques = "Resource Hijacking" + // ScheduledTaskJob ... + ScheduledTaskJob Techniques = "Scheduled Task/Job" + // ScreenCapture ... + ScreenCapture Techniques = "Screen Capture" + // SearchVictimOwnedWebsites ... + SearchVictimOwnedWebsites Techniques = "Search Victim-Owned Websites" + // ServerSoftwareComponent ... + ServerSoftwareComponent Techniques = "Server Software Component" + // ServiceStop ... + ServiceStop Techniques = "Service Stop" + // SignedBinaryProxyExecution ... + SignedBinaryProxyExecution Techniques = "Signed Binary Proxy Execution" + // SoftwareDeploymentTools ... + SoftwareDeploymentTools Techniques = "Software Deployment Tools" + // SQLStoredProcedures ... + SQLStoredProcedures Techniques = "SQL Stored Procedures" + // StealorForgeKerberosTickets ... + StealorForgeKerberosTickets Techniques = "Steal or Forge Kerberos Tickets" + // SubvertTrustControls ... + SubvertTrustControls Techniques = "Subvert Trust Controls" + // SupplyChainCompromise ... + SupplyChainCompromise Techniques = "Supply Chain Compromise" + // SystemInformationDiscovery ... + SystemInformationDiscovery Techniques = "System Information Discovery" + // TaintSharedContent ... + TaintSharedContent Techniques = "Taint Shared Content" + // TrafficSignaling ... + TrafficSignaling Techniques = "Traffic Signaling" + // TransferDatatoCloudAccount ... + TransferDatatoCloudAccount Techniques = "Transfer Data to Cloud Account" + // TrustedRelationship ... + TrustedRelationship Techniques = "Trusted Relationship" + // UnsecuredCredentials ... + UnsecuredCredentials Techniques = "Unsecured Credentials" + // UserExecution ... + UserExecution Techniques = "User Execution" + // ValidAccounts ... + ValidAccounts Techniques = "Valid Accounts" + // WindowsManagementInstrumentation ... + WindowsManagementInstrumentation Techniques = "Windows Management Instrumentation" +) + +// PossibleTechniquesValues returns an array of possible values for the Techniques const type. +func PossibleTechniquesValues() []Techniques { + return []Techniques{AbuseElevationControlMechanism, AccessTokenManipulation, AccountDiscovery, AccountManipulation, ActiveScanning, ApplicationLayerProtocol, AudioCapture, BootorLogonAutostartExecution, BootorLogonInitializationScripts, BruteForce, CloudInfrastructureDiscovery, CloudServiceDashboard, CloudServiceDiscovery, CommandandScriptingInterpreter, CompromiseClientSoftwareBinary, CompromiseInfrastructure, ContainerandResourceDiscovery, CreateAccount, CreateorModifySystemProcess, CredentialsfromPasswordStores, DataDestruction, DataEncryptedforImpact, DatafromCloudStorageObject, DatafromConfigurationRepository, DatafromInformationRepositories, DatafromLocalSystem, DataManipulation, DataStaged, Defacement, DeobfuscateDecodeFilesorInformation, DiskWipe, DomainTrustDiscovery, DriveByCompromise, DynamicResolution, EndpointDenialofService, EventTriggeredExecution, ExfiltrationOverAlternativeProtocol, ExploitationforClientExecution, ExploitationforCredentialAccess, ExploitationforDefenseEvasion, ExploitationforPrivilegeEscalation, ExploitationofRemoteServices, ExploitPublicFacingApplication, ExternalRemoteServices, FallbackChannels, FileandDirectoryDiscovery, FileandDirectoryPermissionsModification, GatherVictimNetworkInformation, HideArtifacts, HijackExecutionFlow, ImpairDefenses, ImplantContainerImage, IndicatorRemovalonHost, IndirectCommandExecution, IngressToolTransfer, InputCapture, InterProcessCommunication, LateralToolTransfer, ManInTheMiddle, Masquerading, ModifyAuthenticationProcess, ModifyRegistry, NetworkDenialofService, NetworkServiceScanning, NetworkSniffing, NonApplicationLayerProtocol, NonStandardPort, ObfuscatedFilesorInformation, ObtainCapabilities, OfficeApplicationStartup, OSCredentialDumping, PermissionGroupsDiscovery, Phishing, PreOSBoot, ProcessDiscovery, ProcessInjection, ProtocolTunneling, Proxy, QueryRegistry, RemoteAccessSoftware, RemoteServices, RemoteServiceSessionHijacking, RemoteSystemDiscovery, ResourceHijacking, ScheduledTaskJob, ScreenCapture, SearchVictimOwnedWebsites, ServerSoftwareComponent, ServiceStop, SignedBinaryProxyExecution, SoftwareDeploymentTools, SQLStoredProcedures, StealorForgeKerberosTickets, SubvertTrustControls, SupplyChainCompromise, SystemInformationDiscovery, TaintSharedContent, TrafficSignaling, TransferDatatoCloudAccount, TrustedRelationship, UnsecuredCredentials, UserExecution, ValidAccounts, WindowsManagementInstrumentation} +} + // Threats enumerates the values for threats. type Threats string @@ -1790,25 +1980,6 @@ func PossibleThreatsValues() []Threats { return []Threats{AccountBreach, DataExfiltration, DataSpillage, DenialOfService, ElevationOfPrivilege, MaliciousInsider, MissingCoverage, ThreatResistance} } -// TiStatus enumerates the values for ti status. -type TiStatus string - -const ( - // TiStatusFailed ... - TiStatusFailed TiStatus = "Failed" - // TiStatusInProgress ... - TiStatusInProgress TiStatus = "InProgress" - // TiStatusOk ... - TiStatusOk TiStatus = "Ok" - // TiStatusUpdateAvailable ... - TiStatusUpdateAvailable TiStatus = "UpdateAvailable" -) - -// PossibleTiStatusValues returns an array of possible values for the TiStatus const type. -func PossibleTiStatusValues() []TiStatus { - return []TiStatus{TiStatusFailed, TiStatusInProgress, TiStatusOk, TiStatusUpdateAvailable} -} - // TransportProtocol enumerates the values for transport protocol. type TransportProtocol string @@ -1910,20 +2081,3 @@ const ( func PossibleValueTypeValues() []ValueType { return []ValueType{ValueTypeIPCidr, ValueTypeString} } - -// VersionKind enumerates the values for version kind. -type VersionKind string - -const ( - // Latest ... - Latest VersionKind = "Latest" - // Preview ... - Preview VersionKind = "Preview" - // Previous ... - Previous VersionKind = "Previous" -) - -// PossibleVersionKindValues returns an array of possible values for the VersionKind const type. -func PossibleVersionKindValues() []VersionKind { - return []VersionKind{Latest, Preview, Previous} -} diff --git a/services/preview/security/mgmt/v3.0/security/externalsecuritysolutions.go b/services/preview/security/mgmt/v3.0/security/externalsecuritysolutions.go index 36f6a34181d7..bc70debdb421 100644 --- a/services/preview/security/mgmt/v3.0/security/externalsecuritysolutions.go +++ b/services/preview/security/mgmt/v3.0/security/externalsecuritysolutions.go @@ -21,23 +21,25 @@ type ExternalSecuritySolutionsClient struct { } // NewExternalSecuritySolutionsClient creates an instance of the ExternalSecuritySolutionsClient client. -func NewExternalSecuritySolutionsClient(subscriptionID string, ascLocation string) ExternalSecuritySolutionsClient { - return NewExternalSecuritySolutionsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewExternalSecuritySolutionsClient(subscriptionID string) ExternalSecuritySolutionsClient { + return NewExternalSecuritySolutionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewExternalSecuritySolutionsClientWithBaseURI creates an instance of the ExternalSecuritySolutionsClient 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 NewExternalSecuritySolutionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) ExternalSecuritySolutionsClient { - return ExternalSecuritySolutionsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewExternalSecuritySolutionsClientWithBaseURI(baseURI string, subscriptionID string) ExternalSecuritySolutionsClient { + return ExternalSecuritySolutionsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets a specific external Security Solution. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // externalSecuritySolutionsName - name of an external security solution. -func (client ExternalSecuritySolutionsClient) Get(ctx context.Context, resourceGroupName string, externalSecuritySolutionsName string) (result ExternalSecuritySolutionModel, err error) { +func (client ExternalSecuritySolutionsClient) Get(ctx context.Context, resourceGroupName string, ascLocation string, externalSecuritySolutionsName string) (result ExternalSecuritySolutionModel, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionsClient.Get") defer func() { @@ -58,7 +60,7 @@ func (client ExternalSecuritySolutionsClient) Get(ctx context.Context, resourceG return result, validation.NewError("security.ExternalSecuritySolutionsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, externalSecuritySolutionsName) + req, err := client.GetPreparer(ctx, resourceGroupName, ascLocation, externalSecuritySolutionsName) if err != nil { err = autorest.NewErrorWithError(err, "security.ExternalSecuritySolutionsClient", "Get", nil, "Failure preparing request") return @@ -81,9 +83,9 @@ func (client ExternalSecuritySolutionsClient) Get(ctx context.Context, resourceG } // GetPreparer prepares the Get request. -func (client ExternalSecuritySolutionsClient) GetPreparer(ctx context.Context, resourceGroupName string, externalSecuritySolutionsName string) (*http.Request, error) { +func (client ExternalSecuritySolutionsClient) GetPreparer(ctx context.Context, resourceGroupName string, ascLocation string, externalSecuritySolutionsName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "externalSecuritySolutionsName": autorest.Encode("path", externalSecuritySolutionsName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -240,7 +242,10 @@ func (client ExternalSecuritySolutionsClient) ListComplete(ctx context.Context) } // ListByHomeRegion gets a list of external Security Solutions for the subscription and location. -func (client ExternalSecuritySolutionsClient) ListByHomeRegion(ctx context.Context) (result ExternalSecuritySolutionListPage, err error) { +// Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations +func (client ExternalSecuritySolutionsClient) ListByHomeRegion(ctx context.Context, ascLocation string) (result ExternalSecuritySolutionListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionsClient.ListByHomeRegion") defer func() { @@ -258,7 +263,7 @@ func (client ExternalSecuritySolutionsClient) ListByHomeRegion(ctx context.Conte } result.fn = client.listByHomeRegionNextResults - req, err := client.ListByHomeRegionPreparer(ctx) + req, err := client.ListByHomeRegionPreparer(ctx, ascLocation) if err != nil { err = autorest.NewErrorWithError(err, "security.ExternalSecuritySolutionsClient", "ListByHomeRegion", nil, "Failure preparing request") return @@ -285,9 +290,9 @@ func (client ExternalSecuritySolutionsClient) ListByHomeRegion(ctx context.Conte } // ListByHomeRegionPreparer prepares the ListByHomeRegion request. -func (client ExternalSecuritySolutionsClient) ListByHomeRegionPreparer(ctx context.Context) (*http.Request, error) { +func (client ExternalSecuritySolutionsClient) ListByHomeRegionPreparer(ctx context.Context, ascLocation string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -344,7 +349,7 @@ func (client ExternalSecuritySolutionsClient) listByHomeRegionNextResults(ctx co } // ListByHomeRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExternalSecuritySolutionsClient) ListByHomeRegionComplete(ctx context.Context) (result ExternalSecuritySolutionListIterator, err error) { +func (client ExternalSecuritySolutionsClient) ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result ExternalSecuritySolutionListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionsClient.ListByHomeRegion") defer func() { @@ -355,6 +360,6 @@ func (client ExternalSecuritySolutionsClient) ListByHomeRegionComplete(ctx conte tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByHomeRegion(ctx) + result.page, err = client.ListByHomeRegion(ctx, ascLocation) return } diff --git a/services/preview/security/mgmt/v3.0/security/informationprotectionpolicies.go b/services/preview/security/mgmt/v3.0/security/informationprotectionpolicies.go index ab62d290cbd9..f2e2cc818b8a 100644 --- a/services/preview/security/mgmt/v3.0/security/informationprotectionpolicies.go +++ b/services/preview/security/mgmt/v3.0/security/informationprotectionpolicies.go @@ -20,15 +20,15 @@ type InformationProtectionPoliciesClient struct { } // NewInformationProtectionPoliciesClient creates an instance of the InformationProtectionPoliciesClient client. -func NewInformationProtectionPoliciesClient(subscriptionID string, ascLocation string) InformationProtectionPoliciesClient { - return NewInformationProtectionPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewInformationProtectionPoliciesClient(subscriptionID string) InformationProtectionPoliciesClient { + return NewInformationProtectionPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewInformationProtectionPoliciesClientWithBaseURI creates an instance of the InformationProtectionPoliciesClient // 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 NewInformationProtectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) InformationProtectionPoliciesClient { - return InformationProtectionPoliciesClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewInformationProtectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) InformationProtectionPoliciesClient { + return InformationProtectionPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate details of the information protection policy. @@ -37,7 +37,7 @@ func NewInformationProtectionPoliciesClientWithBaseURI(baseURI string, subscript // management group (/providers/Microsoft.Management/managementGroups/mgName). // informationProtectionPolicyName - name of the information protection policy. // informationProtectionPolicy - information protection policy. -func (client InformationProtectionPoliciesClient) CreateOrUpdate(ctx context.Context, scope string, informationProtectionPolicyName string, informationProtectionPolicy InformationProtectionPolicy) (result InformationProtectionPolicy, err error) { +func (client InformationProtectionPoliciesClient) CreateOrUpdate(ctx context.Context, scope string, informationProtectionPolicyName InformationProtectionPolicyName, informationProtectionPolicy InformationProtectionPolicy) (result InformationProtectionPolicy, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/InformationProtectionPoliciesClient.CreateOrUpdate") defer func() { @@ -71,7 +71,7 @@ func (client InformationProtectionPoliciesClient) CreateOrUpdate(ctx context.Con } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client InformationProtectionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, scope string, informationProtectionPolicyName string, informationProtectionPolicy InformationProtectionPolicy) (*http.Request, error) { +func (client InformationProtectionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, scope string, informationProtectionPolicyName InformationProtectionPolicyName, informationProtectionPolicy InformationProtectionPolicy) (*http.Request, error) { pathParameters := map[string]interface{}{ "informationProtectionPolicyName": autorest.Encode("path", informationProtectionPolicyName), "scope": scope, @@ -115,7 +115,7 @@ func (client InformationProtectionPoliciesClient) CreateOrUpdateResponder(resp * // scope - scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or // management group (/providers/Microsoft.Management/managementGroups/mgName). // informationProtectionPolicyName - name of the information protection policy. -func (client InformationProtectionPoliciesClient) Get(ctx context.Context, scope string, informationProtectionPolicyName string) (result InformationProtectionPolicy, err error) { +func (client InformationProtectionPoliciesClient) Get(ctx context.Context, scope string, informationProtectionPolicyName InformationProtectionPolicyName) (result InformationProtectionPolicy, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/InformationProtectionPoliciesClient.Get") defer func() { @@ -149,7 +149,7 @@ func (client InformationProtectionPoliciesClient) Get(ctx context.Context, scope } // GetPreparer prepares the Get request. -func (client InformationProtectionPoliciesClient) GetPreparer(ctx context.Context, scope string, informationProtectionPolicyName string) (*http.Request, error) { +func (client InformationProtectionPoliciesClient) GetPreparer(ctx context.Context, scope string, informationProtectionPolicyName InformationProtectionPolicyName) (*http.Request, error) { pathParameters := map[string]interface{}{ "informationProtectionPolicyName": autorest.Encode("path", informationProtectionPolicyName), "scope": scope, diff --git a/services/preview/security/mgmt/v3.0/security/ingestionsettings.go b/services/preview/security/mgmt/v3.0/security/ingestionsettings.go index b5f7ce03a686..894afa66e205 100644 --- a/services/preview/security/mgmt/v3.0/security/ingestionsettings.go +++ b/services/preview/security/mgmt/v3.0/security/ingestionsettings.go @@ -21,15 +21,15 @@ type IngestionSettingsClient struct { } // NewIngestionSettingsClient creates an instance of the IngestionSettingsClient client. -func NewIngestionSettingsClient(subscriptionID string, ascLocation string) IngestionSettingsClient { - return NewIngestionSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewIngestionSettingsClient(subscriptionID string) IngestionSettingsClient { + return NewIngestionSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // 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)} +func NewIngestionSettingsClientWithBaseURI(baseURI string, subscriptionID string) IngestionSettingsClient { + return IngestionSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Create create setting for ingesting security data and logs to correlate with resources associated with the diff --git a/services/preview/security/mgmt/v3.0/security/iotalerts.go b/services/preview/security/mgmt/v3.0/security/iotalerts.go deleted file mode 100644 index 0db7982efdb0..000000000000 --- a/services/preview/security/mgmt/v3.0/security/iotalerts.go +++ /dev/null @@ -1,251 +0,0 @@ -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/tracing" - "net/http" -) - -// IotAlertsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider -type IotAlertsClient struct { - BaseClient -} - -// NewIotAlertsClient creates an instance of the IotAlertsClient client. -func NewIotAlertsClient(subscriptionID string, ascLocation string) IotAlertsClient { - return NewIotAlertsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewIotAlertsClientWithBaseURI creates an instance of the IotAlertsClient 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 NewIotAlertsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotAlertsClient { - return IotAlertsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// Get 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) Get(ctx context.Context, scope string, iotAlertID string) (result IotAlertModel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, scope, iotAlertID) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotAlertsClient", "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.IotAlertsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotAlertsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -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, - } - - const APIVersion = "2020-08-06-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/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, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client IotAlertsClient) GetResponder(resp *http.Response) (result IotAlertModel, 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 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) 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.ialm.Response.Response != nil { - sc = result.ialm.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - 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 - } - - resp, err := client.ListSender(req) - if err != nil { - result.ialm.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IotAlertsClient", "List", resp, "Failure sending request") - return - } - - result.ialm, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotAlertsClient", "List", resp, "Failure responding to request") - return - } - if result.ialm.hasNextLink() && result.ialm.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -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{}{ - "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)) -} - -// 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, 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 IotAlertListModel, 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 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") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "security.IotAlertsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotAlertsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -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() { - 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, scope, minStartTimeUtc, maxStartTimeUtc, alertType, deviceManagementType, compromisedEntity, limit, skipToken) - return -} diff --git a/services/preview/security/mgmt/v3.0/security/iotdefendersettings.go b/services/preview/security/mgmt/v3.0/security/iotdefendersettings.go deleted file mode 100644 index 9d3ee16a1d8c..000000000000 --- a/services/preview/security/mgmt/v3.0/security/iotdefendersettings.go +++ /dev/null @@ -1,503 +0,0 @@ -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" -) - -// IotDefenderSettingsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider -type IotDefenderSettingsClient struct { - BaseClient -} - -// NewIotDefenderSettingsClient creates an instance of the IotDefenderSettingsClient client. -func NewIotDefenderSettingsClient(subscriptionID string, ascLocation string) IotDefenderSettingsClient { - return NewIotDefenderSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewIotDefenderSettingsClientWithBaseURI creates an instance of the IotDefenderSettingsClient 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 NewIotDefenderSettingsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotDefenderSettingsClient { - return IotDefenderSettingsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// CreateOrUpdate create or update IoT Defender settings -// Parameters: -// iotDefenderSettingsModel - the IoT defender settings model -func (client IotDefenderSettingsClient) CreateOrUpdate(ctx context.Context, iotDefenderSettingsModel IotDefenderSettingsModel) (result IotDefenderSettingsModel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotDefenderSettingsClient.CreateOrUpdate") - 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: iotDefenderSettingsModel, - Constraints: []validation.Constraint{{Target: "iotDefenderSettingsModel.IotDefenderSettingsProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "iotDefenderSettingsModel.IotDefenderSettingsProperties.DeviceQuota", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "iotDefenderSettingsModel.IotDefenderSettingsProperties.DeviceQuota", Name: validation.InclusiveMinimum, Rule: int64(1000), Chain: nil}}}, - {Target: "iotDefenderSettingsModel.IotDefenderSettingsProperties.SentinelWorkspaceResourceIds", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("security.IotDefenderSettingsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, iotDefenderSettingsModel) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotDefenderSettingsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IotDefenderSettingsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotDefenderSettingsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client IotDefenderSettingsClient) CreateOrUpdatePreparer(ctx context.Context, iotDefenderSettingsModel IotDefenderSettingsModel) (*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.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default", pathParameters), - autorest.WithJSON(iotDefenderSettingsModel), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client IotDefenderSettingsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client IotDefenderSettingsClient) CreateOrUpdateResponder(resp *http.Response) (result IotDefenderSettingsModel, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete IoT Defender settings -func (client IotDefenderSettingsClient) Delete(ctx context.Context) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotDefenderSettingsClient.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.IotDefenderSettingsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotDefenderSettingsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "security.IotDefenderSettingsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotDefenderSettingsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client IotDefenderSettingsClient) DeletePreparer(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.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default", 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 IotDefenderSettingsClient) 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 IotDefenderSettingsClient) 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 -} - -// DownloadManagerActivation download manager activation data defined for this subscription -func (client IotDefenderSettingsClient) DownloadManagerActivation(ctx context.Context) (result ReadCloser, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotDefenderSettingsClient.DownloadManagerActivation") - 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.IotDefenderSettingsClient", "DownloadManagerActivation", err.Error()) - } - - req, err := client.DownloadManagerActivationPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotDefenderSettingsClient", "DownloadManagerActivation", nil, "Failure preparing request") - return - } - - resp, err := client.DownloadManagerActivationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IotDefenderSettingsClient", "DownloadManagerActivation", resp, "Failure sending request") - return - } - - result, err = client.DownloadManagerActivationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotDefenderSettingsClient", "DownloadManagerActivation", resp, "Failure responding to request") - return - } - - return -} - -// DownloadManagerActivationPreparer prepares the DownloadManagerActivation request. -func (client IotDefenderSettingsClient) DownloadManagerActivationPreparer(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.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default/downloadManagerActivation", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DownloadManagerActivationSender sends the DownloadManagerActivation request. The method will close the -// http.Response Body if it receives an error. -func (client IotDefenderSettingsClient) DownloadManagerActivationSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DownloadManagerActivationResponder handles the response to the DownloadManagerActivation request. The method always -// closes the http.Response Body. -func (client IotDefenderSettingsClient) DownloadManagerActivationResponder(resp *http.Response) (result ReadCloser, err error) { - result.Value = &resp.Body - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK)) - result.Response = autorest.Response{Response: resp} - return -} - -// Get get IoT Defender Settings -func (client IotDefenderSettingsClient) Get(ctx context.Context) (result IotDefenderSettingsModel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotDefenderSettingsClient.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.IotDefenderSettingsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotDefenderSettingsClient", "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.IotDefenderSettingsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotDefenderSettingsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client IotDefenderSettingsClient) GetPreparer(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/iotDefenderSettings/default", 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 IotDefenderSettingsClient) 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 IotDefenderSettingsClient) GetResponder(resp *http.Response) (result IotDefenderSettingsModel, 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 Defender Settings -func (client IotDefenderSettingsClient) List(ctx context.Context) (result IotDefenderSettingsList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotDefenderSettingsClient.List") - 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.IotDefenderSettingsClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotDefenderSettingsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IotDefenderSettingsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotDefenderSettingsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client IotDefenderSettingsClient) ListPreparer(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/iotDefenderSettings", 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 IotDefenderSettingsClient) 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 IotDefenderSettingsClient) ListResponder(resp *http.Response) (result IotDefenderSettingsList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// PackageDownloadsMethod information about downloadable packages -func (client IotDefenderSettingsClient) PackageDownloadsMethod(ctx context.Context) (result PackageDownloads, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotDefenderSettingsClient.PackageDownloadsMethod") - 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.IotDefenderSettingsClient", "PackageDownloadsMethod", err.Error()) - } - - req, err := client.PackageDownloadsMethodPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotDefenderSettingsClient", "PackageDownloadsMethod", nil, "Failure preparing request") - return - } - - resp, err := client.PackageDownloadsMethodSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IotDefenderSettingsClient", "PackageDownloadsMethod", resp, "Failure sending request") - return - } - - result, err = client.PackageDownloadsMethodResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotDefenderSettingsClient", "PackageDownloadsMethod", resp, "Failure responding to request") - return - } - - return -} - -// PackageDownloadsMethodPreparer prepares the PackageDownloadsMethod request. -func (client IotDefenderSettingsClient) PackageDownloadsMethodPreparer(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.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default/packageDownloads", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PackageDownloadsMethodSender sends the PackageDownloadsMethod request. The method will close the -// http.Response Body if it receives an error. -func (client IotDefenderSettingsClient) PackageDownloadsMethodSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// PackageDownloadsMethodResponder handles the response to the PackageDownloadsMethod request. The method always -// closes the http.Response Body. -func (client IotDefenderSettingsClient) PackageDownloadsMethodResponder(resp *http.Response) (result PackageDownloads, 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/services/preview/security/mgmt/v3.0/security/iotrecommendations.go b/services/preview/security/mgmt/v3.0/security/iotrecommendations.go deleted file mode 100644 index d65c06b1cb94..000000000000 --- a/services/preview/security/mgmt/v3.0/security/iotrecommendations.go +++ /dev/null @@ -1,240 +0,0 @@ -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/tracing" - "net/http" -) - -// IotRecommendationsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider -type IotRecommendationsClient struct { - BaseClient -} - -// NewIotRecommendationsClient creates an instance of the IotRecommendationsClient client. -func NewIotRecommendationsClient(subscriptionID string, ascLocation string) IotRecommendationsClient { - return NewIotRecommendationsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewIotRecommendationsClientWithBaseURI creates an instance of the IotRecommendationsClient 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 NewIotRecommendationsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotRecommendationsClient { - return IotRecommendationsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// Get 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) Get(ctx context.Context, scope string, iotRecommendationID string) (result IotRecommendationModel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, scope, iotRecommendationID) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "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.IotRecommendationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -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, - } - - const APIVersion = "2020-08-06-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/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, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client IotRecommendationsClient) GetResponder(resp *http.Response) (result IotRecommendationModel, 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 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) 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.irlm.Response.Response != nil { - sc = result.irlm.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - 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 - } - - resp, err := client.ListSender(req) - if err != nil { - result.irlm.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "List", resp, "Failure sending request") - return - } - - result.irlm, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "List", resp, "Failure responding to request") - return - } - if result.irlm.hasNextLink() && result.irlm.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client IotRecommendationsClient) ListPreparer(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)) -} - -// 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, 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 IotRecommendationListModel, 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 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") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -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() { - 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, scope, recommendationType, deviceID, limit, skipToken) - return -} diff --git a/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go index 453312504f18..5ed674e8992e 100644 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go +++ b/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go @@ -21,15 +21,15 @@ type IotSecuritySolutionClient struct { } // NewIotSecuritySolutionClient creates an instance of the IotSecuritySolutionClient client. -func NewIotSecuritySolutionClient(subscriptionID string, ascLocation string) IotSecuritySolutionClient { - return NewIotSecuritySolutionClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewIotSecuritySolutionClient(subscriptionID string) IotSecuritySolutionClient { + return NewIotSecuritySolutionClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewIotSecuritySolutionClientWithBaseURI creates an instance of the IotSecuritySolutionClient 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 NewIotSecuritySolutionClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotSecuritySolutionClient { - return IotSecuritySolutionClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewIotSecuritySolutionClientWithBaseURI(baseURI string, subscriptionID string) IotSecuritySolutionClient { + return IotSecuritySolutionClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate use this method to create or update yours IoT Security solution diff --git a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionanalytics.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionanalytics.go index 15fab8b9be65..d1f1ffca0f17 100644 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionanalytics.go +++ b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionanalytics.go @@ -21,15 +21,15 @@ type IotSecuritySolutionAnalyticsClient struct { } // NewIotSecuritySolutionAnalyticsClient creates an instance of the IotSecuritySolutionAnalyticsClient client. -func NewIotSecuritySolutionAnalyticsClient(subscriptionID string, ascLocation string) IotSecuritySolutionAnalyticsClient { - return NewIotSecuritySolutionAnalyticsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewIotSecuritySolutionAnalyticsClient(subscriptionID string) IotSecuritySolutionAnalyticsClient { + return NewIotSecuritySolutionAnalyticsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewIotSecuritySolutionAnalyticsClientWithBaseURI creates an instance of the IotSecuritySolutionAnalyticsClient // 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 NewIotSecuritySolutionAnalyticsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotSecuritySolutionAnalyticsClient { - return IotSecuritySolutionAnalyticsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewIotSecuritySolutionAnalyticsClientWithBaseURI(baseURI string, subscriptionID string) IotSecuritySolutionAnalyticsClient { + return IotSecuritySolutionAnalyticsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get use this method to get IoT Security Analytics metrics. diff --git a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsaggregatedalert.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsaggregatedalert.go index 02b09bb92e84..c2a5c21f850c 100644 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsaggregatedalert.go +++ b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsaggregatedalert.go @@ -23,15 +23,15 @@ type IotSecuritySolutionsAnalyticsAggregatedAlertClient struct { // NewIotSecuritySolutionsAnalyticsAggregatedAlertClient creates an instance of the // IotSecuritySolutionsAnalyticsAggregatedAlertClient client. -func NewIotSecuritySolutionsAnalyticsAggregatedAlertClient(subscriptionID string, ascLocation string) IotSecuritySolutionsAnalyticsAggregatedAlertClient { - return NewIotSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewIotSecuritySolutionsAnalyticsAggregatedAlertClient(subscriptionID string) IotSecuritySolutionsAnalyticsAggregatedAlertClient { + return NewIotSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewIotSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI creates an instance of the // IotSecuritySolutionsAnalyticsAggregatedAlertClient 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 NewIotSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotSecuritySolutionsAnalyticsAggregatedAlertClient { - return IotSecuritySolutionsAnalyticsAggregatedAlertClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewIotSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI(baseURI string, subscriptionID string) IotSecuritySolutionsAnalyticsAggregatedAlertClient { + return IotSecuritySolutionsAnalyticsAggregatedAlertClient{NewWithBaseURI(baseURI, subscriptionID)} } // Dismiss use this method to dismiss an aggregated IoT Security Solution Alert. diff --git a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsrecommendation.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsrecommendation.go index c79fdceffa46..5c25a7040288 100644 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsrecommendation.go +++ b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsrecommendation.go @@ -23,15 +23,15 @@ type IotSecuritySolutionsAnalyticsRecommendationClient struct { // NewIotSecuritySolutionsAnalyticsRecommendationClient creates an instance of the // IotSecuritySolutionsAnalyticsRecommendationClient client. -func NewIotSecuritySolutionsAnalyticsRecommendationClient(subscriptionID string, ascLocation string) IotSecuritySolutionsAnalyticsRecommendationClient { - return NewIotSecuritySolutionsAnalyticsRecommendationClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewIotSecuritySolutionsAnalyticsRecommendationClient(subscriptionID string) IotSecuritySolutionsAnalyticsRecommendationClient { + return NewIotSecuritySolutionsAnalyticsRecommendationClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewIotSecuritySolutionsAnalyticsRecommendationClientWithBaseURI creates an instance of the // IotSecuritySolutionsAnalyticsRecommendationClient 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 NewIotSecuritySolutionsAnalyticsRecommendationClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotSecuritySolutionsAnalyticsRecommendationClient { - return IotSecuritySolutionsAnalyticsRecommendationClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewIotSecuritySolutionsAnalyticsRecommendationClientWithBaseURI(baseURI string, subscriptionID string) IotSecuritySolutionsAnalyticsRecommendationClient { + return IotSecuritySolutionsAnalyticsRecommendationClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This diff --git a/services/preview/security/mgmt/v3.0/security/iotsensors.go b/services/preview/security/mgmt/v3.0/security/iotsensors.go deleted file mode 100644 index ff3ae20b5dc0..000000000000 --- a/services/preview/security/mgmt/v3.0/security/iotsensors.go +++ /dev/null @@ -1,556 +0,0 @@ -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/tracing" - "net/http" -) - -// IotSensorsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider -type IotSensorsClient struct { - BaseClient -} - -// NewIotSensorsClient creates an instance of the IotSensorsClient client. -func NewIotSensorsClient(subscriptionID string, ascLocation string) IotSensorsClient { - return NewIotSensorsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewIotSensorsClientWithBaseURI creates an instance of the IotSensorsClient 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 NewIotSensorsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotSensorsClient { - return IotSensorsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// CreateOrUpdate create or update IoT sensor -// Parameters: -// scope - scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) -// iotSensorName - name of the IoT sensor -// iotSensorsModel - the IoT sensor model -func (client IotSensorsClient) CreateOrUpdate(ctx context.Context, scope string, iotSensorName string, iotSensorsModel IotSensorsModel) (result IotSensorsModel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotSensorsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, scope, iotSensorName, iotSensorsModel) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSensorsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IotSensorsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSensorsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client IotSensorsClient) CreateOrUpdatePreparer(ctx context.Context, scope string, iotSensorName string, iotSensorsModel IotSensorsModel) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "iotSensorName": autorest.Encode("path", iotSensorName), - "scope": scope, - } - - const APIVersion = "2020-08-06-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("/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}", pathParameters), - autorest.WithJSON(iotSensorsModel), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client IotSensorsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client IotSensorsClient) CreateOrUpdateResponder(resp *http.Response) (result IotSensorsModel, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete IoT sensor -// Parameters: -// scope - scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) -// iotSensorName - name of the IoT sensor -func (client IotSensorsClient) Delete(ctx context.Context, scope string, iotSensorName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotSensorsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, scope, iotSensorName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSensorsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "security.IotSensorsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSensorsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client IotSensorsClient) DeletePreparer(ctx context.Context, scope string, iotSensorName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "iotSensorName": autorest.Encode("path", iotSensorName), - "scope": scope, - } - - const APIVersion = "2020-08-06-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}", 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 IotSensorsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client IotSensorsClient) 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 -} - -// DownloadActivation download sensor activation file -// Parameters: -// scope - scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) -// iotSensorName - name of the IoT sensor -func (client IotSensorsClient) DownloadActivation(ctx context.Context, scope string, iotSensorName string) (result ReadCloser, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotSensorsClient.DownloadActivation") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DownloadActivationPreparer(ctx, scope, iotSensorName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSensorsClient", "DownloadActivation", nil, "Failure preparing request") - return - } - - resp, err := client.DownloadActivationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IotSensorsClient", "DownloadActivation", resp, "Failure sending request") - return - } - - result, err = client.DownloadActivationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSensorsClient", "DownloadActivation", resp, "Failure responding to request") - return - } - - return -} - -// DownloadActivationPreparer prepares the DownloadActivation request. -func (client IotSensorsClient) DownloadActivationPreparer(ctx context.Context, scope string, iotSensorName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "iotSensorName": autorest.Encode("path", iotSensorName), - "scope": scope, - } - - const APIVersion = "2020-08-06-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}/downloadActivation", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DownloadActivationSender sends the DownloadActivation request. The method will close the -// http.Response Body if it receives an error. -func (client IotSensorsClient) DownloadActivationSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DownloadActivationResponder handles the response to the DownloadActivation request. The method always -// closes the http.Response Body. -func (client IotSensorsClient) DownloadActivationResponder(resp *http.Response) (result ReadCloser, err error) { - result.Value = &resp.Body - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK)) - result.Response = autorest.Response{Response: resp} - return -} - -// DownloadResetPassword download file for reset password of the sensor -// Parameters: -// scope - scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) -// iotSensorName - name of the IoT sensor -// body - the reset password input. -func (client IotSensorsClient) DownloadResetPassword(ctx context.Context, scope string, iotSensorName string, body ResetPasswordInput) (result ReadCloser, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotSensorsClient.DownloadResetPassword") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DownloadResetPasswordPreparer(ctx, scope, iotSensorName, body) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSensorsClient", "DownloadResetPassword", nil, "Failure preparing request") - return - } - - resp, err := client.DownloadResetPasswordSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IotSensorsClient", "DownloadResetPassword", resp, "Failure sending request") - return - } - - result, err = client.DownloadResetPasswordResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSensorsClient", "DownloadResetPassword", resp, "Failure responding to request") - return - } - - return -} - -// DownloadResetPasswordPreparer prepares the DownloadResetPassword request. -func (client IotSensorsClient) DownloadResetPasswordPreparer(ctx context.Context, scope string, iotSensorName string, body ResetPasswordInput) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "iotSensorName": autorest.Encode("path", iotSensorName), - "scope": scope, - } - - const APIVersion = "2020-08-06-preview" - 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("/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}/downloadResetPassword", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DownloadResetPasswordSender sends the DownloadResetPassword request. The method will close the -// http.Response Body if it receives an error. -func (client IotSensorsClient) DownloadResetPasswordSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DownloadResetPasswordResponder handles the response to the DownloadResetPassword request. The method always -// closes the http.Response Body. -func (client IotSensorsClient) DownloadResetPasswordResponder(resp *http.Response) (result ReadCloser, err error) { - result.Value = &resp.Body - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK)) - result.Response = autorest.Response{Response: resp} - return -} - -// Get get IoT sensor -// Parameters: -// scope - scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) -// iotSensorName - name of the IoT sensor -func (client IotSensorsClient) Get(ctx context.Context, scope string, iotSensorName string) (result IotSensorsModel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotSensorsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, scope, iotSensorName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSensorsClient", "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.IotSensorsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSensorsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client IotSensorsClient) GetPreparer(ctx context.Context, scope string, iotSensorName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "iotSensorName": autorest.Encode("path", iotSensorName), - "scope": scope, - } - - const APIVersion = "2020-08-06-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}", 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 IotSensorsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client IotSensorsClient) GetResponder(resp *http.Response) (result IotSensorsModel, 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 sensors -// Parameters: -// scope - scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) -func (client IotSensorsClient) List(ctx context.Context, scope string) (result IotSensorsList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotSensorsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, scope) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSensorsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IotSensorsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSensorsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client IotSensorsClient) ListPreparer(ctx context.Context, scope string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "scope": scope, - } - - const APIVersion = "2020-08-06-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/iotSensors", 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 IotSensorsClient) ListSender(req *http.Request) (*http.Response, error) { - 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 IotSensorsClient) ListResponder(resp *http.Response) (result IotSensorsList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// TriggerTiPackageUpdate trigger threat intelligence package update -// Parameters: -// scope - scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) -// iotSensorName - name of the IoT sensor -func (client IotSensorsClient) TriggerTiPackageUpdate(ctx context.Context, scope string, iotSensorName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotSensorsClient.TriggerTiPackageUpdate") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.TriggerTiPackageUpdatePreparer(ctx, scope, iotSensorName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSensorsClient", "TriggerTiPackageUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.TriggerTiPackageUpdateSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "security.IotSensorsClient", "TriggerTiPackageUpdate", resp, "Failure sending request") - return - } - - result, err = client.TriggerTiPackageUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSensorsClient", "TriggerTiPackageUpdate", resp, "Failure responding to request") - return - } - - return -} - -// TriggerTiPackageUpdatePreparer prepares the TriggerTiPackageUpdate request. -func (client IotSensorsClient) TriggerTiPackageUpdatePreparer(ctx context.Context, scope string, iotSensorName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "iotSensorName": autorest.Encode("path", iotSensorName), - "scope": scope, - } - - const APIVersion = "2020-08-06-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}/triggerTiPackageUpdate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TriggerTiPackageUpdateSender sends the TriggerTiPackageUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client IotSensorsClient) TriggerTiPackageUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// TriggerTiPackageUpdateResponder handles the response to the TriggerTiPackageUpdate request. The method always -// closes the http.Response Body. -func (client IotSensorsClient) TriggerTiPackageUpdateResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/services/preview/security/mgmt/v3.0/security/iotsites.go b/services/preview/security/mgmt/v3.0/security/iotsites.go deleted file mode 100644 index 1326e67d8924..000000000000 --- a/services/preview/security/mgmt/v3.0/security/iotsites.go +++ /dev/null @@ -1,333 +0,0 @@ -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" -) - -// IotSitesClient is the API spec for Microsoft.Security (Azure Security Center) resource provider -type IotSitesClient struct { - BaseClient -} - -// NewIotSitesClient creates an instance of the IotSitesClient client. -func NewIotSitesClient(subscriptionID string, ascLocation string) IotSitesClient { - return NewIotSitesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewIotSitesClientWithBaseURI creates an instance of the IotSitesClient 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 NewIotSitesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotSitesClient { - return IotSitesClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// CreateOrUpdate create or update IoT site -// Parameters: -// scope - scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) -// iotSitesModel - the IoT sites model -func (client IotSitesClient) CreateOrUpdate(ctx context.Context, scope string, iotSitesModel IotSitesModel) (result IotSitesModel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotSitesClient.CreateOrUpdate") - 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: iotSitesModel, - Constraints: []validation.Constraint{{Target: "iotSitesModel.IotSiteProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "iotSitesModel.IotSiteProperties.DisplayName", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("security.IotSitesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, scope, iotSitesModel) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSitesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IotSitesClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSitesClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client IotSitesClient) CreateOrUpdatePreparer(ctx context.Context, scope string, iotSitesModel IotSitesModel) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "scope": scope, - } - - const APIVersion = "2020-08-06-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("/{scope}/providers/Microsoft.Security/iotSites/default", pathParameters), - autorest.WithJSON(iotSitesModel), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client IotSitesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client IotSitesClient) CreateOrUpdateResponder(resp *http.Response) (result IotSitesModel, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete IoT site -// Parameters: -// scope - scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) -func (client IotSitesClient) Delete(ctx context.Context, scope string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotSitesClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, scope) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSitesClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "security.IotSitesClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSitesClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client IotSitesClient) DeletePreparer(ctx context.Context, scope string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "scope": scope, - } - - const APIVersion = "2020-08-06-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/iotSites/default", 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 IotSitesClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client IotSitesClient) 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 get IoT site -// Parameters: -// scope - scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) -func (client IotSitesClient) Get(ctx context.Context, scope string) (result IotSitesModel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotSitesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, scope) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSitesClient", "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.IotSitesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSitesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client IotSitesClient) GetPreparer(ctx context.Context, scope string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "scope": scope, - } - - const APIVersion = "2020-08-06-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/iotSites/default", 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 IotSitesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client IotSitesClient) GetResponder(resp *http.Response) (result IotSitesModel, 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 sites -// Parameters: -// scope - scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) -func (client IotSitesClient) List(ctx context.Context, scope string) (result IotSitesList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotSitesClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, scope) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSitesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.IotSitesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.IotSitesClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client IotSitesClient) ListPreparer(ctx context.Context, scope string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "scope": scope, - } - - const APIVersion = "2020-08-06-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/iotSites", 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 IotSitesClient) ListSender(req *http.Request) (*http.Response, error) { - 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 IotSitesClient) ListResponder(resp *http.Response) (result IotSitesList, 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/services/preview/security/mgmt/v3.0/security/jitnetworkaccesspolicies.go b/services/preview/security/mgmt/v3.0/security/jitnetworkaccesspolicies.go index 4557a7d3db38..386753510395 100644 --- a/services/preview/security/mgmt/v3.0/security/jitnetworkaccesspolicies.go +++ b/services/preview/security/mgmt/v3.0/security/jitnetworkaccesspolicies.go @@ -21,23 +21,25 @@ type JitNetworkAccessPoliciesClient struct { } // NewJitNetworkAccessPoliciesClient creates an instance of the JitNetworkAccessPoliciesClient client. -func NewJitNetworkAccessPoliciesClient(subscriptionID string, ascLocation string) JitNetworkAccessPoliciesClient { - return NewJitNetworkAccessPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewJitNetworkAccessPoliciesClient(subscriptionID string) JitNetworkAccessPoliciesClient { + return NewJitNetworkAccessPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewJitNetworkAccessPoliciesClientWithBaseURI creates an instance of the JitNetworkAccessPoliciesClient 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 NewJitNetworkAccessPoliciesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) JitNetworkAccessPoliciesClient { - return JitNetworkAccessPoliciesClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewJitNetworkAccessPoliciesClientWithBaseURI(baseURI string, subscriptionID string) JitNetworkAccessPoliciesClient { + return JitNetworkAccessPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate create a policy for protecting resources using Just-in-Time access control // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // jitNetworkAccessPolicyName - name of a Just-in-Time access configuration policy. -func (client JitNetworkAccessPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicy) (result JitNetworkAccessPolicy, err error) { +func (client JitNetworkAccessPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicy) (result JitNetworkAccessPolicy, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.CreateOrUpdate") defer func() { @@ -61,7 +63,7 @@ func (client JitNetworkAccessPoliciesClient) CreateOrUpdate(ctx context.Context, return result, validation.NewError("security.JitNetworkAccessPoliciesClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, jitNetworkAccessPolicyName, body) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body) if err != nil { err = autorest.NewErrorWithError(err, "security.JitNetworkAccessPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -84,9 +86,9 @@ func (client JitNetworkAccessPoliciesClient) CreateOrUpdate(ctx context.Context, } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client JitNetworkAccessPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicy) (*http.Request, error) { +func (client JitNetworkAccessPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicy) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "jitNetworkAccessPolicyName": autorest.Encode("path", jitNetworkAccessPolicyName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -133,8 +135,10 @@ func (client JitNetworkAccessPoliciesClient) CreateOrUpdateResponder(resp *http. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // jitNetworkAccessPolicyName - name of a Just-in-Time access configuration policy. -func (client JitNetworkAccessPoliciesClient) Delete(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string) (result autorest.Response, err error) { +func (client JitNetworkAccessPoliciesClient) Delete(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.Delete") defer func() { @@ -155,7 +159,7 @@ func (client JitNetworkAccessPoliciesClient) Delete(ctx context.Context, resourc return result, validation.NewError("security.JitNetworkAccessPoliciesClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, jitNetworkAccessPolicyName) + req, err := client.DeletePreparer(ctx, resourceGroupName, ascLocation, jitNetworkAccessPolicyName) if err != nil { err = autorest.NewErrorWithError(err, "security.JitNetworkAccessPoliciesClient", "Delete", nil, "Failure preparing request") return @@ -178,9 +182,9 @@ func (client JitNetworkAccessPoliciesClient) Delete(ctx context.Context, resourc } // DeletePreparer prepares the Delete request. -func (client JitNetworkAccessPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string) (*http.Request, error) { +func (client JitNetworkAccessPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "jitNetworkAccessPolicyName": autorest.Encode("path", jitNetworkAccessPolicyName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -220,8 +224,10 @@ func (client JitNetworkAccessPoliciesClient) DeleteResponder(resp *http.Response // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // jitNetworkAccessPolicyName - name of a Just-in-Time access configuration policy. -func (client JitNetworkAccessPoliciesClient) Get(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string) (result JitNetworkAccessPolicy, err error) { +func (client JitNetworkAccessPoliciesClient) Get(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string) (result JitNetworkAccessPolicy, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.Get") defer func() { @@ -242,7 +248,7 @@ func (client JitNetworkAccessPoliciesClient) Get(ctx context.Context, resourceGr return result, validation.NewError("security.JitNetworkAccessPoliciesClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, jitNetworkAccessPolicyName) + req, err := client.GetPreparer(ctx, resourceGroupName, ascLocation, jitNetworkAccessPolicyName) if err != nil { err = autorest.NewErrorWithError(err, "security.JitNetworkAccessPoliciesClient", "Get", nil, "Failure preparing request") return @@ -265,9 +271,9 @@ func (client JitNetworkAccessPoliciesClient) Get(ctx context.Context, resourceGr } // GetPreparer prepares the Get request. -func (client JitNetworkAccessPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string) (*http.Request, error) { +func (client JitNetworkAccessPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "jitNetworkAccessPolicyName": autorest.Encode("path", jitNetworkAccessPolicyName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -308,8 +314,10 @@ func (client JitNetworkAccessPoliciesClient) GetResponder(resp *http.Response) ( // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // jitNetworkAccessPolicyName - name of a Just-in-Time access configuration policy. -func (client JitNetworkAccessPoliciesClient) Initiate(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicyInitiateRequest) (result JitNetworkAccessRequest, err error) { +func (client JitNetworkAccessPoliciesClient) Initiate(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicyInitiateRequest) (result JitNetworkAccessRequest, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.Initiate") defer func() { @@ -332,7 +340,7 @@ func (client JitNetworkAccessPoliciesClient) Initiate(ctx context.Context, resou return result, validation.NewError("security.JitNetworkAccessPoliciesClient", "Initiate", err.Error()) } - req, err := client.InitiatePreparer(ctx, resourceGroupName, jitNetworkAccessPolicyName, body) + req, err := client.InitiatePreparer(ctx, resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body) if err != nil { err = autorest.NewErrorWithError(err, "security.JitNetworkAccessPoliciesClient", "Initiate", nil, "Failure preparing request") return @@ -355,9 +363,9 @@ func (client JitNetworkAccessPoliciesClient) Initiate(ctx context.Context, resou } // InitiatePreparer prepares the Initiate request. -func (client JitNetworkAccessPoliciesClient) InitiatePreparer(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicyInitiateRequest) (*http.Request, error) { +func (client JitNetworkAccessPoliciesClient) InitiatePreparer(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicyInitiateRequest) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "jitNetworkAccessPolicyInitiateType": autorest.Encode("path", "initiate"), "jitNetworkAccessPolicyName": autorest.Encode("path", jitNetworkAccessPolicyName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -517,7 +525,10 @@ func (client JitNetworkAccessPoliciesClient) ListComplete(ctx context.Context) ( } // ListByRegion policies for protecting resources using Just-in-Time access control for the subscription, location -func (client JitNetworkAccessPoliciesClient) ListByRegion(ctx context.Context) (result JitNetworkAccessPoliciesListPage, err error) { +// Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations +func (client JitNetworkAccessPoliciesClient) ListByRegion(ctx context.Context, ascLocation string) (result JitNetworkAccessPoliciesListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.ListByRegion") defer func() { @@ -535,7 +546,7 @@ func (client JitNetworkAccessPoliciesClient) ListByRegion(ctx context.Context) ( } result.fn = client.listByRegionNextResults - req, err := client.ListByRegionPreparer(ctx) + req, err := client.ListByRegionPreparer(ctx, ascLocation) if err != nil { err = autorest.NewErrorWithError(err, "security.JitNetworkAccessPoliciesClient", "ListByRegion", nil, "Failure preparing request") return @@ -562,9 +573,9 @@ func (client JitNetworkAccessPoliciesClient) ListByRegion(ctx context.Context) ( } // ListByRegionPreparer prepares the ListByRegion request. -func (client JitNetworkAccessPoliciesClient) ListByRegionPreparer(ctx context.Context) (*http.Request, error) { +func (client JitNetworkAccessPoliciesClient) ListByRegionPreparer(ctx context.Context, ascLocation string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -621,7 +632,7 @@ func (client JitNetworkAccessPoliciesClient) listByRegionNextResults(ctx context } // ListByRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client JitNetworkAccessPoliciesClient) ListByRegionComplete(ctx context.Context) (result JitNetworkAccessPoliciesListIterator, err error) { +func (client JitNetworkAccessPoliciesClient) ListByRegionComplete(ctx context.Context, ascLocation string) (result JitNetworkAccessPoliciesListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.ListByRegion") defer func() { @@ -632,7 +643,7 @@ func (client JitNetworkAccessPoliciesClient) ListByRegionComplete(ctx context.Co tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByRegion(ctx) + result.page, err = client.ListByRegion(ctx, ascLocation) return } @@ -769,7 +780,9 @@ func (client JitNetworkAccessPoliciesClient) ListByResourceGroupComplete(ctx con // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. -func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegion(ctx context.Context, resourceGroupName string) (result JitNetworkAccessPoliciesListPage, err error) { +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations +func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegion(ctx context.Context, resourceGroupName string, ascLocation string) (result JitNetworkAccessPoliciesListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.ListByResourceGroupAndRegion") defer func() { @@ -791,7 +804,7 @@ func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegion(ctx co } result.fn = client.listByResourceGroupAndRegionNextResults - req, err := client.ListByResourceGroupAndRegionPreparer(ctx, resourceGroupName) + req, err := client.ListByResourceGroupAndRegionPreparer(ctx, resourceGroupName, ascLocation) if err != nil { err = autorest.NewErrorWithError(err, "security.JitNetworkAccessPoliciesClient", "ListByResourceGroupAndRegion", nil, "Failure preparing request") return @@ -818,9 +831,9 @@ func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegion(ctx co } // ListByResourceGroupAndRegionPreparer prepares the ListByResourceGroupAndRegion request. -func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegionPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { +func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegionPreparer(ctx context.Context, resourceGroupName string, ascLocation string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -878,7 +891,7 @@ func (client JitNetworkAccessPoliciesClient) listByResourceGroupAndRegionNextRes } // ListByResourceGroupAndRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegionComplete(ctx context.Context, resourceGroupName string) (result JitNetworkAccessPoliciesListIterator, err error) { +func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegionComplete(ctx context.Context, resourceGroupName string, ascLocation string) (result JitNetworkAccessPoliciesListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesClient.ListByResourceGroupAndRegion") defer func() { @@ -889,6 +902,6 @@ func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegionComplet tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByResourceGroupAndRegion(ctx, resourceGroupName) + result.page, err = client.ListByResourceGroupAndRegion(ctx, resourceGroupName, ascLocation) return } diff --git a/services/preview/security/mgmt/v3.0/security/locations.go b/services/preview/security/mgmt/v3.0/security/locations.go index a8b208f811fc..f6381e9bb043 100644 --- a/services/preview/security/mgmt/v3.0/security/locations.go +++ b/services/preview/security/mgmt/v3.0/security/locations.go @@ -21,18 +21,21 @@ type LocationsClient struct { } // NewLocationsClient creates an instance of the LocationsClient client. -func NewLocationsClient(subscriptionID string, ascLocation string) LocationsClient { - return NewLocationsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewLocationsClient(subscriptionID string) LocationsClient { + return NewLocationsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewLocationsClientWithBaseURI creates an instance of the LocationsClient 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 NewLocationsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) LocationsClient { - return LocationsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewLocationsClientWithBaseURI(baseURI string, subscriptionID string) LocationsClient { + return LocationsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get details of a specific location -func (client LocationsClient) Get(ctx context.Context) (result AscLocation, err error) { +// Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations +func (client LocationsClient) Get(ctx context.Context, ascLocation string) (result AscLocation, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LocationsClient.Get") defer func() { @@ -49,7 +52,7 @@ func (client LocationsClient) Get(ctx context.Context) (result AscLocation, err return result, validation.NewError("security.LocationsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx) + req, err := client.GetPreparer(ctx, ascLocation) if err != nil { err = autorest.NewErrorWithError(err, "security.LocationsClient", "Get", nil, "Failure preparing request") return @@ -72,9 +75,9 @@ func (client LocationsClient) Get(ctx context.Context) (result AscLocation, err } // GetPreparer prepares the Get request. -func (client LocationsClient) GetPreparer(ctx context.Context) (*http.Request, error) { +func (client LocationsClient) GetPreparer(ctx context.Context, ascLocation string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } diff --git a/services/preview/security/mgmt/v3.0/security/mdeonboardings.go b/services/preview/security/mgmt/v3.0/security/mdeonboardings.go new file mode 100644 index 000000000000..9b52e014e356 --- /dev/null +++ b/services/preview/security/mgmt/v3.0/security/mdeonboardings.go @@ -0,0 +1,186 @@ +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" +) + +// MdeOnboardingsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type MdeOnboardingsClient struct { + BaseClient +} + +// NewMdeOnboardingsClient creates an instance of the MdeOnboardingsClient client. +func NewMdeOnboardingsClient(subscriptionID string) MdeOnboardingsClient { + return NewMdeOnboardingsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewMdeOnboardingsClientWithBaseURI creates an instance of the MdeOnboardingsClient 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 NewMdeOnboardingsClientWithBaseURI(baseURI string, subscriptionID string) MdeOnboardingsClient { + return MdeOnboardingsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get the default configuration or data needed to onboard the machine to MDE +func (client MdeOnboardingsClient) Get(ctx context.Context) (result MdeOnboardingData, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MdeOnboardingsClient.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.MdeOnboardingsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.MdeOnboardingsClient", "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.MdeOnboardingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.MdeOnboardingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client MdeOnboardingsClient) GetPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-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/mdeOnboardings/default", 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 MdeOnboardingsClient) 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 MdeOnboardingsClient) GetResponder(resp *http.Response) (result MdeOnboardingData, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List the configuration or data needed to onboard the machine to MDE +func (client MdeOnboardingsClient) List(ctx context.Context) (result MdeOnboardingDataList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MdeOnboardingsClient.List") + 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.MdeOnboardingsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.MdeOnboardingsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.MdeOnboardingsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.MdeOnboardingsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client MdeOnboardingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-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/mdeOnboardings", 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 MdeOnboardingsClient) 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 MdeOnboardingsClient) ListResponder(resp *http.Response) (result MdeOnboardingDataList, 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/services/preview/security/mgmt/v3.0/security/models.go b/services/preview/security/mgmt/v3.0/security/models.go index 03a13201a108..cdf9c6748b2e 100644 --- a/services/preview/security/mgmt/v3.0/security/models.go +++ b/services/preview/security/mgmt/v3.0/security/models.go @@ -15,7 +15,6 @@ import ( "github.com/Azure/go-autorest/autorest/to" "github.com/Azure/go-autorest/tracing" "github.com/gofrs/uuid" - "io" "net/http" ) @@ -405,8 +404,8 @@ func (aacgd AdaptiveApplicationControlGroupData) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// AdaptiveApplicationControlGroups represents a list of machine groups and set of rules that are -// recommended by Azure Security Center to be allowed +// AdaptiveApplicationControlGroups represents a list of VM/server groups and set of rules that are +// Recommended by Microsoft Defender for Cloud to be allowed type AdaptiveApplicationControlGroups struct { autorest.Response `json:"-"` Value *[]AdaptiveApplicationControlGroup `json:"value,omitempty"` @@ -1695,43 +1694,6 @@ func (asrp *AlertSimulatorRequestProperties) UnmarshalJSON(body []byte) error { 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:"-"` @@ -3412,7 +3374,6 @@ func NewAscLocationListPage(cur AscLocationList, getNextPage func(context.Contex // Assessment security assessment on a resource type Assessment struct { - autorest.Response `json:"-"` *AssessmentProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` @@ -3498,7 +3459,7 @@ func (al AssessmentLinks) MarshalJSON() ([]byte, error) { type AssessmentList struct { autorest.Response `json:"-"` // Value - READ-ONLY; Collection of security assessments in this page - Value *[]Assessment `json:"value,omitempty"` + Value *[]AssessmentResponse `json:"value,omitempty"` // NextLink - READ-ONLY; The URI to fetch the next page. NextLink *string `json:"nextLink,omitempty"` } @@ -3509,7 +3470,7 @@ func (al AssessmentList) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// AssessmentListIterator provides access to a complete listing of Assessment values. +// AssessmentListIterator provides access to a complete listing of AssessmentResponse values. type AssessmentListIterator struct { i int page AssessmentListPage @@ -3560,9 +3521,9 @@ func (iter AssessmentListIterator) Response() AssessmentList { // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter AssessmentListIterator) Value() Assessment { +func (iter AssessmentListIterator) Value() AssessmentResponse { if !iter.page.NotDone() { - return Assessment{} + return AssessmentResponse{} } return iter.page.Values()[iter.i] } @@ -3594,7 +3555,7 @@ func (al AssessmentList) assessmentListPreparer(ctx context.Context) (*http.Requ autorest.WithBaseURL(to.String(al.NextLink))) } -// AssessmentListPage contains a page of Assessment values. +// AssessmentListPage contains a page of AssessmentResponse values. type AssessmentListPage struct { fn func(context.Context, AssessmentList) (AssessmentList, error) al AssessmentList @@ -3644,7 +3605,7 @@ func (page AssessmentListPage) Response() AssessmentList { } // Values returns the slice of values for the current page or nil if there are no values. -func (page AssessmentListPage) Values() []Assessment { +func (page AssessmentListPage) Values() []AssessmentResponse { if page.al.IsEmpty() { return nil } @@ -3661,7 +3622,6 @@ func NewAssessmentListPage(cur AssessmentList, getNextPage func(context.Context, // AssessmentMetadata security assessment metadata type AssessmentMetadata struct { - autorest.Response `json:"-"` *AssessmentMetadataProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` @@ -3731,32 +3691,265 @@ func (am *AssessmentMetadata) UnmarshalJSON(body []byte) error { return nil } -// AssessmentMetadataList list of security assessment metadata -type AssessmentMetadataList struct { +// AssessmentMetadataPartnerData describes the partner that created the assessment +type AssessmentMetadataPartnerData struct { + // PartnerName - Name of the company of the partner + PartnerName *string `json:"partnerName,omitempty"` + // ProductName - Name of the product of the partner that created the assessment + ProductName *string `json:"productName,omitempty"` + // Secret - Secret to authenticate the partner and verify it created the assessment - write only + Secret *string `json:"secret,omitempty"` +} + +// AssessmentMetadataProperties describes properties of an assessment metadata. +type AssessmentMetadataProperties struct { + // DisplayName - User friendly display name of the assessment + DisplayName *string `json:"displayName,omitempty"` + // PolicyDefinitionID - READ-ONLY; Azure resource ID of the policy definition that turns this assessment calculation on + PolicyDefinitionID *string `json:"policyDefinitionId,omitempty"` + // 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"` + 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' + UserImpact UserImpact `json:"userImpact,omitempty"` + // ImplementationEffort - The implementation effort required to remediate this assessment. Possible values include: 'ImplementationEffortLow', 'ImplementationEffortModerate', 'ImplementationEffortHigh' + ImplementationEffort ImplementationEffort `json:"implementationEffort,omitempty"` + Threats *[]Threats `json:"threats,omitempty"` + // Preview - True if this assessment is in preview release status + Preview *bool `json:"preview,omitempty"` + // AssessmentType - BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure Policy definition. Possible values include: 'BuiltIn', 'CustomPolicy', 'CustomerManaged', 'VerifiedPartner' + AssessmentType AssessmentType `json:"assessmentType,omitempty"` + PartnerData *AssessmentMetadataPartnerData `json:"partnerData,omitempty"` +} + +// MarshalJSON is the custom marshaler for AssessmentMetadataProperties. +func (amp AssessmentMetadataProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if amp.DisplayName != nil { + objectMap["displayName"] = amp.DisplayName + } + if amp.Description != nil { + objectMap["description"] = amp.Description + } + if amp.RemediationDescription != nil { + objectMap["remediationDescription"] = amp.RemediationDescription + } + if amp.Categories != nil { + objectMap["categories"] = amp.Categories + } + if amp.Severity != "" { + objectMap["severity"] = amp.Severity + } + if amp.UserImpact != "" { + objectMap["userImpact"] = amp.UserImpact + } + if amp.ImplementationEffort != "" { + objectMap["implementationEffort"] = amp.ImplementationEffort + } + if amp.Threats != nil { + objectMap["threats"] = amp.Threats + } + if amp.Preview != nil { + objectMap["preview"] = amp.Preview + } + if amp.AssessmentType != "" { + objectMap["assessmentType"] = amp.AssessmentType + } + if amp.PartnerData != nil { + objectMap["partnerData"] = amp.PartnerData + } + return json.Marshal(objectMap) +} + +// AssessmentMetadataPropertiesResponse describes properties of an assessment metadata response. +type AssessmentMetadataPropertiesResponse struct { + PublishDates *AssessmentMetadataPropertiesResponsePublishDates `json:"publishDates,omitempty"` + PlannedDeprecationDate *string `json:"plannedDeprecationDate,omitempty"` + Tactics *[]Tactics `json:"tactics,omitempty"` + Techniques *[]Techniques `json:"techniques,omitempty"` + // DisplayName - User friendly display name of the assessment + DisplayName *string `json:"displayName,omitempty"` + // PolicyDefinitionID - READ-ONLY; Azure resource ID of the policy definition that turns this assessment calculation on + PolicyDefinitionID *string `json:"policyDefinitionId,omitempty"` + // 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"` + 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' + UserImpact UserImpact `json:"userImpact,omitempty"` + // ImplementationEffort - The implementation effort required to remediate this assessment. Possible values include: 'ImplementationEffortLow', 'ImplementationEffortModerate', 'ImplementationEffortHigh' + ImplementationEffort ImplementationEffort `json:"implementationEffort,omitempty"` + Threats *[]Threats `json:"threats,omitempty"` + // Preview - True if this assessment is in preview release status + Preview *bool `json:"preview,omitempty"` + // AssessmentType - BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure Policy definition. Possible values include: 'BuiltIn', 'CustomPolicy', 'CustomerManaged', 'VerifiedPartner' + AssessmentType AssessmentType `json:"assessmentType,omitempty"` + PartnerData *AssessmentMetadataPartnerData `json:"partnerData,omitempty"` +} + +// MarshalJSON is the custom marshaler for AssessmentMetadataPropertiesResponse. +func (ampr AssessmentMetadataPropertiesResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ampr.PublishDates != nil { + objectMap["publishDates"] = ampr.PublishDates + } + if ampr.PlannedDeprecationDate != nil { + objectMap["plannedDeprecationDate"] = ampr.PlannedDeprecationDate + } + if ampr.Tactics != nil { + objectMap["tactics"] = ampr.Tactics + } + if ampr.Techniques != nil { + objectMap["techniques"] = ampr.Techniques + } + if ampr.DisplayName != nil { + objectMap["displayName"] = ampr.DisplayName + } + if ampr.Description != nil { + objectMap["description"] = ampr.Description + } + if ampr.RemediationDescription != nil { + objectMap["remediationDescription"] = ampr.RemediationDescription + } + if ampr.Categories != nil { + objectMap["categories"] = ampr.Categories + } + if ampr.Severity != "" { + objectMap["severity"] = ampr.Severity + } + if ampr.UserImpact != "" { + objectMap["userImpact"] = ampr.UserImpact + } + if ampr.ImplementationEffort != "" { + objectMap["implementationEffort"] = ampr.ImplementationEffort + } + if ampr.Threats != nil { + objectMap["threats"] = ampr.Threats + } + if ampr.Preview != nil { + objectMap["preview"] = ampr.Preview + } + if ampr.AssessmentType != "" { + objectMap["assessmentType"] = ampr.AssessmentType + } + if ampr.PartnerData != nil { + objectMap["partnerData"] = ampr.PartnerData + } + return json.Marshal(objectMap) +} + +// AssessmentMetadataPropertiesResponsePublishDates ... +type AssessmentMetadataPropertiesResponsePublishDates struct { + GA *string `json:"GA,omitempty"` + Public *string `json:"public,omitempty"` +} + +// AssessmentMetadataResponse security assessment metadata response +type AssessmentMetadataResponse struct { + autorest.Response `json:"-"` + *AssessmentMetadataPropertiesResponse `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 AssessmentMetadataResponse. +func (amr AssessmentMetadataResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if amr.AssessmentMetadataPropertiesResponse != nil { + objectMap["properties"] = amr.AssessmentMetadataPropertiesResponse + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AssessmentMetadataResponse struct. +func (amr *AssessmentMetadataResponse) 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 assessmentMetadataPropertiesResponse AssessmentMetadataPropertiesResponse + err = json.Unmarshal(*v, &assessmentMetadataPropertiesResponse) + if err != nil { + return err + } + amr.AssessmentMetadataPropertiesResponse = &assessmentMetadataPropertiesResponse + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + amr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + amr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + amr.Type = &typeVar + } + } + } + + return nil +} + +// AssessmentMetadataResponseList list of security assessment metadata +type AssessmentMetadataResponseList struct { autorest.Response `json:"-"` // Value - READ-ONLY - Value *[]AssessmentMetadata `json:"value,omitempty"` + Value *[]AssessmentMetadataResponse `json:"value,omitempty"` // NextLink - READ-ONLY; The URI to fetch the next page. NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for AssessmentMetadataList. -func (aml AssessmentMetadataList) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for AssessmentMetadataResponseList. +func (amrl AssessmentMetadataResponseList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) return json.Marshal(objectMap) } -// AssessmentMetadataListIterator provides access to a complete listing of AssessmentMetadata values. -type AssessmentMetadataListIterator struct { +// AssessmentMetadataResponseListIterator provides access to a complete listing of +// AssessmentMetadataResponse values. +type AssessmentMetadataResponseListIterator struct { i int - page AssessmentMetadataListPage + page AssessmentMetadataResponseListPage } // 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 *AssessmentMetadataListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *AssessmentMetadataResponseListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentMetadataListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentMetadataResponseListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -3781,67 +3974,67 @@ func (iter *AssessmentMetadataListIterator) NextWithContext(ctx context.Context) // 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 *AssessmentMetadataListIterator) Next() error { +func (iter *AssessmentMetadataResponseListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AssessmentMetadataListIterator) NotDone() bool { +func (iter AssessmentMetadataResponseListIterator) 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 AssessmentMetadataListIterator) Response() AssessmentMetadataList { +func (iter AssessmentMetadataResponseListIterator) Response() AssessmentMetadataResponseList { 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 AssessmentMetadataListIterator) Value() AssessmentMetadata { +func (iter AssessmentMetadataResponseListIterator) Value() AssessmentMetadataResponse { if !iter.page.NotDone() { - return AssessmentMetadata{} + return AssessmentMetadataResponse{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the AssessmentMetadataListIterator type. -func NewAssessmentMetadataListIterator(page AssessmentMetadataListPage) AssessmentMetadataListIterator { - return AssessmentMetadataListIterator{page: page} +// Creates a new instance of the AssessmentMetadataResponseListIterator type. +func NewAssessmentMetadataResponseListIterator(page AssessmentMetadataResponseListPage) AssessmentMetadataResponseListIterator { + return AssessmentMetadataResponseListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (aml AssessmentMetadataList) IsEmpty() bool { - return aml.Value == nil || len(*aml.Value) == 0 +func (amrl AssessmentMetadataResponseList) IsEmpty() bool { + return amrl.Value == nil || len(*amrl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (aml AssessmentMetadataList) hasNextLink() bool { - return aml.NextLink != nil && len(*aml.NextLink) != 0 +func (amrl AssessmentMetadataResponseList) hasNextLink() bool { + return amrl.NextLink != nil && len(*amrl.NextLink) != 0 } -// assessmentMetadataListPreparer prepares a request to retrieve the next set of results. +// assessmentMetadataResponseListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (aml AssessmentMetadataList) assessmentMetadataListPreparer(ctx context.Context) (*http.Request, error) { - if !aml.hasNextLink() { +func (amrl AssessmentMetadataResponseList) assessmentMetadataResponseListPreparer(ctx context.Context) (*http.Request, error) { + if !amrl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(aml.NextLink))) + autorest.WithBaseURL(to.String(amrl.NextLink))) } -// AssessmentMetadataListPage contains a page of AssessmentMetadata values. -type AssessmentMetadataListPage struct { - fn func(context.Context, AssessmentMetadataList) (AssessmentMetadataList, error) - aml AssessmentMetadataList +// AssessmentMetadataResponseListPage contains a page of AssessmentMetadataResponse values. +type AssessmentMetadataResponseListPage struct { + fn func(context.Context, AssessmentMetadataResponseList) (AssessmentMetadataResponseList, error) + amrl AssessmentMetadataResponseList } // 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 *AssessmentMetadataListPage) NextWithContext(ctx context.Context) (err error) { +func (page *AssessmentMetadataResponseListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentMetadataListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentMetadataResponseListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -3851,11 +4044,11 @@ func (page *AssessmentMetadataListPage) NextWithContext(ctx context.Context) (er }() } for { - next, err := page.fn(ctx, page.aml) + next, err := page.fn(ctx, page.amrl) if err != nil { return err } - page.aml = next + page.amrl = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -3866,138 +4059,64 @@ func (page *AssessmentMetadataListPage) NextWithContext(ctx context.Context) (er // 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 *AssessmentMetadataListPage) Next() error { +func (page *AssessmentMetadataResponseListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AssessmentMetadataListPage) NotDone() bool { - return !page.aml.IsEmpty() +func (page AssessmentMetadataResponseListPage) NotDone() bool { + return !page.amrl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page AssessmentMetadataListPage) Response() AssessmentMetadataList { - return page.aml +func (page AssessmentMetadataResponseListPage) Response() AssessmentMetadataResponseList { + return page.amrl } // Values returns the slice of values for the current page or nil if there are no values. -func (page AssessmentMetadataListPage) Values() []AssessmentMetadata { - if page.aml.IsEmpty() { +func (page AssessmentMetadataResponseListPage) Values() []AssessmentMetadataResponse { + if page.amrl.IsEmpty() { return nil } - return *page.aml.Value + return *page.amrl.Value } -// Creates a new instance of the AssessmentMetadataListPage type. -func NewAssessmentMetadataListPage(cur AssessmentMetadataList, getNextPage func(context.Context, AssessmentMetadataList) (AssessmentMetadataList, error)) AssessmentMetadataListPage { - return AssessmentMetadataListPage{ - fn: getNextPage, - aml: cur, +// Creates a new instance of the AssessmentMetadataResponseListPage type. +func NewAssessmentMetadataResponseListPage(cur AssessmentMetadataResponseList, getNextPage func(context.Context, AssessmentMetadataResponseList) (AssessmentMetadataResponseList, error)) AssessmentMetadataResponseListPage { + return AssessmentMetadataResponseListPage{ + fn: getNextPage, + amrl: cur, } } -// AssessmentMetadataPartnerData describes the partner that created the assessment -type AssessmentMetadataPartnerData struct { +// AssessmentPartnerData data regarding 3rd party partner integration +type AssessmentPartnerData struct { // PartnerName - Name of the company of the partner PartnerName *string `json:"partnerName,omitempty"` - // ProductName - Name of the product of the partner that created the assessment - ProductName *string `json:"productName,omitempty"` - // Secret - Secret to authenticate the partner and verify it created the assessment - write only + // Secret - secret to authenticate the partner - write only Secret *string `json:"secret,omitempty"` } -// AssessmentMetadataProperties describes properties of an assessment metadata. -type AssessmentMetadataProperties struct { - // DisplayName - User friendly display name of the assessment +// AssessmentProperties describes properties of an assessment. +type AssessmentProperties struct { + Status *AssessmentStatus `json:"status,omitempty"` + ResourceDetails BasicResourceDetails `json:"resourceDetails,omitempty"` + // DisplayName - READ-ONLY; User friendly display name of the assessment DisplayName *string `json:"displayName,omitempty"` - // PolicyDefinitionID - READ-ONLY; Azure resource ID of the policy definition that turns this assessment calculation on - PolicyDefinitionID *string `json:"policyDefinitionId,omitempty"` - // 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"` - 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' - UserImpact UserImpact `json:"userImpact,omitempty"` - // ImplementationEffort - The implementation effort required to remediate this assessment. Possible values include: 'ImplementationEffortLow', 'ImplementationEffortModerate', 'ImplementationEffortHigh' - ImplementationEffort ImplementationEffort `json:"implementationEffort,omitempty"` - Threats *[]Threats `json:"threats,omitempty"` - // Preview - True if this assessment is in preview release status - Preview *bool `json:"preview,omitempty"` - // AssessmentType - BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure Policy definition. Possible values include: 'BuiltIn', 'CustomPolicy', 'CustomerManaged', 'VerifiedPartner' - AssessmentType AssessmentType `json:"assessmentType,omitempty"` - PartnerData *AssessmentMetadataPartnerData `json:"partnerData,omitempty"` + // AdditionalData - Additional data regarding the assessment + AdditionalData map[string]*string `json:"additionalData"` + Links *AssessmentLinks `json:"links,omitempty"` + Metadata *AssessmentMetadataProperties `json:"metadata,omitempty"` + PartnersData *AssessmentPartnerData `json:"partnersData,omitempty"` } -// MarshalJSON is the custom marshaler for AssessmentMetadataProperties. -func (amp AssessmentMetadataProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for AssessmentProperties. +func (ap AssessmentProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if amp.DisplayName != nil { - objectMap["displayName"] = amp.DisplayName - } - if amp.Description != nil { - objectMap["description"] = amp.Description + if ap.Status != nil { + objectMap["status"] = ap.Status } - if amp.RemediationDescription != nil { - objectMap["remediationDescription"] = amp.RemediationDescription - } - if amp.Categories != nil { - objectMap["categories"] = amp.Categories - } - if amp.Severity != "" { - objectMap["severity"] = amp.Severity - } - if amp.UserImpact != "" { - objectMap["userImpact"] = amp.UserImpact - } - if amp.ImplementationEffort != "" { - objectMap["implementationEffort"] = amp.ImplementationEffort - } - if amp.Threats != nil { - objectMap["threats"] = amp.Threats - } - if amp.Preview != nil { - objectMap["preview"] = amp.Preview - } - if amp.AssessmentType != "" { - objectMap["assessmentType"] = amp.AssessmentType - } - if amp.PartnerData != nil { - objectMap["partnerData"] = amp.PartnerData - } - return json.Marshal(objectMap) -} - -// AssessmentPartnerData data regarding 3rd party partner integration -type AssessmentPartnerData struct { - // PartnerName - Name of the company of the partner - PartnerName *string `json:"partnerName,omitempty"` - // Secret - secret to authenticate the partner - write only - Secret *string `json:"secret,omitempty"` -} - -// AssessmentProperties describes properties of an assessment. -type AssessmentProperties struct { - ResourceDetails BasicResourceDetails `json:"resourceDetails,omitempty"` - // DisplayName - READ-ONLY; User friendly display name of the assessment - DisplayName *string `json:"displayName,omitempty"` - Status *AssessmentStatus `json:"status,omitempty"` - // AdditionalData - Additional data regarding the assessment - AdditionalData map[string]*string `json:"additionalData"` - Links *AssessmentLinks `json:"links,omitempty"` - Metadata *AssessmentMetadataProperties `json:"metadata,omitempty"` - PartnersData *AssessmentPartnerData `json:"partnersData,omitempty"` -} - -// MarshalJSON is the custom marshaler for AssessmentProperties. -func (ap AssessmentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) objectMap["resourceDetails"] = ap.ResourceDetails - if ap.Status != nil { - objectMap["status"] = ap.Status - } if ap.AdditionalData != nil { objectMap["additionalData"] = ap.AdditionalData } @@ -4022,6 +4141,15 @@ func (ap *AssessmentProperties) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "status": + if v != nil { + var status AssessmentStatus + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + ap.Status = &status + } case "resourceDetails": if v != nil { resourceDetails, err := unmarshalBasicResourceDetails(*v) @@ -4039,15 +4167,6 @@ func (ap *AssessmentProperties) UnmarshalJSON(body []byte) error { } ap.DisplayName = &displayName } - case "status": - if v != nil { - var status AssessmentStatus - err = json.Unmarshal(*v, &status) - if err != nil { - return err - } - ap.Status = &status - } case "additionalData": if v != nil { var additionalData map[string]*string @@ -4090,102 +4209,39 @@ func (ap *AssessmentProperties) UnmarshalJSON(body []byte) error { return nil } -// AssessmentStatus the result of the assessment -type AssessmentStatus struct { - // Code - Programmatic code for the status of the assessment. Possible values include: 'Healthy', 'Unhealthy', 'NotApplicable' - Code AssessmentStatusCode `json:"code,omitempty"` - // Cause - Programmatic code for the cause of the assessment status - Cause *string `json:"cause,omitempty"` - // Description - Human readable description of the assessment status - Description *string `json:"description,omitempty"` -} - -// AtaExternalSecuritySolution represents an ATA security solution which sends logs to an OMS workspace -type AtaExternalSecuritySolution struct { - Properties *AtaSolutionProperties `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"` - // Location - READ-ONLY; Location where the resource is stored - Location *string `json:"location,omitempty"` - // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' - Kind KindEnum `json:"kind,omitempty"` -} - -// MarshalJSON is the custom marshaler for AtaExternalSecuritySolution. -func (aess AtaExternalSecuritySolution) MarshalJSON() ([]byte, error) { - aess.Kind = KindATA - objectMap := make(map[string]interface{}) - if aess.Properties != nil { - objectMap["properties"] = aess.Properties - } - if aess.Kind != "" { - objectMap["kind"] = aess.Kind - } - return json.Marshal(objectMap) -} - -// AsCefExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. -func (aess AtaExternalSecuritySolution) AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) { - return nil, false -} - -// AsAtaExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. -func (aess AtaExternalSecuritySolution) AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) { - return &aess, true -} - -// AsAadExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. -func (aess AtaExternalSecuritySolution) AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) { - return nil, false -} - -// AsExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. -func (aess AtaExternalSecuritySolution) AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) { - return nil, false -} - -// AsBasicExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. -func (aess AtaExternalSecuritySolution) AsBasicExternalSecuritySolution() (BasicExternalSecuritySolution, bool) { - return &aess, true -} - -// AtaSolutionProperties ... -type AtaSolutionProperties struct { - LastEventReceived *string `json:"lastEventReceived,omitempty"` - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - DeviceVendor *string `json:"deviceVendor,omitempty"` - DeviceType *string `json:"deviceType,omitempty"` - Workspace *ConnectedWorkspace `json:"workspace,omitempty"` +// AssessmentPropertiesBase describes properties of an assessment. +type AssessmentPropertiesBase struct { + ResourceDetails BasicResourceDetails `json:"resourceDetails,omitempty"` + // DisplayName - READ-ONLY; User friendly display name of the assessment + DisplayName *string `json:"displayName,omitempty"` + // AdditionalData - Additional data regarding the assessment + AdditionalData map[string]*string `json:"additionalData"` + Links *AssessmentLinks `json:"links,omitempty"` + Metadata *AssessmentMetadataProperties `json:"metadata,omitempty"` + PartnersData *AssessmentPartnerData `json:"partnersData,omitempty"` } -// MarshalJSON is the custom marshaler for AtaSolutionProperties. -func (asp AtaSolutionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for AssessmentPropertiesBase. +func (apb AssessmentPropertiesBase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if asp.LastEventReceived != nil { - objectMap["lastEventReceived"] = asp.LastEventReceived - } - if asp.DeviceVendor != nil { - objectMap["deviceVendor"] = asp.DeviceVendor + objectMap["resourceDetails"] = apb.ResourceDetails + if apb.AdditionalData != nil { + objectMap["additionalData"] = apb.AdditionalData } - if asp.DeviceType != nil { - objectMap["deviceType"] = asp.DeviceType + if apb.Links != nil { + objectMap["links"] = apb.Links } - if asp.Workspace != nil { - objectMap["workspace"] = asp.Workspace + if apb.Metadata != nil { + objectMap["metadata"] = apb.Metadata } - for k, v := range asp.AdditionalProperties { - objectMap[k] = v + if apb.PartnersData != nil { + objectMap["partnersData"] = apb.PartnersData } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for AtaSolutionProperties struct. -func (asp *AtaSolutionProperties) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for AssessmentPropertiesBase struct. +func (apb *AssessmentPropertiesBase) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -4193,53 +4249,58 @@ func (asp *AtaSolutionProperties) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "lastEventReceived": + case "resourceDetails": if v != nil { - var lastEventReceived string - err = json.Unmarshal(*v, &lastEventReceived) + resourceDetails, err := unmarshalBasicResourceDetails(*v) if err != nil { return err } - asp.LastEventReceived = &lastEventReceived + apb.ResourceDetails = resourceDetails } - default: + case "displayName": if v != nil { - var additionalProperties interface{} - err = json.Unmarshal(*v, &additionalProperties) + var displayName string + err = json.Unmarshal(*v, &displayName) if err != nil { return err } - if asp.AdditionalProperties == nil { - asp.AdditionalProperties = make(map[string]interface{}) + apb.DisplayName = &displayName + } + case "additionalData": + if v != nil { + var additionalData map[string]*string + err = json.Unmarshal(*v, &additionalData) + if err != nil { + return err } - asp.AdditionalProperties[k] = additionalProperties + apb.AdditionalData = additionalData } - case "deviceVendor": + case "links": if v != nil { - var deviceVendor string - err = json.Unmarshal(*v, &deviceVendor) + var links AssessmentLinks + err = json.Unmarshal(*v, &links) if err != nil { return err } - asp.DeviceVendor = &deviceVendor + apb.Links = &links } - case "deviceType": + case "metadata": if v != nil { - var deviceType string - err = json.Unmarshal(*v, &deviceType) + var metadata AssessmentMetadataProperties + err = json.Unmarshal(*v, &metadata) if err != nil { return err } - asp.DeviceType = &deviceType + apb.Metadata = &metadata } - case "workspace": + case "partnersData": if v != nil { - var workspace ConnectedWorkspace - err = json.Unmarshal(*v, &workspace) + var partnersData AssessmentPartnerData + err = json.Unmarshal(*v, &partnersData) if err != nil { return err } - asp.Workspace = &workspace + apb.PartnersData = &partnersData } } } @@ -4247,148 +4308,141 @@ func (asp *AtaSolutionProperties) UnmarshalJSON(body []byte) error { return nil } -// BasicAuthenticationDetailsProperties settings for cloud authentication management -type BasicAuthenticationDetailsProperties interface { - AsAwsCredsAuthenticationDetailsProperties() (*AwsCredsAuthenticationDetailsProperties, bool) - AsAwAssumeRoleAuthenticationDetailsProperties() (*AwAssumeRoleAuthenticationDetailsProperties, bool) - AsGcpCredentialsDetailsProperties() (*GcpCredentialsDetailsProperties, bool) - AsAuthenticationDetailsProperties() (*AuthenticationDetailsProperties, bool) +// AssessmentPropertiesResponse describes properties of an assessment. +type AssessmentPropertiesResponse struct { + Status *AssessmentStatusResponse `json:"status,omitempty"` + ResourceDetails BasicResourceDetails `json:"resourceDetails,omitempty"` + // DisplayName - READ-ONLY; User friendly display name of the assessment + DisplayName *string `json:"displayName,omitempty"` + // AdditionalData - Additional data regarding the assessment + AdditionalData map[string]*string `json:"additionalData"` + Links *AssessmentLinks `json:"links,omitempty"` + Metadata *AssessmentMetadataProperties `json:"metadata,omitempty"` + PartnersData *AssessmentPartnerData `json:"partnersData,omitempty"` } -// AuthenticationDetailsProperties settings for cloud authentication management -type AuthenticationDetailsProperties struct { - // AuthenticationProvisioningState - READ-ONLY; State of the multi-cloud connector. Possible values include: 'Valid', 'Invalid', 'Expired', 'IncorrectPolicy' - AuthenticationProvisioningState AuthenticationProvisioningState `json:"authenticationProvisioningState,omitempty"` - // GrantedPermissions - READ-ONLY; The permissions detected in the cloud account. - GrantedPermissions *[]PermissionProperty `json:"grantedPermissions,omitempty"` - // AuthenticationType - Possible values include: 'AuthenticationTypeAuthenticationDetailsProperties', 'AuthenticationTypeAwsCreds', 'AuthenticationTypeAwsAssumeRole', 'AuthenticationTypeGcpCredentials' - AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` +// MarshalJSON is the custom marshaler for AssessmentPropertiesResponse. +func (apr AssessmentPropertiesResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if apr.Status != nil { + objectMap["status"] = apr.Status + } + objectMap["resourceDetails"] = apr.ResourceDetails + if apr.AdditionalData != nil { + objectMap["additionalData"] = apr.AdditionalData + } + if apr.Links != nil { + objectMap["links"] = apr.Links + } + if apr.Metadata != nil { + objectMap["metadata"] = apr.Metadata + } + if apr.PartnersData != nil { + objectMap["partnersData"] = apr.PartnersData + } + return json.Marshal(objectMap) } -func unmarshalBasicAuthenticationDetailsProperties(body []byte) (BasicAuthenticationDetailsProperties, error) { - var m map[string]interface{} +// UnmarshalJSON is the custom unmarshaler for AssessmentPropertiesResponse struct. +func (apr *AssessmentPropertiesResponse) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { - return nil, err + return err } - - switch m["authenticationType"] { - case string(AuthenticationTypeAwsCreds): - var acadp AwsCredsAuthenticationDetailsProperties - err := json.Unmarshal(body, &acadp) - return acadp, err - case string(AuthenticationTypeAwsAssumeRole): - var aaradp AwAssumeRoleAuthenticationDetailsProperties - err := json.Unmarshal(body, &aaradp) - return aaradp, err - case string(AuthenticationTypeGcpCredentials): - var gcdp GcpCredentialsDetailsProperties - err := json.Unmarshal(body, &gcdp) - return gcdp, err - default: - var adp AuthenticationDetailsProperties - err := json.Unmarshal(body, &adp) - return adp, err - } -} -func unmarshalBasicAuthenticationDetailsPropertiesArray(body []byte) ([]BasicAuthenticationDetailsProperties, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - adpArray := make([]BasicAuthenticationDetailsProperties, len(rawMessages)) - - for index, rawMessage := range rawMessages { - adp, err := unmarshalBasicAuthenticationDetailsProperties(*rawMessage) - if err != nil { - return nil, err + for k, v := range m { + switch k { + case "status": + if v != nil { + var status AssessmentStatusResponse + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + apr.Status = &status + } + case "resourceDetails": + if v != nil { + resourceDetails, err := unmarshalBasicResourceDetails(*v) + if err != nil { + return err + } + apr.ResourceDetails = resourceDetails + } + case "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + apr.DisplayName = &displayName + } + case "additionalData": + if v != nil { + var additionalData map[string]*string + err = json.Unmarshal(*v, &additionalData) + if err != nil { + return err + } + apr.AdditionalData = additionalData + } + case "links": + if v != nil { + var links AssessmentLinks + err = json.Unmarshal(*v, &links) + if err != nil { + return err + } + apr.Links = &links + } + case "metadata": + if v != nil { + var metadata AssessmentMetadataProperties + err = json.Unmarshal(*v, &metadata) + if err != nil { + return err + } + apr.Metadata = &metadata + } + case "partnersData": + if v != nil { + var partnersData AssessmentPartnerData + err = json.Unmarshal(*v, &partnersData) + if err != nil { + return err + } + apr.PartnersData = &partnersData + } } - adpArray[index] = adp - } - return adpArray, nil -} - -// MarshalJSON is the custom marshaler for AuthenticationDetailsProperties. -func (adp AuthenticationDetailsProperties) MarshalJSON() ([]byte, error) { - adp.AuthenticationType = AuthenticationTypeAuthenticationDetailsProperties - objectMap := make(map[string]interface{}) - if adp.AuthenticationType != "" { - objectMap["authenticationType"] = adp.AuthenticationType } - return json.Marshal(objectMap) -} - -// AsAwsCredsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AuthenticationDetailsProperties. -func (adp AuthenticationDetailsProperties) AsAwsCredsAuthenticationDetailsProperties() (*AwsCredsAuthenticationDetailsProperties, bool) { - return nil, false -} - -// AsAwAssumeRoleAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AuthenticationDetailsProperties. -func (adp AuthenticationDetailsProperties) AsAwAssumeRoleAuthenticationDetailsProperties() (*AwAssumeRoleAuthenticationDetailsProperties, bool) { - return nil, false -} - -// AsGcpCredentialsDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AuthenticationDetailsProperties. -func (adp AuthenticationDetailsProperties) AsGcpCredentialsDetailsProperties() (*GcpCredentialsDetailsProperties, bool) { - return nil, false -} - -// AsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AuthenticationDetailsProperties. -func (adp AuthenticationDetailsProperties) AsAuthenticationDetailsProperties() (*AuthenticationDetailsProperties, bool) { - return &adp, true -} -// AsBasicAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AuthenticationDetailsProperties. -func (adp AuthenticationDetailsProperties) AsBasicAuthenticationDetailsProperties() (BasicAuthenticationDetailsProperties, bool) { - return &adp, true + return nil } -// Automation the security automation resource. -type Automation struct { - autorest.Response `json:"-"` - // AutomationProperties - Security automation data - *AutomationProperties `json:"properties,omitempty"` +// AssessmentResponse security assessment on a resource - response format +type AssessmentResponse struct { + autorest.Response `json:"-"` + *AssessmentPropertiesResponse `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"` - // Location - Location where the resource is stored - Location *string `json:"location,omitempty"` - // Kind - Kind of the resource - Kind *string `json:"kind,omitempty"` - // Etag - Entity tag is used for comparing two or more entities from the same requested resource. - Etag *string `json:"etag,omitempty"` - // Tags - A list of key value pairs that describe the resource. - Tags map[string]*string `json:"tags"` } -// MarshalJSON is the custom marshaler for Automation. -func (a Automation) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for AssessmentResponse. +func (ar AssessmentResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if a.AutomationProperties != nil { - objectMap["properties"] = a.AutomationProperties - } - if a.Location != nil { - objectMap["location"] = a.Location - } - if a.Kind != nil { - objectMap["kind"] = a.Kind - } - if a.Etag != nil { - objectMap["etag"] = a.Etag - } - if a.Tags != nil { - objectMap["tags"] = a.Tags + if ar.AssessmentPropertiesResponse != nil { + objectMap["properties"] = ar.AssessmentPropertiesResponse } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for Automation struct. -func (a *Automation) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for AssessmentResponse struct. +func (ar *AssessmentResponse) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -4398,12 +4452,12 @@ func (a *Automation) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var automationProperties AutomationProperties - err = json.Unmarshal(*v, &automationProperties) + var assessmentPropertiesResponse AssessmentPropertiesResponse + err = json.Unmarshal(*v, &assessmentPropertiesResponse) if err != nil { return err } - a.AutomationProperties = &automationProperties + ar.AssessmentPropertiesResponse = &assessmentPropertiesResponse } case "id": if v != nil { @@ -4412,7 +4466,7 @@ func (a *Automation) UnmarshalJSON(body []byte) error { if err != nil { return err } - a.ID = &ID + ar.ID = &ID } case "name": if v != nil { @@ -4421,7 +4475,7 @@ func (a *Automation) UnmarshalJSON(body []byte) error { if err != nil { return err } - a.Name = &name + ar.Name = &name } case "type": if v != nil { @@ -4430,43 +4484,7 @@ func (a *Automation) UnmarshalJSON(body []byte) error { if err != nil { return err } - a.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - a.Location = &location - } - case "kind": - if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - a.Kind = &kind - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - a.Etag = &etag - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - a.Tags = tags + ar.Type = &typeVar } } } @@ -4474,294 +4492,708 @@ func (a *Automation) UnmarshalJSON(body []byte) error { return nil } -// BasicAutomationAction the action that should be triggered. -type BasicAutomationAction interface { - AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) - AsAutomationActionEventHub() (*AutomationActionEventHub, bool) - AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) - AsAutomationAction() (*AutomationAction, bool) +// AssessmentStatus the result of the assessment +type AssessmentStatus struct { + // Code - Programmatic code for the status of the assessment. Possible values include: 'Healthy', 'Unhealthy', 'NotApplicable' + Code AssessmentStatusCode `json:"code,omitempty"` + // Cause - Programmatic code for the cause of the assessment status + Cause *string `json:"cause,omitempty"` + // Description - Human readable description of the assessment status + Description *string `json:"description,omitempty"` } -// AutomationAction the action that should be triggered. -type AutomationAction struct { - // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' - ActionType ActionType `json:"actionType,omitempty"` +// AssessmentStatusResponse the result of the assessment +type AssessmentStatusResponse struct { + // FirstEvaluationDate - READ-ONLY; The time that the assessment was created and first evaluated. Returned as UTC time in ISO 8601 format + FirstEvaluationDate *date.Time `json:"firstEvaluationDate,omitempty"` + // StatusChangeDate - READ-ONLY; The time that the status of the assessment last changed. Returned as UTC time in ISO 8601 format + StatusChangeDate *date.Time `json:"statusChangeDate,omitempty"` + // Code - Programmatic code for the status of the assessment. Possible values include: 'Healthy', 'Unhealthy', 'NotApplicable' + Code AssessmentStatusCode `json:"code,omitempty"` + // Cause - Programmatic code for the cause of the assessment status + Cause *string `json:"cause,omitempty"` + // Description - Human readable description of the assessment status + Description *string `json:"description,omitempty"` } -func unmarshalBasicAutomationAction(body []byte) (BasicAutomationAction, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["actionType"] { - case string(ActionTypeLogicApp): - var aala AutomationActionLogicApp - err := json.Unmarshal(body, &aala) - return aala, err - case string(ActionTypeEventHub): - var aaeh AutomationActionEventHub - err := json.Unmarshal(body, &aaeh) - return aaeh, err - case string(ActionTypeWorkspace): - var aaw AutomationActionWorkspace - err := json.Unmarshal(body, &aaw) - return aaw, err - default: - var aa AutomationAction - err := json.Unmarshal(body, &aa) - return aa, err +// MarshalJSON is the custom marshaler for AssessmentStatusResponse. +func (asr AssessmentStatusResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asr.Code != "" { + objectMap["code"] = asr.Code } -} -func unmarshalBasicAutomationActionArray(body []byte) ([]BasicAutomationAction, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err + if asr.Cause != nil { + objectMap["cause"] = asr.Cause } - - aaArray := make([]BasicAutomationAction, len(rawMessages)) - - for index, rawMessage := range rawMessages { - aa, err := unmarshalBasicAutomationAction(*rawMessage) - if err != nil { - return nil, err - } - aaArray[index] = aa + if asr.Description != nil { + objectMap["description"] = asr.Description } - return aaArray, nil + return json.Marshal(objectMap) } -// MarshalJSON is the custom marshaler for AutomationAction. -func (aa AutomationAction) MarshalJSON() ([]byte, error) { - aa.ActionType = ActionTypeAutomationAction - objectMap := make(map[string]interface{}) - if aa.ActionType != "" { - objectMap["actionType"] = aa.ActionType +// AtaExternalSecuritySolution represents an ATA security solution which sends logs to an OMS workspace +type AtaExternalSecuritySolution struct { + Properties *AtaSolutionProperties `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"` + // Location - READ-ONLY; Location where the resource is stored + Location *string `json:"location,omitempty"` + // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' + Kind KindEnum `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for AtaExternalSecuritySolution. +func (aess AtaExternalSecuritySolution) MarshalJSON() ([]byte, error) { + aess.Kind = KindATA + objectMap := make(map[string]interface{}) + if aess.Properties != nil { + objectMap["properties"] = aess.Properties + } + if aess.Kind != "" { + objectMap["kind"] = aess.Kind } return json.Marshal(objectMap) } -// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationAction. -func (aa AutomationAction) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { +// AsCefExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. +func (aess AtaExternalSecuritySolution) AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) { return nil, false } -// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationAction. -func (aa AutomationAction) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { - return nil, false +// AsAtaExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. +func (aess AtaExternalSecuritySolution) AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) { + return &aess, true } -// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationAction. -func (aa AutomationAction) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { +// AsAadExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. +func (aess AtaExternalSecuritySolution) AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) { return nil, false } -// AsAutomationAction is the BasicAutomationAction implementation for AutomationAction. -func (aa AutomationAction) AsAutomationAction() (*AutomationAction, bool) { - return &aa, true +// AsExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. +func (aess AtaExternalSecuritySolution) AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) { + return nil, false } -// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationAction. -func (aa AutomationAction) AsBasicAutomationAction() (BasicAutomationAction, bool) { - return &aa, true +// AsBasicExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. +func (aess AtaExternalSecuritySolution) AsBasicExternalSecuritySolution() (BasicExternalSecuritySolution, bool) { + return &aess, true } -// AutomationActionEventHub the target Event Hub to which event data will be exported. To learn more about -// Security Center continuous export capabilities, visit https://aka.ms/ASCExportLearnMore -type AutomationActionEventHub struct { - // EventHubResourceID - The target Event Hub Azure Resource ID. - EventHubResourceID *string `json:"eventHubResourceId,omitempty"` - // SasPolicyName - READ-ONLY; The target Event Hub SAS policy name. - SasPolicyName *string `json:"sasPolicyName,omitempty"` - // ConnectionString - The target Event Hub connection string (it will not be included in any response). - ConnectionString *string `json:"connectionString,omitempty"` - // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' - ActionType ActionType `json:"actionType,omitempty"` +// AtaSolutionProperties ... +type AtaSolutionProperties struct { + LastEventReceived *string `json:"lastEventReceived,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + DeviceVendor *string `json:"deviceVendor,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + Workspace *ConnectedWorkspace `json:"workspace,omitempty"` } -// MarshalJSON is the custom marshaler for AutomationActionEventHub. -func (aaeh AutomationActionEventHub) MarshalJSON() ([]byte, error) { - aaeh.ActionType = ActionTypeEventHub +// MarshalJSON is the custom marshaler for AtaSolutionProperties. +func (asp AtaSolutionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if aaeh.EventHubResourceID != nil { - objectMap["eventHubResourceId"] = aaeh.EventHubResourceID + if asp.LastEventReceived != nil { + objectMap["lastEventReceived"] = asp.LastEventReceived } - if aaeh.ConnectionString != nil { - objectMap["connectionString"] = aaeh.ConnectionString + if asp.DeviceVendor != nil { + objectMap["deviceVendor"] = asp.DeviceVendor } - if aaeh.ActionType != "" { - objectMap["actionType"] = aaeh.ActionType + if asp.DeviceType != nil { + objectMap["deviceType"] = asp.DeviceType + } + if asp.Workspace != nil { + objectMap["workspace"] = asp.Workspace + } + for k, v := range asp.AdditionalProperties { + objectMap[k] = v } return json.Marshal(objectMap) } -// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationActionEventHub. -func (aaeh AutomationActionEventHub) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { - return nil, false -} +// UnmarshalJSON is the custom unmarshaler for AtaSolutionProperties struct. +func (asp *AtaSolutionProperties) 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 "lastEventReceived": + if v != nil { + var lastEventReceived string + err = json.Unmarshal(*v, &lastEventReceived) + if err != nil { + return err + } + asp.LastEventReceived = &lastEventReceived + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if asp.AdditionalProperties == nil { + asp.AdditionalProperties = make(map[string]interface{}) + } + asp.AdditionalProperties[k] = additionalProperties + } + case "deviceVendor": + if v != nil { + var deviceVendor string + err = json.Unmarshal(*v, &deviceVendor) + if err != nil { + return err + } + asp.DeviceVendor = &deviceVendor + } + case "deviceType": + if v != nil { + var deviceType string + err = json.Unmarshal(*v, &deviceType) + if err != nil { + return err + } + asp.DeviceType = &deviceType + } + case "workspace": + if v != nil { + var workspace ConnectedWorkspace + err = json.Unmarshal(*v, &workspace) + if err != nil { + return err + } + asp.Workspace = &workspace + } + } + } -// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationActionEventHub. -func (aaeh AutomationActionEventHub) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { - return &aaeh, true + return nil } -// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationActionEventHub. -func (aaeh AutomationActionEventHub) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { - return nil, false +// BasicAuthenticationDetailsProperties settings for cloud authentication management +type BasicAuthenticationDetailsProperties interface { + AsAwsCredsAuthenticationDetailsProperties() (*AwsCredsAuthenticationDetailsProperties, bool) + AsAwAssumeRoleAuthenticationDetailsProperties() (*AwAssumeRoleAuthenticationDetailsProperties, bool) + AsGcpCredentialsDetailsProperties() (*GcpCredentialsDetailsProperties, bool) + AsAuthenticationDetailsProperties() (*AuthenticationDetailsProperties, bool) } -// AsAutomationAction is the BasicAutomationAction implementation for AutomationActionEventHub. -func (aaeh AutomationActionEventHub) AsAutomationAction() (*AutomationAction, bool) { - return nil, false +// AuthenticationDetailsProperties settings for cloud authentication management +type AuthenticationDetailsProperties struct { + // AuthenticationProvisioningState - READ-ONLY; State of the multi-cloud connector. Possible values include: 'Valid', 'Invalid', 'Expired', 'IncorrectPolicy' + AuthenticationProvisioningState AuthenticationProvisioningState `json:"authenticationProvisioningState,omitempty"` + // GrantedPermissions - READ-ONLY; The permissions detected in the cloud account. + GrantedPermissions *[]PermissionProperty `json:"grantedPermissions,omitempty"` + // AuthenticationType - Possible values include: 'AuthenticationTypeAuthenticationDetailsProperties', 'AuthenticationTypeAwsCreds', 'AuthenticationTypeAwsAssumeRole', 'AuthenticationTypeGcpCredentials' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` } -// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationActionEventHub. -func (aaeh AutomationActionEventHub) AsBasicAutomationAction() (BasicAutomationAction, bool) { - return &aaeh, true +func unmarshalBasicAuthenticationDetailsProperties(body []byte) (BasicAuthenticationDetailsProperties, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["authenticationType"] { + case string(AuthenticationTypeAwsCreds): + var acadp AwsCredsAuthenticationDetailsProperties + err := json.Unmarshal(body, &acadp) + return acadp, err + case string(AuthenticationTypeAwsAssumeRole): + var aaradp AwAssumeRoleAuthenticationDetailsProperties + err := json.Unmarshal(body, &aaradp) + return aaradp, err + case string(AuthenticationTypeGcpCredentials): + var gcdp GcpCredentialsDetailsProperties + err := json.Unmarshal(body, &gcdp) + return gcdp, err + default: + var adp AuthenticationDetailsProperties + err := json.Unmarshal(body, &adp) + return adp, err + } } +func unmarshalBasicAuthenticationDetailsPropertiesArray(body []byte) ([]BasicAuthenticationDetailsProperties, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } -// AutomationActionLogicApp the logic app action that should be triggered. To learn more about Security -// Center's Workflow Automation capabilities, visit https://aka.ms/ASCWorkflowAutomationLearnMore -type AutomationActionLogicApp struct { - // LogicAppResourceID - The triggered Logic App Azure Resource ID. This can also reside on other subscriptions, given that you have permissions to trigger the Logic App - LogicAppResourceID *string `json:"logicAppResourceId,omitempty"` - // URI - The Logic App trigger URI endpoint (it will not be included in any response). - URI *string `json:"uri,omitempty"` - // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' - ActionType ActionType `json:"actionType,omitempty"` + adpArray := make([]BasicAuthenticationDetailsProperties, len(rawMessages)) + + for index, rawMessage := range rawMessages { + adp, err := unmarshalBasicAuthenticationDetailsProperties(*rawMessage) + if err != nil { + return nil, err + } + adpArray[index] = adp + } + return adpArray, nil } -// MarshalJSON is the custom marshaler for AutomationActionLogicApp. -func (aala AutomationActionLogicApp) MarshalJSON() ([]byte, error) { - aala.ActionType = ActionTypeLogicApp +// MarshalJSON is the custom marshaler for AuthenticationDetailsProperties. +func (adp AuthenticationDetailsProperties) MarshalJSON() ([]byte, error) { + adp.AuthenticationType = AuthenticationTypeAuthenticationDetailsProperties objectMap := make(map[string]interface{}) - if aala.LogicAppResourceID != nil { - objectMap["logicAppResourceId"] = aala.LogicAppResourceID - } - if aala.URI != nil { - objectMap["uri"] = aala.URI - } - if aala.ActionType != "" { - objectMap["actionType"] = aala.ActionType + if adp.AuthenticationType != "" { + objectMap["authenticationType"] = adp.AuthenticationType } return json.Marshal(objectMap) } -// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationActionLogicApp. -func (aala AutomationActionLogicApp) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { - return &aala, true -} - -// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationActionLogicApp. -func (aala AutomationActionLogicApp) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { +// AsAwsCredsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AuthenticationDetailsProperties. +func (adp AuthenticationDetailsProperties) AsAwsCredsAuthenticationDetailsProperties() (*AwsCredsAuthenticationDetailsProperties, bool) { return nil, false } -// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationActionLogicApp. -func (aala AutomationActionLogicApp) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { +// AsAwAssumeRoleAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AuthenticationDetailsProperties. +func (adp AuthenticationDetailsProperties) AsAwAssumeRoleAuthenticationDetailsProperties() (*AwAssumeRoleAuthenticationDetailsProperties, bool) { return nil, false } -// AsAutomationAction is the BasicAutomationAction implementation for AutomationActionLogicApp. -func (aala AutomationActionLogicApp) AsAutomationAction() (*AutomationAction, bool) { +// AsGcpCredentialsDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AuthenticationDetailsProperties. +func (adp AuthenticationDetailsProperties) AsGcpCredentialsDetailsProperties() (*GcpCredentialsDetailsProperties, bool) { return nil, false } -// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationActionLogicApp. -func (aala AutomationActionLogicApp) AsBasicAutomationAction() (BasicAutomationAction, bool) { - return &aala, true +// AsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AuthenticationDetailsProperties. +func (adp AuthenticationDetailsProperties) AsAuthenticationDetailsProperties() (*AuthenticationDetailsProperties, bool) { + return &adp, true } -// AutomationActionWorkspace the Log Analytics Workspace to which event data will be exported. Security -// alerts data will reside in the 'SecurityAlert' table and the assessments data will reside in the -// 'SecurityRecommendation' table (under the 'Security'/'SecurityCenterFree' solutions). Note that in order -// to view the data in the workspace, the Security Center Log Analytics free/standard solution needs to be -// enabled on that workspace. To learn more about Security Center continuous export capabilities, visit -// https://aka.ms/ASCExportLearnMore -type AutomationActionWorkspace struct { - // WorkspaceResourceID - The fully qualified Log Analytics Workspace Azure Resource ID. - WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"` - // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' - ActionType ActionType `json:"actionType,omitempty"` +// AsBasicAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AuthenticationDetailsProperties. +func (adp AuthenticationDetailsProperties) AsBasicAuthenticationDetailsProperties() (BasicAuthenticationDetailsProperties, bool) { + return &adp, true } -// MarshalJSON is the custom marshaler for AutomationActionWorkspace. -func (aaw AutomationActionWorkspace) MarshalJSON() ([]byte, error) { - aaw.ActionType = ActionTypeWorkspace +// Automation the security automation resource. +type Automation struct { + autorest.Response `json:"-"` + // AutomationProperties - Security automation data + *AutomationProperties `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"` + // Location - Location where the resource is stored + Location *string `json:"location,omitempty"` + // Kind - Kind of the resource + Kind *string `json:"kind,omitempty"` + // Etag - Entity tag is used for comparing two or more entities from the same requested resource. + Etag *string `json:"etag,omitempty"` + // Tags - A list of key value pairs that describe the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Automation. +func (a Automation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if aaw.WorkspaceResourceID != nil { - objectMap["workspaceResourceId"] = aaw.WorkspaceResourceID + if a.AutomationProperties != nil { + objectMap["properties"] = a.AutomationProperties } - if aaw.ActionType != "" { - objectMap["actionType"] = aaw.ActionType + if a.Location != nil { + objectMap["location"] = a.Location + } + if a.Kind != nil { + objectMap["kind"] = a.Kind + } + if a.Etag != nil { + objectMap["etag"] = a.Etag + } + if a.Tags != nil { + objectMap["tags"] = a.Tags } return json.Marshal(objectMap) } -// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationActionWorkspace. -func (aaw AutomationActionWorkspace) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { - return nil, false -} +// UnmarshalJSON is the custom unmarshaler for Automation struct. +func (a *Automation) 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 automationProperties AutomationProperties + err = json.Unmarshal(*v, &automationProperties) + if err != nil { + return err + } + a.AutomationProperties = &automationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + a.Location = &location + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + a.Kind = &kind + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + a.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + a.Tags = tags + } + } + } -// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationActionWorkspace. -func (aaw AutomationActionWorkspace) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { - return nil, false + return nil } -// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationActionWorkspace. -func (aaw AutomationActionWorkspace) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { - return &aaw, true +// BasicAutomationAction the action that should be triggered. +type BasicAutomationAction interface { + AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) + AsAutomationActionEventHub() (*AutomationActionEventHub, bool) + AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) + AsAutomationAction() (*AutomationAction, bool) } -// AsAutomationAction is the BasicAutomationAction implementation for AutomationActionWorkspace. -func (aaw AutomationActionWorkspace) AsAutomationAction() (*AutomationAction, bool) { - return nil, false +// AutomationAction the action that should be triggered. +type AutomationAction struct { + // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' + ActionType ActionType `json:"actionType,omitempty"` } -// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationActionWorkspace. -func (aaw AutomationActionWorkspace) AsBasicAutomationAction() (BasicAutomationAction, bool) { - return &aaw, true +func unmarshalBasicAutomationAction(body []byte) (BasicAutomationAction, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["actionType"] { + case string(ActionTypeLogicApp): + var aala AutomationActionLogicApp + err := json.Unmarshal(body, &aala) + return aala, err + case string(ActionTypeEventHub): + var aaeh AutomationActionEventHub + err := json.Unmarshal(body, &aaeh) + return aaeh, err + case string(ActionTypeWorkspace): + var aaw AutomationActionWorkspace + err := json.Unmarshal(body, &aaw) + return aaw, err + default: + var aa AutomationAction + err := json.Unmarshal(body, &aa) + return aa, err + } } +func unmarshalBasicAutomationActionArray(body []byte) ([]BasicAutomationAction, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } -// AutomationList list of security automations response. -type AutomationList struct { - autorest.Response `json:"-"` - // Value - The list of security automations under the given scope. - Value *[]Automation `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` + aaArray := make([]BasicAutomationAction, len(rawMessages)) + + for index, rawMessage := range rawMessages { + aa, err := unmarshalBasicAutomationAction(*rawMessage) + if err != nil { + return nil, err + } + aaArray[index] = aa + } + return aaArray, nil } -// MarshalJSON is the custom marshaler for AutomationList. -func (al AutomationList) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for AutomationAction. +func (aa AutomationAction) MarshalJSON() ([]byte, error) { + aa.ActionType = ActionTypeAutomationAction objectMap := make(map[string]interface{}) - if al.Value != nil { - objectMap["value"] = al.Value + if aa.ActionType != "" { + objectMap["actionType"] = aa.ActionType } return json.Marshal(objectMap) } -// AutomationListIterator provides access to a complete listing of Automation values. -type AutomationListIterator struct { - i int - page AutomationListPage +// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { + return nil, false } -// 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 *AutomationListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AutomationListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } +// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { + return nil, false +} + +// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { + return nil, false +} + +// AsAutomationAction is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsAutomationAction() (*AutomationAction, bool) { + return &aa, true +} + +// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsBasicAutomationAction() (BasicAutomationAction, bool) { + return &aa, true +} + +// AutomationActionEventHub the target Event Hub to which event data will be exported. To learn more about +// Microsoft Defender for Cloud continuous export capabilities, visit https://aka.ms/ASCExportLearnMore +type AutomationActionEventHub struct { + // EventHubResourceID - The target Event Hub Azure Resource ID. + EventHubResourceID *string `json:"eventHubResourceId,omitempty"` + // SasPolicyName - READ-ONLY; The target Event Hub SAS policy name. + SasPolicyName *string `json:"sasPolicyName,omitempty"` + // ConnectionString - The target Event Hub connection string (it will not be included in any response). + ConnectionString *string `json:"connectionString,omitempty"` + // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' + ActionType ActionType `json:"actionType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) MarshalJSON() ([]byte, error) { + aaeh.ActionType = ActionTypeEventHub + objectMap := make(map[string]interface{}) + if aaeh.EventHubResourceID != nil { + objectMap["eventHubResourceId"] = aaeh.EventHubResourceID + } + if aaeh.ConnectionString != nil { + objectMap["connectionString"] = aaeh.ConnectionString + } + if aaeh.ActionType != "" { + objectMap["actionType"] = aaeh.ActionType + } + return json.Marshal(objectMap) +} + +// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { + return nil, false +} + +// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { + return &aaeh, true +} + +// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { + return nil, false +} + +// AsAutomationAction is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsAutomationAction() (*AutomationAction, bool) { + return nil, false +} + +// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsBasicAutomationAction() (BasicAutomationAction, bool) { + return &aaeh, true +} + +// AutomationActionLogicApp the logic app action that should be triggered. To learn more about Microsoft +// Defender for Cloud's Workflow Automation capabilities, visit +// https://aka.ms/ASCWorkflowAutomationLearnMore +type AutomationActionLogicApp struct { + // LogicAppResourceID - The triggered Logic App Azure Resource ID. This can also reside on other subscriptions, given that you have permissions to trigger the Logic App + LogicAppResourceID *string `json:"logicAppResourceId,omitempty"` + // URI - The Logic App trigger URI endpoint (it will not be included in any response). + URI *string `json:"uri,omitempty"` + // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' + ActionType ActionType `json:"actionType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) MarshalJSON() ([]byte, error) { + aala.ActionType = ActionTypeLogicApp + objectMap := make(map[string]interface{}) + if aala.LogicAppResourceID != nil { + objectMap["logicAppResourceId"] = aala.LogicAppResourceID + } + if aala.URI != nil { + objectMap["uri"] = aala.URI + } + if aala.ActionType != "" { + objectMap["actionType"] = aala.ActionType + } + return json.Marshal(objectMap) +} + +// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { + return &aala, true +} + +// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { + return nil, false +} + +// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { + return nil, false +} + +// AsAutomationAction is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsAutomationAction() (*AutomationAction, bool) { + return nil, false +} + +// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsBasicAutomationAction() (BasicAutomationAction, bool) { + return &aala, true +} + +// AutomationActionWorkspace the Log Analytics Workspace to which event data will be exported. Security +// alerts data will reside in the 'SecurityAlert' table and the assessments data will reside in the +// 'SecurityRecommendation' table (under the 'Security'/'SecurityCenterFree' solutions). Note that in order +// to view the data in the workspace, the Security Center Log Analytics free/standard solution needs to be +// enabled on that workspace. To learn more about Microsoft Defender for Cloud continuous export +// capabilities, visit https://aka.ms/ASCExportLearnMore +type AutomationActionWorkspace struct { + // WorkspaceResourceID - The fully qualified Log Analytics Workspace Azure Resource ID. + WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"` + // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' + ActionType ActionType `json:"actionType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) MarshalJSON() ([]byte, error) { + aaw.ActionType = ActionTypeWorkspace + objectMap := make(map[string]interface{}) + if aaw.WorkspaceResourceID != nil { + objectMap["workspaceResourceId"] = aaw.WorkspaceResourceID + } + if aaw.ActionType != "" { + objectMap["actionType"] = aaw.ActionType + } + return json.Marshal(objectMap) +} + +// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { + return nil, false +} + +// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { + return nil, false +} + +// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { + return &aaw, true +} + +// AsAutomationAction is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsAutomationAction() (*AutomationAction, bool) { + return nil, false +} + +// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsBasicAutomationAction() (BasicAutomationAction, bool) { + return &aaw, true +} + +// AutomationList list of security automations response. +type AutomationList struct { + autorest.Response `json:"-"` + // Value - The list of security automations under the given scope. + Value *[]Automation `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationList. +func (al AutomationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if al.Value != nil { + objectMap["value"] = al.Value + } + return json.Marshal(objectMap) +} + +// AutomationListIterator provides access to a complete listing of Automation values. +type AutomationListIterator struct { + i int + page AutomationListPage +} + +// 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 *AutomationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationListIterator.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 @@ -4986,7 +5418,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: 'EventSourceAssessments', 'EventSourceSubAssessments', 'EventSourceAlerts', 'EventSourceSecureScores', 'EventSourceSecureScoresSnapshot', 'EventSourceSecureScoreControls', 'EventSourceSecureScoreControlsSnapshot', 'EventSourceRegulatoryComplianceAssessment', 'EventSourceRegulatoryComplianceAssessmentSnapshot' + // EventSource - A valid event source type. Possible values include: 'EventSourceAssessments', 'EventSourceAssessmentsSnapshot', 'EventSourceSubAssessments', 'EventSourceSubAssessmentsSnapshot', '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"` @@ -5748,57 +6180,163 @@ func (ceb CloudErrorBody) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// Compliance compliance of a scope -type Compliance struct { - autorest.Response `json:"-"` - // ComplianceProperties - Compliance data - *ComplianceProperties `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"` +// BasicCloudOffering the security offering details +type BasicCloudOffering interface { + AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) + AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) + AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) + AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) + AsCloudOffering() (*CloudOffering, bool) } -// MarshalJSON is the custom marshaler for Compliance. -func (c Compliance) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.ComplianceProperties != nil { - objectMap["properties"] = c.ComplianceProperties - } - return json.Marshal(objectMap) +// CloudOffering the security offering details +type CloudOffering struct { + // Description - READ-ONLY; The offering description. + Description *string `json:"description,omitempty"` + // OfferingType - Possible values include: 'OfferingTypeCloudOffering', 'OfferingTypeCspmMonitorAws', 'OfferingTypeDefenderForContainersAws', 'OfferingTypeDefenderForServersAws', 'OfferingTypeInformationProtectionAws' + OfferingType OfferingType `json:"offeringType,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for Compliance struct. -func (c *Compliance) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage +func unmarshalBasicCloudOffering(body []byte) (BasicCloudOffering, error) { + var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { - return err + return nil, err } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var complianceProperties ComplianceProperties - err = json.Unmarshal(*v, &complianceProperties) - if err != nil { - return err - } - c.ComplianceProperties = &complianceProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - c.ID = &ID - } - case "name": - if v != nil { + + switch m["offeringType"] { + case string(OfferingTypeCspmMonitorAws): + var cmao CspmMonitorAwsOffering + err := json.Unmarshal(body, &cmao) + return cmao, err + case string(OfferingTypeDefenderForContainersAws): + var dfcao DefenderForContainersAwsOffering + err := json.Unmarshal(body, &dfcao) + return dfcao, err + case string(OfferingTypeDefenderForServersAws): + var dfsao DefenderForServersAwsOffering + err := json.Unmarshal(body, &dfsao) + return dfsao, err + case string(OfferingTypeInformationProtectionAws): + var ipao InformationProtectionAwsOffering + err := json.Unmarshal(body, &ipao) + return ipao, err + default: + var co CloudOffering + err := json.Unmarshal(body, &co) + return co, err + } +} +func unmarshalBasicCloudOfferingArray(body []byte) ([]BasicCloudOffering, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + coArray := make([]BasicCloudOffering, len(rawMessages)) + + for index, rawMessage := range rawMessages { + co, err := unmarshalBasicCloudOffering(*rawMessage) + if err != nil { + return nil, err + } + coArray[index] = co + } + return coArray, nil +} + +// MarshalJSON is the custom marshaler for CloudOffering. +func (co CloudOffering) MarshalJSON() ([]byte, error) { + co.OfferingType = OfferingTypeCloudOffering + objectMap := make(map[string]interface{}) + if co.OfferingType != "" { + objectMap["offeringType"] = co.OfferingType + } + return json.Marshal(objectMap) +} + +// AsCspmMonitorAwsOffering is the BasicCloudOffering implementation for CloudOffering. +func (co CloudOffering) AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) { + return nil, false +} + +// AsDefenderForContainersAwsOffering is the BasicCloudOffering implementation for CloudOffering. +func (co CloudOffering) AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) { + return nil, false +} + +// AsDefenderForServersAwsOffering is the BasicCloudOffering implementation for CloudOffering. +func (co CloudOffering) AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) { + return nil, false +} + +// AsInformationProtectionAwsOffering is the BasicCloudOffering implementation for CloudOffering. +func (co CloudOffering) AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) { + return nil, false +} + +// AsCloudOffering is the BasicCloudOffering implementation for CloudOffering. +func (co CloudOffering) AsCloudOffering() (*CloudOffering, bool) { + return &co, true +} + +// AsBasicCloudOffering is the BasicCloudOffering implementation for CloudOffering. +func (co CloudOffering) AsBasicCloudOffering() (BasicCloudOffering, bool) { + return &co, true +} + +// Compliance compliance of a scope +type Compliance struct { + autorest.Response `json:"-"` + // ComplianceProperties - Compliance data + *ComplianceProperties `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 Compliance. +func (c Compliance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.ComplianceProperties != nil { + objectMap["properties"] = c.ComplianceProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Compliance struct. +func (c *Compliance) 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 complianceProperties ComplianceProperties + err = json.Unmarshal(*v, &complianceProperties) + if err != nil { + return err + } + c.ComplianceProperties = &complianceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { var name string err = json.Unmarshal(*v, &name) if err != nil { @@ -6695,6 +7233,220 @@ func (ctina ConnectionToIPNotAllowed) AsBasicCustomAlertRule() (BasicCustomAlert return &ctina, true } +// Connector the security connector resource. +type Connector struct { + autorest.Response `json:"-"` + // SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty"` + // ConnectorProperties - Security connector data + *ConnectorProperties `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"` + // Location - Location where the resource is stored + Location *string `json:"location,omitempty"` + // Kind - Kind of the resource + Kind *string `json:"kind,omitempty"` + // Etag - Entity tag is used for comparing two or more entities from the same requested resource. + Etag *string `json:"etag,omitempty"` + // Tags - A list of key value pairs that describe the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Connector. +func (c Connector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.ConnectorProperties != nil { + objectMap["properties"] = c.ConnectorProperties + } + if c.Location != nil { + objectMap["location"] = c.Location + } + if c.Kind != nil { + objectMap["kind"] = c.Kind + } + if c.Etag != nil { + objectMap["etag"] = c.Etag + } + if c.Tags != nil { + objectMap["tags"] = c.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Connector struct. +func (c *Connector) 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 "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + c.SystemData = &systemData + } + case "properties": + if v != nil { + var connectorProperties ConnectorProperties + err = json.Unmarshal(*v, &connectorProperties) + if err != nil { + return err + } + c.ConnectorProperties = &connectorProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + c.Location = &location + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + c.Kind = &kind + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + c.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + c.Tags = tags + } + } + } + + return nil +} + +// ConnectorProperties a set of properties that defines the security connector configuration. +type ConnectorProperties struct { + // HierarchyIdentifier - The multi cloud resource identifier (account id in case of AWS connector). + HierarchyIdentifier *string `json:"hierarchyIdentifier,omitempty"` + // CloudName - The multi cloud resource's cloud name. Possible values include: 'Azure', 'AWS', 'GCP' + CloudName CloudName `json:"cloudName,omitempty"` + // Offerings - A collection of offerings for the security connector. + Offerings *[]BasicCloudOffering `json:"offerings,omitempty"` + // OrganizationalData - The multi cloud account's organizational data + OrganizationalData *ConnectorPropertiesOrganizationalData `json:"organizationalData,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ConnectorProperties struct. +func (cp *ConnectorProperties) 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 "hierarchyIdentifier": + if v != nil { + var hierarchyIdentifier string + err = json.Unmarshal(*v, &hierarchyIdentifier) + if err != nil { + return err + } + cp.HierarchyIdentifier = &hierarchyIdentifier + } + case "cloudName": + if v != nil { + var cloudName CloudName + err = json.Unmarshal(*v, &cloudName) + if err != nil { + return err + } + cp.CloudName = cloudName + } + case "offerings": + if v != nil { + offerings, err := unmarshalBasicCloudOfferingArray(*v) + if err != nil { + return err + } + cp.Offerings = &offerings + } + case "organizationalData": + if v != nil { + var organizationalData ConnectorPropertiesOrganizationalData + err = json.Unmarshal(*v, &organizationalData) + if err != nil { + return err + } + cp.OrganizationalData = &organizationalData + } + } + } + + return nil +} + +// ConnectorPropertiesOrganizationalData the multi cloud account's organizational data +type ConnectorPropertiesOrganizationalData struct { + // OrganizationMembershipType - The multi cloud account's membership type in the organization. Possible values include: 'Member', 'Organization' + OrganizationMembershipType OrganizationMembershipType `json:"organizationMembershipType,omitempty"` + // ParentHierarchyID - If the multi cloud account is not of membership type organization, this will be the ID of the account's parent + ParentHierarchyID *string `json:"parentHierarchyId,omitempty"` + // StacksetName - If the multi cloud account is of membership type organization, this will be the name of the onboarding stackset + StacksetName *string `json:"stacksetName,omitempty"` + // ExcludedAccountIds - If the multi cloud account is of membership type organization, list of accounts excluded from offering + ExcludedAccountIds *[]string `json:"excludedAccountIds,omitempty"` +} + // ConnectorSetting the connector setting type ConnectorSetting struct { autorest.Response `json:"-"` @@ -6976,23 +7728,191 @@ func (csp *ConnectorSettingProperties) UnmarshalJSON(body []byte) error { return nil } -// Contact contact details for security issues -type Contact struct { +// ConnectorsList list of security connectors response. +type ConnectorsList struct { autorest.Response `json:"-"` - // ContactProperties - Security contact data - *ContactProperties `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"` + // Value - The list of security connectors under the given scope. + Value *[]Connector `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for Contact. -func (c Contact) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ConnectorsList. +func (cl ConnectorsList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if c.ContactProperties != nil { + if cl.Value != nil { + objectMap["value"] = cl.Value + } + return json.Marshal(objectMap) +} + +// ConnectorsListIterator provides access to a complete listing of Connector values. +type ConnectorsListIterator struct { + i int + page ConnectorsListPage +} + +// 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 *ConnectorsListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsListIterator.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 *ConnectorsListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ConnectorsListIterator) 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 ConnectorsListIterator) Response() ConnectorsList { + 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 ConnectorsListIterator) Value() Connector { + if !iter.page.NotDone() { + return Connector{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ConnectorsListIterator type. +func NewConnectorsListIterator(page ConnectorsListPage) ConnectorsListIterator { + return ConnectorsListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cl ConnectorsList) IsEmpty() bool { + return cl.Value == nil || len(*cl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (cl ConnectorsList) hasNextLink() bool { + return cl.NextLink != nil && len(*cl.NextLink) != 0 +} + +// connectorsListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cl ConnectorsList) connectorsListPreparer(ctx context.Context) (*http.Request, error) { + if !cl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cl.NextLink))) +} + +// ConnectorsListPage contains a page of Connector values. +type ConnectorsListPage struct { + fn func(context.Context, ConnectorsList) (ConnectorsList, error) + cl ConnectorsList +} + +// 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 *ConnectorsListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorsListPage.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.cl) + if err != nil { + return err + } + page.cl = 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 *ConnectorsListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ConnectorsListPage) NotDone() bool { + return !page.cl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ConnectorsListPage) Response() ConnectorsList { + return page.cl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ConnectorsListPage) Values() []Connector { + if page.cl.IsEmpty() { + return nil + } + return *page.cl.Value +} + +// Creates a new instance of the ConnectorsListPage type. +func NewConnectorsListPage(cur ConnectorsList, getNextPage func(context.Context, ConnectorsList) (ConnectorsList, error)) ConnectorsListPage { + return ConnectorsListPage{ + fn: getNextPage, + cl: cur, + } +} + +// Contact contact details for security issues +type Contact struct { + autorest.Response `json:"-"` + // ContactProperties - Security contact data + *ContactProperties `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 Contact. +func (c Contact) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.ContactProperties != nil { objectMap["properties"] = c.ContactProperties } return json.Marshal(objectMap) @@ -7284,6 +8204,65 @@ func (crvp ContainerRegistryVulnerabilityProperties) AsBasicAdditionalData() (Ba return &crvp, true } +// CspmMonitorAwsOffering the CSPM monitoring for AWS offering configurations +type CspmMonitorAwsOffering struct { + // NativeCloudConnection - The native cloud connection configuration + NativeCloudConnection *CspmMonitorAwsOfferingNativeCloudConnection `json:"nativeCloudConnection,omitempty"` + // Description - READ-ONLY; The offering description. + Description *string `json:"description,omitempty"` + // OfferingType - Possible values include: 'OfferingTypeCloudOffering', 'OfferingTypeCspmMonitorAws', 'OfferingTypeDefenderForContainersAws', 'OfferingTypeDefenderForServersAws', 'OfferingTypeInformationProtectionAws' + OfferingType OfferingType `json:"offeringType,omitempty"` +} + +// MarshalJSON is the custom marshaler for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) MarshalJSON() ([]byte, error) { + cmao.OfferingType = OfferingTypeCspmMonitorAws + objectMap := make(map[string]interface{}) + if cmao.NativeCloudConnection != nil { + objectMap["nativeCloudConnection"] = cmao.NativeCloudConnection + } + if cmao.OfferingType != "" { + objectMap["offeringType"] = cmao.OfferingType + } + return json.Marshal(objectMap) +} + +// AsCspmMonitorAwsOffering is the BasicCloudOffering implementation for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) { + return &cmao, true +} + +// AsDefenderForContainersAwsOffering is the BasicCloudOffering implementation for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) { + return nil, false +} + +// AsDefenderForServersAwsOffering is the BasicCloudOffering implementation for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) { + return nil, false +} + +// AsInformationProtectionAwsOffering is the BasicCloudOffering implementation for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) { + return nil, false +} + +// AsCloudOffering is the BasicCloudOffering implementation for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) AsCloudOffering() (*CloudOffering, bool) { + return nil, false +} + +// AsBasicCloudOffering is the BasicCloudOffering implementation for CspmMonitorAwsOffering. +func (cmao CspmMonitorAwsOffering) AsBasicCloudOffering() (BasicCloudOffering, bool) { + return &cmao, true +} + +// CspmMonitorAwsOfferingNativeCloudConnection the native cloud connection configuration +type CspmMonitorAwsOfferingNativeCloudConnection struct { + // CloudRoleArn - The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` +} + // BasicCustomAlertRule a custom alert rule. type BasicCustomAlertRule interface { AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) @@ -7502,467 +8481,241 @@ func (car CustomAlertRule) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRu } // AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { - return nil, false -} - -// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { - return nil, false -} - -// AsListCustomAlertRule is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { - return nil, false -} - -// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { - return nil, false -} - -// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { - 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 -} - -// AsProcessNotAllowed is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { - return nil, false -} - -// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { - return nil, false -} - -// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { - return nil, false -} - -// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { - return nil, false -} - -// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { - return nil, false -} - -// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { - return nil, false -} - -// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { - return nil, false -} - -// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { - return nil, false -} - -// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { - return nil, false -} - -// AsCustomAlertRule is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsCustomAlertRule() (*CustomAlertRule, bool) { - return &car, true -} - -// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for CustomAlertRule. -func (car CustomAlertRule) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { - return &car, true -} - -// CVE CVE details -type CVE struct { - // Title - READ-ONLY; CVE title - Title *string `json:"title,omitempty"` - // Link - READ-ONLY; Link url - Link *string `json:"link,omitempty"` -} - -// MarshalJSON is the custom marshaler for CVE. -func (c CVE) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// CVSS CVSS details -type CVSS struct { - // Base - READ-ONLY; CVSS base - Base *float64 `json:"base,omitempty"` -} - -// MarshalJSON is the custom marshaler for CVSS. -func (c CVSS) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// DataExportSettingProperties the data export setting properties -type DataExportSettingProperties struct { - // Enabled - Is the data export setting enabled - Enabled *bool `json:"enabled,omitempty"` -} - -// DataExportSettings represents a data export setting -type DataExportSettings struct { - // DataExportSettingProperties - Data export setting data - *DataExportSettingProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindSetting', 'KindDataExportSettings', 'KindAlertSyncSettings' - Kind KindEnum2 `json:"kind,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 DataExportSettings. -func (desVar DataExportSettings) MarshalJSON() ([]byte, error) { - desVar.Kind = KindDataExportSettings - objectMap := make(map[string]interface{}) - if desVar.DataExportSettingProperties != nil { - objectMap["properties"] = desVar.DataExportSettingProperties - } - if desVar.Kind != "" { - objectMap["kind"] = desVar.Kind - } - return json.Marshal(objectMap) -} - -// AsDataExportSettings is the BasicSetting implementation for DataExportSettings. -func (desVar DataExportSettings) AsDataExportSettings() (*DataExportSettings, bool) { - return &desVar, true -} - -// AsAlertSyncSettings is the BasicSetting implementation for DataExportSettings. -func (desVar DataExportSettings) AsAlertSyncSettings() (*AlertSyncSettings, bool) { - return nil, false -} - -// AsSetting is the BasicSetting implementation for DataExportSettings. -func (desVar DataExportSettings) AsSetting() (*Setting, bool) { - return nil, false -} - -// AsBasicSetting is the BasicSetting implementation for DataExportSettings. -func (desVar DataExportSettings) AsBasicSetting() (BasicSetting, bool) { - return &desVar, true -} - -// UnmarshalJSON is the custom unmarshaler for DataExportSettings struct. -func (desVar *DataExportSettings) 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 dataExportSettingProperties DataExportSettingProperties - err = json.Unmarshal(*v, &dataExportSettingProperties) - if err != nil { - return err - } - desVar.DataExportSettingProperties = &dataExportSettingProperties - } - case "kind": - if v != nil { - var kind KindEnum2 - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - desVar.Kind = kind - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - desVar.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - desVar.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - desVar.Type = &typeVar - } - } - } - - return nil -} - -// DenylistCustomAlertRule a custom alert rule that checks if a value (depends on the custom alert type) is -// denied. -type DenylistCustomAlertRule struct { - // DenylistValues - The values to deny. The format of the values depends on the rule type. - DenylistValues *[]string `json:"denylistValues,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 DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) MarshalJSON() ([]byte, error) { - dcar.RuleType = RuleTypeDenylistCustomAlertRule - objectMap := make(map[string]interface{}) - if dcar.DenylistValues != nil { - objectMap["denylistValues"] = dcar.DenylistValues - } - if dcar.IsEnabled != nil { - objectMap["isEnabled"] = dcar.IsEnabled - } - if dcar.RuleType != "" { - objectMap["ruleType"] = dcar.RuleType - } - return json.Marshal(objectMap) -} - -// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { - return nil, false -} - -// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { +func (car CustomAlertRule) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { return nil, false } -// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { return nil, false } -// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { return nil, false } -// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { return nil, false } -// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { return nil, false } -// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { - return &dcar, true +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false } -// AsListCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false } -// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { - return &dcar, true +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false } -// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { return nil, false } -// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { return nil, false } -// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { return nil, false } -// AsProcessNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { return nil, false } -// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { return nil, false } -// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { return nil, false } -// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { return nil, false } -// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { return nil, false } -// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { return nil, false } -// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { return nil, false } -// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { return nil, false } -// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { return nil, false } -// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { return nil, false } -// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { return nil, false } -// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { return nil, false } -// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { return nil, false } -// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { - return nil, false +// AsCustomAlertRule is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsCustomAlertRule() (*CustomAlertRule, bool) { + return &car, true } -// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { - return nil, false +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &car, true } -// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { - return nil, false +// CustomAssessmentAutomation custom Assessment Automation +type CustomAssessmentAutomation struct { + autorest.Response `json:"-"` + // SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty"` + // CustomAssessmentAutomationProperties - describes Custom Assessment Automation properties. + *CustomAssessmentAutomationProperties `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"` } -// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { - return nil, false +// MarshalJSON is the custom marshaler for CustomAssessmentAutomation. +func (caa CustomAssessmentAutomation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if caa.CustomAssessmentAutomationProperties != nil { + objectMap["properties"] = caa.CustomAssessmentAutomationProperties + } + return json.Marshal(objectMap) } -// AsCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsCustomAlertRule() (*CustomAlertRule, bool) { - return nil, false +// UnmarshalJSON is the custom unmarshaler for CustomAssessmentAutomation struct. +func (caa *CustomAssessmentAutomation) 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 "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + caa.SystemData = &systemData + } + case "properties": + if v != nil { + var customAssessmentAutomationProperties CustomAssessmentAutomationProperties + err = json.Unmarshal(*v, &customAssessmentAutomationProperties) + if err != nil { + return err + } + caa.CustomAssessmentAutomationProperties = &customAssessmentAutomationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + caa.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + caa.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + caa.Type = &typeVar + } + } + } + + return nil } -// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { - return &dcar, true +// CustomAssessmentAutomationProperties describes the Custom Assessment Automation properties +type CustomAssessmentAutomationProperties struct { + // CompressedQuery - GZip encoded KQL query representing the assessment automation results required. + CompressedQuery *string `json:"compressedQuery,omitempty"` + // SupportedCloud - Relevant cloud for the custom assessment automation. Possible values include: 'SupportedCloudEnumAWS', 'SupportedCloudEnumGCP' + SupportedCloud SupportedCloudEnum `json:"supportedCloud,omitempty"` + // Severity - The severity to relate to the assessments generated by this assessment automation. Possible values include: 'SeverityEnumHigh', 'SeverityEnumMedium', 'SeverityEnumLow' + Severity SeverityEnum `json:"severity,omitempty"` + // DisplayName - The display name of the assessments generated by this assessment automation. + DisplayName *string `json:"displayName,omitempty"` + // Description - The description to relate to the assessments generated by this assessment automation. + Description *string `json:"description,omitempty"` + // RemediationDescription - The remediation description to relate to the assessments generated by this assessment automation. + RemediationDescription *string `json:"remediationDescription,omitempty"` + // AssessmentKey - The assessment metadata key used when an assessment is generated for this assessment automation. + AssessmentKey *string `json:"assessmentKey,omitempty"` } -// Device device model -type Device struct { - autorest.Response `json:"-"` - // DeviceProperties - Device data - *DeviceProperties `json:"properties,omitempty"` +// CustomAssessmentAutomationRequest custom Assessment Automation request +type CustomAssessmentAutomationRequest struct { + // CustomAssessmentAutomationRequestProperties - describes Custom Assessment Automation request properties. + *CustomAssessmentAutomationRequestProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name @@ -7971,17 +8724,17 @@ type Device struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for Device. -func (d Device) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for CustomAssessmentAutomationRequest. +func (caar CustomAssessmentAutomationRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if d.DeviceProperties != nil { - objectMap["properties"] = d.DeviceProperties + if caar.CustomAssessmentAutomationRequestProperties != nil { + objectMap["properties"] = caar.CustomAssessmentAutomationRequestProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for Device struct. -func (d *Device) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for CustomAssessmentAutomationRequest struct. +func (caar *CustomAssessmentAutomationRequest) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -7991,12 +8744,12 @@ func (d *Device) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var deviceProperties DeviceProperties - err = json.Unmarshal(*v, &deviceProperties) + var customAssessmentAutomationRequestProperties CustomAssessmentAutomationRequestProperties + err = json.Unmarshal(*v, &customAssessmentAutomationRequestProperties) if err != nil { return err } - d.DeviceProperties = &deviceProperties + caar.CustomAssessmentAutomationRequestProperties = &customAssessmentAutomationRequestProperties } case "id": if v != nil { @@ -8005,7 +8758,7 @@ func (d *Device) UnmarshalJSON(body []byte) error { if err != nil { return err } - d.ID = &ID + caar.ID = &ID } case "name": if v != nil { @@ -8014,7 +8767,7 @@ func (d *Device) UnmarshalJSON(body []byte) error { if err != nil { return err } - d.Name = &name + caar.Name = &name } case "type": if v != nil { @@ -8023,7 +8776,7 @@ func (d *Device) UnmarshalJSON(body []byte) error { if err != nil { return err } - d.Type = &typeVar + caar.Type = &typeVar } } } @@ -8031,35 +8784,52 @@ func (d *Device) UnmarshalJSON(body []byte) error { return nil } -// DeviceList list of Devices -type DeviceList struct { +// CustomAssessmentAutomationRequestProperties describes the Custom Assessment Automation properties +type CustomAssessmentAutomationRequestProperties struct { + // CompressedQuery - Base 64 encoded KQL query representing the assessment automation results required. + CompressedQuery *string `json:"compressedQuery,omitempty"` + // SupportedCloud - Relevant cloud for the custom assessment automation. Possible values include: 'SupportedCloudEnumAWS', 'SupportedCloudEnumGCP' + SupportedCloud SupportedCloudEnum `json:"supportedCloud,omitempty"` + // Severity - The severity to relate to the assessments generated by this assessment automation. Possible values include: 'SeverityEnumHigh', 'SeverityEnumMedium', 'SeverityEnumLow' + Severity SeverityEnum `json:"severity,omitempty"` + // DisplayName - The display name of the assessments generated by this assessment automation. + DisplayName *string `json:"displayName,omitempty"` + // Description - The description to relate to the assessments generated by this assessment automation. + Description *string `json:"description,omitempty"` + // RemediationDescription - The remediation description to relate to the assessments generated by this assessment automation. + RemediationDescription *string `json:"remediationDescription,omitempty"` +} + +// CustomAssessmentAutomationsListResult a list of Custom Assessment Automations +type CustomAssessmentAutomationsListResult struct { autorest.Response `json:"-"` - // Value - List of devices - Value *[]Device `json:"value,omitempty"` - // NextLink - READ-ONLY; When there are too many devices for one page, use this URI to fetch the next page. + // Value - READ-ONLY; Collection of Custom Assessment Automations + Value *[]CustomAssessmentAutomation `json:"value,omitempty"` + // NextLink - The link used to get the next page of operations. NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for DeviceList. -func (dl DeviceList) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for CustomAssessmentAutomationsListResult. +func (caalr CustomAssessmentAutomationsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dl.Value != nil { - objectMap["value"] = dl.Value + if caalr.NextLink != nil { + objectMap["nextLink"] = caalr.NextLink } return json.Marshal(objectMap) } -// DeviceListIterator provides access to a complete listing of Device values. -type DeviceListIterator struct { +// CustomAssessmentAutomationsListResultIterator provides access to a complete listing of +// CustomAssessmentAutomation values. +type CustomAssessmentAutomationsListResultIterator struct { i int - page DeviceListPage + page CustomAssessmentAutomationsListResultPage } // 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 *DeviceListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *CustomAssessmentAutomationsListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DeviceListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -8084,67 +8854,67 @@ func (iter *DeviceListIterator) NextWithContext(ctx context.Context) (err error) // 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 *DeviceListIterator) Next() error { +func (iter *CustomAssessmentAutomationsListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DeviceListIterator) NotDone() bool { +func (iter CustomAssessmentAutomationsListResultIterator) 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 DeviceListIterator) Response() DeviceList { +func (iter CustomAssessmentAutomationsListResultIterator) Response() CustomAssessmentAutomationsListResult { 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 DeviceListIterator) Value() Device { +func (iter CustomAssessmentAutomationsListResultIterator) Value() CustomAssessmentAutomation { if !iter.page.NotDone() { - return Device{} + return CustomAssessmentAutomation{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the DeviceListIterator type. -func NewDeviceListIterator(page DeviceListPage) DeviceListIterator { - return DeviceListIterator{page: page} +// Creates a new instance of the CustomAssessmentAutomationsListResultIterator type. +func NewCustomAssessmentAutomationsListResultIterator(page CustomAssessmentAutomationsListResultPage) CustomAssessmentAutomationsListResultIterator { + return CustomAssessmentAutomationsListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (dl DeviceList) IsEmpty() bool { - return dl.Value == nil || len(*dl.Value) == 0 +func (caalr CustomAssessmentAutomationsListResult) IsEmpty() bool { + return caalr.Value == nil || len(*caalr.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (dl DeviceList) hasNextLink() bool { - return dl.NextLink != nil && len(*dl.NextLink) != 0 +func (caalr CustomAssessmentAutomationsListResult) hasNextLink() bool { + return caalr.NextLink != nil && len(*caalr.NextLink) != 0 } -// deviceListPreparer prepares a request to retrieve the next set of results. +// customAssessmentAutomationsListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (dl DeviceList) deviceListPreparer(ctx context.Context) (*http.Request, error) { - if !dl.hasNextLink() { +func (caalr CustomAssessmentAutomationsListResult) customAssessmentAutomationsListResultPreparer(ctx context.Context) (*http.Request, error) { + if !caalr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(dl.NextLink))) + autorest.WithBaseURL(to.String(caalr.NextLink))) } -// DeviceListPage contains a page of Device values. -type DeviceListPage struct { - fn func(context.Context, DeviceList) (DeviceList, error) - dl DeviceList +// CustomAssessmentAutomationsListResultPage contains a page of CustomAssessmentAutomation values. +type CustomAssessmentAutomationsListResultPage struct { + fn func(context.Context, CustomAssessmentAutomationsListResult) (CustomAssessmentAutomationsListResult, error) + caalr CustomAssessmentAutomationsListResult } // 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 *DeviceListPage) NextWithContext(ctx context.Context) (err error) { +func (page *CustomAssessmentAutomationsListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DeviceListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/CustomAssessmentAutomationsListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -8154,11 +8924,11 @@ func (page *DeviceListPage) NextWithContext(ctx context.Context) (err error) { }() } for { - next, err := page.fn(ctx, page.dl) + next, err := page.fn(ctx, page.caalr) if err != nil { return err } - page.dl = next + page.caalr = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -8169,120 +8939,43 @@ func (page *DeviceListPage) NextWithContext(ctx context.Context) (err error) { // 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 *DeviceListPage) Next() error { +func (page *CustomAssessmentAutomationsListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DeviceListPage) NotDone() bool { - return !page.dl.IsEmpty() +func (page CustomAssessmentAutomationsListResultPage) NotDone() bool { + return !page.caalr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page DeviceListPage) Response() DeviceList { - return page.dl +func (page CustomAssessmentAutomationsListResultPage) Response() CustomAssessmentAutomationsListResult { + return page.caalr } // Values returns the slice of values for the current page or nil if there are no values. -func (page DeviceListPage) Values() []Device { - if page.dl.IsEmpty() { +func (page CustomAssessmentAutomationsListResultPage) Values() []CustomAssessmentAutomation { + if page.caalr.IsEmpty() { return nil } - return *page.dl.Value -} - -// Creates a new instance of the DeviceListPage type. -func NewDeviceListPage(cur DeviceList, getNextPage func(context.Context, DeviceList) (DeviceList, error)) DeviceListPage { - return DeviceListPage{ - fn: getNextPage, - dl: cur, - } + return *page.caalr.Value } -// DeviceProperties device Information -type DeviceProperties struct { - // DisplayName - Device display name given by the collector - DisplayName *string `json:"displayName,omitempty"` - // DeviceType - Device type. - DeviceType *string `json:"deviceType,omitempty"` - // SourceName - READ-ONLY; The source that created the device - SourceName *string `json:"sourceName,omitempty"` - // NetworkInterfaces - READ-ONLY; List of network interfaces. - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - // Vendor - READ-ONLY; Device vendor - Vendor *string `json:"vendor,omitempty"` - // OsName - Device operating system name. - OsName *string `json:"osName,omitempty"` - // Protocols - READ-ONLY; List of protocols. - Protocols *[]Protocol1 `json:"protocols,omitempty"` - // LastActiveTime - READ-ONLY; last time the device was active in the network - LastActiveTime *date.Time `json:"lastActiveTime,omitempty"` - // LastUpdateTime - READ-ONLY; last time the device was updated - LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` - // ManagementState - READ-ONLY; Managed state of the device. Possible values include: 'Managed', 'Unmanaged' - ManagementState ManagementState `json:"managementState,omitempty"` - // AuthorizationState - Authorized state of the device. Possible values include: 'Authorized', 'Unauthorized' - AuthorizationState AuthorizationState `json:"authorizationState,omitempty"` - // DeviceCriticality - Device criticality. Possible values include: 'Important', 'Standard' - DeviceCriticality DeviceCriticality `json:"deviceCriticality,omitempty"` - // PurdueLevel - Purdue level of the device. Possible values include: 'ProcessControl', 'Supervisory', 'Enterprise' - PurdueLevel PurdueLevel `json:"purdueLevel,omitempty"` - // Notes - user notes for the device, up to 300 characters. - Notes *string `json:"notes,omitempty"` - // Firmwares - READ-ONLY; List of device firmwares. - Firmwares *[]Firmware `json:"firmwares,omitempty"` - // DiscoveryTime - READ-ONLY; Discovered time of the device. - DiscoveryTime *date.Time `json:"discoveryTime,omitempty"` - // ProgrammingState - READ-ONLY; Indicates whether this device is programming. Possible values include: 'ProgrammingDevice', 'NotProgrammingDevice' - ProgrammingState ProgrammingState `json:"programmingState,omitempty"` - // LastProgrammingTime - READ-ONLY; last time the device was programming or programed. - LastProgrammingTime *date.Time `json:"lastProgrammingTime,omitempty"` - // ScanningFunctionality - READ-ONLY; Indicates whether the device is a scanner. Possible values include: 'ScannerDevice', 'NotScannerDevice' - ScanningFunctionality ScanningFunctionality `json:"scanningFunctionality,omitempty"` - // LastScanTime - READ-ONLY; last time the device was scanning. - LastScanTime *date.Time `json:"lastScanTime,omitempty"` - // RiskScore - READ-ONLY; risk score of the device. - RiskScore *int32 `json:"riskScore,omitempty"` - // Sensors - READ-ONLY; List of sensors that scanned this device. - Sensors *[]Sensor `json:"sensors,omitempty"` - // Site - READ-ONLY - Site *Site `json:"site,omitempty"` - // DeviceStatus - READ-ONLY; Device status. Possible values include: 'DeviceStatusActive', 'DeviceStatusRemoved' - DeviceStatus DeviceStatus `json:"deviceStatus,omitempty"` -} - -// MarshalJSON is the custom marshaler for DeviceProperties. -func (dp DeviceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dp.DisplayName != nil { - objectMap["displayName"] = dp.DisplayName - } - if dp.DeviceType != nil { - objectMap["deviceType"] = dp.DeviceType - } - if dp.OsName != nil { - objectMap["osName"] = dp.OsName - } - if dp.AuthorizationState != "" { - objectMap["authorizationState"] = dp.AuthorizationState - } - if dp.DeviceCriticality != "" { - objectMap["deviceCriticality"] = dp.DeviceCriticality - } - if dp.PurdueLevel != "" { - objectMap["purdueLevel"] = dp.PurdueLevel - } - if dp.Notes != nil { - objectMap["notes"] = dp.Notes +// Creates a new instance of the CustomAssessmentAutomationsListResultPage type. +func NewCustomAssessmentAutomationsListResultPage(cur CustomAssessmentAutomationsListResult, getNextPage func(context.Context, CustomAssessmentAutomationsListResult) (CustomAssessmentAutomationsListResult, error)) CustomAssessmentAutomationsListResultPage { + return CustomAssessmentAutomationsListResultPage{ + fn: getNextPage, + caalr: cur, } - return json.Marshal(objectMap) } -// DeviceSecurityGroup the device security group resource -type DeviceSecurityGroup struct { +// CustomEntityStoreAssignment custom entity store assignment +type CustomEntityStoreAssignment struct { autorest.Response `json:"-"` - // DeviceSecurityGroupProperties - Device Security group data - *DeviceSecurityGroupProperties `json:"properties,omitempty"` + // SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty"` + // CustomEntityStoreAssignmentProperties - describes custom entity store assignment properties. + *CustomEntityStoreAssignmentProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name @@ -8291,17 +8984,17 @@ type DeviceSecurityGroup struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for DeviceSecurityGroup. -func (dsg DeviceSecurityGroup) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for CustomEntityStoreAssignment. +func (cesa CustomEntityStoreAssignment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dsg.DeviceSecurityGroupProperties != nil { - objectMap["properties"] = dsg.DeviceSecurityGroupProperties + if cesa.CustomEntityStoreAssignmentProperties != nil { + objectMap["properties"] = cesa.CustomEntityStoreAssignmentProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for DeviceSecurityGroup struct. -func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for CustomEntityStoreAssignment struct. +func (cesa *CustomEntityStoreAssignment) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -8309,14 +9002,23 @@ func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + cesa.SystemData = &systemData + } case "properties": if v != nil { - var deviceSecurityGroupProperties DeviceSecurityGroupProperties - err = json.Unmarshal(*v, &deviceSecurityGroupProperties) + var customEntityStoreAssignmentProperties CustomEntityStoreAssignmentProperties + err = json.Unmarshal(*v, &customEntityStoreAssignmentProperties) if err != nil { return err } - dsg.DeviceSecurityGroupProperties = &deviceSecurityGroupProperties + cesa.CustomEntityStoreAssignmentProperties = &customEntityStoreAssignmentProperties } case "id": if v != nil { @@ -8325,7 +9027,7 @@ func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { if err != nil { return err } - dsg.ID = &ID + cesa.ID = &ID } case "name": if v != nil { @@ -8334,16 +9036,62 @@ func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { if err != nil { return err } - dsg.Name = &name + cesa.Name = &name } case "type": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cesa.Type = &typeVar + } + } + } + + return nil +} + +// CustomEntityStoreAssignmentProperties describes the custom entity store assignment properties +type CustomEntityStoreAssignmentProperties struct { + // Principal - The principal assigned with entity store. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId] + Principal *string `json:"principal,omitempty"` + // EntityStoreDatabaseLink - The link to entity store database. + EntityStoreDatabaseLink *string `json:"entityStoreDatabaseLink,omitempty"` +} + +// CustomEntityStoreAssignmentRequest describes the custom entity store assignment request +type CustomEntityStoreAssignmentRequest struct { + *CustomEntityStoreAssignmentRequestProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CustomEntityStoreAssignmentRequest. +func (cesar CustomEntityStoreAssignmentRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cesar.CustomEntityStoreAssignmentRequestProperties != nil { + objectMap["properties"] = cesar.CustomEntityStoreAssignmentRequestProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CustomEntityStoreAssignmentRequest struct. +func (cesar *CustomEntityStoreAssignmentRequest) 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 customEntityStoreAssignmentRequestProperties CustomEntityStoreAssignmentRequestProperties + err = json.Unmarshal(*v, &customEntityStoreAssignmentRequestProperties) if err != nil { return err } - dsg.Type = &typeVar + cesar.CustomEntityStoreAssignmentRequestProperties = &customEntityStoreAssignmentRequestProperties } } } @@ -8351,35 +9099,43 @@ func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { return nil } -// DeviceSecurityGroupList list of device security groups -type DeviceSecurityGroupList struct { +// CustomEntityStoreAssignmentRequestProperties describes properties of custom entity store assignment +// request +type CustomEntityStoreAssignmentRequestProperties struct { + // Principal - The principal assigned with entity store. If not provided, will use caller principal. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId] + Principal *string `json:"principal,omitempty"` +} + +// CustomEntityStoreAssignmentsListResult a list of custom entity store assignments +type CustomEntityStoreAssignmentsListResult struct { autorest.Response `json:"-"` - // Value - List of device security group objects - Value *[]DeviceSecurityGroup `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. + // Value - READ-ONLY; Collection of custom entity store assignments + Value *[]CustomEntityStoreAssignment `json:"value,omitempty"` + // NextLink - The link used to get the next page of operations. NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for DeviceSecurityGroupList. -func (dsgl DeviceSecurityGroupList) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for CustomEntityStoreAssignmentsListResult. +func (cesalr CustomEntityStoreAssignmentsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dsgl.Value != nil { - objectMap["value"] = dsgl.Value + if cesalr.NextLink != nil { + objectMap["nextLink"] = cesalr.NextLink } return json.Marshal(objectMap) } -// DeviceSecurityGroupListIterator provides access to a complete listing of DeviceSecurityGroup values. -type DeviceSecurityGroupListIterator struct { +// CustomEntityStoreAssignmentsListResultIterator provides access to a complete listing of +// CustomEntityStoreAssignment values. +type CustomEntityStoreAssignmentsListResultIterator struct { i int - page DeviceSecurityGroupListPage + page CustomEntityStoreAssignmentsListResultPage } // 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 *DeviceSecurityGroupListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *CustomEntityStoreAssignmentsListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -8404,67 +9160,67 @@ func (iter *DeviceSecurityGroupListIterator) NextWithContext(ctx context.Context // 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 *DeviceSecurityGroupListIterator) Next() error { +func (iter *CustomEntityStoreAssignmentsListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DeviceSecurityGroupListIterator) NotDone() bool { +func (iter CustomEntityStoreAssignmentsListResultIterator) 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 DeviceSecurityGroupListIterator) Response() DeviceSecurityGroupList { +func (iter CustomEntityStoreAssignmentsListResultIterator) Response() CustomEntityStoreAssignmentsListResult { 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 DeviceSecurityGroupListIterator) Value() DeviceSecurityGroup { +func (iter CustomEntityStoreAssignmentsListResultIterator) Value() CustomEntityStoreAssignment { if !iter.page.NotDone() { - return DeviceSecurityGroup{} + return CustomEntityStoreAssignment{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the DeviceSecurityGroupListIterator type. -func NewDeviceSecurityGroupListIterator(page DeviceSecurityGroupListPage) DeviceSecurityGroupListIterator { - return DeviceSecurityGroupListIterator{page: page} +// Creates a new instance of the CustomEntityStoreAssignmentsListResultIterator type. +func NewCustomEntityStoreAssignmentsListResultIterator(page CustomEntityStoreAssignmentsListResultPage) CustomEntityStoreAssignmentsListResultIterator { + return CustomEntityStoreAssignmentsListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (dsgl DeviceSecurityGroupList) IsEmpty() bool { - return dsgl.Value == nil || len(*dsgl.Value) == 0 +func (cesalr CustomEntityStoreAssignmentsListResult) IsEmpty() bool { + return cesalr.Value == nil || len(*cesalr.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (dsgl DeviceSecurityGroupList) hasNextLink() bool { - return dsgl.NextLink != nil && len(*dsgl.NextLink) != 0 +func (cesalr CustomEntityStoreAssignmentsListResult) hasNextLink() bool { + return cesalr.NextLink != nil && len(*cesalr.NextLink) != 0 } -// deviceSecurityGroupListPreparer prepares a request to retrieve the next set of results. +// customEntityStoreAssignmentsListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (dsgl DeviceSecurityGroupList) deviceSecurityGroupListPreparer(ctx context.Context) (*http.Request, error) { - if !dsgl.hasNextLink() { +func (cesalr CustomEntityStoreAssignmentsListResult) customEntityStoreAssignmentsListResultPreparer(ctx context.Context) (*http.Request, error) { + if !cesalr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(dsgl.NextLink))) + autorest.WithBaseURL(to.String(cesalr.NextLink))) } -// DeviceSecurityGroupListPage contains a page of DeviceSecurityGroup values. -type DeviceSecurityGroupListPage struct { - fn func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error) - dsgl DeviceSecurityGroupList +// CustomEntityStoreAssignmentsListResultPage contains a page of CustomEntityStoreAssignment values. +type CustomEntityStoreAssignmentsListResultPage struct { + fn func(context.Context, CustomEntityStoreAssignmentsListResult) (CustomEntityStoreAssignmentsListResult, error) + cesalr CustomEntityStoreAssignmentsListResult } // 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 *DeviceSecurityGroupListPage) NextWithContext(ctx context.Context) (err error) { +func (page *CustomEntityStoreAssignmentsListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/CustomEntityStoreAssignmentsListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -8474,11 +9230,11 @@ func (page *DeviceSecurityGroupListPage) NextWithContext(ctx context.Context) (e }() } for { - next, err := page.fn(ctx, page.dsgl) + next, err := page.fn(ctx, page.cesalr) if err != nil { return err } - page.dsgl = next + page.cesalr = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -8489,50 +9245,117 @@ func (page *DeviceSecurityGroupListPage) NextWithContext(ctx context.Context) (e // 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 *DeviceSecurityGroupListPage) Next() error { +func (page *CustomEntityStoreAssignmentsListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DeviceSecurityGroupListPage) NotDone() bool { - return !page.dsgl.IsEmpty() +func (page CustomEntityStoreAssignmentsListResultPage) NotDone() bool { + return !page.cesalr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page DeviceSecurityGroupListPage) Response() DeviceSecurityGroupList { - return page.dsgl +func (page CustomEntityStoreAssignmentsListResultPage) Response() CustomEntityStoreAssignmentsListResult { + return page.cesalr } // Values returns the slice of values for the current page or nil if there are no values. -func (page DeviceSecurityGroupListPage) Values() []DeviceSecurityGroup { - if page.dsgl.IsEmpty() { +func (page CustomEntityStoreAssignmentsListResultPage) Values() []CustomEntityStoreAssignment { + if page.cesalr.IsEmpty() { return nil } - return *page.dsgl.Value + return *page.cesalr.Value } -// Creates a new instance of the DeviceSecurityGroupListPage type. -func NewDeviceSecurityGroupListPage(cur DeviceSecurityGroupList, getNextPage func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error)) DeviceSecurityGroupListPage { - return DeviceSecurityGroupListPage{ - fn: getNextPage, - dsgl: cur, +// Creates a new instance of the CustomEntityStoreAssignmentsListResultPage type. +func NewCustomEntityStoreAssignmentsListResultPage(cur CustomEntityStoreAssignmentsListResult, getNextPage func(context.Context, CustomEntityStoreAssignmentsListResult) (CustomEntityStoreAssignmentsListResult, error)) CustomEntityStoreAssignmentsListResultPage { + return CustomEntityStoreAssignmentsListResultPage{ + fn: getNextPage, + cesalr: cur, } } -// DeviceSecurityGroupProperties describes properties of a security group. -type DeviceSecurityGroupProperties struct { - // ThresholdRules - The list of custom alert threshold rules. - ThresholdRules *[]BasicThresholdCustomAlertRule `json:"thresholdRules,omitempty"` - // TimeWindowRules - The list of custom alert time-window rules. - TimeWindowRules *[]BasicTimeWindowCustomAlertRule `json:"timeWindowRules,omitempty"` - // AllowlistRules - The allow-list custom alert rules. - AllowlistRules *[]BasicAllowlistCustomAlertRule `json:"allowlistRules,omitempty"` - // DenylistRules - The deny-list custom alert rules. - DenylistRules *[]DenylistCustomAlertRule `json:"denylistRules,omitempty"` +// CVE CVE details +type CVE struct { + // Title - READ-ONLY; CVE title + Title *string `json:"title,omitempty"` + // Link - READ-ONLY; Link url + Link *string `json:"link,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for DeviceSecurityGroupProperties struct. -func (dsgp *DeviceSecurityGroupProperties) UnmarshalJSON(body []byte) error { +// MarshalJSON is the custom marshaler for CVE. +func (c CVE) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CVSS CVSS details +type CVSS struct { + // Base - READ-ONLY; CVSS base + Base *float64 `json:"base,omitempty"` +} + +// MarshalJSON is the custom marshaler for CVSS. +func (c CVSS) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DataExportSettingProperties the data export setting properties +type DataExportSettingProperties struct { + // Enabled - Is the data export setting enabled + Enabled *bool `json:"enabled,omitempty"` +} + +// DataExportSettings represents a data export setting +type DataExportSettings struct { + // DataExportSettingProperties - Data export setting data + *DataExportSettingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindSetting', 'KindDataExportSettings', 'KindAlertSyncSettings' + Kind KindEnum2 `json:"kind,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 DataExportSettings. +func (desVar DataExportSettings) MarshalJSON() ([]byte, error) { + desVar.Kind = KindDataExportSettings + objectMap := make(map[string]interface{}) + if desVar.DataExportSettingProperties != nil { + objectMap["properties"] = desVar.DataExportSettingProperties + } + if desVar.Kind != "" { + objectMap["kind"] = desVar.Kind + } + return json.Marshal(objectMap) +} + +// AsDataExportSettings is the BasicSetting implementation for DataExportSettings. +func (desVar DataExportSettings) AsDataExportSettings() (*DataExportSettings, bool) { + return &desVar, true +} + +// AsAlertSyncSettings is the BasicSetting implementation for DataExportSettings. +func (desVar DataExportSettings) AsAlertSyncSettings() (*AlertSyncSettings, bool) { + return nil, false +} + +// AsSetting is the BasicSetting implementation for DataExportSettings. +func (desVar DataExportSettings) AsSetting() (*Setting, bool) { + return nil, false +} + +// AsBasicSetting is the BasicSetting implementation for DataExportSettings. +func (desVar DataExportSettings) AsBasicSetting() (BasicSetting, bool) { + return &desVar, true +} + +// UnmarshalJSON is the custom unmarshaler for DataExportSettings struct. +func (desVar *DataExportSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -8540,53 +9363,239 @@ func (dsgp *DeviceSecurityGroupProperties) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "thresholdRules": + case "properties": if v != nil { - thresholdRules, err := unmarshalBasicThresholdCustomAlertRuleArray(*v) + var dataExportSettingProperties DataExportSettingProperties + err = json.Unmarshal(*v, &dataExportSettingProperties) if err != nil { return err } - dsgp.ThresholdRules = &thresholdRules + desVar.DataExportSettingProperties = &dataExportSettingProperties } - case "timeWindowRules": + case "kind": if v != nil { - timeWindowRules, err := unmarshalBasicTimeWindowCustomAlertRuleArray(*v) + var kind KindEnum2 + err = json.Unmarshal(*v, &kind) if err != nil { return err } - dsgp.TimeWindowRules = &timeWindowRules + desVar.Kind = kind } - case "allowlistRules": + case "id": if v != nil { - allowlistRules, err := unmarshalBasicAllowlistCustomAlertRuleArray(*v) + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - dsgp.AllowlistRules = &allowlistRules + desVar.ID = &ID } - case "denylistRules": + case "name": if v != nil { - var denylistRules []DenylistCustomAlertRule - err = json.Unmarshal(*v, &denylistRules) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - dsgp.DenylistRules = &denylistRules + desVar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + desVar.Type = &typeVar } } } - return nil + return nil +} + +// DefenderForContainersAwsOffering the Defender for Containers AWS offering configurations +type DefenderForContainersAwsOffering struct { + // KubernetesService - The kubernetes service connection configuration + KubernetesService *DefenderForContainersAwsOfferingKubernetesService `json:"kubernetesService,omitempty"` + // KubernetesScubaReader - The kubernetes to scuba connection configuration + KubernetesScubaReader *DefenderForContainersAwsOfferingKubernetesScubaReader `json:"kubernetesScubaReader,omitempty"` + // CloudWatchToKinesis - The cloudwatch to kinesis connection configuration + CloudWatchToKinesis *DefenderForContainersAwsOfferingCloudWatchToKinesis `json:"cloudWatchToKinesis,omitempty"` + // KinesisToS3 - The kinesis to s3 connection configuration + KinesisToS3 *DefenderForContainersAwsOfferingKinesisToS3 `json:"kinesisToS3,omitempty"` + // Description - READ-ONLY; The offering description. + Description *string `json:"description,omitempty"` + // OfferingType - Possible values include: 'OfferingTypeCloudOffering', 'OfferingTypeCspmMonitorAws', 'OfferingTypeDefenderForContainersAws', 'OfferingTypeDefenderForServersAws', 'OfferingTypeInformationProtectionAws' + OfferingType OfferingType `json:"offeringType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) MarshalJSON() ([]byte, error) { + dfcao.OfferingType = OfferingTypeDefenderForContainersAws + objectMap := make(map[string]interface{}) + if dfcao.KubernetesService != nil { + objectMap["kubernetesService"] = dfcao.KubernetesService + } + if dfcao.KubernetesScubaReader != nil { + objectMap["kubernetesScubaReader"] = dfcao.KubernetesScubaReader + } + if dfcao.CloudWatchToKinesis != nil { + objectMap["cloudWatchToKinesis"] = dfcao.CloudWatchToKinesis + } + if dfcao.KinesisToS3 != nil { + objectMap["kinesisToS3"] = dfcao.KinesisToS3 + } + if dfcao.OfferingType != "" { + objectMap["offeringType"] = dfcao.OfferingType + } + return json.Marshal(objectMap) +} + +// AsCspmMonitorAwsOffering is the BasicCloudOffering implementation for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) { + return nil, false +} + +// AsDefenderForContainersAwsOffering is the BasicCloudOffering implementation for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) { + return &dfcao, true +} + +// AsDefenderForServersAwsOffering is the BasicCloudOffering implementation for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) { + return nil, false +} + +// AsInformationProtectionAwsOffering is the BasicCloudOffering implementation for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) { + return nil, false +} + +// AsCloudOffering is the BasicCloudOffering implementation for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) AsCloudOffering() (*CloudOffering, bool) { + return nil, false +} + +// AsBasicCloudOffering is the BasicCloudOffering implementation for DefenderForContainersAwsOffering. +func (dfcao DefenderForContainersAwsOffering) AsBasicCloudOffering() (BasicCloudOffering, bool) { + return &dfcao, true +} + +// DefenderForContainersAwsOfferingCloudWatchToKinesis the cloudwatch to kinesis connection configuration +type DefenderForContainersAwsOfferingCloudWatchToKinesis struct { + // CloudRoleArn - The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` +} + +// DefenderForContainersAwsOfferingKinesisToS3 the kinesis to s3 connection configuration +type DefenderForContainersAwsOfferingKinesisToS3 struct { + // CloudRoleArn - The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` +} + +// DefenderForContainersAwsOfferingKubernetesScubaReader the kubernetes to scuba connection configuration +type DefenderForContainersAwsOfferingKubernetesScubaReader struct { + // CloudRoleArn - The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` +} + +// DefenderForContainersAwsOfferingKubernetesService the kubernetes service connection configuration +type DefenderForContainersAwsOfferingKubernetesService struct { + // CloudRoleArn - The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` +} + +// DefenderForServersAwsOffering the Defender for Servers AWS offering configurations +type DefenderForServersAwsOffering struct { + // DefenderForServers - The Defender for servers connection configuration + DefenderForServers *DefenderForServersAwsOfferingDefenderForServers `json:"defenderForServers,omitempty"` + // ArcAutoProvisioning - The ARC autoprovisioning configuration + ArcAutoProvisioning *DefenderForServersAwsOfferingArcAutoProvisioning `json:"arcAutoProvisioning,omitempty"` + // Description - READ-ONLY; The offering description. + Description *string `json:"description,omitempty"` + // OfferingType - Possible values include: 'OfferingTypeCloudOffering', 'OfferingTypeCspmMonitorAws', 'OfferingTypeDefenderForContainersAws', 'OfferingTypeDefenderForServersAws', 'OfferingTypeInformationProtectionAws' + OfferingType OfferingType `json:"offeringType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) MarshalJSON() ([]byte, error) { + dfsao.OfferingType = OfferingTypeDefenderForServersAws + objectMap := make(map[string]interface{}) + if dfsao.DefenderForServers != nil { + objectMap["defenderForServers"] = dfsao.DefenderForServers + } + if dfsao.ArcAutoProvisioning != nil { + objectMap["arcAutoProvisioning"] = dfsao.ArcAutoProvisioning + } + if dfsao.OfferingType != "" { + objectMap["offeringType"] = dfsao.OfferingType + } + return json.Marshal(objectMap) +} + +// AsCspmMonitorAwsOffering is the BasicCloudOffering implementation for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) { + return nil, false +} + +// AsDefenderForContainersAwsOffering is the BasicCloudOffering implementation for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) { + return nil, false +} + +// AsDefenderForServersAwsOffering is the BasicCloudOffering implementation for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) { + return &dfsao, true +} + +// AsInformationProtectionAwsOffering is the BasicCloudOffering implementation for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) { + return nil, false +} + +// AsCloudOffering is the BasicCloudOffering implementation for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) AsCloudOffering() (*CloudOffering, bool) { + return nil, false +} + +// AsBasicCloudOffering is the BasicCloudOffering implementation for DefenderForServersAwsOffering. +func (dfsao DefenderForServersAwsOffering) AsBasicCloudOffering() (BasicCloudOffering, bool) { + return &dfsao, true +} + +// DefenderForServersAwsOfferingArcAutoProvisioning the ARC autoprovisioning configuration +type DefenderForServersAwsOfferingArcAutoProvisioning struct { + // Enabled - Is arc auto provisioning enabled + Enabled *bool `json:"enabled,omitempty"` + // ServicePrincipalSecretMetadata - Metadata of Service Principal secret for autoprovisioning + ServicePrincipalSecretMetadata *DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata `json:"servicePrincipalSecretMetadata,omitempty"` +} + +// DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata metadata of Service +// Principal secret for autoprovisioning +type DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata struct { + // ExpiryDate - expiration date of service principal secret + ExpiryDate *string `json:"expiryDate,omitempty"` + // ParameterStoreRegion - region of parameter store where secret is kept + ParameterStoreRegion *string `json:"parameterStoreRegion,omitempty"` + // ParameterNameInStore - name of secret resource in parameter store + ParameterNameInStore *string `json:"parameterNameInStore,omitempty"` } -// DirectMethodInvokesNotInAllowedRange number of direct method invokes is not in allowed range. -type DirectMethodInvokesNotInAllowedRange struct { - // TimeWindowSize - The time window size in iso8601 format. - TimeWindowSize *string `json:"timeWindowSize,omitempty"` - // MinThreshold - The minimum threshold. - MinThreshold *int32 `json:"minThreshold,omitempty"` - // MaxThreshold - The maximum threshold. - MaxThreshold *int32 `json:"maxThreshold,omitempty"` +// DefenderForServersAwsOfferingDefenderForServers the Defender for servers connection configuration +type DefenderForServersAwsOfferingDefenderForServers struct { + // CloudRoleArn - The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` +} + +// DenylistCustomAlertRule a custom alert rule that checks if a value (depends on the custom alert type) is +// denied. +type DenylistCustomAlertRule struct { + // DenylistValues - The values to deny. The format of the values depends on the rule type. + DenylistValues *[]string `json:"denylistValues,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. @@ -8597,208 +9606,201 @@ type DirectMethodInvokesNotInAllowedRange struct { RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } -// MarshalJSON is the custom marshaler for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) MarshalJSON() ([]byte, error) { - dminiar.RuleType = RuleTypeDirectMethodInvokesNotInAllowedRange +// MarshalJSON is the custom marshaler for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) MarshalJSON() ([]byte, error) { + dcar.RuleType = RuleTypeDenylistCustomAlertRule objectMap := make(map[string]interface{}) - if dminiar.TimeWindowSize != nil { - objectMap["timeWindowSize"] = dminiar.TimeWindowSize - } - if dminiar.MinThreshold != nil { - objectMap["minThreshold"] = dminiar.MinThreshold - } - if dminiar.MaxThreshold != nil { - objectMap["maxThreshold"] = dminiar.MaxThreshold + if dcar.DenylistValues != nil { + objectMap["denylistValues"] = dcar.DenylistValues } - if dminiar.IsEnabled != nil { - objectMap["isEnabled"] = dminiar.IsEnabled + if dcar.IsEnabled != nil { + objectMap["isEnabled"] = dcar.IsEnabled } - if dminiar.RuleType != "" { - objectMap["ruleType"] = dminiar.RuleType + if dcar.RuleType != "" { + objectMap["ruleType"] = dcar.RuleType } return json.Marshal(objectMap) } -// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { return nil, false } -// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { - return &dminiar, true +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return nil, false } -// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { return nil, false } -// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { - return &dminiar, true +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return nil, false } -// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { return nil, false } -// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { return nil, false } -// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { - return nil, false +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return &dcar, true } -// AsListCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { return nil, false } -// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { - return nil, false +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return &dcar, true } -// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { return nil, false } -// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { return nil, false } -// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false } -// AsProcessNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { return nil, false } -// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { return nil, false } -// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { return nil, false } -// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { return nil, false } -// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { return nil, false } -// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { return nil, false } -// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { return nil, false } -// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { return nil, false } -// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { return nil, false } -// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { return nil, false } -// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { return nil, false } -// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { - return &dminiar, true +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false } -// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { return nil, false } -// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { return nil, false } -// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { return nil, false } -// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { return nil, false } -// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { return nil, false } -// AsCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { +// AsCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsCustomAlertRule() (*CustomAlertRule, bool) { return nil, false } -// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. -func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { - return &dminiar, true +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &dcar, true } -// DiscoveredSecuritySolution ... -type DiscoveredSecuritySolution struct { +// DeviceSecurityGroup the device security group resource +type DeviceSecurityGroup struct { autorest.Response `json:"-"` + // DeviceSecurityGroupProperties - Device Security group data + *DeviceSecurityGroupProperties `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"` - // Location - READ-ONLY; Location where the resource is stored - Location *string `json:"location,omitempty"` - *DiscoveredSecuritySolutionProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for DiscoveredSecuritySolution. -func (dss DiscoveredSecuritySolution) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for DeviceSecurityGroup. +func (dsg DeviceSecurityGroup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dss.DiscoveredSecuritySolutionProperties != nil { - objectMap["properties"] = dss.DiscoveredSecuritySolutionProperties + if dsg.DeviceSecurityGroupProperties != nil { + objectMap["properties"] = dsg.DeviceSecurityGroupProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for DiscoveredSecuritySolution struct. -func (dss *DiscoveredSecuritySolution) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for DeviceSecurityGroup struct. +func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -8806,6 +9808,15 @@ func (dss *DiscoveredSecuritySolution) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "properties": + if v != nil { + var deviceSecurityGroupProperties DeviceSecurityGroupProperties + err = json.Unmarshal(*v, &deviceSecurityGroupProperties) + if err != nil { + return err + } + dsg.DeviceSecurityGroupProperties = &deviceSecurityGroupProperties + } case "id": if v != nil { var ID string @@ -8813,7 +9824,7 @@ func (dss *DiscoveredSecuritySolution) UnmarshalJSON(body []byte) error { if err != nil { return err } - dss.ID = &ID + dsg.ID = &ID } case "name": if v != nil { @@ -8822,7 +9833,7 @@ func (dss *DiscoveredSecuritySolution) UnmarshalJSON(body []byte) error { if err != nil { return err } - dss.Name = &name + dsg.Name = &name } case "type": if v != nil { @@ -8831,25 +9842,7 @@ func (dss *DiscoveredSecuritySolution) UnmarshalJSON(body []byte) error { if err != nil { return err } - dss.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dss.Location = &location - } - case "properties": - if v != nil { - var discoveredSecuritySolutionProperties DiscoveredSecuritySolutionProperties - err = json.Unmarshal(*v, &discoveredSecuritySolutionProperties) - if err != nil { - return err - } - dss.DiscoveredSecuritySolutionProperties = &discoveredSecuritySolutionProperties + dsg.Type = &typeVar } } } @@ -8857,35 +9850,35 @@ func (dss *DiscoveredSecuritySolution) UnmarshalJSON(body []byte) error { return nil } -// DiscoveredSecuritySolutionList ... -type DiscoveredSecuritySolutionList struct { +// DeviceSecurityGroupList list of device security groups +type DeviceSecurityGroupList struct { autorest.Response `json:"-"` - Value *[]DiscoveredSecuritySolution `json:"value,omitempty"` + // Value - List of device security group objects + Value *[]DeviceSecurityGroup `json:"value,omitempty"` // NextLink - READ-ONLY; The URI to fetch the next page. NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for DiscoveredSecuritySolutionList. -func (dssl DiscoveredSecuritySolutionList) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for DeviceSecurityGroupList. +func (dsgl DeviceSecurityGroupList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dssl.Value != nil { - objectMap["value"] = dssl.Value + if dsgl.Value != nil { + objectMap["value"] = dsgl.Value } return json.Marshal(objectMap) } -// DiscoveredSecuritySolutionListIterator provides access to a complete listing of -// DiscoveredSecuritySolution values. -type DiscoveredSecuritySolutionListIterator struct { +// DeviceSecurityGroupListIterator provides access to a complete listing of DeviceSecurityGroup values. +type DeviceSecurityGroupListIterator struct { i int - page DiscoveredSecuritySolutionListPage + page DeviceSecurityGroupListPage } // 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 *DiscoveredSecuritySolutionListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *DeviceSecurityGroupListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -8910,67 +9903,67 @@ func (iter *DiscoveredSecuritySolutionListIterator) NextWithContext(ctx context. // 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 *DiscoveredSecuritySolutionListIterator) Next() error { +func (iter *DeviceSecurityGroupListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DiscoveredSecuritySolutionListIterator) NotDone() bool { +func (iter DeviceSecurityGroupListIterator) 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 DiscoveredSecuritySolutionListIterator) Response() DiscoveredSecuritySolutionList { +func (iter DeviceSecurityGroupListIterator) Response() DeviceSecurityGroupList { 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 DiscoveredSecuritySolutionListIterator) Value() DiscoveredSecuritySolution { +func (iter DeviceSecurityGroupListIterator) Value() DeviceSecurityGroup { if !iter.page.NotDone() { - return DiscoveredSecuritySolution{} + return DeviceSecurityGroup{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the DiscoveredSecuritySolutionListIterator type. -func NewDiscoveredSecuritySolutionListIterator(page DiscoveredSecuritySolutionListPage) DiscoveredSecuritySolutionListIterator { - return DiscoveredSecuritySolutionListIterator{page: page} +// Creates a new instance of the DeviceSecurityGroupListIterator type. +func NewDeviceSecurityGroupListIterator(page DeviceSecurityGroupListPage) DeviceSecurityGroupListIterator { + return DeviceSecurityGroupListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (dssl DiscoveredSecuritySolutionList) IsEmpty() bool { - return dssl.Value == nil || len(*dssl.Value) == 0 +func (dsgl DeviceSecurityGroupList) IsEmpty() bool { + return dsgl.Value == nil || len(*dsgl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (dssl DiscoveredSecuritySolutionList) hasNextLink() bool { - return dssl.NextLink != nil && len(*dssl.NextLink) != 0 +func (dsgl DeviceSecurityGroupList) hasNextLink() bool { + return dsgl.NextLink != nil && len(*dsgl.NextLink) != 0 } -// discoveredSecuritySolutionListPreparer prepares a request to retrieve the next set of results. +// deviceSecurityGroupListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (dssl DiscoveredSecuritySolutionList) discoveredSecuritySolutionListPreparer(ctx context.Context) (*http.Request, error) { - if !dssl.hasNextLink() { +func (dsgl DeviceSecurityGroupList) deviceSecurityGroupListPreparer(ctx context.Context) (*http.Request, error) { + if !dsgl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(dssl.NextLink))) + autorest.WithBaseURL(to.String(dsgl.NextLink))) } -// DiscoveredSecuritySolutionListPage contains a page of DiscoveredSecuritySolution values. -type DiscoveredSecuritySolutionListPage struct { - fn func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error) - dssl DiscoveredSecuritySolutionList +// DeviceSecurityGroupListPage contains a page of DeviceSecurityGroup values. +type DeviceSecurityGroupListPage struct { + fn func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error) + dsgl DeviceSecurityGroupList } // 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 *DiscoveredSecuritySolutionListPage) NextWithContext(ctx context.Context) (err error) { +func (page *DeviceSecurityGroupListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -8980,11 +9973,11 @@ func (page *DiscoveredSecuritySolutionListPage) NextWithContext(ctx context.Cont }() } for { - next, err := page.fn(ctx, page.dssl) + next, err := page.fn(ctx, page.dsgl) if err != nil { return err } - page.dssl = next + page.dsgl = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -8995,433 +9988,316 @@ func (page *DiscoveredSecuritySolutionListPage) NextWithContext(ctx context.Cont // 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 *DiscoveredSecuritySolutionListPage) Next() error { +func (page *DeviceSecurityGroupListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DiscoveredSecuritySolutionListPage) NotDone() bool { - return !page.dssl.IsEmpty() +func (page DeviceSecurityGroupListPage) NotDone() bool { + return !page.dsgl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page DiscoveredSecuritySolutionListPage) Response() DiscoveredSecuritySolutionList { - return page.dssl +func (page DeviceSecurityGroupListPage) Response() DeviceSecurityGroupList { + return page.dsgl } // Values returns the slice of values for the current page or nil if there are no values. -func (page DiscoveredSecuritySolutionListPage) Values() []DiscoveredSecuritySolution { - if page.dssl.IsEmpty() { +func (page DeviceSecurityGroupListPage) Values() []DeviceSecurityGroup { + if page.dsgl.IsEmpty() { return nil } - return *page.dssl.Value + return *page.dsgl.Value } -// Creates a new instance of the DiscoveredSecuritySolutionListPage type. -func NewDiscoveredSecuritySolutionListPage(cur DiscoveredSecuritySolutionList, getNextPage func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error)) DiscoveredSecuritySolutionListPage { - return DiscoveredSecuritySolutionListPage{ +// Creates a new instance of the DeviceSecurityGroupListPage type. +func NewDeviceSecurityGroupListPage(cur DeviceSecurityGroupList, getNextPage func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error)) DeviceSecurityGroupListPage { + return DeviceSecurityGroupListPage{ fn: getNextPage, - dssl: cur, + dsgl: cur, } } -// DiscoveredSecuritySolutionProperties ... -type DiscoveredSecuritySolutionProperties struct { - // SecurityFamily - The security family of the discovered solution. Possible values include: 'Waf', 'Ngfw', 'SaasWaf', 'Va' - SecurityFamily Family `json:"securityFamily,omitempty"` - // Offer - The security solutions' image offer - Offer *string `json:"offer,omitempty"` - // Publisher - The security solutions' image publisher - Publisher *string `json:"publisher,omitempty"` - // Sku - The security solutions' image sku - Sku *string `json:"sku,omitempty"` -} - -// EffectiveNetworkSecurityGroups describes the Network Security Groups effective on a network interface -type EffectiveNetworkSecurityGroups struct { - // NetworkInterface - The Azure resource ID of the network interface - NetworkInterface *string `json:"networkInterface,omitempty"` - // NetworkSecurityGroups - The Network Security Groups effective on the network interface - 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. - Etag *string `json:"etag,omitempty"` -} - -// BasicExternalSecuritySolution represents a security solution external to Azure Security Center which sends -// information to an OMS workspace and whose data is displayed by Azure Security Center. -type BasicExternalSecuritySolution interface { - AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) - AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) - AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) - AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) -} - -// ExternalSecuritySolution represents a security solution external to Azure Security Center which sends -// information to an OMS workspace and whose data is displayed by Azure Security Center. -type ExternalSecuritySolution struct { - autorest.Response `json:"-"` - // 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"` - // Location - READ-ONLY; Location where the resource is stored - Location *string `json:"location,omitempty"` - // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' - Kind KindEnum `json:"kind,omitempty"` +// DeviceSecurityGroupProperties describes properties of a security group. +type DeviceSecurityGroupProperties struct { + // ThresholdRules - The list of custom alert threshold rules. + ThresholdRules *[]BasicThresholdCustomAlertRule `json:"thresholdRules,omitempty"` + // TimeWindowRules - The list of custom alert time-window rules. + TimeWindowRules *[]BasicTimeWindowCustomAlertRule `json:"timeWindowRules,omitempty"` + // AllowlistRules - The allow-list custom alert rules. + AllowlistRules *[]BasicAllowlistCustomAlertRule `json:"allowlistRules,omitempty"` + // DenylistRules - The deny-list custom alert rules. + DenylistRules *[]DenylistCustomAlertRule `json:"denylistRules,omitempty"` } -func unmarshalBasicExternalSecuritySolution(body []byte) (BasicExternalSecuritySolution, error) { - var m map[string]interface{} +// UnmarshalJSON is the custom unmarshaler for DeviceSecurityGroupProperties struct. +func (dsgp *DeviceSecurityGroupProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { - return nil, err - } - - switch m["kind"] { - case string(KindCEF): - var cess CefExternalSecuritySolution - err := json.Unmarshal(body, &cess) - return cess, err - case string(KindATA): - var aess AtaExternalSecuritySolution - err := json.Unmarshal(body, &aess) - return aess, err - case string(KindAAD): - var aess AadExternalSecuritySolution - err := json.Unmarshal(body, &aess) - return aess, err - default: - var ess ExternalSecuritySolution - err := json.Unmarshal(body, &ess) - return ess, err + return err } -} -func unmarshalBasicExternalSecuritySolutionArray(body []byte) ([]BasicExternalSecuritySolution, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err + for k, v := range m { + switch k { + case "thresholdRules": + if v != nil { + thresholdRules, err := unmarshalBasicThresholdCustomAlertRuleArray(*v) + if err != nil { + return err + } + dsgp.ThresholdRules = &thresholdRules + } + case "timeWindowRules": + if v != nil { + timeWindowRules, err := unmarshalBasicTimeWindowCustomAlertRuleArray(*v) + if err != nil { + return err + } + dsgp.TimeWindowRules = &timeWindowRules + } + case "allowlistRules": + if v != nil { + allowlistRules, err := unmarshalBasicAllowlistCustomAlertRuleArray(*v) + if err != nil { + return err + } + dsgp.AllowlistRules = &allowlistRules + } + case "denylistRules": + if v != nil { + var denylistRules []DenylistCustomAlertRule + err = json.Unmarshal(*v, &denylistRules) + if err != nil { + return err + } + dsgp.DenylistRules = &denylistRules + } + } } - essArray := make([]BasicExternalSecuritySolution, len(rawMessages)) + return nil +} - for index, rawMessage := range rawMessages { - ess, err := unmarshalBasicExternalSecuritySolution(*rawMessage) - if err != nil { - return nil, err - } - essArray[index] = ess - } - return essArray, nil +// DirectMethodInvokesNotInAllowedRange number of direct method invokes is not in allowed range. +type DirectMethodInvokesNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,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 ExternalSecuritySolution. -func (ess ExternalSecuritySolution) MarshalJSON() ([]byte, error) { - ess.Kind = KindExternalSecuritySolution +// MarshalJSON is the custom marshaler for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) MarshalJSON() ([]byte, error) { + dminiar.RuleType = RuleTypeDirectMethodInvokesNotInAllowedRange objectMap := make(map[string]interface{}) - if ess.Kind != "" { - objectMap["kind"] = ess.Kind + if dminiar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = dminiar.TimeWindowSize + } + if dminiar.MinThreshold != nil { + objectMap["minThreshold"] = dminiar.MinThreshold + } + if dminiar.MaxThreshold != nil { + objectMap["maxThreshold"] = dminiar.MaxThreshold + } + if dminiar.IsEnabled != nil { + objectMap["isEnabled"] = dminiar.IsEnabled + } + if dminiar.RuleType != "" { + objectMap["ruleType"] = dminiar.RuleType } return json.Marshal(objectMap) } -// AsCefExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. -func (ess ExternalSecuritySolution) AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) { +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { return nil, false } -// AsAtaExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. -func (ess ExternalSecuritySolution) AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) { - return nil, false +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &dminiar, true } -// AsAadExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. -func (ess ExternalSecuritySolution) AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) { +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { return nil, false } -// AsExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. -func (ess ExternalSecuritySolution) AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) { - return &ess, true +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &dminiar, true } -// AsBasicExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. -func (ess ExternalSecuritySolution) AsBasicExternalSecuritySolution() (BasicExternalSecuritySolution, bool) { - return &ess, true +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false } -// ExternalSecuritySolutionKind1 describes an Azure resource with kind -type ExternalSecuritySolutionKind1 struct { - // Kind - The kind of the external solution. Possible values include: 'CEF', 'ATA', 'AAD' - Kind ExternalSecuritySolutionKind `json:"kind,omitempty"` +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false } -// ExternalSecuritySolutionList ... -type ExternalSecuritySolutionList struct { - autorest.Response `json:"-"` - Value *[]BasicExternalSecuritySolution `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for ExternalSecuritySolutionList. -func (essl ExternalSecuritySolutionList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if essl.Value != nil { - objectMap["value"] = essl.Value - } - return json.Marshal(objectMap) +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false } -// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionList struct. -func (essl *ExternalSecuritySolutionList) 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 "value": - if v != nil { - value, err := unmarshalBasicExternalSecuritySolutionArray(*v) - if err != nil { - return err - } - essl.Value = &value - } - case "nextLink": - if v != nil { - var nextLink string - err = json.Unmarshal(*v, &nextLink) - if err != nil { - return err - } - essl.NextLink = &nextLink - } - } - } +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false +} - return nil +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false } -// ExternalSecuritySolutionListIterator provides access to a complete listing of ExternalSecuritySolution -// values. -type ExternalSecuritySolutionListIterator struct { - i int - page ExternalSecuritySolutionListPage +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false } -// 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 *ExternalSecuritySolutionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionListIterator.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 +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false } -// 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 *ExternalSecuritySolutionListIterator) Next() error { - return iter.NextWithContext(context.Background()) +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false } -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExternalSecuritySolutionListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (iter ExternalSecuritySolutionListIterator) Response() ExternalSecuritySolutionList { - return iter.page.Response() +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ExternalSecuritySolutionListIterator) Value() BasicExternalSecuritySolution { - if !iter.page.NotDone() { - return ExternalSecuritySolution{} - } - return iter.page.Values()[iter.i] +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// Creates a new instance of the ExternalSecuritySolutionListIterator type. -func NewExternalSecuritySolutionListIterator(page ExternalSecuritySolutionListPage) ExternalSecuritySolutionListIterator { - return ExternalSecuritySolutionListIterator{page: page} +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// IsEmpty returns true if the ListResult contains no values. -func (essl ExternalSecuritySolutionList) IsEmpty() bool { - return essl.Value == nil || len(*essl.Value) == 0 +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// hasNextLink returns true if the NextLink is not empty. -func (essl ExternalSecuritySolutionList) hasNextLink() bool { - return essl.NextLink != nil && len(*essl.NextLink) != 0 +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// externalSecuritySolutionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (essl ExternalSecuritySolutionList) externalSecuritySolutionListPreparer(ctx context.Context) (*http.Request, error) { - if !essl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(essl.NextLink))) +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// ExternalSecuritySolutionListPage contains a page of BasicExternalSecuritySolution values. -type ExternalSecuritySolutionListPage struct { - fn func(context.Context, ExternalSecuritySolutionList) (ExternalSecuritySolutionList, error) - essl ExternalSecuritySolutionList +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// 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 *ExternalSecuritySolutionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionListPage.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.essl) - if err != nil { - return err - } - page.essl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// 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 *ExternalSecuritySolutionListPage) Next() error { - return page.NextWithContext(context.Background()) +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExternalSecuritySolutionListPage) NotDone() bool { - return !page.essl.IsEmpty() +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return &dminiar, true } -// Response returns the raw server response from the last page request. -func (page ExternalSecuritySolutionListPage) Response() ExternalSecuritySolutionList { - return page.essl +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false } -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExternalSecuritySolutionListPage) Values() []BasicExternalSecuritySolution { - if page.essl.IsEmpty() { - return nil - } - return *page.essl.Value +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false +} + +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false } -// Creates a new instance of the ExternalSecuritySolutionListPage type. -func NewExternalSecuritySolutionListPage(cur ExternalSecuritySolutionList, getNextPage func(context.Context, ExternalSecuritySolutionList) (ExternalSecuritySolutionList, error)) ExternalSecuritySolutionListPage { - return ExternalSecuritySolutionListPage{ - fn: getNextPage, - essl: cur, - } +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false } -// ExternalSecuritySolutionModel ... -type ExternalSecuritySolutionModel struct { - autorest.Response `json:"-"` - Value BasicExternalSecuritySolution `json:"value,omitempty"` +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false } -// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionModel struct. -func (essm *ExternalSecuritySolutionModel) UnmarshalJSON(body []byte) error { - ess, err := unmarshalBasicExternalSecuritySolution(body) - if err != nil { - return err - } - essm.Value = ess +// AsCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false +} - return nil +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &dminiar, true } -// ExternalSecuritySolutionProperties the solution properties (correspond to the solution kind) -type ExternalSecuritySolutionProperties struct { - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - DeviceVendor *string `json:"deviceVendor,omitempty"` - DeviceType *string `json:"deviceType,omitempty"` - Workspace *ConnectedWorkspace `json:"workspace,omitempty"` +// DiscoveredSecuritySolution ... +type DiscoveredSecuritySolution struct { + autorest.Response `json:"-"` + // 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"` + // Location - READ-ONLY; Location where the resource is stored + Location *string `json:"location,omitempty"` + *DiscoveredSecuritySolutionProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for ExternalSecuritySolutionProperties. -func (essp ExternalSecuritySolutionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for DiscoveredSecuritySolution. +func (dss DiscoveredSecuritySolution) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if essp.DeviceVendor != nil { - objectMap["deviceVendor"] = essp.DeviceVendor - } - if essp.DeviceType != nil { - objectMap["deviceType"] = essp.DeviceType - } - if essp.Workspace != nil { - objectMap["workspace"] = essp.Workspace - } - for k, v := range essp.AdditionalProperties { - objectMap[k] = v + if dss.DiscoveredSecuritySolutionProperties != nil { + objectMap["properties"] = dss.DiscoveredSecuritySolutionProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionProperties struct. -func (essp *ExternalSecuritySolutionProperties) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for DiscoveredSecuritySolution struct. +func (dss *DiscoveredSecuritySolution) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -9429,44 +10305,50 @@ func (essp *ExternalSecuritySolutionProperties) UnmarshalJSON(body []byte) error } for k, v := range m { switch k { - default: + case "id": if v != nil { - var additionalProperties interface{} - err = json.Unmarshal(*v, &additionalProperties) + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - if essp.AdditionalProperties == nil { - essp.AdditionalProperties = make(map[string]interface{}) + dss.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err } - essp.AdditionalProperties[k] = additionalProperties + dss.Name = &name } - case "deviceVendor": + case "type": if v != nil { - var deviceVendor string - err = json.Unmarshal(*v, &deviceVendor) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - essp.DeviceVendor = &deviceVendor + dss.Type = &typeVar } - case "deviceType": + case "location": if v != nil { - var deviceType string - err = json.Unmarshal(*v, &deviceType) + var location string + err = json.Unmarshal(*v, &location) if err != nil { return err } - essp.DeviceType = &deviceType + dss.Location = &location } - case "workspace": + case "properties": if v != nil { - var workspace ConnectedWorkspace - err = json.Unmarshal(*v, &workspace) + var discoveredSecuritySolutionProperties DiscoveredSecuritySolutionProperties + err = json.Unmarshal(*v, &discoveredSecuritySolutionProperties) if err != nil { return err } - essp.Workspace = &workspace + dss.DiscoveredSecuritySolutionProperties = &discoveredSecuritySolutionProperties } } } @@ -9474,524 +10356,625 @@ func (essp *ExternalSecuritySolutionProperties) UnmarshalJSON(body []byte) error return nil } -// FailedLocalLoginsNotInAllowedRange number of failed local logins is not in allowed range. -type FailedLocalLoginsNotInAllowedRange struct { - // TimeWindowSize - The time window size in iso8601 format. - TimeWindowSize *string `json:"timeWindowSize,omitempty"` - // MinThreshold - The minimum threshold. - MinThreshold *int32 `json:"minThreshold,omitempty"` - // MaxThreshold - The maximum threshold. - MaxThreshold *int32 `json:"maxThreshold,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"` +// DiscoveredSecuritySolutionList ... +type DiscoveredSecuritySolutionList struct { + autorest.Response `json:"-"` + Value *[]DiscoveredSecuritySolution `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) MarshalJSON() ([]byte, error) { - fllniar.RuleType = RuleTypeFailedLocalLoginsNotInAllowedRange +// MarshalJSON is the custom marshaler for DiscoveredSecuritySolutionList. +func (dssl DiscoveredSecuritySolutionList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if fllniar.TimeWindowSize != nil { - objectMap["timeWindowSize"] = fllniar.TimeWindowSize - } - if fllniar.MinThreshold != nil { - objectMap["minThreshold"] = fllniar.MinThreshold - } - if fllniar.MaxThreshold != nil { - objectMap["maxThreshold"] = fllniar.MaxThreshold - } - if fllniar.IsEnabled != nil { - objectMap["isEnabled"] = fllniar.IsEnabled - } - if fllniar.RuleType != "" { - objectMap["ruleType"] = fllniar.RuleType + if dssl.Value != nil { + objectMap["value"] = dssl.Value } return json.Marshal(objectMap) } -// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { - return nil, false -} - -// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { - return &fllniar, true -} - -// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { - return nil, false -} - -// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { - return &fllniar, true -} - -// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { - return nil, false -} - -// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { - return nil, false -} - -// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { - return nil, false -} - -// AsListCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { - return nil, false -} - -// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { - return nil, false +// DiscoveredSecuritySolutionListIterator provides access to a complete listing of +// DiscoveredSecuritySolution values. +type DiscoveredSecuritySolutionListIterator struct { + i int + page DiscoveredSecuritySolutionListPage } -// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { - return nil, false +// 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 *DiscoveredSecuritySolutionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionListIterator.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 } -// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { - return nil, false +// 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 *DiscoveredSecuritySolutionListIterator) Next() error { + return iter.NextWithContext(context.Background()) } -// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { - return nil, false +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DiscoveredSecuritySolutionListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// AsProcessNotAllowed is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { - return nil, false +// Response returns the raw server response from the last page request. +func (iter DiscoveredSecuritySolutionListIterator) Response() DiscoveredSecuritySolutionList { + return iter.page.Response() } - -// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { - return nil, false + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DiscoveredSecuritySolutionListIterator) Value() DiscoveredSecuritySolution { + if !iter.page.NotDone() { + return DiscoveredSecuritySolution{} + } + return iter.page.Values()[iter.i] } -// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { - return nil, false +// Creates a new instance of the DiscoveredSecuritySolutionListIterator type. +func NewDiscoveredSecuritySolutionListIterator(page DiscoveredSecuritySolutionListPage) DiscoveredSecuritySolutionListIterator { + return DiscoveredSecuritySolutionListIterator{page: page} } -// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { - return nil, false +// IsEmpty returns true if the ListResult contains no values. +func (dssl DiscoveredSecuritySolutionList) IsEmpty() bool { + return dssl.Value == nil || len(*dssl.Value) == 0 } -// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { - return nil, false +// hasNextLink returns true if the NextLink is not empty. +func (dssl DiscoveredSecuritySolutionList) hasNextLink() bool { + return dssl.NextLink != nil && len(*dssl.NextLink) != 0 } -// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { - return nil, false +// discoveredSecuritySolutionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dssl DiscoveredSecuritySolutionList) discoveredSecuritySolutionListPreparer(ctx context.Context) (*http.Request, error) { + if !dssl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dssl.NextLink))) } -// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { - return nil, false +// DiscoveredSecuritySolutionListPage contains a page of DiscoveredSecuritySolution values. +type DiscoveredSecuritySolutionListPage struct { + fn func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error) + dssl DiscoveredSecuritySolutionList } -// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { - return nil, false +// 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 *DiscoveredSecuritySolutionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionListPage.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.dssl) + if err != nil { + return err + } + page.dssl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil } -// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { - return nil, false +// 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 *DiscoveredSecuritySolutionListPage) Next() error { + return page.NextWithContext(context.Background()) } -// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { - return nil, false +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DiscoveredSecuritySolutionListPage) NotDone() bool { + return !page.dssl.IsEmpty() } -// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { - return nil, false +// Response returns the raw server response from the last page request. +func (page DiscoveredSecuritySolutionListPage) Response() DiscoveredSecuritySolutionList { + return page.dssl } -// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { - return nil, false +// Values returns the slice of values for the current page or nil if there are no values. +func (page DiscoveredSecuritySolutionListPage) Values() []DiscoveredSecuritySolution { + if page.dssl.IsEmpty() { + return nil + } + return *page.dssl.Value } -// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { - return &fllniar, true +// Creates a new instance of the DiscoveredSecuritySolutionListPage type. +func NewDiscoveredSecuritySolutionListPage(cur DiscoveredSecuritySolutionList, getNextPage func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error)) DiscoveredSecuritySolutionListPage { + return DiscoveredSecuritySolutionListPage{ + fn: getNextPage, + dssl: cur, + } } -// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { - return nil, false +// DiscoveredSecuritySolutionProperties ... +type DiscoveredSecuritySolutionProperties struct { + // SecurityFamily - The security family of the discovered solution. Possible values include: 'Waf', 'Ngfw', 'SaasWaf', 'Va' + SecurityFamily Family `json:"securityFamily,omitempty"` + // Offer - The security solutions' image offer + Offer *string `json:"offer,omitempty"` + // Publisher - The security solutions' image publisher + Publisher *string `json:"publisher,omitempty"` + // Sku - The security solutions' image sku + Sku *string `json:"sku,omitempty"` } -// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { - return nil, false +// EffectiveNetworkSecurityGroups describes the Network Security Groups effective on a network interface +type EffectiveNetworkSecurityGroups struct { + // NetworkInterface - The Azure resource ID of the network interface + NetworkInterface *string `json:"networkInterface,omitempty"` + // NetworkSecurityGroups - The Network Security Groups effective on the network interface + NetworkSecurityGroups *[]string `json:"networkSecurityGroups,omitempty"` } -// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { - return nil, false +// 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"` } -// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { - return nil, false +// MarshalJSON is the custom marshaler for ErrorAdditionalInfo. +func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) } -// AsCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { - return nil, false +// 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. + Etag *string `json:"etag,omitempty"` } -// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. -func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { - return &fllniar, true +// BasicExternalSecuritySolution represents a security solution external to Microsoft Defender for Cloud which sends +// information to an OMS workspace and whose data is displayed by Microsoft Defender for Cloud. +type BasicExternalSecuritySolution interface { + AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) + AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) + AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) + AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) } -// FileUploadsNotInAllowedRange number of file uploads is not in allowed range. -type FileUploadsNotInAllowedRange struct { - // TimeWindowSize - The time window size in iso8601 format. - TimeWindowSize *string `json:"timeWindowSize,omitempty"` - // MinThreshold - The minimum threshold. - MinThreshold *int32 `json:"minThreshold,omitempty"` - // MaxThreshold - The maximum threshold. - MaxThreshold *int32 `json:"maxThreshold,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"` +// ExternalSecuritySolution represents a security solution external to Microsoft Defender for Cloud which sends +// information to an OMS workspace and whose data is displayed by Microsoft Defender for Cloud. +type ExternalSecuritySolution struct { + autorest.Response `json:"-"` + // 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"` + // Location - READ-ONLY; Location where the resource is stored + Location *string `json:"location,omitempty"` + // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' + Kind KindEnum `json:"kind,omitempty"` } -// MarshalJSON is the custom marshaler for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) MarshalJSON() ([]byte, error) { - funiar.RuleType = RuleTypeFileUploadsNotInAllowedRange - objectMap := make(map[string]interface{}) - if funiar.TimeWindowSize != nil { - objectMap["timeWindowSize"] = funiar.TimeWindowSize - } - if funiar.MinThreshold != nil { - objectMap["minThreshold"] = funiar.MinThreshold - } - if funiar.MaxThreshold != nil { - objectMap["maxThreshold"] = funiar.MaxThreshold - } - if funiar.IsEnabled != nil { - objectMap["isEnabled"] = funiar.IsEnabled - } - if funiar.RuleType != "" { - objectMap["ruleType"] = funiar.RuleType +func unmarshalBasicExternalSecuritySolution(body []byte) (BasicExternalSecuritySolution, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err } - return json.Marshal(objectMap) -} -// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { - return nil, false + switch m["kind"] { + case string(KindCEF): + var cess CefExternalSecuritySolution + err := json.Unmarshal(body, &cess) + return cess, err + case string(KindATA): + var aess AtaExternalSecuritySolution + err := json.Unmarshal(body, &aess) + return aess, err + case string(KindAAD): + var aess AadExternalSecuritySolution + err := json.Unmarshal(body, &aess) + return aess, err + default: + var ess ExternalSecuritySolution + err := json.Unmarshal(body, &ess) + return ess, err + } } +func unmarshalBasicExternalSecuritySolutionArray(body []byte) ([]BasicExternalSecuritySolution, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } -// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { - return &funiar, true -} + essArray := make([]BasicExternalSecuritySolution, len(rawMessages)) -// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { - return nil, false + for index, rawMessage := range rawMessages { + ess, err := unmarshalBasicExternalSecuritySolution(*rawMessage) + if err != nil { + return nil, err + } + essArray[index] = ess + } + return essArray, nil } -// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { - return &funiar, true +// MarshalJSON is the custom marshaler for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) MarshalJSON() ([]byte, error) { + ess.Kind = KindExternalSecuritySolution + objectMap := make(map[string]interface{}) + if ess.Kind != "" { + objectMap["kind"] = ess.Kind + } + return json.Marshal(objectMap) } -// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { +// AsCefExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) { return nil, false } -// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { +// AsAtaExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) { return nil, false } -// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { +// AsAadExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) { return nil, false } -// AsListCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { - return nil, false +// AsExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) { + return &ess, true } -// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { - return nil, false +// AsBasicExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) AsBasicExternalSecuritySolution() (BasicExternalSecuritySolution, bool) { + return &ess, true } -// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { - return nil, false +// ExternalSecuritySolutionKind1 describes an Azure resource with kind +type ExternalSecuritySolutionKind1 struct { + // Kind - The kind of the external solution. Possible values include: 'CEF', 'ATA', 'AAD' + Kind ExternalSecuritySolutionKind `json:"kind,omitempty"` } -// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { - return nil, false +// ExternalSecuritySolutionList ... +type ExternalSecuritySolutionList struct { + autorest.Response `json:"-"` + Value *[]BasicExternalSecuritySolution `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` } -// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { - return nil, false +// MarshalJSON is the custom marshaler for ExternalSecuritySolutionList. +func (essl ExternalSecuritySolutionList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if essl.Value != nil { + objectMap["value"] = essl.Value + } + return json.Marshal(objectMap) } -// AsProcessNotAllowed is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { - return nil, false +// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionList struct. +func (essl *ExternalSecuritySolutionList) 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 "value": + if v != nil { + value, err := unmarshalBasicExternalSecuritySolutionArray(*v) + if err != nil { + return err + } + essl.Value = &value + } + case "nextLink": + if v != nil { + var nextLink string + err = json.Unmarshal(*v, &nextLink) + if err != nil { + return err + } + essl.NextLink = &nextLink + } + } + } + + return nil } -// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { - return nil, false +// ExternalSecuritySolutionListIterator provides access to a complete listing of ExternalSecuritySolution +// values. +type ExternalSecuritySolutionListIterator struct { + i int + page ExternalSecuritySolutionListPage } -// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { - return nil, false +// 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 *ExternalSecuritySolutionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionListIterator.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 } -// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { - return nil, false +// 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 *ExternalSecuritySolutionListIterator) Next() error { + return iter.NextWithContext(context.Background()) } -// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { - return nil, false +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ExternalSecuritySolutionListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { - return nil, false +// Response returns the raw server response from the last page request. +func (iter ExternalSecuritySolutionListIterator) Response() ExternalSecuritySolutionList { + return iter.page.Response() } -// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { - return nil, false +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ExternalSecuritySolutionListIterator) Value() BasicExternalSecuritySolution { + if !iter.page.NotDone() { + return ExternalSecuritySolution{} + } + return iter.page.Values()[iter.i] } -// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { - return nil, false +// Creates a new instance of the ExternalSecuritySolutionListIterator type. +func NewExternalSecuritySolutionListIterator(page ExternalSecuritySolutionListPage) ExternalSecuritySolutionListIterator { + return ExternalSecuritySolutionListIterator{page: page} } -// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { - return nil, false +// IsEmpty returns true if the ListResult contains no values. +func (essl ExternalSecuritySolutionList) IsEmpty() bool { + return essl.Value == nil || len(*essl.Value) == 0 } -// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { - return nil, false +// hasNextLink returns true if the NextLink is not empty. +func (essl ExternalSecuritySolutionList) hasNextLink() bool { + return essl.NextLink != nil && len(*essl.NextLink) != 0 } -// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { - return nil, false +// externalSecuritySolutionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (essl ExternalSecuritySolutionList) externalSecuritySolutionListPreparer(ctx context.Context) (*http.Request, error) { + if !essl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(essl.NextLink))) } -// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { - return nil, false +// ExternalSecuritySolutionListPage contains a page of BasicExternalSecuritySolution values. +type ExternalSecuritySolutionListPage struct { + fn func(context.Context, ExternalSecuritySolutionList) (ExternalSecuritySolutionList, error) + essl ExternalSecuritySolutionList } -// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { - return nil, false +// 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 *ExternalSecuritySolutionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionListPage.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.essl) + if err != nil { + return err + } + page.essl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil } -// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { - return &funiar, true +// 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 *ExternalSecuritySolutionListPage) Next() error { + return page.NextWithContext(context.Background()) } -// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { - return nil, false +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ExternalSecuritySolutionListPage) NotDone() bool { + return !page.essl.IsEmpty() } -// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { - return nil, false +// Response returns the raw server response from the last page request. +func (page ExternalSecuritySolutionListPage) Response() ExternalSecuritySolutionList { + return page.essl } -// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { - return nil, false +// Values returns the slice of values for the current page or nil if there are no values. +func (page ExternalSecuritySolutionListPage) Values() []BasicExternalSecuritySolution { + if page.essl.IsEmpty() { + return nil + } + return *page.essl.Value } -// AsCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { - return nil, false +// Creates a new instance of the ExternalSecuritySolutionListPage type. +func NewExternalSecuritySolutionListPage(cur ExternalSecuritySolutionList, getNextPage func(context.Context, ExternalSecuritySolutionList) (ExternalSecuritySolutionList, error)) ExternalSecuritySolutionListPage { + return ExternalSecuritySolutionListPage{ + fn: getNextPage, + essl: cur, + } } -// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. -func (funiar FileUploadsNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { - return &funiar, true +// ExternalSecuritySolutionModel ... +type ExternalSecuritySolutionModel struct { + autorest.Response `json:"-"` + Value BasicExternalSecuritySolution `json:"value,omitempty"` } -// Firmware firmware information -type Firmware struct { - // ModuleAddress - READ-ONLY; Address of the specific module a firmware is related to - ModuleAddress *string `json:"moduleAddress,omitempty"` - // Rack - READ-ONLY; Rack number of the module a firmware is related to. - Rack *string `json:"rack,omitempty"` - // Slot - READ-ONLY; Slot number in the rack of the module a firmware is related to - Slot *string `json:"slot,omitempty"` - // Serial - READ-ONLY; Serial of the firmware - Serial *string `json:"serial,omitempty"` - // Model - READ-ONLY; Firmware model - Model *string `json:"model,omitempty"` - // Version - READ-ONLY; Firmware version - Version *string `json:"version,omitempty"` - // AdditionalData - READ-ONLY; A bag of fields which extends the firmware information. - AdditionalData interface{} `json:"additionalData,omitempty"` -} +// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionModel struct. +func (essm *ExternalSecuritySolutionModel) UnmarshalJSON(body []byte) error { + ess, err := unmarshalBasicExternalSecuritySolution(body) + if err != nil { + return err + } + essm.Value = ess -// MarshalJSON is the custom marshaler for Firmware. -func (f Firmware) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) + return nil } -// GcpCredentialsDetailsProperties GCP cloud account connector based service to service credentials, the -// credentials are composed of the organization ID and a JSON API key (write only) -type GcpCredentialsDetailsProperties struct { - // OrganizationID - The organization ID of the GCP cloud account - OrganizationID *string `json:"organizationId,omitempty"` - // Type - Type field of the API key (write only) - Type *string `json:"type,omitempty"` - // ProjectID - Project ID field of the API key (write only) - ProjectID *string `json:"projectId,omitempty"` - // PrivateKeyID - Private key ID field of the API key (write only) - PrivateKeyID *string `json:"privateKeyId,omitempty"` - // PrivateKey - Private key field of the API key (write only) - PrivateKey *string `json:"privateKey,omitempty"` - // ClientEmail - Client email field of the API key (write only) - ClientEmail *string `json:"clientEmail,omitempty"` - // ClientID - Client ID field of the API key (write only) - ClientID *string `json:"clientId,omitempty"` - // AuthURI - Auth URI field of the API key (write only) - AuthURI *string `json:"authUri,omitempty"` - // TokenURI - Token URI field of the API key (write only) - TokenURI *string `json:"tokenUri,omitempty"` - // AuthProviderX509CertURL - Auth provider x509 certificate URL field of the API key (write only) - AuthProviderX509CertURL *string `json:"authProviderX509CertUrl,omitempty"` - // ClientX509CertURL - Client x509 certificate URL field of the API key (write only) - ClientX509CertURL *string `json:"clientX509CertUrl,omitempty"` - // AuthenticationProvisioningState - READ-ONLY; State of the multi-cloud connector. Possible values include: 'Valid', 'Invalid', 'Expired', 'IncorrectPolicy' - AuthenticationProvisioningState AuthenticationProvisioningState `json:"authenticationProvisioningState,omitempty"` - // GrantedPermissions - READ-ONLY; The permissions detected in the cloud account. - GrantedPermissions *[]PermissionProperty `json:"grantedPermissions,omitempty"` - // AuthenticationType - Possible values include: 'AuthenticationTypeAuthenticationDetailsProperties', 'AuthenticationTypeAwsCreds', 'AuthenticationTypeAwsAssumeRole', 'AuthenticationTypeGcpCredentials' - AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` +// ExternalSecuritySolutionProperties the solution properties (correspond to the solution kind) +type ExternalSecuritySolutionProperties struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + DeviceVendor *string `json:"deviceVendor,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + Workspace *ConnectedWorkspace `json:"workspace,omitempty"` } -// MarshalJSON is the custom marshaler for GcpCredentialsDetailsProperties. -func (gcdp GcpCredentialsDetailsProperties) MarshalJSON() ([]byte, error) { - gcdp.AuthenticationType = AuthenticationTypeGcpCredentials +// MarshalJSON is the custom marshaler for ExternalSecuritySolutionProperties. +func (essp ExternalSecuritySolutionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if gcdp.OrganizationID != nil { - objectMap["organizationId"] = gcdp.OrganizationID - } - if gcdp.Type != nil { - objectMap["type"] = gcdp.Type - } - if gcdp.ProjectID != nil { - objectMap["projectId"] = gcdp.ProjectID - } - if gcdp.PrivateKeyID != nil { - objectMap["privateKeyId"] = gcdp.PrivateKeyID - } - if gcdp.PrivateKey != nil { - objectMap["privateKey"] = gcdp.PrivateKey - } - if gcdp.ClientEmail != nil { - objectMap["clientEmail"] = gcdp.ClientEmail - } - if gcdp.ClientID != nil { - objectMap["clientId"] = gcdp.ClientID - } - if gcdp.AuthURI != nil { - objectMap["authUri"] = gcdp.AuthURI - } - if gcdp.TokenURI != nil { - objectMap["tokenUri"] = gcdp.TokenURI + if essp.DeviceVendor != nil { + objectMap["deviceVendor"] = essp.DeviceVendor } - if gcdp.AuthProviderX509CertURL != nil { - objectMap["authProviderX509CertUrl"] = gcdp.AuthProviderX509CertURL + if essp.DeviceType != nil { + objectMap["deviceType"] = essp.DeviceType } - if gcdp.ClientX509CertURL != nil { - objectMap["clientX509CertUrl"] = gcdp.ClientX509CertURL + if essp.Workspace != nil { + objectMap["workspace"] = essp.Workspace } - if gcdp.AuthenticationType != "" { - objectMap["authenticationType"] = gcdp.AuthenticationType + for k, v := range essp.AdditionalProperties { + objectMap[k] = v } return json.Marshal(objectMap) } -// AsAwsCredsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. -func (gcdp GcpCredentialsDetailsProperties) AsAwsCredsAuthenticationDetailsProperties() (*AwsCredsAuthenticationDetailsProperties, bool) { - return nil, false -} - -// AsAwAssumeRoleAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. -func (gcdp GcpCredentialsDetailsProperties) AsAwAssumeRoleAuthenticationDetailsProperties() (*AwAssumeRoleAuthenticationDetailsProperties, bool) { - return nil, false -} - -// AsGcpCredentialsDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. -func (gcdp GcpCredentialsDetailsProperties) AsGcpCredentialsDetailsProperties() (*GcpCredentialsDetailsProperties, bool) { - return &gcdp, true -} - -// AsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. -func (gcdp GcpCredentialsDetailsProperties) AsAuthenticationDetailsProperties() (*AuthenticationDetailsProperties, bool) { - return nil, false -} +// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionProperties struct. +func (essp *ExternalSecuritySolutionProperties) 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 essp.AdditionalProperties == nil { + essp.AdditionalProperties = make(map[string]interface{}) + } + essp.AdditionalProperties[k] = additionalProperties + } + case "deviceVendor": + if v != nil { + var deviceVendor string + err = json.Unmarshal(*v, &deviceVendor) + if err != nil { + return err + } + essp.DeviceVendor = &deviceVendor + } + case "deviceType": + if v != nil { + var deviceType string + err = json.Unmarshal(*v, &deviceType) + if err != nil { + return err + } + essp.DeviceType = &deviceType + } + case "workspace": + if v != nil { + var workspace ConnectedWorkspace + err = json.Unmarshal(*v, &workspace) + if err != nil { + return err + } + essp.Workspace = &workspace + } + } + } -// AsBasicAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. -func (gcdp GcpCredentialsDetailsProperties) AsBasicAuthenticationDetailsProperties() (BasicAuthenticationDetailsProperties, bool) { - return &gcdp, true + return nil } -// HTTPC2DMessagesNotInAllowedRange number of cloud to device messages (HTTP protocol) is not in allowed -// range. -type HTTPC2DMessagesNotInAllowedRange struct { +// FailedLocalLoginsNotInAllowedRange number of failed local logins is not in allowed range. +type FailedLocalLoginsNotInAllowedRange struct { // TimeWindowSize - The time window size in iso8601 format. TimeWindowSize *string `json:"timeWindowSize,omitempty"` // MinThreshold - The minimum threshold. @@ -10008,186 +10991,185 @@ type HTTPC2DMessagesNotInAllowedRange struct { RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } -// MarshalJSON is the custom marshaler for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { - hcmniar.RuleType = RuleTypeHTTPC2DMessagesNotInAllowedRange +// MarshalJSON is the custom marshaler for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) MarshalJSON() ([]byte, error) { + fllniar.RuleType = RuleTypeFailedLocalLoginsNotInAllowedRange objectMap := make(map[string]interface{}) - if hcmniar.TimeWindowSize != nil { - objectMap["timeWindowSize"] = hcmniar.TimeWindowSize + if fllniar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = fllniar.TimeWindowSize } - if hcmniar.MinThreshold != nil { - objectMap["minThreshold"] = hcmniar.MinThreshold + if fllniar.MinThreshold != nil { + objectMap["minThreshold"] = fllniar.MinThreshold } - if hcmniar.MaxThreshold != nil { - objectMap["maxThreshold"] = hcmniar.MaxThreshold + if fllniar.MaxThreshold != nil { + objectMap["maxThreshold"] = fllniar.MaxThreshold } - if hcmniar.IsEnabled != nil { - objectMap["isEnabled"] = hcmniar.IsEnabled + if fllniar.IsEnabled != nil { + objectMap["isEnabled"] = fllniar.IsEnabled } - if hcmniar.RuleType != "" { - objectMap["ruleType"] = hcmniar.RuleType + if fllniar.RuleType != "" { + objectMap["ruleType"] = fllniar.RuleType } return json.Marshal(objectMap) } -// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { return nil, false } -// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { - return &hcmniar, true +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &fllniar, true } -// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { return nil, false } -// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { - return &hcmniar, true +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &fllniar, true } -// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { return nil, false } -// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { return nil, false } -// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { return nil, false } -// AsListCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { return nil, false } -// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { return nil, false } -// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { return nil, false } -// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { return nil, false } -// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false } -// AsProcessNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { return nil, false } -// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { return nil, false } -// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { return nil, false } -// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { return nil, false } -// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { - return &hcmniar, true +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { return nil, false } -// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { return nil, false } -// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { return nil, false } -// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { return nil, false } -// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { return nil, false } -// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { return nil, false } -// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { return nil, false } -// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { - return nil, false +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return &fllniar, true } -// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { return nil, false } -// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { return nil, false } -// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { return nil, false } -// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { return nil, false } -// AsCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { +// AsCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { return nil, false } -// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. -func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { - return &hcmniar, true +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &fllniar, true } -// HTTPC2DRejectedMessagesNotInAllowedRange number of rejected cloud to device messages (HTTP protocol) is -// not in allowed range. -type HTTPC2DRejectedMessagesNotInAllowedRange struct { +// FileUploadsNotInAllowedRange number of file uploads is not in allowed range. +type FileUploadsNotInAllowedRange struct { // TimeWindowSize - The time window size in iso8601 format. TimeWindowSize *string `json:"timeWindowSize,omitempty"` // MinThreshold - The minimum threshold. @@ -10204,186 +11186,287 @@ type HTTPC2DRejectedMessagesNotInAllowedRange struct { RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } -// MarshalJSON is the custom marshaler for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { - hcrmniar.RuleType = RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange +// MarshalJSON is the custom marshaler for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) MarshalJSON() ([]byte, error) { + funiar.RuleType = RuleTypeFileUploadsNotInAllowedRange objectMap := make(map[string]interface{}) - if hcrmniar.TimeWindowSize != nil { - objectMap["timeWindowSize"] = hcrmniar.TimeWindowSize + if funiar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = funiar.TimeWindowSize } - if hcrmniar.MinThreshold != nil { - objectMap["minThreshold"] = hcrmniar.MinThreshold + if funiar.MinThreshold != nil { + objectMap["minThreshold"] = funiar.MinThreshold } - if hcrmniar.MaxThreshold != nil { - objectMap["maxThreshold"] = hcrmniar.MaxThreshold + if funiar.MaxThreshold != nil { + objectMap["maxThreshold"] = funiar.MaxThreshold } - if hcrmniar.IsEnabled != nil { - objectMap["isEnabled"] = hcrmniar.IsEnabled + if funiar.IsEnabled != nil { + objectMap["isEnabled"] = funiar.IsEnabled } - if hcrmniar.RuleType != "" { - objectMap["ruleType"] = hcrmniar.RuleType + if funiar.RuleType != "" { + objectMap["ruleType"] = funiar.RuleType } return json.Marshal(objectMap) } -// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { return nil, false } -// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { - return &hcrmniar, true +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &funiar, true } -// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { return nil, false } -// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { - return &hcrmniar, true +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &funiar, true } -// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { return nil, false } -// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { return nil, false } -// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { return nil, false } -// AsListCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { return nil, false } -// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { return nil, false } -// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { return nil, false } -// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { return nil, false } -// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false } -// AsProcessNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { return nil, false } -// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { return nil, false } -// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { return nil, false } -// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { return nil, false } -// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { return nil, false } -// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { return nil, false } -// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { return nil, false } -// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { - return &hcrmniar, true +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { return nil, false } -// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { return nil, false } -// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false +} + +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false +} + +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return &funiar, true +} + +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false +} + +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false +} + +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false +} + +// AsCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { return nil, false } -// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { - return nil, false +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &funiar, true } -// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { - return nil, false +// GcpCredentialsDetailsProperties GCP cloud account connector based service to service credentials, the +// credentials are composed of the organization ID and a JSON API key (write only) +type GcpCredentialsDetailsProperties struct { + // OrganizationID - The organization ID of the GCP cloud account + OrganizationID *string `json:"organizationId,omitempty"` + // Type - Type field of the API key (write only) + Type *string `json:"type,omitempty"` + // ProjectID - Project ID field of the API key (write only) + ProjectID *string `json:"projectId,omitempty"` + // PrivateKeyID - Private key ID field of the API key (write only) + PrivateKeyID *string `json:"privateKeyId,omitempty"` + // PrivateKey - Private key field of the API key (write only) + PrivateKey *string `json:"privateKey,omitempty"` + // ClientEmail - Client email field of the API key (write only) + ClientEmail *string `json:"clientEmail,omitempty"` + // ClientID - Client ID field of the API key (write only) + ClientID *string `json:"clientId,omitempty"` + // AuthURI - Auth URI field of the API key (write only) + AuthURI *string `json:"authUri,omitempty"` + // TokenURI - Token URI field of the API key (write only) + TokenURI *string `json:"tokenUri,omitempty"` + // AuthProviderX509CertURL - Auth provider x509 certificate URL field of the API key (write only) + AuthProviderX509CertURL *string `json:"authProviderX509CertUrl,omitempty"` + // ClientX509CertURL - Client x509 certificate URL field of the API key (write only) + ClientX509CertURL *string `json:"clientX509CertUrl,omitempty"` + // AuthenticationProvisioningState - READ-ONLY; State of the multi-cloud connector. Possible values include: 'Valid', 'Invalid', 'Expired', 'IncorrectPolicy' + AuthenticationProvisioningState AuthenticationProvisioningState `json:"authenticationProvisioningState,omitempty"` + // GrantedPermissions - READ-ONLY; The permissions detected in the cloud account. + GrantedPermissions *[]PermissionProperty `json:"grantedPermissions,omitempty"` + // AuthenticationType - Possible values include: 'AuthenticationTypeAuthenticationDetailsProperties', 'AuthenticationTypeAwsCreds', 'AuthenticationTypeAwsAssumeRole', 'AuthenticationTypeGcpCredentials' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` } -// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { - return nil, false +// MarshalJSON is the custom marshaler for GcpCredentialsDetailsProperties. +func (gcdp GcpCredentialsDetailsProperties) MarshalJSON() ([]byte, error) { + gcdp.AuthenticationType = AuthenticationTypeGcpCredentials + objectMap := make(map[string]interface{}) + if gcdp.OrganizationID != nil { + objectMap["organizationId"] = gcdp.OrganizationID + } + if gcdp.Type != nil { + objectMap["type"] = gcdp.Type + } + if gcdp.ProjectID != nil { + objectMap["projectId"] = gcdp.ProjectID + } + if gcdp.PrivateKeyID != nil { + objectMap["privateKeyId"] = gcdp.PrivateKeyID + } + if gcdp.PrivateKey != nil { + objectMap["privateKey"] = gcdp.PrivateKey + } + if gcdp.ClientEmail != nil { + objectMap["clientEmail"] = gcdp.ClientEmail + } + if gcdp.ClientID != nil { + objectMap["clientId"] = gcdp.ClientID + } + if gcdp.AuthURI != nil { + objectMap["authUri"] = gcdp.AuthURI + } + if gcdp.TokenURI != nil { + objectMap["tokenUri"] = gcdp.TokenURI + } + if gcdp.AuthProviderX509CertURL != nil { + objectMap["authProviderX509CertUrl"] = gcdp.AuthProviderX509CertURL + } + if gcdp.ClientX509CertURL != nil { + objectMap["clientX509CertUrl"] = gcdp.ClientX509CertURL + } + if gcdp.AuthenticationType != "" { + objectMap["authenticationType"] = gcdp.AuthenticationType + } + return json.Marshal(objectMap) } -// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { +// AsAwsCredsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. +func (gcdp GcpCredentialsDetailsProperties) AsAwsCredsAuthenticationDetailsProperties() (*AwsCredsAuthenticationDetailsProperties, bool) { return nil, false } -// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { +// AsAwAssumeRoleAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. +func (gcdp GcpCredentialsDetailsProperties) AsAwAssumeRoleAuthenticationDetailsProperties() (*AwAssumeRoleAuthenticationDetailsProperties, bool) { return nil, false } -// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { - return nil, false +// AsGcpCredentialsDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. +func (gcdp GcpCredentialsDetailsProperties) AsGcpCredentialsDetailsProperties() (*GcpCredentialsDetailsProperties, bool) { + return &gcdp, true } -// AsCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { +// AsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. +func (gcdp GcpCredentialsDetailsProperties) AsAuthenticationDetailsProperties() (*AuthenticationDetailsProperties, bool) { return nil, false } -// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. -func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { - return &hcrmniar, true +// AsBasicAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. +func (gcdp GcpCredentialsDetailsProperties) AsBasicAuthenticationDetailsProperties() (BasicAuthenticationDetailsProperties, bool) { + return &gcdp, true } -// HTTPD2CMessagesNotInAllowedRange number of device to cloud messages (HTTP protocol) is not in allowed +// HTTPC2DMessagesNotInAllowedRange number of cloud to device messages (HTTP protocol) is not in allowed // range. -type HTTPD2CMessagesNotInAllowedRange struct { +type HTTPC2DMessagesNotInAllowedRange struct { // TimeWindowSize - The time window size in iso8601 format. TimeWindowSize *string `json:"timeWindowSize,omitempty"` // MinThreshold - The minimum threshold. @@ -10400,1126 +11483,688 @@ type HTTPD2CMessagesNotInAllowedRange struct { RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } -// MarshalJSON is the custom marshaler for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { - hdmniar.RuleType = RuleTypeHTTPD2CMessagesNotInAllowedRange +// MarshalJSON is the custom marshaler for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { + hcmniar.RuleType = RuleTypeHTTPC2DMessagesNotInAllowedRange objectMap := make(map[string]interface{}) - if hdmniar.TimeWindowSize != nil { - objectMap["timeWindowSize"] = hdmniar.TimeWindowSize + if hcmniar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = hcmniar.TimeWindowSize } - if hdmniar.MinThreshold != nil { - objectMap["minThreshold"] = hdmniar.MinThreshold + if hcmniar.MinThreshold != nil { + objectMap["minThreshold"] = hcmniar.MinThreshold } - if hdmniar.MaxThreshold != nil { - objectMap["maxThreshold"] = hdmniar.MaxThreshold + if hcmniar.MaxThreshold != nil { + objectMap["maxThreshold"] = hcmniar.MaxThreshold } - if hdmniar.IsEnabled != nil { - objectMap["isEnabled"] = hdmniar.IsEnabled + if hcmniar.IsEnabled != nil { + objectMap["isEnabled"] = hcmniar.IsEnabled } - if hdmniar.RuleType != "" { - objectMap["ruleType"] = hdmniar.RuleType + if hcmniar.RuleType != "" { + objectMap["ruleType"] = hcmniar.RuleType } return json.Marshal(objectMap) } -// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { - return nil, false -} - -// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { - return &hdmniar, true -} - -// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { - return nil, false -} - -// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { - return &hdmniar, true -} - -// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { - return nil, false -} - -// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { - return nil, false -} - -// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { - return nil, false -} - -// AsListCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { - return nil, false -} - -// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { - return nil, false -} - -// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { - 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 -} - -// AsProcessNotAllowed is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { - return nil, false -} - -// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { return nil, false } -// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { - return nil, false +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &hcmniar, true } -// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { return nil, false } -// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { - return nil, false +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &hcmniar, true } -// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { return nil, false } -// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { return nil, false } -// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { return nil, false } -// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { return nil, false } -// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { return nil, false } -// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { - return &hdmniar, true -} - -// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { return nil, false } -// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { return nil, false } -// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false } -// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { return nil, false } -// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { return nil, false } -// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { return nil, false } -// AsCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { return nil, false } -// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. -func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { - return &hdmniar, true +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return &hcmniar, true } -// HybridComputeSettingsProperties settings for hybrid compute management -type HybridComputeSettingsProperties struct { - // HybridComputeProvisioningState - READ-ONLY; State of the service principal and its secret. Possible values include: 'HybridComputeProvisioningStateValid', 'HybridComputeProvisioningStateInvalid', 'HybridComputeProvisioningStateExpired' - HybridComputeProvisioningState HybridComputeProvisioningState `json:"hybridComputeProvisioningState,omitempty"` - // AutoProvision - Whether or not to automatically install Azure Arc (hybrid compute) agents on machines. Possible values include: 'AutoProvisionOn', 'AutoProvisionOff' - AutoProvision AutoProvision `json:"autoProvision,omitempty"` - // ResourceGroupName - The name of the resource group where Arc (Hybrid Compute) connectors are connected. - ResourceGroupName *string `json:"resourceGroupName,omitempty"` - // Region - The location where the metadata of machines will be stored - Region *string `json:"region,omitempty"` - // ProxyServer - For a non-Azure machine that is not connected directly to the internet, specify a proxy server that the non-Azure machine can use. - ProxyServer *ProxyServerProperties `json:"proxyServer,omitempty"` - // ServicePrincipal - An object to access resources that are secured by an Azure AD tenant. - ServicePrincipal *ServicePrincipalProperties `json:"servicePrincipal,omitempty"` +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for HybridComputeSettingsProperties. -func (hcsp HybridComputeSettingsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if hcsp.AutoProvision != "" { - objectMap["autoProvision"] = hcsp.AutoProvision - } - if hcsp.ResourceGroupName != nil { - objectMap["resourceGroupName"] = hcsp.ResourceGroupName - } - if hcsp.Region != nil { - objectMap["region"] = hcsp.Region - } - if hcsp.ProxyServer != nil { - objectMap["proxyServer"] = hcsp.ProxyServer - } - if hcsp.ServicePrincipal != nil { - objectMap["servicePrincipal"] = hcsp.ServicePrincipal - } - return json.Marshal(objectMap) +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// InformationProtectionKeyword the information type keyword. -type InformationProtectionKeyword struct { - // Pattern - The keyword pattern. - Pattern *string `json:"pattern,omitempty"` - // Custom - Indicates whether the keyword is custom or not. - Custom *bool `json:"custom,omitempty"` - // CanBeNumeric - Indicates whether the keyword can be applied on numeric types or not. - CanBeNumeric *bool `json:"canBeNumeric,omitempty"` - // Excluded - Indicates whether the keyword is excluded or not. - Excluded *bool `json:"excluded,omitempty"` +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// InformationProtectionPolicy information protection policy. -type InformationProtectionPolicy struct { - autorest.Response `json:"-"` - // InformationProtectionPolicyProperties - Information protection policy data - *InformationProtectionPolicyProperties `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"` +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for InformationProtectionPolicy. -func (ipp InformationProtectionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ipp.InformationProtectionPolicyProperties != nil { - objectMap["properties"] = ipp.InformationProtectionPolicyProperties - } - return json.Marshal(objectMap) +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// UnmarshalJSON is the custom unmarshaler for InformationProtectionPolicy struct. -func (ipp *InformationProtectionPolicy) 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 informationProtectionPolicyProperties InformationProtectionPolicyProperties - err = json.Unmarshal(*v, &informationProtectionPolicyProperties) - if err != nil { - return err - } - ipp.InformationProtectionPolicyProperties = &informationProtectionPolicyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ipp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ipp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ipp.Type = &typeVar - } - } - } +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} - return nil +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false } -// InformationProtectionPolicyList information protection policies response. -type InformationProtectionPolicyList struct { - autorest.Response `json:"-"` - // Value - List of information protection policies. - Value *[]InformationProtectionPolicy `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for InformationProtectionPolicyList. -func (ippl InformationProtectionPolicyList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ippl.Value != nil { - objectMap["value"] = ippl.Value - } - return json.Marshal(objectMap) +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false } -// InformationProtectionPolicyListIterator provides access to a complete listing of -// InformationProtectionPolicy values. -type InformationProtectionPolicyListIterator struct { - i int - page InformationProtectionPolicyListPage +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false } -// 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 *InformationProtectionPolicyListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InformationProtectionPolicyListIterator.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 +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false } -// 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 *InformationProtectionPolicyListIterator) Next() error { - return iter.NextWithContext(context.Background()) +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false } -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter InformationProtectionPolicyListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) +// AsCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (iter InformationProtectionPolicyListIterator) Response() InformationProtectionPolicyList { - return iter.page.Response() +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &hcmniar, true } -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter InformationProtectionPolicyListIterator) Value() InformationProtectionPolicy { - if !iter.page.NotDone() { - return InformationProtectionPolicy{} - } - return iter.page.Values()[iter.i] +// HTTPC2DRejectedMessagesNotInAllowedRange number of rejected cloud to device messages (HTTP protocol) is +// not in allowed range. +type HTTPC2DRejectedMessagesNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,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"` } -// Creates a new instance of the InformationProtectionPolicyListIterator type. -func NewInformationProtectionPolicyListIterator(page InformationProtectionPolicyListPage) InformationProtectionPolicyListIterator { - return InformationProtectionPolicyListIterator{page: page} +// MarshalJSON is the custom marshaler for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { + hcrmniar.RuleType = RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange + objectMap := make(map[string]interface{}) + if hcrmniar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = hcrmniar.TimeWindowSize + } + if hcrmniar.MinThreshold != nil { + objectMap["minThreshold"] = hcrmniar.MinThreshold + } + if hcrmniar.MaxThreshold != nil { + objectMap["maxThreshold"] = hcrmniar.MaxThreshold + } + if hcrmniar.IsEnabled != nil { + objectMap["isEnabled"] = hcrmniar.IsEnabled + } + if hcrmniar.RuleType != "" { + objectMap["ruleType"] = hcrmniar.RuleType + } + return json.Marshal(objectMap) } -// IsEmpty returns true if the ListResult contains no values. -func (ippl InformationProtectionPolicyList) IsEmpty() bool { - return ippl.Value == nil || len(*ippl.Value) == 0 +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false } -// hasNextLink returns true if the NextLink is not empty. -func (ippl InformationProtectionPolicyList) hasNextLink() bool { - return ippl.NextLink != nil && len(*ippl.NextLink) != 0 +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &hcrmniar, true } -// informationProtectionPolicyListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ippl InformationProtectionPolicyList) informationProtectionPolicyListPreparer(ctx context.Context) (*http.Request, error) { - if !ippl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ippl.NextLink))) +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false } -// InformationProtectionPolicyListPage contains a page of InformationProtectionPolicy values. -type InformationProtectionPolicyListPage struct { - fn func(context.Context, InformationProtectionPolicyList) (InformationProtectionPolicyList, error) - ippl InformationProtectionPolicyList +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &hcrmniar, true } -// 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 *InformationProtectionPolicyListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InformationProtectionPolicyListPage.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.ippl) - if err != nil { - return err - } - page.ippl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false } -// 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 *InformationProtectionPolicyListPage) Next() error { - return page.NextWithContext(context.Background()) +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page InformationProtectionPolicyListPage) NotDone() bool { - return !page.ippl.IsEmpty() +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (page InformationProtectionPolicyListPage) Response() InformationProtectionPolicyList { - return page.ippl +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false } -// Values returns the slice of values for the current page or nil if there are no values. -func (page InformationProtectionPolicyListPage) Values() []InformationProtectionPolicy { - if page.ippl.IsEmpty() { - return nil - } - return *page.ippl.Value +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false } -// Creates a new instance of the InformationProtectionPolicyListPage type. -func NewInformationProtectionPolicyListPage(cur InformationProtectionPolicyList, getNextPage func(context.Context, InformationProtectionPolicyList) (InformationProtectionPolicyList, error)) InformationProtectionPolicyListPage { - return InformationProtectionPolicyListPage{ - fn: getNextPage, - ippl: cur, - } +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false } -// InformationProtectionPolicyProperties describes properties of an information protection policy. -type InformationProtectionPolicyProperties struct { - // LastModifiedUtc - READ-ONLY; Describes the last UTC time the policy was modified. - LastModifiedUtc *date.Time `json:"lastModifiedUtc,omitempty"` - // Version - READ-ONLY; Describes the version of the policy. - Version *string `json:"version,omitempty"` - // Labels - Dictionary of sensitivity labels. - Labels map[string]*SensitivityLabel `json:"labels"` - // InformationTypes - The sensitivity information types. - InformationTypes map[string]*InformationType `json:"informationTypes"` +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for InformationProtectionPolicyProperties. -func (ippp InformationProtectionPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ippp.Labels != nil { - objectMap["labels"] = ippp.Labels - } - if ippp.InformationTypes != nil { - objectMap["informationTypes"] = ippp.InformationTypes - } - return json.Marshal(objectMap) +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false } -// InformationType the information type. -type InformationType struct { - // DisplayName - The name of the information type. - DisplayName *string `json:"displayName,omitempty"` - // Description - The description of the information type. - Description *string `json:"description,omitempty"` - // Order - The order of the information type. - Order *int32 `json:"order,omitempty"` - // RecommendedLabelID - The recommended label id to be associated with this information type. - RecommendedLabelID *uuid.UUID `json:"recommendedLabelId,omitempty"` - // Enabled - Indicates whether the information type is enabled or not. - Enabled *bool `json:"enabled,omitempty"` - // Custom - Indicates whether the information type is custom or not. - Custom *bool `json:"custom,omitempty"` - // Keywords - The information type keywords. - Keywords *[]InformationProtectionKeyword `json:"keywords,omitempty"` +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false } -// 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"` +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for IngestionConnectionString. -func (ics IngestionConnectionString) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// 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"` +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// 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) +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// IngestionSettingList list of ingestion settings -type IngestionSettingList struct { - autorest.Response `json:"-"` - // 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"` +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for IngestionSettingList. -func (isl IngestionSettingList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// IngestionSettingListIterator provides access to a complete listing of IngestionSetting values. -type IngestionSettingListIterator struct { - i int - page IngestionSettingListPage +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return &hcrmniar, true } -// 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 *IngestionSettingListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IngestionSettingListIterator.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 +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// 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 *IngestionSettingListIterator) Next() error { - return iter.NextWithContext(context.Background()) +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter IngestionSettingListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (iter IngestionSettingListIterator) Response() IngestionSettingList { - return iter.page.Response() +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false } -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter IngestionSettingListIterator) Value() IngestionSetting { - if !iter.page.NotDone() { - return IngestionSetting{} - } - return iter.page.Values()[iter.i] +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false } -// Creates a new instance of the IngestionSettingListIterator type. -func NewIngestionSettingListIterator(page IngestionSettingListPage) IngestionSettingListIterator { - return IngestionSettingListIterator{page: page} +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false } -// IsEmpty returns true if the ListResult contains no values. -func (isl IngestionSettingList) IsEmpty() bool { - return isl.Value == nil || len(*isl.Value) == 0 +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false } -// hasNextLink returns true if the NextLink is not empty. -func (isl IngestionSettingList) hasNextLink() bool { - return isl.NextLink != nil && len(*isl.NextLink) != 0 +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false } -// 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))) +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false } -// IngestionSettingListPage contains a page of IngestionSetting values. -type IngestionSettingListPage struct { - fn func(context.Context, IngestionSettingList) (IngestionSettingList, error) - isl IngestionSettingList +// AsCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false } -// 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) - }() +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &hcrmniar, true +} + +// HTTPD2CMessagesNotInAllowedRange number of device to cloud messages (HTTP protocol) is not in allowed +// range. +type HTTPD2CMessagesNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,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 HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { + hdmniar.RuleType = RuleTypeHTTPD2CMessagesNotInAllowedRange + objectMap := make(map[string]interface{}) + if hdmniar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = hdmniar.TimeWindowSize } - for { - next, err := page.fn(ctx, page.isl) - if err != nil { - return err - } - page.isl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } + if hdmniar.MinThreshold != nil { + objectMap["minThreshold"] = hdmniar.MinThreshold } - return nil + if hdmniar.MaxThreshold != nil { + objectMap["maxThreshold"] = hdmniar.MaxThreshold + } + if hdmniar.IsEnabled != nil { + objectMap["isEnabled"] = hdmniar.IsEnabled + } + if hdmniar.RuleType != "" { + objectMap["ruleType"] = hdmniar.RuleType + } + return json.Marshal(objectMap) } -// 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()) +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page IngestionSettingListPage) NotDone() bool { - return !page.isl.IsEmpty() +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &hdmniar, true } -// Response returns the raw server response from the last page request. -func (page IngestionSettingListPage) Response() IngestionSettingList { - return page.isl +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false } -// 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 +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &hdmniar, true } -// 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, - } +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false } -// 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"` +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for IngestionSettingToken. -func (ist IngestionSettingToken) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false } -// 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"` +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for IotAlertListModel. -func (ialm IotAlertListModel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false } -// IotAlertListModelIterator provides access to a complete listing of IotAlertModel values. -type IotAlertListModelIterator struct { - i int - page IotAlertListModelPage +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false } -// 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 *IotAlertListModelIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertListModelIterator.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 +// AsConnectionFromIPNotAllowed is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsConnectionFromIPNotAllowed() (*ConnectionFromIPNotAllowed, bool) { + return nil, false } -// 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 *IotAlertListModelIterator) Next() error { - return iter.NextWithContext(context.Background()) +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false +} + +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false +} + +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter IotAlertListModelIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (iter IotAlertListModelIterator) Response() IotAlertListModel { - return iter.page.Response() +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter IotAlertListModelIterator) Value() IotAlertModel { - if !iter.page.NotDone() { - return IotAlertModel{} - } - return iter.page.Values()[iter.i] +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// Creates a new instance of the IotAlertListModelIterator type. -func NewIotAlertListModelIterator(page IotAlertListModelPage) IotAlertListModelIterator { - return IotAlertListModelIterator{page: page} +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// IsEmpty returns true if the ListResult contains no values. -func (ialm IotAlertListModel) IsEmpty() bool { - return ialm.Value == nil || len(*ialm.Value) == 0 +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// hasNextLink returns true if the NextLink is not empty. -func (ialm IotAlertListModel) hasNextLink() bool { - return ialm.NextLink != nil && len(*ialm.NextLink) != 0 +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return &hdmniar, true } -// iotAlertListModelPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ialm IotAlertListModel) iotAlertListModelPreparer(ctx context.Context) (*http.Request, error) { - if !ialm.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ialm.NextLink))) +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false } -// IotAlertListModelPage contains a page of IotAlertModel values. -type IotAlertListModelPage struct { - fn func(context.Context, IotAlertListModel) (IotAlertListModel, error) - ialm IotAlertListModel +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false } -// 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 *IotAlertListModelPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertListModelPage.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.ialm) - if err != nil { - return err - } - page.ialm = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false } -// 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 *IotAlertListModelPage) Next() error { - return page.NextWithContext(context.Background()) +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page IotAlertListModelPage) NotDone() bool { - return !page.ialm.IsEmpty() +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (page IotAlertListModelPage) Response() IotAlertListModel { - return page.ialm +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false } -// Values returns the slice of values for the current page or nil if there are no values. -func (page IotAlertListModelPage) Values() []IotAlertModel { - if page.ialm.IsEmpty() { - return nil - } - return *page.ialm.Value +// AsCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false } -// Creates a new instance of the IotAlertListModelPage type. -func NewIotAlertListModelPage(cur IotAlertListModel, getNextPage func(context.Context, IotAlertListModel) (IotAlertListModel, error)) IotAlertListModelPage { - return IotAlertListModelPage{ - fn: getNextPage, - ialm: cur, - } +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &hdmniar, true } -// 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"` +// HybridComputeSettingsProperties settings for hybrid compute management +type HybridComputeSettingsProperties struct { + // HybridComputeProvisioningState - READ-ONLY; State of the service principal and its secret. Possible values include: 'HybridComputeProvisioningStateValid', 'HybridComputeProvisioningStateInvalid', 'HybridComputeProvisioningStateExpired' + HybridComputeProvisioningState HybridComputeProvisioningState `json:"hybridComputeProvisioningState,omitempty"` + // AutoProvision - Whether or not to automatically install Azure Arc (hybrid compute) agents on machines. Possible values include: 'AutoProvisionOn', 'AutoProvisionOff' + AutoProvision AutoProvision `json:"autoProvision,omitempty"` + // ResourceGroupName - The name of the resource group where Arc (Hybrid Compute) connectors are connected. + ResourceGroupName *string `json:"resourceGroupName,omitempty"` + // Region - The location where the metadata of machines will be stored + Region *string `json:"region,omitempty"` + // ProxyServer - For a non-Azure machine that is not connected directly to the internet, specify a proxy server that the non-Azure machine can use. + ProxyServer *ProxyServerProperties `json:"proxyServer,omitempty"` + // ServicePrincipal - An object to access resources that are secured by an Azure AD tenant. + ServicePrincipal *ServicePrincipalProperties `json:"servicePrincipal,omitempty"` } -// MarshalJSON is the custom marshaler for IotAlertModel. -func (iam IotAlertModel) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for HybridComputeSettingsProperties. +func (hcsp HybridComputeSettingsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if iam.IotAlertPropertiesModel != nil { - objectMap["properties"] = iam.IotAlertPropertiesModel + if hcsp.AutoProvision != "" { + objectMap["autoProvision"] = hcsp.AutoProvision } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for IotAlertModel struct. -func (iam *IotAlertModel) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err + if hcsp.ResourceGroupName != nil { + objectMap["resourceGroupName"] = hcsp.ResourceGroupName } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var iotAlertPropertiesModel IotAlertPropertiesModel - err = json.Unmarshal(*v, &iotAlertPropertiesModel) - if err != nil { - return err - } - 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 - } - } + if hcsp.Region != nil { + objectMap["region"] = hcsp.Region } - - return nil -} - -// IotAlertPropertiesModel ioT alert properties -type IotAlertPropertiesModel 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 IotAlertPropertiesModel. -func (iapm IotAlertPropertiesModel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if iapm.Entities != nil { - objectMap["entities"] = iapm.Entities + if hcsp.ProxyServer != nil { + objectMap["proxyServer"] = hcsp.ProxyServer } - if iapm.ExtendedProperties != nil { - objectMap["extendedProperties"] = iapm.ExtendedProperties + if hcsp.ServicePrincipal != nil { + objectMap["servicePrincipal"] = hcsp.ServicePrincipal } return json.Marshal(objectMap) } -// IotAlertType ioT alert type. -type IotAlertType struct { - autorest.Response `json:"-"` - // IotAlertTypeProperties - Alert type properties - *IotAlertTypeProperties `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"` +// InformationProtectionAwsOffering the information protection for AWS offering configurations +type InformationProtectionAwsOffering struct { + // InformationProtection - The native cloud connection configuration + InformationProtection *InformationProtectionAwsOfferingInformationProtection `json:"informationProtection,omitempty"` + // Description - READ-ONLY; The offering description. + Description *string `json:"description,omitempty"` + // OfferingType - Possible values include: 'OfferingTypeCloudOffering', 'OfferingTypeCspmMonitorAws', 'OfferingTypeDefenderForContainersAws', 'OfferingTypeDefenderForServersAws', 'OfferingTypeInformationProtectionAws' + OfferingType OfferingType `json:"offeringType,omitempty"` } -// MarshalJSON is the custom marshaler for IotAlertType. -func (iat IotAlertType) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) MarshalJSON() ([]byte, error) { + ipao.OfferingType = OfferingTypeInformationProtectionAws objectMap := make(map[string]interface{}) - if iat.IotAlertTypeProperties != nil { - objectMap["properties"] = iat.IotAlertTypeProperties + if ipao.InformationProtection != nil { + objectMap["informationProtection"] = ipao.InformationProtection + } + if ipao.OfferingType != "" { + objectMap["offeringType"] = ipao.OfferingType } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for IotAlertType struct. -func (iat *IotAlertType) 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 iotAlertTypeProperties IotAlertTypeProperties - err = json.Unmarshal(*v, &iotAlertTypeProperties) - if err != nil { - return err - } - iat.IotAlertTypeProperties = &iotAlertTypeProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - iat.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - iat.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - iat.Type = &typeVar - } - } - } +// AsCspmMonitorAwsOffering is the BasicCloudOffering implementation for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) AsCspmMonitorAwsOffering() (*CspmMonitorAwsOffering, bool) { + return nil, false +} - return nil +// AsDefenderForContainersAwsOffering is the BasicCloudOffering implementation for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) AsDefenderForContainersAwsOffering() (*DefenderForContainersAwsOffering, bool) { + return nil, false } -// IotAlertTypeList list of alert types -type IotAlertTypeList struct { - autorest.Response `json:"-"` - // Value - List data - Value *[]IotAlertType `json:"value,omitempty"` +// AsDefenderForServersAwsOffering is the BasicCloudOffering implementation for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) AsDefenderForServersAwsOffering() (*DefenderForServersAwsOffering, bool) { + return nil, false } -// IotAlertTypeProperties ioT alert type information. -type IotAlertTypeProperties struct { - // AlertDisplayName - READ-ONLY; The display name of the alert - AlertDisplayName *string `json:"alertDisplayName,omitempty"` - // Severity - READ-ONLY; The severity of the alert. Possible values include: 'Informational', 'Low', 'Medium', 'High' - Severity AlertSeverity `json:"severity,omitempty"` - // Description - READ-ONLY; Description of the suspected vulnerability and meaning. - Description *string `json:"description,omitempty"` - // ProviderName - READ-ONLY; The name of the alert provider or internal partner - ProviderName *string `json:"providerName,omitempty"` - // ProductName - READ-ONLY; The name of the product which published this alert - ProductName *string `json:"productName,omitempty"` - // ProductComponentName - READ-ONLY; The name of a component inside the product which generated the alert - ProductComponentName *string `json:"productComponentName,omitempty"` - // VendorName - READ-ONLY; The name of the vendor that raise the alert - VendorName *string `json:"vendorName,omitempty"` - // Intent - READ-ONLY; Kill chain related intent behind the alert. Could contain multiple enum values (separated by commas). Possible values include: 'Unknown', 'PreAttack', 'InitialAccess', 'Persistence', 'PrivilegeEscalation', 'DefenseEvasion', 'CredentialAccess', 'Discovery', 'LateralMovement', 'Execution', 'Collection', 'Exfiltration', 'CommandAndControl', 'Impact', 'Probing', 'Exploitation' - Intent AlertIntent `json:"intent,omitempty"` - // RemediationSteps - READ-ONLY; Manual action items to take to remediate the alert - RemediationSteps *[]string `json:"remediationSteps,omitempty"` +// AsInformationProtectionAwsOffering is the BasicCloudOffering implementation for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) AsInformationProtectionAwsOffering() (*InformationProtectionAwsOffering, bool) { + return &ipao, true } -// MarshalJSON is the custom marshaler for IotAlertTypeProperties. -func (iatp IotAlertTypeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) +// AsCloudOffering is the BasicCloudOffering implementation for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) AsCloudOffering() (*CloudOffering, bool) { + return nil, false } -// IotDefenderSettingsList list of IoT Defender settings -type IotDefenderSettingsList struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; List data - Value *[]IotDefenderSettingsModel `json:"value,omitempty"` +// AsBasicCloudOffering is the BasicCloudOffering implementation for InformationProtectionAwsOffering. +func (ipao InformationProtectionAwsOffering) AsBasicCloudOffering() (BasicCloudOffering, bool) { + return &ipao, true } -// MarshalJSON is the custom marshaler for IotDefenderSettingsList. -func (idsl IotDefenderSettingsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) +// InformationProtectionAwsOfferingInformationProtection the native cloud connection configuration +type InformationProtectionAwsOfferingInformationProtection struct { + // CloudRoleArn - The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` +} + +// InformationProtectionKeyword the information type keyword. +type InformationProtectionKeyword struct { + // Pattern - The keyword pattern. + Pattern *string `json:"pattern,omitempty"` + // Custom - Indicates whether the keyword is custom or not. + Custom *bool `json:"custom,omitempty"` + // CanBeNumeric - Indicates whether the keyword can be applied on numeric types or not. + CanBeNumeric *bool `json:"canBeNumeric,omitempty"` + // Excluded - Indicates whether the keyword is excluded or not. + Excluded *bool `json:"excluded,omitempty"` } -// IotDefenderSettingsModel ioT Defender settings -type IotDefenderSettingsModel struct { +// InformationProtectionPolicy information protection policy. +type InformationProtectionPolicy struct { autorest.Response `json:"-"` - // IotDefenderSettingsProperties - IoT Defender settings properties - *IotDefenderSettingsProperties `json:"properties,omitempty"` + // InformationProtectionPolicyProperties - Information protection policy data + *InformationProtectionPolicyProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name @@ -11528,17 +12173,17 @@ type IotDefenderSettingsModel struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for IotDefenderSettingsModel. -func (idsm IotDefenderSettingsModel) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for InformationProtectionPolicy. +func (ipp InformationProtectionPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if idsm.IotDefenderSettingsProperties != nil { - objectMap["properties"] = idsm.IotDefenderSettingsProperties + if ipp.InformationProtectionPolicyProperties != nil { + objectMap["properties"] = ipp.InformationProtectionPolicyProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for IotDefenderSettingsModel struct. -func (idsm *IotDefenderSettingsModel) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for InformationProtectionPolicy struct. +func (ipp *InformationProtectionPolicy) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -11548,12 +12193,12 @@ func (idsm *IotDefenderSettingsModel) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var iotDefenderSettingsProperties IotDefenderSettingsProperties - err = json.Unmarshal(*v, &iotDefenderSettingsProperties) + var informationProtectionPolicyProperties InformationProtectionPolicyProperties + err = json.Unmarshal(*v, &informationProtectionPolicyProperties) if err != nil { return err } - idsm.IotDefenderSettingsProperties = &iotDefenderSettingsProperties + ipp.InformationProtectionPolicyProperties = &informationProtectionPolicyProperties } case "id": if v != nil { @@ -11562,7 +12207,7 @@ func (idsm *IotDefenderSettingsModel) UnmarshalJSON(body []byte) error { if err != nil { return err } - idsm.ID = &ID + ipp.ID = &ID } case "name": if v != nil { @@ -11571,7 +12216,7 @@ func (idsm *IotDefenderSettingsModel) UnmarshalJSON(body []byte) error { if err != nil { return err } - idsm.Name = &name + ipp.Name = &name } case "type": if v != nil { @@ -11580,7 +12225,7 @@ func (idsm *IotDefenderSettingsModel) UnmarshalJSON(body []byte) error { if err != nil { return err } - idsm.Type = &typeVar + ipp.Type = &typeVar } } } @@ -11588,60 +12233,36 @@ func (idsm *IotDefenderSettingsModel) UnmarshalJSON(body []byte) error { return nil } -// IotDefenderSettingsProperties ioT Defender settings properties -type IotDefenderSettingsProperties struct { - // DeviceQuota - Size of the device quota (as a opposed to a Pay as You Go billing model). Value is required to be in multiples of 1000. - DeviceQuota *int32 `json:"deviceQuota,omitempty"` - // SentinelWorkspaceResourceIds - Sentinel Workspace Resource Ids - SentinelWorkspaceResourceIds *[]string `json:"sentinelWorkspaceResourceIds,omitempty"` - // OnboardingKind - The kind of onboarding for the subscription. Possible values include: 'Default', 'MigratedToAzure', 'Evaluation', 'Purchased' - OnboardingKind OnboardingKind `json:"onboardingKind,omitempty"` - // EvaluationEndTime - READ-ONLY; End time of the evaluation period, if such exist - EvaluationEndTime *date.Time `json:"evaluationEndTime,omitempty"` -} - -// MarshalJSON is the custom marshaler for IotDefenderSettingsProperties. -func (idsp IotDefenderSettingsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if idsp.DeviceQuota != nil { - objectMap["deviceQuota"] = idsp.DeviceQuota - } - if idsp.SentinelWorkspaceResourceIds != nil { - objectMap["sentinelWorkspaceResourceIds"] = idsp.SentinelWorkspaceResourceIds - } - if idsp.OnboardingKind != "" { - objectMap["onboardingKind"] = idsp.OnboardingKind - } - return json.Marshal(objectMap) -} - -// IotRecommendationListModel list of IoT recommendations -type IotRecommendationListModel struct { +// InformationProtectionPolicyList information protection policies response. +type InformationProtectionPolicyList struct { autorest.Response `json:"-"` - // Value - READ-ONLY; List data - Value *[]IotRecommendationModel `json:"value,omitempty"` - // NextLink - READ-ONLY; When available, follow the URI to get the next page of data + // Value - List of information protection policies. + Value *[]InformationProtectionPolicy `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for IotRecommendationListModel. -func (irlm IotRecommendationListModel) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for InformationProtectionPolicyList. +func (ippl InformationProtectionPolicyList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if ippl.Value != nil { + objectMap["value"] = ippl.Value + } return json.Marshal(objectMap) } -// IotRecommendationListModelIterator provides access to a complete listing of IotRecommendationModel -// values. -type IotRecommendationListModelIterator struct { +// InformationProtectionPolicyListIterator provides access to a complete listing of +// InformationProtectionPolicy values. +type InformationProtectionPolicyListIterator struct { i int - page IotRecommendationListModelPage + page InformationProtectionPolicyListPage } // 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 *IotRecommendationListModelIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *InformationProtectionPolicyListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationListModelIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/InformationProtectionPolicyListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -11666,67 +12287,67 @@ func (iter *IotRecommendationListModelIterator) NextWithContext(ctx context.Cont // 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 *IotRecommendationListModelIterator) Next() error { +func (iter *InformationProtectionPolicyListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter IotRecommendationListModelIterator) NotDone() bool { +func (iter InformationProtectionPolicyListIterator) 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 IotRecommendationListModelIterator) Response() IotRecommendationListModel { +func (iter InformationProtectionPolicyListIterator) Response() InformationProtectionPolicyList { 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 IotRecommendationListModelIterator) Value() IotRecommendationModel { +func (iter InformationProtectionPolicyListIterator) Value() InformationProtectionPolicy { if !iter.page.NotDone() { - return IotRecommendationModel{} + return InformationProtectionPolicy{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the IotRecommendationListModelIterator type. -func NewIotRecommendationListModelIterator(page IotRecommendationListModelPage) IotRecommendationListModelIterator { - return IotRecommendationListModelIterator{page: page} +// Creates a new instance of the InformationProtectionPolicyListIterator type. +func NewInformationProtectionPolicyListIterator(page InformationProtectionPolicyListPage) InformationProtectionPolicyListIterator { + return InformationProtectionPolicyListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (irlm IotRecommendationListModel) IsEmpty() bool { - return irlm.Value == nil || len(*irlm.Value) == 0 +func (ippl InformationProtectionPolicyList) IsEmpty() bool { + return ippl.Value == nil || len(*ippl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (irlm IotRecommendationListModel) hasNextLink() bool { - return irlm.NextLink != nil && len(*irlm.NextLink) != 0 +func (ippl InformationProtectionPolicyList) hasNextLink() bool { + return ippl.NextLink != nil && len(*ippl.NextLink) != 0 } -// iotRecommendationListModelPreparer prepares a request to retrieve the next set of results. +// informationProtectionPolicyListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (irlm IotRecommendationListModel) iotRecommendationListModelPreparer(ctx context.Context) (*http.Request, error) { - if !irlm.hasNextLink() { +func (ippl InformationProtectionPolicyList) informationProtectionPolicyListPreparer(ctx context.Context) (*http.Request, error) { + if !ippl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(irlm.NextLink))) + autorest.WithBaseURL(to.String(ippl.NextLink))) } -// IotRecommendationListModelPage contains a page of IotRecommendationModel values. -type IotRecommendationListModelPage struct { - fn func(context.Context, IotRecommendationListModel) (IotRecommendationListModel, error) - irlm IotRecommendationListModel +// InformationProtectionPolicyListPage contains a page of InformationProtectionPolicy values. +type InformationProtectionPolicyListPage struct { + fn func(context.Context, InformationProtectionPolicyList) (InformationProtectionPolicyList, error) + ippl InformationProtectionPolicyList } // 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 *IotRecommendationListModelPage) NextWithContext(ctx context.Context) (err error) { +func (page *InformationProtectionPolicyListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationListModelPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/InformationProtectionPolicyListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -11736,11 +12357,11 @@ func (page *IotRecommendationListModelPage) NextWithContext(ctx context.Context) }() } for { - next, err := page.fn(ctx, page.irlm) + next, err := page.fn(ctx, page.ippl) if err != nil { return err } - page.irlm = next + page.ippl = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -11751,41 +12372,98 @@ func (page *IotRecommendationListModelPage) NextWithContext(ctx context.Context) // 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 *IotRecommendationListModelPage) Next() error { +func (page *InformationProtectionPolicyListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page IotRecommendationListModelPage) NotDone() bool { - return !page.irlm.IsEmpty() +func (page InformationProtectionPolicyListPage) NotDone() bool { + return !page.ippl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page IotRecommendationListModelPage) Response() IotRecommendationListModel { - return page.irlm +func (page InformationProtectionPolicyListPage) Response() InformationProtectionPolicyList { + return page.ippl } // Values returns the slice of values for the current page or nil if there are no values. -func (page IotRecommendationListModelPage) Values() []IotRecommendationModel { - if page.irlm.IsEmpty() { +func (page InformationProtectionPolicyListPage) Values() []InformationProtectionPolicy { + if page.ippl.IsEmpty() { return nil } - return *page.irlm.Value + return *page.ippl.Value } -// Creates a new instance of the IotRecommendationListModelPage type. -func NewIotRecommendationListModelPage(cur IotRecommendationListModel, getNextPage func(context.Context, IotRecommendationListModel) (IotRecommendationListModel, error)) IotRecommendationListModelPage { - return IotRecommendationListModelPage{ +// Creates a new instance of the InformationProtectionPolicyListPage type. +func NewInformationProtectionPolicyListPage(cur InformationProtectionPolicyList, getNextPage func(context.Context, InformationProtectionPolicyList) (InformationProtectionPolicyList, error)) InformationProtectionPolicyListPage { + return InformationProtectionPolicyListPage{ fn: getNextPage, - irlm: cur, + ippl: cur, + } +} + +// InformationProtectionPolicyProperties describes properties of an information protection policy. +type InformationProtectionPolicyProperties struct { + // LastModifiedUtc - READ-ONLY; Describes the last UTC time the policy was modified. + LastModifiedUtc *date.Time `json:"lastModifiedUtc,omitempty"` + // Version - READ-ONLY; Describes the version of the policy. + Version *string `json:"version,omitempty"` + // Labels - Dictionary of sensitivity labels. + Labels map[string]*SensitivityLabel `json:"labels"` + // InformationTypes - The sensitivity information types. + InformationTypes map[string]*InformationType `json:"informationTypes"` +} + +// MarshalJSON is the custom marshaler for InformationProtectionPolicyProperties. +func (ippp InformationProtectionPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ippp.Labels != nil { + objectMap["labels"] = ippp.Labels + } + if ippp.InformationTypes != nil { + objectMap["informationTypes"] = ippp.InformationTypes } + return json.Marshal(objectMap) +} + +// InformationType the information type. +type InformationType struct { + // DisplayName - The name of the information type. + DisplayName *string `json:"displayName,omitempty"` + // Description - The description of the information type. + Description *string `json:"description,omitempty"` + // Order - The order of the information type. + Order *int32 `json:"order,omitempty"` + // RecommendedLabelID - The recommended label id to be associated with this information type. + RecommendedLabelID *uuid.UUID `json:"recommendedLabelId,omitempty"` + // Enabled - Indicates whether the information type is enabled or not. + Enabled *bool `json:"enabled,omitempty"` + // Custom - Indicates whether the information type is custom or not. + Custom *bool `json:"custom,omitempty"` + // Keywords - The information type keywords. + Keywords *[]InformationProtectionKeyword `json:"keywords,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 IngestionConnectionString. +func (ics IngestionConnectionString) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) } -// IotRecommendationModel ioT recommendation -type IotRecommendationModel struct { +// IngestionSetting configures how to correlate scan data and logs with resources associated with the +// subscription. +type IngestionSetting struct { autorest.Response `json:"-"` - // IotRecommendationPropertiesModel - Recommendation properties - *IotRecommendationPropertiesModel `json:"properties,omitempty"` + // Properties - Ingestion setting data + Properties interface{} `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name @@ -11794,191 +12472,190 @@ type IotRecommendationModel struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for IotRecommendationModel. -func (irm IotRecommendationModel) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for IngestionSetting. +func (is IngestionSetting) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if irm.IotRecommendationPropertiesModel != nil { - objectMap["properties"] = irm.IotRecommendationPropertiesModel + if is.Properties != nil { + objectMap["properties"] = is.Properties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for IotRecommendationModel struct. -func (irm *IotRecommendationModel) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) +// IngestionSettingList list of ingestion settings +type IngestionSettingList struct { + autorest.Response `json:"-"` + // 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"` +} + +// MarshalJSON is the custom marshaler for IngestionSettingList. +func (isl IngestionSettingList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// IngestionSettingListIterator provides access to a complete listing of IngestionSetting values. +type IngestionSettingListIterator struct { + i int + 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 *IngestionSettingListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IngestionSettingListIterator.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 } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var iotRecommendationPropertiesModel IotRecommendationPropertiesModel - err = json.Unmarshal(*v, &iotRecommendationPropertiesModel) - if err != nil { - return err - } - irm.IotRecommendationPropertiesModel = &iotRecommendationPropertiesModel - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - irm.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - irm.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - irm.Type = &typeVar + 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 *IngestionSettingListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +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 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 IngestionSettingListIterator) Value() IngestionSetting { + if !iter.page.NotDone() { + return IngestionSetting{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IngestionSettingListIterator type. +func NewIngestionSettingListIterator(page IngestionSettingListPage) IngestionSettingListIterator { + return IngestionSettingListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (isl IngestionSettingList) IsEmpty() bool { + return isl.Value == nil || len(*isl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (isl IngestionSettingList) hasNextLink() bool { + return isl.NextLink != nil && len(*isl.NextLink) != 0 +} + +// 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 } -// IotRecommendationPropertiesModel ioT recommendation properties -type IotRecommendationPropertiesModel 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"` +// 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()) } -// MarshalJSON is the custom marshaler for IotRecommendationPropertiesModel. -func (irpm IotRecommendationPropertiesModel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if irpm.RecommendationAdditionalData != nil { - objectMap["recommendationAdditionalData"] = irpm.RecommendationAdditionalData - } - return json.Marshal(objectMap) +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IngestionSettingListPage) NotDone() bool { + return !page.isl.IsEmpty() } -// IotRecommendationType ioT recommendation type. -type IotRecommendationType struct { - autorest.Response `json:"-"` - // IotRecommendationTypeProperties - Recommendation type properties - *IotRecommendationTypeProperties `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"` +// Response returns the raw server response from the last page request. +func (page IngestionSettingListPage) Response() IngestionSettingList { + return page.isl } -// MarshalJSON is the custom marshaler for IotRecommendationType. -func (irt IotRecommendationType) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if irt.IotRecommendationTypeProperties != nil { - objectMap["properties"] = irt.IotRecommendationTypeProperties +// 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 json.Marshal(objectMap) + return *page.isl.Value } -// UnmarshalJSON is the custom unmarshaler for IotRecommendationType struct. -func (irt *IotRecommendationType) 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 iotRecommendationTypeProperties IotRecommendationTypeProperties - err = json.Unmarshal(*v, &iotRecommendationTypeProperties) - if err != nil { - return err - } - irt.IotRecommendationTypeProperties = &iotRecommendationTypeProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - irt.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - irt.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - irt.Type = &typeVar - } - } +// 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, } - - return nil } -// IotRecommendationTypeList list of recommendation types -type IotRecommendationTypeList struct { +// IngestionSettingToken configures how to correlate scan data and logs with resources associated with the +// subscription. +type IngestionSettingToken struct { autorest.Response `json:"-"` - // Value - List data - Value *[]IotRecommendationType `json:"value,omitempty"` -} - -// IotRecommendationTypeProperties ioT recommendation type information. -type IotRecommendationTypeProperties struct { - // RecommendationDisplayName - READ-ONLY; The display name of the recommendation - RecommendationDisplayName *string `json:"recommendationDisplayName,omitempty"` - // Severity - READ-ONLY; The severity of the recommendation. Possible values include: 'RecommendationSeverityUnknown', 'RecommendationSeverityNotApplicable', 'RecommendationSeverityHealthy', 'RecommendationSeverityOffByPolicy', 'RecommendationSeverityLow', 'RecommendationSeverityMedium', 'RecommendationSeverityHigh' - Severity RecommendationSeverity `json:"severity,omitempty"` - // Description - READ-ONLY; Description of the suspected vulnerability and meaning. - Description *string `json:"description,omitempty"` - // ProductName - READ-ONLY; The name of the product which published this recommendation - ProductName *string `json:"productName,omitempty"` - // ProductComponentName - READ-ONLY; The name of a component inside the product which generated the recommendation - ProductComponentName *string `json:"productComponentName,omitempty"` - // VendorName - READ-ONLY; The name of the vendor that raised the recommendation - VendorName *string `json:"vendorName,omitempty"` - // Control - READ-ONLY; The name of the recommendation's control category - Control *string `json:"control,omitempty"` - // RemediationSteps - READ-ONLY; Manual action items to take to resolve the recommendation - RemediationSteps *[]string `json:"remediationSteps,omitempty"` - // DataSource - READ-ONLY; The alert's data source - DataSource *string `json:"dataSource,omitempty"` + // 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 IotRecommendationTypeProperties. -func (irtp IotRecommendationTypeProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for IngestionSettingToken. +func (ist IngestionSettingToken) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) return json.Marshal(objectMap) } @@ -13071,298 +13748,45 @@ func (page *IoTSecuritySolutionsListPage) NextWithContext(ctx context.Context) ( // 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 *IoTSecuritySolutionsListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page IoTSecuritySolutionsListPage) NotDone() bool { - return !page.itssl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page IoTSecuritySolutionsListPage) Response() IoTSecuritySolutionsList { - return page.itssl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page IoTSecuritySolutionsListPage) Values() []IoTSecuritySolutionModel { - if page.itssl.IsEmpty() { - return nil - } - return *page.itssl.Value -} - -// Creates a new instance of the IoTSecuritySolutionsListPage type. -func NewIoTSecuritySolutionsListPage(cur IoTSecuritySolutionsList, getNextPage func(context.Context, IoTSecuritySolutionsList) (IoTSecuritySolutionsList, error)) IoTSecuritySolutionsListPage { - return IoTSecuritySolutionsListPage{ - fn: getNextPage, - itssl: cur, - } -} - -// IotSensorProperties ioT sensor properties -type IotSensorProperties struct { - // ConnectivityTime - READ-ONLY; Last connectivity time of the IoT sensor - ConnectivityTime *string `json:"connectivityTime,omitempty"` - // CreationTime - READ-ONLY; Creation time of the IoT sensor - CreationTime *string `json:"creationTime,omitempty"` - // DynamicLearning - READ-ONLY; Dynamic mode status of the IoT sensor - DynamicLearning *bool `json:"dynamicLearning,omitempty"` - // LearningMode - READ-ONLY; Learning mode status of the IoT sensor - LearningMode *bool `json:"learningMode,omitempty"` - // SensorStatus - READ-ONLY; Status of the IoT sensor. Possible values include: 'Ok', 'Disconnected', 'Unavailable' - SensorStatus SensorStatus `json:"sensorStatus,omitempty"` - // SensorVersion - READ-ONLY; Version of the IoT sensor - SensorVersion *string `json:"sensorVersion,omitempty"` - // TiAutomaticUpdates - TI Automatic mode status of the IoT sensor - TiAutomaticUpdates *bool `json:"tiAutomaticUpdates,omitempty"` - // TiStatus - READ-ONLY; TI Status of the IoT sensor. Possible values include: 'TiStatusOk', 'TiStatusFailed', 'TiStatusInProgress', 'TiStatusUpdateAvailable' - TiStatus TiStatus `json:"tiStatus,omitempty"` - // TiVersion - READ-ONLY; TI Version of the IoT sensor - 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. -func (isp IotSensorProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if isp.TiAutomaticUpdates != nil { - objectMap["tiAutomaticUpdates"] = isp.TiAutomaticUpdates - } - if isp.Zone != nil { - objectMap["zone"] = isp.Zone - } - if isp.SensorType != "" { - objectMap["sensorType"] = isp.SensorType - } - return json.Marshal(objectMap) -} - -// IotSensorsList list of IoT sensors -type IotSensorsList struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; List data - Value *[]IotSensorsModel `json:"value,omitempty"` -} - -// MarshalJSON is the custom marshaler for IotSensorsList. -func (isl IotSensorsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// IotSensorsModel ioT sensor model -type IotSensorsModel struct { - autorest.Response `json:"-"` - // IotSensorProperties - IoT sensor properties - *IotSensorProperties `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 IotSensorsModel. -func (ism IotSensorsModel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ism.IotSensorProperties != nil { - objectMap["properties"] = ism.IotSensorProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for IotSensorsModel struct. -func (ism *IotSensorsModel) 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 iotSensorProperties IotSensorProperties - err = json.Unmarshal(*v, &iotSensorProperties) - if err != nil { - return err - } - ism.IotSensorProperties = &iotSensorProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ism.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ism.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ism.Type = &typeVar - } - } - } - - return nil -} - -// IoTSeverityMetrics ioT Security solution analytics severity metrics. -type IoTSeverityMetrics struct { - // High - Count of high severity alerts/recommendations. - High *int64 `json:"high,omitempty"` - // Medium - Count of medium severity alerts/recommendations. - Medium *int64 `json:"medium,omitempty"` - // Low - Count of low severity alerts/recommendations. - Low *int64 `json:"low,omitempty"` -} - -// IotSiteProperties ioT site properties -type IotSiteProperties struct { - // DisplayName - Display name of the IoT site - DisplayName *string `json:"displayName,omitempty"` - // Tags - Tags of the IoT site - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for IotSiteProperties. -func (isp IotSiteProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if isp.DisplayName != nil { - objectMap["displayName"] = isp.DisplayName - } - if isp.Tags != nil { - objectMap["tags"] = isp.Tags - } - return json.Marshal(objectMap) -} - -// IotSitesList list of IoT sites -type IotSitesList struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; List data - Value *[]IotSitesModel `json:"value,omitempty"` +// Deprecated: Use NextWithContext() instead. +func (page *IoTSecuritySolutionsListPage) Next() error { + return page.NextWithContext(context.Background()) } -// MarshalJSON is the custom marshaler for IotSitesList. -func (isl IotSitesList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IoTSecuritySolutionsListPage) NotDone() bool { + return !page.itssl.IsEmpty() } -// IotSitesModel ioT site model -type IotSitesModel struct { - autorest.Response `json:"-"` - // IotSiteProperties - IoT site properties - *IotSiteProperties `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"` +// Response returns the raw server response from the last page request. +func (page IoTSecuritySolutionsListPage) Response() IoTSecuritySolutionsList { + return page.itssl } -// MarshalJSON is the custom marshaler for IotSitesModel. -func (ism IotSitesModel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ism.IotSiteProperties != nil { - objectMap["properties"] = ism.IotSiteProperties +// Values returns the slice of values for the current page or nil if there are no values. +func (page IoTSecuritySolutionsListPage) Values() []IoTSecuritySolutionModel { + if page.itssl.IsEmpty() { + return nil } - return json.Marshal(objectMap) + return *page.itssl.Value } -// UnmarshalJSON is the custom unmarshaler for IotSitesModel struct. -func (ism *IotSitesModel) 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 iotSiteProperties IotSiteProperties - err = json.Unmarshal(*v, &iotSiteProperties) - if err != nil { - return err - } - ism.IotSiteProperties = &iotSiteProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ism.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ism.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ism.Type = &typeVar - } - } +// Creates a new instance of the IoTSecuritySolutionsListPage type. +func NewIoTSecuritySolutionsListPage(cur IoTSecuritySolutionsList, getNextPage func(context.Context, IoTSecuritySolutionsList) (IoTSecuritySolutionsList, error)) IoTSecuritySolutionsListPage { + return IoTSecuritySolutionsListPage{ + fn: getNextPage, + itssl: cur, } - - return nil -} - -// IPAddress IP Address information -type IPAddress struct { - // V4Address - READ-ONLY; IPV4 address - V4Address *string `json:"v4Address,omitempty"` - // DetectionTime - READ-ONLY; Detection time of the ip address. - DetectionTime *date.Time `json:"detectionTime,omitempty"` - // SubnetCidr - READ-ONLY; Subnet Classless Inter-Domain Routing - SubnetCidr *string `json:"subnetCidr,omitempty"` - // Fqdn - READ-ONLY; Fully qualified domain name - Fqdn *string `json:"fqdn,omitempty"` - // FqdnLastLookupTime - READ-ONLY; FQDN last lookup time. - FqdnLastLookupTime *date.Time `json:"fqdnLastLookupTime,omitempty"` } -// MarshalJSON is the custom marshaler for IPAddress. -func (ia IPAddress) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) +// IoTSeverityMetrics ioT Security solution analytics severity metrics. +type IoTSeverityMetrics struct { + // High - Count of high severity alerts/recommendations. + High *int64 `json:"high,omitempty"` + // Medium - Count of medium severity alerts/recommendations. + Medium *int64 `json:"medium,omitempty"` + // Low - Count of low severity alerts/recommendations. + Low *int64 `json:"low,omitempty"` } // JitNetworkAccessPoliciesList ... @@ -14237,24 +14661,94 @@ func (lai LogAnalyticsIdentifier) AsBasicResourceIdentifier() (BasicResourceIden return &lai, true } -// MacAddress MAC Address information -type MacAddress struct { - // Address - READ-ONLY; MAC address - Address *string `json:"address,omitempty"` - // DetectionTime - READ-ONLY; Detection time of the mac address. - DetectionTime *date.Time `json:"detectionTime,omitempty"` - // Significance - READ-ONLY; Indicates whether this is the primary secondary MAC address of the device. Possible values include: 'Primary', 'Secondary' - Significance MacSignificance `json:"significance,omitempty"` - // RelationToIPStatus - READ-ONLY; Indicates whether the relation of the mac to the ip address is certain or a guess. Possible values include: 'Guess', 'Certain' - RelationToIPStatus RelationToIPStatus `json:"relationToIpStatus,omitempty"` +// MdeOnboardingData the resource of the configuration or data needed to onboard the machine to MDE +type MdeOnboardingData struct { + autorest.Response `json:"-"` + *MdeOnboardingDataProperties `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 MacAddress. -func (ma MacAddress) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for MdeOnboardingData. +func (mod MdeOnboardingData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if mod.MdeOnboardingDataProperties != nil { + objectMap["properties"] = mod.MdeOnboardingDataProperties + } return json.Marshal(objectMap) } +// UnmarshalJSON is the custom unmarshaler for MdeOnboardingData struct. +func (mod *MdeOnboardingData) 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 mdeOnboardingDataProperties MdeOnboardingDataProperties + err = json.Unmarshal(*v, &mdeOnboardingDataProperties) + if err != nil { + return err + } + mod.MdeOnboardingDataProperties = &mdeOnboardingDataProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mod.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mod.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mod.Type = &typeVar + } + } + } + + return nil +} + +// MdeOnboardingDataList list of all MDE onboarding data resources +type MdeOnboardingDataList struct { + autorest.Response `json:"-"` + // Value - List of the resources of the configuration or data needed to onboard the machine to MDE + Value *[]MdeOnboardingData `json:"value,omitempty"` +} + +// MdeOnboardingDataProperties properties of the MDE configuration or data parameter needed to onboard the +// machine to MDE +type MdeOnboardingDataProperties struct { + // OnboardingPackageWindows - The onboarding package used to onboard Windows machines to MDE, coded in base64. This can also be used for onboarding using the dedicated VM Extension + OnboardingPackageWindows *[]byte `json:"onboardingPackageWindows,omitempty"` + // OnboardingPackageLinux - The onboarding package used to onboard Linux machines to MDE, coded in base64. This can also be used for onboarding using the dedicated VM Extension + OnboardingPackageLinux *[]byte `json:"onboardingPackageLinux,omitempty"` +} + // MqttC2DMessagesNotInAllowedRange number of cloud to device messages (MQTT protocol) is not in allowed // range. type MqttC2DMessagesNotInAllowedRange struct { @@ -14843,61 +15337,6 @@ func (mdmniar MqttD2CMessagesNotInAllowedRange) AsBasicCustomAlertRule() (BasicC return &mdmniar, true } -// NetworkInterface network interface -type NetworkInterface struct { - IPAddress *IPAddress `json:"ipAddress,omitempty"` - MacAddress *MacAddress `json:"macAddress,omitempty"` - // Vlans - READ-ONLY; List of device vlans. - Vlans *[]string `json:"vlans,omitempty"` -} - -// MarshalJSON is the custom marshaler for NetworkInterface. -func (ni NetworkInterface) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ni.IPAddress != nil { - objectMap["ipAddress"] = ni.IPAddress - } - if ni.MacAddress != nil { - objectMap["macAddress"] = ni.MacAddress - } - return json.Marshal(objectMap) -} - -// OnPremiseIotSensor on-premise IoT sensor -type OnPremiseIotSensor struct { - autorest.Response `json:"-"` - // Properties - On-premise IoT sensor properties - 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"` -} - -// MarshalJSON is the custom marshaler for OnPremiseIotSensor. -func (opis OnPremiseIotSensor) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if opis.Properties != nil { - objectMap["properties"] = opis.Properties - } - return json.Marshal(objectMap) -} - -// OnPremiseIotSensorsList list of on-premise IoT sensors -type OnPremiseIotSensorsList struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; List data - Value *[]OnPremiseIotSensor `json:"value,omitempty"` -} - -// MarshalJSON is the custom marshaler for OnPremiseIotSensorsList. -func (opisl OnPremiseIotSensorsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - // BasicOnPremiseResourceDetails details of the On Premise resource that was assessed type BasicOnPremiseResourceDetails interface { AsOnPremiseSQLResourceDetails() (*OnPremiseSQLResourceDetails, bool) @@ -15287,147 +15726,6 @@ func NewOperationListPage(cur OperationList, getNextPage func(context.Context, O } } -// PackageDownloadInfo information on a specific package download -type PackageDownloadInfo struct { - // Version - READ-ONLY; Version number - Version *string `json:"version,omitempty"` - // Link - Download link - Link *string `json:"link,omitempty"` - // VersionKind - READ-ONLY; Kind of the version. Possible values include: 'Latest', 'Previous', 'Preview' - VersionKind VersionKind `json:"versionKind,omitempty"` -} - -// MarshalJSON is the custom marshaler for PackageDownloadInfo. -func (pdi PackageDownloadInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pdi.Link != nil { - objectMap["link"] = pdi.Link - } - return json.Marshal(objectMap) -} - -// PackageDownloads information about package downloads -type PackageDownloads struct { - autorest.Response `json:"-"` - // Sensor - READ-ONLY; Contains all Sensor binary downloads - Sensor *PackageDownloadsSensor `json:"sensor,omitempty"` - // CentralManager - READ-ONLY; All downloads for Central Manager - CentralManager *PackageDownloadsCentralManager `json:"centralManager,omitempty"` - // ThreatIntelligence - READ-ONLY; All downloads for threat intelligence - ThreatIntelligence *[]PackageDownloadInfo `json:"threatIntelligence,omitempty"` - // Snmp - READ-ONLY; SNMP Server file - Snmp *[]PackageDownloadInfo `json:"snmp,omitempty"` - // WmiTool - READ-ONLY; Used for local configuration export - WmiTool *[]PackageDownloadInfo `json:"wmiTool,omitempty"` - // AuthorizedDevicesImportTemplate - READ-ONLY; Authorized devices import template - AuthorizedDevicesImportTemplate *[]PackageDownloadInfo `json:"authorizedDevicesImportTemplate,omitempty"` - // DeviceInformationUpdateImportTemplate - READ-ONLY; Authorized devices import template - DeviceInformationUpdateImportTemplate *[]PackageDownloadInfo `json:"deviceInformationUpdateImportTemplate,omitempty"` -} - -// MarshalJSON is the custom marshaler for PackageDownloads. -func (pd PackageDownloads) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PackageDownloadsCentralManager all downloads for Central Manager -type PackageDownloadsCentralManager struct { - // Full - READ-ONLY; Contains full package downloads - Full *PackageDownloadsCentralManagerFull `json:"full,omitempty"` - // Upgrade - READ-ONLY; Central Manager upgrade package downloads (on existing installations) - Upgrade *[]UpgradePackageDownloadInfo `json:"upgrade,omitempty"` -} - -// MarshalJSON is the custom marshaler for PackageDownloadsCentralManager. -func (pdM PackageDownloadsCentralManager) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PackageDownloadsCentralManagerFull contains full package downloads -type PackageDownloadsCentralManagerFull struct { - // Iso - READ-ONLY; Contains all ISO full versions of the Central Manager - Iso *[]PackageDownloadInfo `json:"iso,omitempty"` - // Ovf - READ-ONLY; Contains all OVF (virtual machine) full versions of the Central Manager - Ovf *PackageDownloadsCentralManagerFullOvf `json:"ovf,omitempty"` -} - -// MarshalJSON is the custom marshaler for PackageDownloadsCentralManagerFull. -func (pdM PackageDownloadsCentralManagerFull) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PackageDownloadsCentralManagerFullOvf contains all OVF (virtual machine) full versions of the Central -// Manager -type PackageDownloadsCentralManagerFullOvf struct { - // Enterprise - READ-ONLY; The Enterprise package type - Enterprise *[]PackageDownloadInfo `json:"enterprise,omitempty"` - // EnterpriseHighAvailability - READ-ONLY; The EnterpriseHighAvailability package type - EnterpriseHighAvailability *[]PackageDownloadInfo `json:"enterpriseHighAvailability,omitempty"` - // Medium - READ-ONLY; The Medium package type - Medium *[]PackageDownloadInfo `json:"medium,omitempty"` - // MediumHighAvailability - READ-ONLY; The MediumHighAvailability package type - MediumHighAvailability *[]PackageDownloadInfo `json:"mediumHighAvailability,omitempty"` -} - -// MarshalJSON is the custom marshaler for PackageDownloadsCentralManagerFullOvf. -func (pdM PackageDownloadsCentralManagerFullOvf) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PackageDownloadsSensor contains all Sensor binary downloads -type PackageDownloadsSensor struct { - // Full - READ-ONLY; Contains full package downloads - Full *PackageDownloadsSensorFull `json:"full,omitempty"` - // Upgrade - Sensor upgrade package downloads (on existing installations) - Upgrade *[]UpgradePackageDownloadInfo `json:"upgrade,omitempty"` -} - -// MarshalJSON is the custom marshaler for PackageDownloadsSensor. -func (pd PackageDownloadsSensor) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pd.Upgrade != nil { - objectMap["upgrade"] = pd.Upgrade - } - return json.Marshal(objectMap) -} - -// PackageDownloadsSensorFull contains full package downloads -type PackageDownloadsSensorFull struct { - // Iso - READ-ONLY; Contains all ISO full versions for the sensor - Iso *[]PackageDownloadInfo `json:"iso,omitempty"` - // Ovf - Contains all OVF (virtual machine) full versions for the sensor - Ovf *PackageDownloadsSensorFullOvf `json:"ovf,omitempty"` -} - -// MarshalJSON is the custom marshaler for PackageDownloadsSensorFull. -func (pd PackageDownloadsSensorFull) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pd.Ovf != nil { - objectMap["ovf"] = pd.Ovf - } - return json.Marshal(objectMap) -} - -// PackageDownloadsSensorFullOvf contains all OVF (virtual machine) full versions for the sensor -type PackageDownloadsSensorFullOvf struct { - // Enterprise - READ-ONLY; Enterprise package type - Enterprise *[]PackageDownloadInfo `json:"enterprise,omitempty"` - // Medium - READ-ONLY; Medium package type - Medium *[]PackageDownloadInfo `json:"medium,omitempty"` - // Line - READ-ONLY; Line package type - Line *[]PackageDownloadInfo `json:"line,omitempty"` -} - -// MarshalJSON is the custom marshaler for PackageDownloadsSensorFullOvf. -func (pd PackageDownloadsSensorFullOvf) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - // PathRecommendation represents a path that is recommended to be allowed and its properties type PathRecommendation struct { // Path - The full path of the file, or an identifier of the application @@ -15447,9 +15745,9 @@ type PathRecommendation struct { ConfigurationStatus ConfigurationStatus1 `json:"configurationStatus,omitempty"` } -// Pricing azure Security Center is provided in two pricing tiers: free and standard, with the standard -// tier available with a trial period. The standard tier offers advanced security capabilities, while the -// free tier offers basic security features. +// Pricing microsoft Defender for Cloud is provided in two pricing tiers: free and standard, with the +// standard tier available with a trial period. The standard tier offers advanced security capabilities, +// while the free tier offers basic security features. type Pricing struct { autorest.Response `json:"-"` // PricingProperties - Pricing data @@ -15531,8 +15829,10 @@ type PricingList struct { // PricingProperties pricing properties for the relevant scope type PricingProperties struct { - // PricingTier - The pricing tier value. Azure Security Center is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features. Possible values include: 'PricingTierFree', 'PricingTierStandard' + // PricingTier - The pricing tier value. Microsoft Defender for Cloud is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features. Possible values include: 'Free', 'Standard' PricingTier PricingTier `json:"pricingTier,omitempty"` + // SubPlan - The sub-plan selected for a Standard pricing configuration, when more than one sub-plan is available. Each sub-plan enables a set of security features. When not specified, full plan is applied. + SubPlan *string `json:"subPlan,omitempty"` // FreeTrialRemainingTime - READ-ONLY; The duration left for the subscriptions free trial period - in ISO 8601 format (e.g. P3Y6M4DT12H30M5S). FreeTrialRemainingTime *string `json:"freeTrialRemainingTime,omitempty"` } @@ -15543,6 +15843,9 @@ func (pp PricingProperties) MarshalJSON() ([]byte, error) { if pp.PricingTier != "" { objectMap["pricingTier"] = pp.PricingTier } + if pp.SubPlan != nil { + objectMap["subPlan"] = pp.SubPlan + } return json.Marshal(objectMap) } @@ -15747,23 +16050,6 @@ type ProtectionMode struct { Executable Executable `json:"executable,omitempty"` } -// Protocol1 protocol data -type Protocol1 struct { - // Name - READ-ONLY; Protocol name - Name *string `json:"name,omitempty"` - // Identifiers - list of protocol identifiers. - Identifiers *string `json:"identifiers,omitempty"` -} - -// MarshalJSON is the custom marshaler for Protocol1. -func (p1 Protocol1) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if p1.Identifiers != nil { - objectMap["identifiers"] = p1.Identifiers - } - return json.Marshal(objectMap) -} - // ProxyServerProperties for a non-Azure machine that is not connected directly to the internet, specify a // proxy server that the non-Azure machine can use. type ProxyServerProperties struct { @@ -15990,12 +16276,6 @@ func (qpniar QueuePurgesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustom return &qpniar, true } -// ReadCloser ... -type ReadCloser struct { - autorest.Response `json:"-"` - Value *io.ReadCloser `json:"value,omitempty"` -} - // RecommendationConfigurationProperties the type of IoT Security recommendation. type RecommendationConfigurationProperties struct { // RecommendationType - The type of IoT Security recommendation. Possible values include: 'IoTACRAuthentication', 'IoTAgentSendsUnutilizedMessages', 'IoTBaseline', 'IoTEdgeHubMemOptimize', 'IoTEdgeLoggingOptions', 'IoTInconsistentModuleSettings', 'IoTInstallAgent', 'IoTIPFilterDenyAll', 'IoTIPFilterPermissiveRule', 'IoTOpenPorts', 'IoTPermissiveFirewallPolicy', 'IoTPermissiveInputFirewallRules', 'IoTPermissiveOutputFirewallRules', 'IoTPrivilegedDockerOptions', 'IoTSharedCredentials', 'IoTVulnerableTLSCipherSuite' @@ -16829,12 +17109,6 @@ type Remediation struct { PortalLink *string `json:"portalLink,omitempty"` } -// ResetPasswordInput reset password input. -type ResetPasswordInput struct { - // ApplianceID - The appliance id of the sensor. - ApplianceID *string `json:"applianceId,omitempty"` -} - // Resource describes an Azure resource. type Resource struct { // ID - READ-ONLY; Resource Id @@ -18222,20 +18496,6 @@ type SensitivityLabel struct { Enabled *bool `json:"enabled,omitempty"` } -// Sensor sensor data -type Sensor struct { - // Name - READ-ONLY; Sensor name - Name *string `json:"name,omitempty"` - // Zone - READ-ONLY; Zone Name. - Zone *string `json:"zone,omitempty"` -} - -// MarshalJSON is the custom marshaler for Sensor. -func (s Sensor) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - // ServerVulnerabilityAssessment describes the server vulnerability assessment details on a resource type ServerVulnerabilityAssessment struct { autorest.Response `json:"-"` @@ -18734,18 +18994,6 @@ func NewSettingsListPage(cur SettingsList, getNextPage func(context.Context, Set } } -// Site site data -type Site struct { - // DisplayName - READ-ONLY; Site display name - DisplayName *string `json:"displayName,omitempty"` -} - -// MarshalJSON is the custom marshaler for Site. -func (s Site) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - // Software represents a software data type Software struct { autorest.Response `json:"-"` @@ -21602,27 +21850,6 @@ type UpdateIoTSecuritySolutionProperties struct { RecommendationsConfiguration *[]RecommendationConfigurationProperties `json:"recommendationsConfiguration,omitempty"` } -// UpgradePackageDownloadInfo information on a specific package upgrade download -type UpgradePackageDownloadInfo struct { - // FromVersion - READ-ONLY; Minimum base version for upgrade - FromVersion *string `json:"fromVersion,omitempty"` - // Version - READ-ONLY; Version number - Version *string `json:"version,omitempty"` - // Link - Download link - Link *string `json:"link,omitempty"` - // VersionKind - READ-ONLY; Kind of the version. Possible values include: 'Latest', 'Previous', 'Preview' - VersionKind VersionKind `json:"versionKind,omitempty"` -} - -// MarshalJSON is the custom marshaler for UpgradePackageDownloadInfo. -func (updi UpgradePackageDownloadInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if updi.Link != nil { - objectMap["link"] = updi.Link - } - return json.Marshal(objectMap) -} - // UserDefinedResourcesProperties properties of the IoT Security solution's user defined resources. type UserDefinedResourcesProperties struct { // Query - Azure Resource Graph query which represents the security solution's user defined resources. Required to start with "where type != "Microsoft.Devices/IotHubs"" @@ -21681,7 +21908,7 @@ type VMRecommendation struct { // RecommendationAction - Possible values include: 'RecommendationActionRecommended', 'RecommendationActionAdd', 'RecommendationActionRemove' RecommendationAction RecommendationAction `json:"recommendationAction,omitempty"` ResourceID *string `json:"resourceId,omitempty"` - // EnforcementSupport - Possible values include: 'EnforcementSupportSupported', 'EnforcementSupportNotSupported', 'EnforcementSupportUnknown' + // EnforcementSupport - Possible values include: 'Supported', 'NotSupported', 'Unknown' EnforcementSupport EnforcementSupport `json:"enforcementSupport,omitempty"` } diff --git a/services/preview/security/mgmt/v3.0/security/onpremiseiotsensors.go b/services/preview/security/mgmt/v3.0/security/onpremiseiotsensors.go deleted file mode 100644 index 9eaca29d5669..000000000000 --- a/services/preview/security/mgmt/v3.0/security/onpremiseiotsensors.go +++ /dev/null @@ -1,510 +0,0 @@ -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" -) - -// OnPremiseIotSensorsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider -type OnPremiseIotSensorsClient struct { - BaseClient -} - -// NewOnPremiseIotSensorsClient creates an instance of the OnPremiseIotSensorsClient client. -func NewOnPremiseIotSensorsClient(subscriptionID string, ascLocation string) OnPremiseIotSensorsClient { - return NewOnPremiseIotSensorsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewOnPremiseIotSensorsClientWithBaseURI creates an instance of the OnPremiseIotSensorsClient 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 NewOnPremiseIotSensorsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) OnPremiseIotSensorsClient { - return OnPremiseIotSensorsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// CreateOrUpdate create or update on-premise IoT sensor -// Parameters: -// onPremiseIotSensorName - name of the on-premise IoT sensor -func (client OnPremiseIotSensorsClient) CreateOrUpdate(ctx context.Context, onPremiseIotSensorName string) (result OnPremiseIotSensor, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OnPremiseIotSensorsClient.CreateOrUpdate") - 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.OnPremiseIotSensorsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, onPremiseIotSensorName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.OnPremiseIotSensorsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.OnPremiseIotSensorsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.OnPremiseIotSensorsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client OnPremiseIotSensorsClient) CreateOrUpdatePreparer(ctx context.Context, onPremiseIotSensorName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "onPremiseIotSensorName": autorest.Encode("path", onPremiseIotSensorName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-08-06-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client OnPremiseIotSensorsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client OnPremiseIotSensorsClient) CreateOrUpdateResponder(resp *http.Response) (result OnPremiseIotSensor, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete on-premise IoT sensor -// Parameters: -// onPremiseIotSensorName - name of the on-premise IoT sensor -func (client OnPremiseIotSensorsClient) Delete(ctx context.Context, onPremiseIotSensorName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OnPremiseIotSensorsClient.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.OnPremiseIotSensorsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, onPremiseIotSensorName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.OnPremiseIotSensorsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "security.OnPremiseIotSensorsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.OnPremiseIotSensorsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client OnPremiseIotSensorsClient) DeletePreparer(ctx context.Context, onPremiseIotSensorName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "onPremiseIotSensorName": autorest.Encode("path", onPremiseIotSensorName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-08-06-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}", 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 OnPremiseIotSensorsClient) 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 OnPremiseIotSensorsClient) 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 -} - -// DownloadActivation download sensor activation file -// Parameters: -// onPremiseIotSensorName - name of the on-premise IoT sensor -func (client OnPremiseIotSensorsClient) DownloadActivation(ctx context.Context, onPremiseIotSensorName string) (result ReadCloser, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OnPremiseIotSensorsClient.DownloadActivation") - 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.OnPremiseIotSensorsClient", "DownloadActivation", err.Error()) - } - - req, err := client.DownloadActivationPreparer(ctx, onPremiseIotSensorName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.OnPremiseIotSensorsClient", "DownloadActivation", nil, "Failure preparing request") - return - } - - resp, err := client.DownloadActivationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.OnPremiseIotSensorsClient", "DownloadActivation", resp, "Failure sending request") - return - } - - result, err = client.DownloadActivationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.OnPremiseIotSensorsClient", "DownloadActivation", resp, "Failure responding to request") - return - } - - return -} - -// DownloadActivationPreparer prepares the DownloadActivation request. -func (client OnPremiseIotSensorsClient) DownloadActivationPreparer(ctx context.Context, onPremiseIotSensorName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "onPremiseIotSensorName": autorest.Encode("path", onPremiseIotSensorName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-08-06-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}/downloadActivation", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DownloadActivationSender sends the DownloadActivation request. The method will close the -// http.Response Body if it receives an error. -func (client OnPremiseIotSensorsClient) DownloadActivationSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DownloadActivationResponder handles the response to the DownloadActivation request. The method always -// closes the http.Response Body. -func (client OnPremiseIotSensorsClient) DownloadActivationResponder(resp *http.Response) (result ReadCloser, err error) { - result.Value = &resp.Body - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK)) - result.Response = autorest.Response{Response: resp} - return -} - -// DownloadResetPassword download file for reset password of the sensor -// Parameters: -// onPremiseIotSensorName - name of the on-premise IoT sensor -// body - input for reset password. -func (client OnPremiseIotSensorsClient) DownloadResetPassword(ctx context.Context, onPremiseIotSensorName string, body ResetPasswordInput) (result ReadCloser, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OnPremiseIotSensorsClient.DownloadResetPassword") - 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.OnPremiseIotSensorsClient", "DownloadResetPassword", err.Error()) - } - - req, err := client.DownloadResetPasswordPreparer(ctx, onPremiseIotSensorName, body) - if err != nil { - err = autorest.NewErrorWithError(err, "security.OnPremiseIotSensorsClient", "DownloadResetPassword", nil, "Failure preparing request") - return - } - - resp, err := client.DownloadResetPasswordSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.OnPremiseIotSensorsClient", "DownloadResetPassword", resp, "Failure sending request") - return - } - - result, err = client.DownloadResetPasswordResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.OnPremiseIotSensorsClient", "DownloadResetPassword", resp, "Failure responding to request") - return - } - - return -} - -// DownloadResetPasswordPreparer prepares the DownloadResetPassword request. -func (client OnPremiseIotSensorsClient) DownloadResetPasswordPreparer(ctx context.Context, onPremiseIotSensorName string, body ResetPasswordInput) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "onPremiseIotSensorName": autorest.Encode("path", onPremiseIotSensorName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-08-06-preview" - 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/onPremiseIotSensors/{onPremiseIotSensorName}/downloadResetPassword", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DownloadResetPasswordSender sends the DownloadResetPassword request. The method will close the -// http.Response Body if it receives an error. -func (client OnPremiseIotSensorsClient) DownloadResetPasswordSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DownloadResetPasswordResponder handles the response to the DownloadResetPassword request. The method always -// closes the http.Response Body. -func (client OnPremiseIotSensorsClient) DownloadResetPasswordResponder(resp *http.Response) (result ReadCloser, err error) { - result.Value = &resp.Body - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK)) - result.Response = autorest.Response{Response: resp} - return -} - -// Get get on-premise IoT sensor -// Parameters: -// onPremiseIotSensorName - name of the on-premise IoT sensor -func (client OnPremiseIotSensorsClient) Get(ctx context.Context, onPremiseIotSensorName string) (result OnPremiseIotSensor, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OnPremiseIotSensorsClient.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.OnPremiseIotSensorsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, onPremiseIotSensorName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.OnPremiseIotSensorsClient", "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.OnPremiseIotSensorsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.OnPremiseIotSensorsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client OnPremiseIotSensorsClient) GetPreparer(ctx context.Context, onPremiseIotSensorName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "onPremiseIotSensorName": autorest.Encode("path", onPremiseIotSensorName), - "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/onPremiseIotSensors/{onPremiseIotSensorName}", 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 OnPremiseIotSensorsClient) 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 OnPremiseIotSensorsClient) GetResponder(resp *http.Response) (result OnPremiseIotSensor, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list on-premise IoT sensors -func (client OnPremiseIotSensorsClient) List(ctx context.Context) (result OnPremiseIotSensorsList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OnPremiseIotSensorsClient.List") - 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.OnPremiseIotSensorsClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "security.OnPremiseIotSensorsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.OnPremiseIotSensorsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.OnPremiseIotSensorsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client OnPremiseIotSensorsClient) ListPreparer(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/onPremiseIotSensors", 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 OnPremiseIotSensorsClient) 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 OnPremiseIotSensorsClient) ListResponder(resp *http.Response) (result OnPremiseIotSensorsList, 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/services/preview/security/mgmt/v3.0/security/operations.go b/services/preview/security/mgmt/v3.0/security/operations.go index af10a5f55613..ddb59b6b17ec 100644 --- a/services/preview/security/mgmt/v3.0/security/operations.go +++ b/services/preview/security/mgmt/v3.0/security/operations.go @@ -20,14 +20,14 @@ type OperationsClient struct { } // NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID string, ascLocation string) OperationsClient { - return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewOperationsClientWithBaseURI creates an instance of the OperationsClient 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 NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) OperationsClient { - return OperationsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} } // List exposes all available operations for discovery purposes. diff --git a/services/preview/security/mgmt/v3.0/security/pricings.go b/services/preview/security/mgmt/v3.0/security/pricings.go index 1361d65dabef..4dcc4b5a302f 100644 --- a/services/preview/security/mgmt/v3.0/security/pricings.go +++ b/services/preview/security/mgmt/v3.0/security/pricings.go @@ -21,17 +21,17 @@ type PricingsClient struct { } // NewPricingsClient creates an instance of the PricingsClient client. -func NewPricingsClient(subscriptionID string, ascLocation string) PricingsClient { - return NewPricingsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewPricingsClient(subscriptionID string) PricingsClient { + return NewPricingsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewPricingsClientWithBaseURI creates an instance of the PricingsClient 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 NewPricingsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) PricingsClient { - return PricingsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewPricingsClientWithBaseURI(baseURI string, subscriptionID string) PricingsClient { + return PricingsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get gets a provided Security Center pricing configuration in the subscription. +// Get gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. // Parameters: // pricingName - name of the pricing configuration func (client PricingsClient) Get(ctx context.Context, pricingName string) (result Pricing, err error) { @@ -80,7 +80,7 @@ func (client PricingsClient) GetPreparer(ctx context.Context, pricingName string "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -111,7 +111,7 @@ func (client PricingsClient) GetResponder(resp *http.Response) (result Pricing, return } -// List lists Security Center pricing configurations in the subscription. +// List lists Microsoft Defender for Cloud pricing configurations in the subscription. func (client PricingsClient) List(ctx context.Context) (result PricingList, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PricingsClient.List") @@ -157,7 +157,7 @@ func (client PricingsClient) ListPreparer(ctx context.Context) (*http.Request, e "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -188,7 +188,7 @@ func (client PricingsClient) ListResponder(resp *http.Response) (result PricingL return } -// Update updates a provided Security Center pricing configuration in the subscription. +// Update updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. // Parameters: // pricingName - name of the pricing configuration // pricing - pricing object @@ -238,7 +238,7 @@ func (client PricingsClient) UpdatePreparer(ctx context.Context, pricingName str "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/security/mgmt/v3.0/security/regulatorycomplianceassessments.go b/services/preview/security/mgmt/v3.0/security/regulatorycomplianceassessments.go index 7706ccb00bed..b9186c6a5562 100644 --- a/services/preview/security/mgmt/v3.0/security/regulatorycomplianceassessments.go +++ b/services/preview/security/mgmt/v3.0/security/regulatorycomplianceassessments.go @@ -22,15 +22,15 @@ type RegulatoryComplianceAssessmentsClient struct { } // NewRegulatoryComplianceAssessmentsClient creates an instance of the RegulatoryComplianceAssessmentsClient client. -func NewRegulatoryComplianceAssessmentsClient(subscriptionID string, ascLocation string) RegulatoryComplianceAssessmentsClient { - return NewRegulatoryComplianceAssessmentsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewRegulatoryComplianceAssessmentsClient(subscriptionID string) RegulatoryComplianceAssessmentsClient { + return NewRegulatoryComplianceAssessmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewRegulatoryComplianceAssessmentsClientWithBaseURI creates an instance of the RegulatoryComplianceAssessmentsClient // 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 NewRegulatoryComplianceAssessmentsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) RegulatoryComplianceAssessmentsClient { - return RegulatoryComplianceAssessmentsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewRegulatoryComplianceAssessmentsClientWithBaseURI(baseURI string, subscriptionID string) RegulatoryComplianceAssessmentsClient { + return RegulatoryComplianceAssessmentsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get supported regulatory compliance details and state for selected assessment diff --git a/services/preview/security/mgmt/v3.0/security/regulatorycompliancecontrols.go b/services/preview/security/mgmt/v3.0/security/regulatorycompliancecontrols.go index 54847e13b4ed..ae94c4b1cccf 100644 --- a/services/preview/security/mgmt/v3.0/security/regulatorycompliancecontrols.go +++ b/services/preview/security/mgmt/v3.0/security/regulatorycompliancecontrols.go @@ -21,15 +21,15 @@ type RegulatoryComplianceControlsClient struct { } // NewRegulatoryComplianceControlsClient creates an instance of the RegulatoryComplianceControlsClient client. -func NewRegulatoryComplianceControlsClient(subscriptionID string, ascLocation string) RegulatoryComplianceControlsClient { - return NewRegulatoryComplianceControlsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewRegulatoryComplianceControlsClient(subscriptionID string) RegulatoryComplianceControlsClient { + return NewRegulatoryComplianceControlsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewRegulatoryComplianceControlsClientWithBaseURI creates an instance of the RegulatoryComplianceControlsClient // 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 NewRegulatoryComplianceControlsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) RegulatoryComplianceControlsClient { - return RegulatoryComplianceControlsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewRegulatoryComplianceControlsClientWithBaseURI(baseURI string, subscriptionID string) RegulatoryComplianceControlsClient { + return RegulatoryComplianceControlsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get selected regulatory compliance control details and state diff --git a/services/preview/security/mgmt/v3.0/security/regulatorycompliancestandards.go b/services/preview/security/mgmt/v3.0/security/regulatorycompliancestandards.go index 32e0167c7ffa..02b59e4ea221 100644 --- a/services/preview/security/mgmt/v3.0/security/regulatorycompliancestandards.go +++ b/services/preview/security/mgmt/v3.0/security/regulatorycompliancestandards.go @@ -21,15 +21,15 @@ type RegulatoryComplianceStandardsClient struct { } // NewRegulatoryComplianceStandardsClient creates an instance of the RegulatoryComplianceStandardsClient client. -func NewRegulatoryComplianceStandardsClient(subscriptionID string, ascLocation string) RegulatoryComplianceStandardsClient { - return NewRegulatoryComplianceStandardsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewRegulatoryComplianceStandardsClient(subscriptionID string) RegulatoryComplianceStandardsClient { + return NewRegulatoryComplianceStandardsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewRegulatoryComplianceStandardsClientWithBaseURI creates an instance of the RegulatoryComplianceStandardsClient // 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 NewRegulatoryComplianceStandardsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) RegulatoryComplianceStandardsClient { - return RegulatoryComplianceStandardsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewRegulatoryComplianceStandardsClientWithBaseURI(baseURI string, subscriptionID string) RegulatoryComplianceStandardsClient { + return RegulatoryComplianceStandardsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get supported regulatory compliance details state for selected standard diff --git a/services/preview/security/mgmt/v3.0/security/securescorecontroldefinitions.go b/services/preview/security/mgmt/v3.0/security/securescorecontroldefinitions.go index adaa8e7fce77..ed56e06258a4 100644 --- a/services/preview/security/mgmt/v3.0/security/securescorecontroldefinitions.go +++ b/services/preview/security/mgmt/v3.0/security/securescorecontroldefinitions.go @@ -21,15 +21,15 @@ type SecureScoreControlDefinitionsClient struct { } // NewSecureScoreControlDefinitionsClient creates an instance of the SecureScoreControlDefinitionsClient client. -func NewSecureScoreControlDefinitionsClient(subscriptionID string, ascLocation string) SecureScoreControlDefinitionsClient { - return NewSecureScoreControlDefinitionsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSecureScoreControlDefinitionsClient(subscriptionID string) SecureScoreControlDefinitionsClient { + return NewSecureScoreControlDefinitionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSecureScoreControlDefinitionsClientWithBaseURI creates an instance of the SecureScoreControlDefinitionsClient // 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 NewSecureScoreControlDefinitionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SecureScoreControlDefinitionsClient { - return SecureScoreControlDefinitionsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSecureScoreControlDefinitionsClientWithBaseURI(baseURI string, subscriptionID string) SecureScoreControlDefinitionsClient { + return SecureScoreControlDefinitionsClient{NewWithBaseURI(baseURI, subscriptionID)} } // List list the available security controls, their assessments, and the max score diff --git a/services/preview/security/mgmt/v3.0/security/securescorecontrols.go b/services/preview/security/mgmt/v3.0/security/securescorecontrols.go index 15aa9245aed0..33fda36aa615 100644 --- a/services/preview/security/mgmt/v3.0/security/securescorecontrols.go +++ b/services/preview/security/mgmt/v3.0/security/securescorecontrols.go @@ -21,15 +21,15 @@ type SecureScoreControlsClient struct { } // NewSecureScoreControlsClient creates an instance of the SecureScoreControlsClient client. -func NewSecureScoreControlsClient(subscriptionID string, ascLocation string) SecureScoreControlsClient { - return NewSecureScoreControlsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSecureScoreControlsClient(subscriptionID string) SecureScoreControlsClient { + return NewSecureScoreControlsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSecureScoreControlsClientWithBaseURI creates an instance of the SecureScoreControlsClient 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 NewSecureScoreControlsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SecureScoreControlsClient { - return SecureScoreControlsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSecureScoreControlsClientWithBaseURI(baseURI string, subscriptionID string) SecureScoreControlsClient { + return SecureScoreControlsClient{NewWithBaseURI(baseURI, subscriptionID)} } // List get all security controls within a scope diff --git a/services/preview/security/mgmt/v3.0/security/securescores.go b/services/preview/security/mgmt/v3.0/security/securescores.go index 9a90039299d4..2192f478a2bf 100644 --- a/services/preview/security/mgmt/v3.0/security/securescores.go +++ b/services/preview/security/mgmt/v3.0/security/securescores.go @@ -21,18 +21,18 @@ type SecureScoresClient struct { } // NewSecureScoresClient creates an instance of the SecureScoresClient client. -func NewSecureScoresClient(subscriptionID string, ascLocation string) SecureScoresClient { - return NewSecureScoresClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSecureScoresClient(subscriptionID string) SecureScoresClient { + return NewSecureScoresClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSecureScoresClientWithBaseURI creates an instance of the SecureScoresClient 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 NewSecureScoresClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SecureScoresClient { - return SecureScoresClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSecureScoresClientWithBaseURI(baseURI string, subscriptionID string) SecureScoresClient { + return SecureScoresClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get get secure score for a specific Security Center initiative within your current scope. For the ASC Default -// initiative, use 'ascScore'. +// Get get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC +// Default initiative, use 'ascScore'. // Parameters: // secureScoreName - the initiative name. For the ASC Default initiative, use 'ascScore' as in the sample // request below. @@ -113,7 +113,7 @@ func (client SecureScoresClient) GetResponder(resp *http.Response) (result Secur return } -// List list secure scores for all your Security Center initiatives within your current scope. +// List list secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. func (client SecureScoresClient) List(ctx context.Context) (result SecureScoresListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresClient.List") diff --git a/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go b/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go index 9e2da968bde0..e59c85bdc745 100644 --- a/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go +++ b/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go @@ -12,6 +12,40 @@ import ( "github.com/Azure/go-autorest/autorest" ) +// MdeOnboardingsClientAPI contains the set of methods on the MdeOnboardingsClient type. +type MdeOnboardingsClientAPI interface { + Get(ctx context.Context) (result security.MdeOnboardingData, err error) + List(ctx context.Context) (result security.MdeOnboardingDataList, err error) +} + +var _ MdeOnboardingsClientAPI = (*security.MdeOnboardingsClient)(nil) + +// CustomAssessmentAutomationsClientAPI contains the set of methods on the CustomAssessmentAutomationsClient type. +type CustomAssessmentAutomationsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string, customAssessmentAutomationBody security.CustomAssessmentAutomationRequest) (result security.CustomAssessmentAutomation, err error) + Delete(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string) (result security.CustomAssessmentAutomation, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result security.CustomAssessmentAutomationsListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result security.CustomAssessmentAutomationsListResultIterator, err error) + ListBySubscription(ctx context.Context) (result security.CustomAssessmentAutomationsListResultPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result security.CustomAssessmentAutomationsListResultIterator, err error) +} + +var _ CustomAssessmentAutomationsClientAPI = (*security.CustomAssessmentAutomationsClient)(nil) + +// CustomEntityStoreAssignmentsClientAPI contains the set of methods on the CustomEntityStoreAssignmentsClient type. +type CustomEntityStoreAssignmentsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string, customEntityStoreAssignmentRequestBody security.CustomEntityStoreAssignmentRequest) (result security.CustomEntityStoreAssignment, err error) + Delete(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string) (result security.CustomEntityStoreAssignment, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result security.CustomEntityStoreAssignmentsListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result security.CustomEntityStoreAssignmentsListResultIterator, err error) + ListBySubscription(ctx context.Context) (result security.CustomEntityStoreAssignmentsListResultPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result security.CustomEntityStoreAssignmentsListResultIterator, err error) +} + +var _ CustomEntityStoreAssignmentsClientAPI = (*security.CustomEntityStoreAssignmentsClient)(nil) + // ComplianceResultsClientAPI contains the set of methods on the ComplianceResultsClient type. type ComplianceResultsClientAPI interface { Get(ctx context.Context, resourceID string, complianceResultName string) (result security.ComplianceResult, err error) @@ -92,7 +126,7 @@ var _ IotSecuritySolutionsAnalyticsRecommendationClientAPI = (*security.IotSecur // LocationsClientAPI contains the set of methods on the LocationsClient type. type LocationsClientAPI interface { - Get(ctx context.Context) (result security.AscLocation, err error) + Get(ctx context.Context, ascLocation string) (result security.AscLocation, err error) List(ctx context.Context) (result security.AscLocationListPage, err error) ListComplete(ctx context.Context) (result security.AscLocationListIterator, err error) } @@ -109,16 +143,16 @@ var _ OperationsClientAPI = (*security.OperationsClient)(nil) // TasksClientAPI contains the set of methods on the TasksClient type. type TasksClientAPI interface { - GetResourceGroupLevelTask(ctx context.Context, resourceGroupName string, taskName string) (result security.Task, err error) - GetSubscriptionLevelTask(ctx context.Context, taskName string) (result security.Task, err error) + GetResourceGroupLevelTask(ctx context.Context, resourceGroupName string, ascLocation string, taskName string) (result security.Task, err error) + GetSubscriptionLevelTask(ctx context.Context, ascLocation string, taskName string) (result security.Task, err error) List(ctx context.Context, filter string) (result security.TaskListPage, err error) ListComplete(ctx context.Context, filter string) (result security.TaskListIterator, err error) - ListByHomeRegion(ctx context.Context, filter string) (result security.TaskListPage, err error) - ListByHomeRegionComplete(ctx context.Context, filter string) (result security.TaskListIterator, err error) - ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string) (result security.TaskListPage, err error) - ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string) (result security.TaskListIterator, err error) - UpdateResourceGroupLevelTaskState(ctx context.Context, resourceGroupName string, taskName string, taskUpdateActionType string) (result autorest.Response, err error) - UpdateSubscriptionLevelTaskState(ctx context.Context, taskName string, taskUpdateActionType string) (result autorest.Response, err error) + ListByHomeRegion(ctx context.Context, ascLocation string, filter string) (result security.TaskListPage, err error) + ListByHomeRegionComplete(ctx context.Context, ascLocation string, filter string) (result security.TaskListIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string, ascLocation string, filter string) (result security.TaskListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, ascLocation string, filter string) (result security.TaskListIterator, err error) + UpdateResourceGroupLevelTaskState(ctx context.Context, resourceGroupName string, ascLocation string, taskName string, taskUpdateActionType security.TaskUpdateActionType) (result autorest.Response, err error) + UpdateSubscriptionLevelTaskState(ctx context.Context, ascLocation string, taskName string, taskUpdateActionType security.TaskUpdateActionType) (result autorest.Response, err error) } var _ TasksClientAPI = (*security.TasksClient)(nil) @@ -144,8 +178,8 @@ var _ CompliancesClientAPI = (*security.CompliancesClient)(nil) // InformationProtectionPoliciesClientAPI contains the set of methods on the InformationProtectionPoliciesClient type. type InformationProtectionPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, scope string, informationProtectionPolicyName string, informationProtectionPolicy security.InformationProtectionPolicy) (result security.InformationProtectionPolicy, err error) - Get(ctx context.Context, scope string, informationProtectionPolicyName string) (result security.InformationProtectionPolicy, err error) + CreateOrUpdate(ctx context.Context, scope string, informationProtectionPolicyName security.InformationProtectionPolicyName, informationProtectionPolicy security.InformationProtectionPolicy) (result security.InformationProtectionPolicy, err error) + Get(ctx context.Context, scope string, informationProtectionPolicyName security.InformationProtectionPolicyName) (result security.InformationProtectionPolicy, err error) List(ctx context.Context, scope string) (result security.InformationProtectionPolicyListPage, err error) ListComplete(ctx context.Context, scope string) (result security.InformationProtectionPolicyListIterator, err error) } @@ -251,23 +285,23 @@ var _ ServerVulnerabilityAssessmentClientAPI = (*security.ServerVulnerabilityAss // AssessmentsMetadataClientAPI contains the set of methods on the AssessmentsMetadataClient type. type AssessmentsMetadataClientAPI interface { - CreateInSubscription(ctx context.Context, assessmentMetadataName string, assessmentMetadata security.AssessmentMetadata) (result security.AssessmentMetadata, err error) + CreateInSubscription(ctx context.Context, assessmentMetadataName string, assessmentMetadata security.AssessmentMetadataResponse) (result security.AssessmentMetadataResponse, err error) DeleteInSubscription(ctx context.Context, assessmentMetadataName string) (result autorest.Response, err error) - Get(ctx context.Context, assessmentMetadataName string) (result security.AssessmentMetadata, err error) - GetInSubscription(ctx context.Context, assessmentMetadataName string) (result security.AssessmentMetadata, err error) - List(ctx context.Context) (result security.AssessmentMetadataListPage, err error) - ListComplete(ctx context.Context) (result security.AssessmentMetadataListIterator, err error) - ListBySubscription(ctx context.Context) (result security.AssessmentMetadataListPage, err error) - ListBySubscriptionComplete(ctx context.Context) (result security.AssessmentMetadataListIterator, err error) + Get(ctx context.Context, assessmentMetadataName string) (result security.AssessmentMetadataResponse, err error) + GetInSubscription(ctx context.Context, assessmentMetadataName string) (result security.AssessmentMetadataResponse, err error) + List(ctx context.Context) (result security.AssessmentMetadataResponseListPage, err error) + ListComplete(ctx context.Context) (result security.AssessmentMetadataResponseListIterator, err error) + ListBySubscription(ctx context.Context) (result security.AssessmentMetadataResponseListPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result security.AssessmentMetadataResponseListIterator, err error) } var _ AssessmentsMetadataClientAPI = (*security.AssessmentsMetadataClient)(nil) // AssessmentsClientAPI contains the set of methods on the AssessmentsClient type. type AssessmentsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceID string, assessmentName string, assessment security.Assessment) (result security.Assessment, err error) + CreateOrUpdate(ctx context.Context, resourceID string, assessmentName string, assessment security.Assessment) (result security.AssessmentResponse, err error) Delete(ctx context.Context, resourceID string, assessmentName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceID string, assessmentName string, expand security.ExpandEnum) (result security.Assessment, err error) + Get(ctx context.Context, resourceID string, assessmentName string, expand security.ExpandEnum) (result security.AssessmentResponse, err error) List(ctx context.Context, scope string) (result security.AssessmentListPage, err error) ListComplete(ctx context.Context, scope string) (result security.AssessmentListIterator, err error) } @@ -276,10 +310,10 @@ var _ AssessmentsClientAPI = (*security.AssessmentsClient)(nil) // AdaptiveApplicationControlsClientAPI contains the set of methods on the AdaptiveApplicationControlsClient type. type AdaptiveApplicationControlsClientAPI interface { - Delete(ctx context.Context, groupName string) (result autorest.Response, err error) - Get(ctx context.Context, groupName string) (result security.AdaptiveApplicationControlGroup, err error) + Delete(ctx context.Context, ascLocation string, groupName string) (result autorest.Response, err error) + Get(ctx context.Context, ascLocation string, groupName string) (result security.AdaptiveApplicationControlGroup, err error) List(ctx context.Context, includePathRecommendations *bool, summary *bool) (result security.AdaptiveApplicationControlGroups, err error) - Put(ctx context.Context, groupName string, body security.AdaptiveApplicationControlGroup) (result security.AdaptiveApplicationControlGroup, err error) + Put(ctx context.Context, ascLocation string, groupName string, body security.AdaptiveApplicationControlGroup) (result security.AdaptiveApplicationControlGroup, err error) } var _ AdaptiveApplicationControlsClientAPI = (*security.AdaptiveApplicationControlsClient)(nil) @@ -296,51 +330,51 @@ var _ AdaptiveNetworkHardeningsClientAPI = (*security.AdaptiveNetworkHardeningsC // AllowedConnectionsClientAPI contains the set of methods on the AllowedConnectionsClient type. type AllowedConnectionsClientAPI interface { - Get(ctx context.Context, resourceGroupName string, connectionType security.ConnectionType) (result security.AllowedConnectionsResource, err error) + Get(ctx context.Context, resourceGroupName string, ascLocation string, connectionType security.ConnectionType) (result security.AllowedConnectionsResource, err error) List(ctx context.Context) (result security.AllowedConnectionsListPage, err error) ListComplete(ctx context.Context) (result security.AllowedConnectionsListIterator, err error) - ListByHomeRegion(ctx context.Context) (result security.AllowedConnectionsListPage, err error) - ListByHomeRegionComplete(ctx context.Context) (result security.AllowedConnectionsListIterator, err error) + ListByHomeRegion(ctx context.Context, ascLocation string) (result security.AllowedConnectionsListPage, err error) + ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result security.AllowedConnectionsListIterator, err error) } var _ AllowedConnectionsClientAPI = (*security.AllowedConnectionsClient)(nil) // TopologyClientAPI contains the set of methods on the TopologyClient type. type TopologyClientAPI interface { - Get(ctx context.Context, resourceGroupName string, topologyResourceName string) (result security.TopologyResource, err error) + Get(ctx context.Context, resourceGroupName string, ascLocation string, topologyResourceName string) (result security.TopologyResource, err error) List(ctx context.Context) (result security.TopologyListPage, err error) ListComplete(ctx context.Context) (result security.TopologyListIterator, err error) - ListByHomeRegion(ctx context.Context) (result security.TopologyListPage, err error) - ListByHomeRegionComplete(ctx context.Context) (result security.TopologyListIterator, err error) + ListByHomeRegion(ctx context.Context, ascLocation string) (result security.TopologyListPage, err error) + ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result security.TopologyListIterator, err error) } var _ TopologyClientAPI = (*security.TopologyClient)(nil) // JitNetworkAccessPoliciesClientAPI contains the set of methods on the JitNetworkAccessPoliciesClient type. type JitNetworkAccessPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string, body security.JitNetworkAccessPolicy) (result security.JitNetworkAccessPolicy, err error) - Delete(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string) (result security.JitNetworkAccessPolicy, err error) - Initiate(ctx context.Context, resourceGroupName string, jitNetworkAccessPolicyName string, body security.JitNetworkAccessPolicyInitiateRequest) (result security.JitNetworkAccessRequest, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body security.JitNetworkAccessPolicy) (result security.JitNetworkAccessPolicy, err error) + Delete(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string) (result security.JitNetworkAccessPolicy, err error) + Initiate(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body security.JitNetworkAccessPolicyInitiateRequest) (result security.JitNetworkAccessRequest, err error) List(ctx context.Context) (result security.JitNetworkAccessPoliciesListPage, err error) ListComplete(ctx context.Context) (result security.JitNetworkAccessPoliciesListIterator, err error) - ListByRegion(ctx context.Context) (result security.JitNetworkAccessPoliciesListPage, err error) - ListByRegionComplete(ctx context.Context) (result security.JitNetworkAccessPoliciesListIterator, err error) + ListByRegion(ctx context.Context, ascLocation string) (result security.JitNetworkAccessPoliciesListPage, err error) + ListByRegionComplete(ctx context.Context, ascLocation string) (result security.JitNetworkAccessPoliciesListIterator, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result security.JitNetworkAccessPoliciesListPage, err error) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result security.JitNetworkAccessPoliciesListIterator, err error) - ListByResourceGroupAndRegion(ctx context.Context, resourceGroupName string) (result security.JitNetworkAccessPoliciesListPage, err error) - ListByResourceGroupAndRegionComplete(ctx context.Context, resourceGroupName string) (result security.JitNetworkAccessPoliciesListIterator, err error) + ListByResourceGroupAndRegion(ctx context.Context, resourceGroupName string, ascLocation string) (result security.JitNetworkAccessPoliciesListPage, err error) + ListByResourceGroupAndRegionComplete(ctx context.Context, resourceGroupName string, ascLocation string) (result security.JitNetworkAccessPoliciesListIterator, err error) } var _ JitNetworkAccessPoliciesClientAPI = (*security.JitNetworkAccessPoliciesClient)(nil) // DiscoveredSecuritySolutionsClientAPI contains the set of methods on the DiscoveredSecuritySolutionsClient type. type DiscoveredSecuritySolutionsClientAPI interface { - Get(ctx context.Context, resourceGroupName string, discoveredSecuritySolutionName string) (result security.DiscoveredSecuritySolution, err error) + Get(ctx context.Context, resourceGroupName string, ascLocation string, discoveredSecuritySolutionName string) (result security.DiscoveredSecuritySolution, err error) List(ctx context.Context) (result security.DiscoveredSecuritySolutionListPage, err error) ListComplete(ctx context.Context) (result security.DiscoveredSecuritySolutionListIterator, err error) - ListByHomeRegion(ctx context.Context) (result security.DiscoveredSecuritySolutionListPage, err error) - ListByHomeRegionComplete(ctx context.Context) (result security.DiscoveredSecuritySolutionListIterator, err error) + ListByHomeRegion(ctx context.Context, ascLocation string) (result security.DiscoveredSecuritySolutionListPage, err error) + ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result security.DiscoveredSecuritySolutionListIterator, err error) } var _ DiscoveredSecuritySolutionsClientAPI = (*security.DiscoveredSecuritySolutionsClient)(nil) @@ -348,18 +382,18 @@ var _ DiscoveredSecuritySolutionsClientAPI = (*security.DiscoveredSecuritySoluti // SolutionsReferenceDataClientAPI contains the set of methods on the SolutionsReferenceDataClient type. type SolutionsReferenceDataClientAPI interface { List(ctx context.Context) (result security.SolutionsReferenceDataList, err error) - ListByHomeRegion(ctx context.Context) (result security.SolutionsReferenceDataList, err error) + ListByHomeRegion(ctx context.Context, ascLocation string) (result security.SolutionsReferenceDataList, err error) } var _ SolutionsReferenceDataClientAPI = (*security.SolutionsReferenceDataClient)(nil) // ExternalSecuritySolutionsClientAPI contains the set of methods on the ExternalSecuritySolutionsClient type. type ExternalSecuritySolutionsClientAPI interface { - Get(ctx context.Context, resourceGroupName string, externalSecuritySolutionsName string) (result security.ExternalSecuritySolutionModel, err error) + Get(ctx context.Context, resourceGroupName string, ascLocation string, externalSecuritySolutionsName string) (result security.ExternalSecuritySolutionModel, err error) List(ctx context.Context) (result security.ExternalSecuritySolutionListPage, err error) ListComplete(ctx context.Context) (result security.ExternalSecuritySolutionListIterator, err error) - ListByHomeRegion(ctx context.Context) (result security.ExternalSecuritySolutionListPage, err error) - ListByHomeRegionComplete(ctx context.Context) (result security.ExternalSecuritySolutionListIterator, err error) + ListByHomeRegion(ctx context.Context, ascLocation string) (result security.ExternalSecuritySolutionListPage, err error) + ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result security.ExternalSecuritySolutionListIterator, err error) } var _ ExternalSecuritySolutionsClientAPI = (*security.ExternalSecuritySolutionsClient)(nil) @@ -395,7 +429,7 @@ var _ SecureScoreControlDefinitionsClientAPI = (*security.SecureScoreControlDefi // SolutionsClientAPI contains the set of methods on the SolutionsClient type. type SolutionsClientAPI interface { - Get(ctx context.Context, resourceGroupName string, securitySolutionName string) (result security.Solution, err error) + Get(ctx context.Context, resourceGroupName string, ascLocation string, securitySolutionName string) (result security.Solution, err error) List(ctx context.Context) (result security.SolutionListPage, err error) ListComplete(ctx context.Context) (result security.SolutionListIterator, err error) } @@ -440,139 +474,35 @@ type SQLVulnerabilityAssessmentBaselineRulesClientAPI interface { var _ SQLVulnerabilityAssessmentBaselineRulesClientAPI = (*security.SQLVulnerabilityAssessmentBaselineRulesClient)(nil) -// IotDefenderSettingsClientAPI contains the set of methods on the IotDefenderSettingsClient type. -type IotDefenderSettingsClientAPI interface { - CreateOrUpdate(ctx context.Context, iotDefenderSettingsModel security.IotDefenderSettingsModel) (result security.IotDefenderSettingsModel, err error) - Delete(ctx context.Context) (result autorest.Response, err error) - DownloadManagerActivation(ctx context.Context) (result security.ReadCloser, err error) - Get(ctx context.Context) (result security.IotDefenderSettingsModel, err error) - List(ctx context.Context) (result security.IotDefenderSettingsList, err error) - PackageDownloadsMethod(ctx context.Context) (result security.PackageDownloads, err error) -} - -var _ IotDefenderSettingsClientAPI = (*security.IotDefenderSettingsClient)(nil) - -// IotSensorsClientAPI contains the set of methods on the IotSensorsClient type. -type IotSensorsClientAPI interface { - CreateOrUpdate(ctx context.Context, scope string, iotSensorName string, iotSensorsModel security.IotSensorsModel) (result security.IotSensorsModel, err error) - Delete(ctx context.Context, scope string, iotSensorName string) (result autorest.Response, err error) - DownloadActivation(ctx context.Context, scope string, iotSensorName string) (result security.ReadCloser, err error) - DownloadResetPassword(ctx context.Context, scope string, iotSensorName string, body security.ResetPasswordInput) (result security.ReadCloser, err error) - Get(ctx context.Context, scope string, iotSensorName string) (result security.IotSensorsModel, err error) - List(ctx context.Context, scope string) (result security.IotSensorsList, err error) - TriggerTiPackageUpdate(ctx context.Context, scope string, iotSensorName string) (result autorest.Response, err error) -} - -var _ IotSensorsClientAPI = (*security.IotSensorsClient)(nil) - -// DevicesForSubscriptionClientAPI contains the set of methods on the DevicesForSubscriptionClient type. -type DevicesForSubscriptionClientAPI interface { - List(ctx context.Context, limit *int32, skipToken string, deviceManagementType security.ManagementState) (result security.DeviceListPage, err error) - ListComplete(ctx context.Context, limit *int32, skipToken string, deviceManagementType security.ManagementState) (result security.DeviceListIterator, err error) -} - -var _ DevicesForSubscriptionClientAPI = (*security.DevicesForSubscriptionClient)(nil) - -// DevicesForHubClientAPI contains the set of methods on the DevicesForHubClient type. -type DevicesForHubClientAPI interface { - List(ctx context.Context, resourceID string, limit *int32, skipToken string, deviceManagementType security.ManagementState) (result security.DeviceListPage, err error) - ListComplete(ctx context.Context, resourceID string, limit *int32, skipToken string, deviceManagementType security.ManagementState) (result security.DeviceListIterator, err error) -} - -var _ DevicesForHubClientAPI = (*security.DevicesForHubClient)(nil) - -// DeviceClientAPI contains the set of methods on the DeviceClient type. -type DeviceClientAPI interface { - Get(ctx context.Context, resourceID string, deviceID string) (result security.Device, err error) -} - -var _ DeviceClientAPI = (*security.DeviceClient)(nil) - -// OnPremiseIotSensorsClientAPI contains the set of methods on the OnPremiseIotSensorsClient type. -type OnPremiseIotSensorsClientAPI interface { - CreateOrUpdate(ctx context.Context, onPremiseIotSensorName string) (result security.OnPremiseIotSensor, err error) - Delete(ctx context.Context, onPremiseIotSensorName string) (result autorest.Response, err error) - DownloadActivation(ctx context.Context, onPremiseIotSensorName string) (result security.ReadCloser, err error) - DownloadResetPassword(ctx context.Context, onPremiseIotSensorName string, body security.ResetPasswordInput) (result security.ReadCloser, err error) - Get(ctx context.Context, onPremiseIotSensorName string) (result security.OnPremiseIotSensor, err error) - List(ctx context.Context) (result security.OnPremiseIotSensorsList, err error) -} - -var _ OnPremiseIotSensorsClientAPI = (*security.OnPremiseIotSensorsClient)(nil) - -// IotSitesClientAPI contains the set of methods on the IotSitesClient type. -type IotSitesClientAPI interface { - CreateOrUpdate(ctx context.Context, scope string, iotSitesModel security.IotSitesModel) (result security.IotSitesModel, err error) - Delete(ctx context.Context, scope string) (result autorest.Response, err error) - Get(ctx context.Context, scope string) (result security.IotSitesModel, err error) - List(ctx context.Context, scope string) (result security.IotSitesList, err error) -} - -var _ IotSitesClientAPI = (*security.IotSitesClient)(nil) - -// IotAlertsClientAPI contains the set of methods on the IotAlertsClient type. -type IotAlertsClientAPI interface { - Get(ctx context.Context, scope string, iotAlertID string) (result security.IotAlertModel, err error) - List(ctx context.Context, scope string, minStartTimeUtc string, maxStartTimeUtc string, alertType string, deviceManagementType security.ManagementState, compromisedEntity string, limit *int32, skipToken string) (result security.IotAlertListModelPage, err error) - ListComplete(ctx context.Context, scope string, minStartTimeUtc string, maxStartTimeUtc string, alertType string, deviceManagementType security.ManagementState, compromisedEntity string, limit *int32, skipToken string) (result security.IotAlertListModelIterator, err error) -} - -var _ IotAlertsClientAPI = (*security.IotAlertsClient)(nil) - -// IotAlertTypesClientAPI contains the set of methods on the IotAlertTypesClient type. -type IotAlertTypesClientAPI interface { - Get(ctx context.Context, iotAlertTypeName string) (result security.IotAlertType, err error) - List(ctx context.Context) (result security.IotAlertTypeList, err error) -} - -var _ IotAlertTypesClientAPI = (*security.IotAlertTypesClient)(nil) - -// IotRecommendationsClientAPI contains the set of methods on the IotRecommendationsClient type. -type IotRecommendationsClientAPI interface { - Get(ctx context.Context, scope string, iotRecommendationID string) (result security.IotRecommendationModel, err error) - List(ctx context.Context, scope string, recommendationType string, deviceID string, limit *int32, skipToken string) (result security.IotRecommendationListModelPage, err error) - ListComplete(ctx context.Context, scope string, recommendationType string, deviceID string, limit *int32, skipToken string) (result security.IotRecommendationListModelIterator, err error) -} - -var _ IotRecommendationsClientAPI = (*security.IotRecommendationsClient)(nil) - -// IotRecommendationTypesClientAPI contains the set of methods on the IotRecommendationTypesClient type. -type IotRecommendationTypesClientAPI interface { - Get(ctx context.Context, iotRecommendationTypeName string) (result security.IotRecommendationType, err error) - List(ctx context.Context) (result security.IotRecommendationTypeList, err error) -} - -var _ IotRecommendationTypesClientAPI = (*security.IotRecommendationTypesClient)(nil) - // AlertsClientAPI contains the set of methods on the AlertsClient type. type AlertsClientAPI interface { - GetResourceGroupLevel(ctx context.Context, alertName string, resourceGroupName string) (result security.Alert, err error) - GetSubscriptionLevel(ctx context.Context, alertName string) (result security.Alert, err error) + GetResourceGroupLevel(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (result security.Alert, err error) + GetSubscriptionLevel(ctx context.Context, ascLocation string, alertName string) (result security.Alert, err error) List(ctx context.Context) (result security.AlertListPage, err error) ListComplete(ctx context.Context) (result security.AlertListIterator, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result security.AlertListPage, err error) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result security.AlertListIterator, err error) - ListResourceGroupLevelByRegion(ctx context.Context, resourceGroupName string) (result security.AlertListPage, err error) - ListResourceGroupLevelByRegionComplete(ctx context.Context, resourceGroupName string) (result security.AlertListIterator, err error) - ListSubscriptionLevelByRegion(ctx context.Context) (result security.AlertListPage, err error) - ListSubscriptionLevelByRegionComplete(ctx context.Context) (result security.AlertListIterator, err error) - Simulate(ctx context.Context, alertSimulatorRequestBody security.AlertSimulatorRequestBody) (result security.AlertsSimulateFuture, err error) - UpdateResourceGroupLevelStateToActivate(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) - UpdateResourceGroupLevelStateToDismiss(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) - UpdateResourceGroupLevelStateToResolve(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) - UpdateSubscriptionLevelStateToActivate(ctx context.Context, alertName string) (result autorest.Response, err error) - UpdateSubscriptionLevelStateToDismiss(ctx context.Context, alertName string) (result autorest.Response, err error) - UpdateSubscriptionLevelStateToResolve(ctx context.Context, alertName string) (result autorest.Response, err error) + ListResourceGroupLevelByRegion(ctx context.Context, ascLocation string, resourceGroupName string) (result security.AlertListPage, err error) + ListResourceGroupLevelByRegionComplete(ctx context.Context, ascLocation string, resourceGroupName string) (result security.AlertListIterator, err error) + ListSubscriptionLevelByRegion(ctx context.Context, ascLocation string) (result security.AlertListPage, err error) + ListSubscriptionLevelByRegionComplete(ctx context.Context, ascLocation string) (result security.AlertListIterator, err error) + Simulate(ctx context.Context, ascLocation string, alertSimulatorRequestBody security.AlertSimulatorRequestBody) (result autorest.Response, err error) + UpdateResourceGroupLevelStateToActivate(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (result autorest.Response, err error) + UpdateResourceGroupLevelStateToDismiss(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (result autorest.Response, err error) + UpdateResourceGroupLevelStateToResolve(ctx context.Context, ascLocation string, alertName string, resourceGroupName string) (result autorest.Response, err error) + UpdateSubscriptionLevelStateToActivate(ctx context.Context, ascLocation string, alertName string) (result autorest.Response, err error) + UpdateSubscriptionLevelStateToDismiss(ctx context.Context, ascLocation string, alertName string) (result autorest.Response, err error) + UpdateSubscriptionLevelStateToResolve(ctx context.Context, ascLocation string, alertName string) (result autorest.Response, err error) } var _ AlertsClientAPI = (*security.AlertsClient)(nil) // SettingsClientAPI contains the set of methods on the SettingsClient type. type SettingsClientAPI interface { - Get(ctx context.Context, settingName string) (result security.SettingModel, err error) + Get(ctx context.Context, settingName security.SettingName4) (result security.SettingModel, err error) List(ctx context.Context) (result security.SettingsListPage, err error) ListComplete(ctx context.Context) (result security.SettingsListIterator, err error) - Update(ctx context.Context, settingName string, setting security.BasicSetting) (result security.SettingModel, err error) + Update(ctx context.Context, settingName security.SettingName5, setting security.BasicSetting) (result security.SettingModel, err error) } var _ SettingsClientAPI = (*security.SettingsClient)(nil) @@ -600,3 +530,17 @@ type SoftwareInventoriesClientAPI interface { } var _ SoftwareInventoriesClientAPI = (*security.SoftwareInventoriesClient)(nil) + +// ConnectorsGroupClientAPI contains the set of methods on the ConnectorsGroupClient type. +type ConnectorsGroupClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector security.Connector) (result security.Connector, err error) + Delete(ctx context.Context, resourceGroupName string, securityConnectorName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, securityConnectorName string) (result security.Connector, err error) + List(ctx context.Context) (result security.ConnectorsListPage, err error) + ListComplete(ctx context.Context) (result security.ConnectorsListIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result security.ConnectorsListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result security.ConnectorsListIterator, err error) + Update(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector security.Connector) (result security.Connector, err error) +} + +var _ ConnectorsGroupClientAPI = (*security.ConnectorsGroupClient)(nil) diff --git a/services/preview/security/mgmt/v3.0/security/servervulnerabilityassessment.go b/services/preview/security/mgmt/v3.0/security/servervulnerabilityassessment.go index 0909571c9e2f..d83ad5106c5e 100644 --- a/services/preview/security/mgmt/v3.0/security/servervulnerabilityassessment.go +++ b/services/preview/security/mgmt/v3.0/security/servervulnerabilityassessment.go @@ -21,15 +21,15 @@ type ServerVulnerabilityAssessmentClient struct { } // NewServerVulnerabilityAssessmentClient creates an instance of the ServerVulnerabilityAssessmentClient client. -func NewServerVulnerabilityAssessmentClient(subscriptionID string, ascLocation string) ServerVulnerabilityAssessmentClient { - return NewServerVulnerabilityAssessmentClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewServerVulnerabilityAssessmentClient(subscriptionID string) ServerVulnerabilityAssessmentClient { + return NewServerVulnerabilityAssessmentClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewServerVulnerabilityAssessmentClientWithBaseURI creates an instance of the ServerVulnerabilityAssessmentClient // 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 NewServerVulnerabilityAssessmentClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) ServerVulnerabilityAssessmentClient { - return ServerVulnerabilityAssessmentClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewServerVulnerabilityAssessmentClientWithBaseURI(baseURI string, subscriptionID string) ServerVulnerabilityAssessmentClient { + return ServerVulnerabilityAssessmentClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate creating a server vulnerability assessment on a resource, which will onboard a resource for having a diff --git a/services/preview/security/mgmt/v3.0/security/settings.go b/services/preview/security/mgmt/v3.0/security/settings.go index 6ff57dc8da26..8bae705260ab 100644 --- a/services/preview/security/mgmt/v3.0/security/settings.go +++ b/services/preview/security/mgmt/v3.0/security/settings.go @@ -21,20 +21,20 @@ type SettingsClient struct { } // NewSettingsClient creates an instance of the SettingsClient client. -func NewSettingsClient(subscriptionID string, ascLocation string) SettingsClient { - return NewSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSettingsClient(subscriptionID string) SettingsClient { + return NewSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSettingsClientWithBaseURI creates an instance of the SettingsClient 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 NewSettingsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SettingsClient { - return SettingsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSettingsClientWithBaseURI(baseURI string, subscriptionID string) SettingsClient { + return SettingsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get settings of different configurations in security center +// Get settings of different configurations in Microsoft Defender for Cloud // Parameters: // settingName - the name of the setting -func (client SettingsClient) Get(ctx context.Context, settingName string) (result SettingModel, err error) { +func (client SettingsClient) Get(ctx context.Context, settingName SettingName4) (result SettingModel, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SettingsClient.Get") defer func() { @@ -74,13 +74,13 @@ func (client SettingsClient) Get(ctx context.Context, settingName string) (resul } // GetPreparer prepares the Get request. -func (client SettingsClient) GetPreparer(ctx context.Context, settingName string) (*http.Request, error) { +func (client SettingsClient) GetPreparer(ctx context.Context, settingName SettingName4) (*http.Request, error) { pathParameters := map[string]interface{}{ "settingName": autorest.Encode("path", settingName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -111,7 +111,7 @@ func (client SettingsClient) GetResponder(resp *http.Response) (result SettingMo return } -// List settings about different configurations in security center +// List settings about different configurations in Microsoft Defender for Cloud func (client SettingsClient) List(ctx context.Context) (result SettingsListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SettingsClient.List") @@ -162,7 +162,7 @@ func (client SettingsClient) ListPreparer(ctx context.Context) (*http.Request, e "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -230,11 +230,11 @@ func (client SettingsClient) ListComplete(ctx context.Context) (result SettingsL return } -// Update updating settings about different configurations in security center +// Update updating settings about different configurations in Microsoft Defender for Cloud // Parameters: // settingName - the name of the setting // setting - setting object -func (client SettingsClient) Update(ctx context.Context, settingName string, setting BasicSetting) (result SettingModel, err error) { +func (client SettingsClient) Update(ctx context.Context, settingName SettingName5, setting BasicSetting) (result SettingModel, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SettingsClient.Update") defer func() { @@ -274,13 +274,13 @@ func (client SettingsClient) Update(ctx context.Context, settingName string, set } // UpdatePreparer prepares the Update request. -func (client SettingsClient) UpdatePreparer(ctx context.Context, settingName string, setting BasicSetting) (*http.Request, error) { +func (client SettingsClient) UpdatePreparer(ctx context.Context, settingName SettingName5, setting BasicSetting) (*http.Request, error) { pathParameters := map[string]interface{}{ "settingName": autorest.Encode("path", settingName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/security/mgmt/v3.0/security/softwareinventories.go b/services/preview/security/mgmt/v3.0/security/softwareinventories.go index d7e3b70fd39a..352d7a173dd7 100644 --- a/services/preview/security/mgmt/v3.0/security/softwareinventories.go +++ b/services/preview/security/mgmt/v3.0/security/softwareinventories.go @@ -21,15 +21,15 @@ type SoftwareInventoriesClient struct { } // NewSoftwareInventoriesClient creates an instance of the SoftwareInventoriesClient client. -func NewSoftwareInventoriesClient(subscriptionID string, ascLocation string) SoftwareInventoriesClient { - return NewSoftwareInventoriesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSoftwareInventoriesClient(subscriptionID string) SoftwareInventoriesClient { + return NewSoftwareInventoriesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // 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)} +func NewSoftwareInventoriesClientWithBaseURI(baseURI string, subscriptionID string) SoftwareInventoriesClient { + return SoftwareInventoriesClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets a single software data of the virtual machine. diff --git a/services/preview/security/mgmt/v3.0/security/solutions.go b/services/preview/security/mgmt/v3.0/security/solutions.go index a6b145ac4f4d..ff272157849b 100644 --- a/services/preview/security/mgmt/v3.0/security/solutions.go +++ b/services/preview/security/mgmt/v3.0/security/solutions.go @@ -21,22 +21,24 @@ type SolutionsClient struct { } // NewSolutionsClient creates an instance of the SolutionsClient client. -func NewSolutionsClient(subscriptionID string, ascLocation string) SolutionsClient { - return NewSolutionsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSolutionsClient(subscriptionID string) SolutionsClient { + return NewSolutionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSolutionsClientWithBaseURI creates an instance of the SolutionsClient 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 NewSolutionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SolutionsClient { - return SolutionsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSolutionsClientWithBaseURI(baseURI string, subscriptionID string) SolutionsClient { + return SolutionsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets a specific Security Solution. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // securitySolutionName - name of security solution. -func (client SolutionsClient) Get(ctx context.Context, resourceGroupName string, securitySolutionName string) (result Solution, err error) { +func (client SolutionsClient) Get(ctx context.Context, resourceGroupName string, ascLocation string, securitySolutionName string) (result Solution, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SolutionsClient.Get") defer func() { @@ -57,7 +59,7 @@ func (client SolutionsClient) Get(ctx context.Context, resourceGroupName string, return result, validation.NewError("security.SolutionsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, securitySolutionName) + req, err := client.GetPreparer(ctx, resourceGroupName, ascLocation, securitySolutionName) if err != nil { err = autorest.NewErrorWithError(err, "security.SolutionsClient", "Get", nil, "Failure preparing request") return @@ -80,9 +82,9 @@ func (client SolutionsClient) Get(ctx context.Context, resourceGroupName string, } // GetPreparer prepares the Get request. -func (client SolutionsClient) GetPreparer(ctx context.Context, resourceGroupName string, securitySolutionName string) (*http.Request, error) { +func (client SolutionsClient) GetPreparer(ctx context.Context, resourceGroupName string, ascLocation string, securitySolutionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "securitySolutionName": autorest.Encode("path", securitySolutionName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), diff --git a/services/preview/security/mgmt/v3.0/security/solutionsreferencedata.go b/services/preview/security/mgmt/v3.0/security/solutionsreferencedata.go index 34216f819691..81dddd4042dd 100644 --- a/services/preview/security/mgmt/v3.0/security/solutionsreferencedata.go +++ b/services/preview/security/mgmt/v3.0/security/solutionsreferencedata.go @@ -21,15 +21,15 @@ type SolutionsReferenceDataClient struct { } // NewSolutionsReferenceDataClient creates an instance of the SolutionsReferenceDataClient client. -func NewSolutionsReferenceDataClient(subscriptionID string, ascLocation string) SolutionsReferenceDataClient { - return NewSolutionsReferenceDataClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSolutionsReferenceDataClient(subscriptionID string) SolutionsReferenceDataClient { + return NewSolutionsReferenceDataClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSolutionsReferenceDataClientWithBaseURI creates an instance of the SolutionsReferenceDataClient 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 NewSolutionsReferenceDataClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SolutionsReferenceDataClient { - return SolutionsReferenceDataClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSolutionsReferenceDataClientWithBaseURI(baseURI string, subscriptionID string) SolutionsReferenceDataClient { + return SolutionsReferenceDataClient{NewWithBaseURI(baseURI, subscriptionID)} } // List gets a list of all supported Security Solutions for the subscription. @@ -110,7 +110,10 @@ func (client SolutionsReferenceDataClient) ListResponder(resp *http.Response) (r } // ListByHomeRegion gets list of all supported Security Solutions for subscription and location. -func (client SolutionsReferenceDataClient) ListByHomeRegion(ctx context.Context) (result SolutionsReferenceDataList, err error) { +// Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations +func (client SolutionsReferenceDataClient) ListByHomeRegion(ctx context.Context, ascLocation string) (result SolutionsReferenceDataList, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SolutionsReferenceDataClient.ListByHomeRegion") defer func() { @@ -127,7 +130,7 @@ func (client SolutionsReferenceDataClient) ListByHomeRegion(ctx context.Context) return result, validation.NewError("security.SolutionsReferenceDataClient", "ListByHomeRegion", err.Error()) } - req, err := client.ListByHomeRegionPreparer(ctx) + req, err := client.ListByHomeRegionPreparer(ctx, ascLocation) if err != nil { err = autorest.NewErrorWithError(err, "security.SolutionsReferenceDataClient", "ListByHomeRegion", nil, "Failure preparing request") return @@ -150,9 +153,9 @@ func (client SolutionsReferenceDataClient) ListByHomeRegion(ctx context.Context) } // ListByHomeRegionPreparer prepares the ListByHomeRegion request. -func (client SolutionsReferenceDataClient) ListByHomeRegionPreparer(ctx context.Context) (*http.Request, error) { +func (client SolutionsReferenceDataClient) ListByHomeRegionPreparer(ctx context.Context, ascLocation string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } diff --git a/services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentbaselinerules.go b/services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentbaselinerules.go index dac36e6f0626..fca9c4dc4938 100644 --- a/services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentbaselinerules.go +++ b/services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentbaselinerules.go @@ -22,15 +22,15 @@ type SQLVulnerabilityAssessmentBaselineRulesClient struct { // NewSQLVulnerabilityAssessmentBaselineRulesClient creates an instance of the // SQLVulnerabilityAssessmentBaselineRulesClient client. -func NewSQLVulnerabilityAssessmentBaselineRulesClient(subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentBaselineRulesClient { - return NewSQLVulnerabilityAssessmentBaselineRulesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSQLVulnerabilityAssessmentBaselineRulesClient(subscriptionID string) SQLVulnerabilityAssessmentBaselineRulesClient { + return NewSQLVulnerabilityAssessmentBaselineRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSQLVulnerabilityAssessmentBaselineRulesClientWithBaseURI creates an instance of the // SQLVulnerabilityAssessmentBaselineRulesClient 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 NewSQLVulnerabilityAssessmentBaselineRulesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentBaselineRulesClient { - return SQLVulnerabilityAssessmentBaselineRulesClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSQLVulnerabilityAssessmentBaselineRulesClientWithBaseURI(baseURI string, subscriptionID string) SQLVulnerabilityAssessmentBaselineRulesClient { + return SQLVulnerabilityAssessmentBaselineRulesClient{NewWithBaseURI(baseURI, subscriptionID)} } // Add sends the add request. diff --git a/services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentscanresults.go b/services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentscanresults.go index 6310b4f1014b..1f1b3740d3e1 100644 --- a/services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentscanresults.go +++ b/services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentscanresults.go @@ -22,15 +22,15 @@ type SQLVulnerabilityAssessmentScanResultsClient struct { // NewSQLVulnerabilityAssessmentScanResultsClient creates an instance of the // SQLVulnerabilityAssessmentScanResultsClient client. -func NewSQLVulnerabilityAssessmentScanResultsClient(subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentScanResultsClient { - return NewSQLVulnerabilityAssessmentScanResultsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSQLVulnerabilityAssessmentScanResultsClient(subscriptionID string) SQLVulnerabilityAssessmentScanResultsClient { + return NewSQLVulnerabilityAssessmentScanResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSQLVulnerabilityAssessmentScanResultsClientWithBaseURI creates an instance of the // SQLVulnerabilityAssessmentScanResultsClient 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 NewSQLVulnerabilityAssessmentScanResultsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentScanResultsClient { - return SQLVulnerabilityAssessmentScanResultsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSQLVulnerabilityAssessmentScanResultsClientWithBaseURI(baseURI string, subscriptionID string) SQLVulnerabilityAssessmentScanResultsClient { + return SQLVulnerabilityAssessmentScanResultsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get sends the get request. diff --git a/services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentscans.go b/services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentscans.go index 1b2f59ba954b..c7507a2d53be 100644 --- a/services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentscans.go +++ b/services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentscans.go @@ -21,15 +21,15 @@ type SQLVulnerabilityAssessmentScansClient struct { } // NewSQLVulnerabilityAssessmentScansClient creates an instance of the SQLVulnerabilityAssessmentScansClient client. -func NewSQLVulnerabilityAssessmentScansClient(subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentScansClient { - return NewSQLVulnerabilityAssessmentScansClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSQLVulnerabilityAssessmentScansClient(subscriptionID string) SQLVulnerabilityAssessmentScansClient { + return NewSQLVulnerabilityAssessmentScansClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSQLVulnerabilityAssessmentScansClientWithBaseURI creates an instance of the SQLVulnerabilityAssessmentScansClient // 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 NewSQLVulnerabilityAssessmentScansClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentScansClient { - return SQLVulnerabilityAssessmentScansClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSQLVulnerabilityAssessmentScansClientWithBaseURI(baseURI string, subscriptionID string) SQLVulnerabilityAssessmentScansClient { + return SQLVulnerabilityAssessmentScansClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get sends the get request. diff --git a/services/preview/security/mgmt/v3.0/security/subassessments.go b/services/preview/security/mgmt/v3.0/security/subassessments.go index d767fbbc6b05..a2440cb9293f 100644 --- a/services/preview/security/mgmt/v3.0/security/subassessments.go +++ b/services/preview/security/mgmt/v3.0/security/subassessments.go @@ -20,14 +20,14 @@ type SubAssessmentsClient struct { } // NewSubAssessmentsClient creates an instance of the SubAssessmentsClient client. -func NewSubAssessmentsClient(subscriptionID string, ascLocation string) SubAssessmentsClient { - return NewSubAssessmentsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewSubAssessmentsClient(subscriptionID string) SubAssessmentsClient { + return NewSubAssessmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSubAssessmentsClientWithBaseURI creates an instance of the SubAssessmentsClient 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 NewSubAssessmentsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SubAssessmentsClient { - return SubAssessmentsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewSubAssessmentsClientWithBaseURI(baseURI string, subscriptionID string) SubAssessmentsClient { + return SubAssessmentsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get get a security sub-assessment on your scanned resource diff --git a/services/preview/security/mgmt/v3.0/security/tasks.go b/services/preview/security/mgmt/v3.0/security/tasks.go index cd9940c935b8..f0c6ec950e9c 100644 --- a/services/preview/security/mgmt/v3.0/security/tasks.go +++ b/services/preview/security/mgmt/v3.0/security/tasks.go @@ -21,22 +21,24 @@ type TasksClient struct { } // NewTasksClient creates an instance of the TasksClient client. -func NewTasksClient(subscriptionID string, ascLocation string) TasksClient { - return NewTasksClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewTasksClient(subscriptionID string) TasksClient { + return NewTasksClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewTasksClientWithBaseURI creates an instance of the TasksClient 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 NewTasksClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) TasksClient { - return TasksClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewTasksClientWithBaseURI(baseURI string, subscriptionID string) TasksClient { + return TasksClient{NewWithBaseURI(baseURI, subscriptionID)} } // GetResourceGroupLevelTask recommended tasks that will help improve the security of the subscription proactively // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // taskName - name of the task object, will be a GUID -func (client TasksClient) GetResourceGroupLevelTask(ctx context.Context, resourceGroupName string, taskName string) (result Task, err error) { +func (client TasksClient) GetResourceGroupLevelTask(ctx context.Context, resourceGroupName string, ascLocation string, taskName string) (result Task, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.GetResourceGroupLevelTask") defer func() { @@ -57,7 +59,7 @@ func (client TasksClient) GetResourceGroupLevelTask(ctx context.Context, resourc return result, validation.NewError("security.TasksClient", "GetResourceGroupLevelTask", err.Error()) } - req, err := client.GetResourceGroupLevelTaskPreparer(ctx, resourceGroupName, taskName) + req, err := client.GetResourceGroupLevelTaskPreparer(ctx, resourceGroupName, ascLocation, taskName) if err != nil { err = autorest.NewErrorWithError(err, "security.TasksClient", "GetResourceGroupLevelTask", nil, "Failure preparing request") return @@ -80,9 +82,9 @@ func (client TasksClient) GetResourceGroupLevelTask(ctx context.Context, resourc } // GetResourceGroupLevelTaskPreparer prepares the GetResourceGroupLevelTask request. -func (client TasksClient) GetResourceGroupLevelTaskPreparer(ctx context.Context, resourceGroupName string, taskName string) (*http.Request, error) { +func (client TasksClient) GetResourceGroupLevelTaskPreparer(ctx context.Context, resourceGroupName string, ascLocation string, taskName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "taskName": autorest.Encode("path", taskName), @@ -121,8 +123,10 @@ func (client TasksClient) GetResourceGroupLevelTaskResponder(resp *http.Response // GetSubscriptionLevelTask recommended tasks that will help improve the security of the subscription proactively // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // taskName - name of the task object, will be a GUID -func (client TasksClient) GetSubscriptionLevelTask(ctx context.Context, taskName string) (result Task, err error) { +func (client TasksClient) GetSubscriptionLevelTask(ctx context.Context, ascLocation string, taskName string) (result Task, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.GetSubscriptionLevelTask") defer func() { @@ -139,7 +143,7 @@ func (client TasksClient) GetSubscriptionLevelTask(ctx context.Context, taskName return result, validation.NewError("security.TasksClient", "GetSubscriptionLevelTask", err.Error()) } - req, err := client.GetSubscriptionLevelTaskPreparer(ctx, taskName) + req, err := client.GetSubscriptionLevelTaskPreparer(ctx, ascLocation, taskName) if err != nil { err = autorest.NewErrorWithError(err, "security.TasksClient", "GetSubscriptionLevelTask", nil, "Failure preparing request") return @@ -162,9 +166,9 @@ func (client TasksClient) GetSubscriptionLevelTask(ctx context.Context, taskName } // GetSubscriptionLevelTaskPreparer prepares the GetSubscriptionLevelTask request. -func (client TasksClient) GetSubscriptionLevelTaskPreparer(ctx context.Context, taskName string) (*http.Request, error) { +func (client TasksClient) GetSubscriptionLevelTaskPreparer(ctx context.Context, ascLocation string, taskName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "taskName": autorest.Encode("path", taskName), } @@ -326,8 +330,10 @@ func (client TasksClient) ListComplete(ctx context.Context, filter string) (resu // ListByHomeRegion recommended tasks that will help improve the security of the subscription proactively // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // filter - oData filter. Optional. -func (client TasksClient) ListByHomeRegion(ctx context.Context, filter string) (result TaskListPage, err error) { +func (client TasksClient) ListByHomeRegion(ctx context.Context, ascLocation string, filter string) (result TaskListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.ListByHomeRegion") defer func() { @@ -345,7 +351,7 @@ func (client TasksClient) ListByHomeRegion(ctx context.Context, filter string) ( } result.fn = client.listByHomeRegionNextResults - req, err := client.ListByHomeRegionPreparer(ctx, filter) + req, err := client.ListByHomeRegionPreparer(ctx, ascLocation, filter) if err != nil { err = autorest.NewErrorWithError(err, "security.TasksClient", "ListByHomeRegion", nil, "Failure preparing request") return @@ -372,9 +378,9 @@ func (client TasksClient) ListByHomeRegion(ctx context.Context, filter string) ( } // ListByHomeRegionPreparer prepares the ListByHomeRegion request. -func (client TasksClient) ListByHomeRegionPreparer(ctx context.Context, filter string) (*http.Request, error) { +func (client TasksClient) ListByHomeRegionPreparer(ctx context.Context, ascLocation string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -434,7 +440,7 @@ func (client TasksClient) listByHomeRegionNextResults(ctx context.Context, lastR } // ListByHomeRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client TasksClient) ListByHomeRegionComplete(ctx context.Context, filter string) (result TaskListIterator, err error) { +func (client TasksClient) ListByHomeRegionComplete(ctx context.Context, ascLocation string, filter string) (result TaskListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.ListByHomeRegion") defer func() { @@ -445,7 +451,7 @@ func (client TasksClient) ListByHomeRegionComplete(ctx context.Context, filter s tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByHomeRegion(ctx, filter) + result.page, err = client.ListByHomeRegion(ctx, ascLocation, filter) return } @@ -453,8 +459,10 @@ func (client TasksClient) ListByHomeRegionComplete(ctx context.Context, filter s // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // filter - oData filter. Optional. -func (client TasksClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string) (result TaskListPage, err error) { +func (client TasksClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, ascLocation string, filter string) (result TaskListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.ListByResourceGroup") defer func() { @@ -476,7 +484,7 @@ func (client TasksClient) ListByResourceGroup(ctx context.Context, resourceGroup } result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, filter) + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, ascLocation, filter) if err != nil { err = autorest.NewErrorWithError(err, "security.TasksClient", "ListByResourceGroup", nil, "Failure preparing request") return @@ -503,9 +511,9 @@ func (client TasksClient) ListByResourceGroup(ctx context.Context, resourceGroup } // ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client TasksClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string) (*http.Request, error) { +func (client TasksClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, ascLocation string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -566,7 +574,7 @@ func (client TasksClient) listByResourceGroupNextResults(ctx context.Context, la } // ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client TasksClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string) (result TaskListIterator, err error) { +func (client TasksClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, ascLocation string, filter string) (result TaskListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.ListByResourceGroup") defer func() { @@ -577,7 +585,7 @@ func (client TasksClient) ListByResourceGroupComplete(ctx context.Context, resou tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, filter) + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, ascLocation, filter) return } @@ -586,9 +594,11 @@ func (client TasksClient) ListByResourceGroupComplete(ctx context.Context, resou // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // taskName - name of the task object, will be a GUID // taskUpdateActionType - type of the action to do on the task -func (client TasksClient) UpdateResourceGroupLevelTaskState(ctx context.Context, resourceGroupName string, taskName string, taskUpdateActionType string) (result autorest.Response, err error) { +func (client TasksClient) UpdateResourceGroupLevelTaskState(ctx context.Context, resourceGroupName string, ascLocation string, taskName string, taskUpdateActionType TaskUpdateActionType) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.UpdateResourceGroupLevelTaskState") defer func() { @@ -609,7 +619,7 @@ func (client TasksClient) UpdateResourceGroupLevelTaskState(ctx context.Context, return result, validation.NewError("security.TasksClient", "UpdateResourceGroupLevelTaskState", err.Error()) } - req, err := client.UpdateResourceGroupLevelTaskStatePreparer(ctx, resourceGroupName, taskName, taskUpdateActionType) + req, err := client.UpdateResourceGroupLevelTaskStatePreparer(ctx, resourceGroupName, ascLocation, taskName, taskUpdateActionType) if err != nil { err = autorest.NewErrorWithError(err, "security.TasksClient", "UpdateResourceGroupLevelTaskState", nil, "Failure preparing request") return @@ -632,9 +642,9 @@ func (client TasksClient) UpdateResourceGroupLevelTaskState(ctx context.Context, } // UpdateResourceGroupLevelTaskStatePreparer prepares the UpdateResourceGroupLevelTaskState request. -func (client TasksClient) UpdateResourceGroupLevelTaskStatePreparer(ctx context.Context, resourceGroupName string, taskName string, taskUpdateActionType string) (*http.Request, error) { +func (client TasksClient) UpdateResourceGroupLevelTaskStatePreparer(ctx context.Context, resourceGroupName string, ascLocation string, taskName string, taskUpdateActionType TaskUpdateActionType) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "taskName": autorest.Encode("path", taskName), @@ -674,9 +684,11 @@ func (client TasksClient) UpdateResourceGroupLevelTaskStateResponder(resp *http. // UpdateSubscriptionLevelTaskState recommended tasks that will help improve the security of the subscription // proactively // Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // taskName - name of the task object, will be a GUID // taskUpdateActionType - type of the action to do on the task -func (client TasksClient) UpdateSubscriptionLevelTaskState(ctx context.Context, taskName string, taskUpdateActionType string) (result autorest.Response, err error) { +func (client TasksClient) UpdateSubscriptionLevelTaskState(ctx context.Context, ascLocation string, taskName string, taskUpdateActionType TaskUpdateActionType) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.UpdateSubscriptionLevelTaskState") defer func() { @@ -693,7 +705,7 @@ func (client TasksClient) UpdateSubscriptionLevelTaskState(ctx context.Context, return result, validation.NewError("security.TasksClient", "UpdateSubscriptionLevelTaskState", err.Error()) } - req, err := client.UpdateSubscriptionLevelTaskStatePreparer(ctx, taskName, taskUpdateActionType) + req, err := client.UpdateSubscriptionLevelTaskStatePreparer(ctx, ascLocation, taskName, taskUpdateActionType) if err != nil { err = autorest.NewErrorWithError(err, "security.TasksClient", "UpdateSubscriptionLevelTaskState", nil, "Failure preparing request") return @@ -716,9 +728,9 @@ func (client TasksClient) UpdateSubscriptionLevelTaskState(ctx context.Context, } // UpdateSubscriptionLevelTaskStatePreparer prepares the UpdateSubscriptionLevelTaskState request. -func (client TasksClient) UpdateSubscriptionLevelTaskStatePreparer(ctx context.Context, taskName string, taskUpdateActionType string) (*http.Request, error) { +func (client TasksClient) UpdateSubscriptionLevelTaskStatePreparer(ctx context.Context, ascLocation string, taskName string, taskUpdateActionType TaskUpdateActionType) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "taskName": autorest.Encode("path", taskName), "taskUpdateActionType": autorest.Encode("path", taskUpdateActionType), diff --git a/services/preview/security/mgmt/v3.0/security/topology.go b/services/preview/security/mgmt/v3.0/security/topology.go index 4fd93cda87c8..4b88ca568d20 100644 --- a/services/preview/security/mgmt/v3.0/security/topology.go +++ b/services/preview/security/mgmt/v3.0/security/topology.go @@ -21,22 +21,24 @@ type TopologyClient struct { } // NewTopologyClient creates an instance of the TopologyClient client. -func NewTopologyClient(subscriptionID string, ascLocation string) TopologyClient { - return NewTopologyClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewTopologyClient(subscriptionID string) TopologyClient { + return NewTopologyClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewTopologyClientWithBaseURI creates an instance of the TopologyClient 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 NewTopologyClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) TopologyClient { - return TopologyClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewTopologyClientWithBaseURI(baseURI string, subscriptionID string) TopologyClient { + return TopologyClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets a specific topology component. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations // topologyResourceName - name of a topology resources collection. -func (client TopologyClient) Get(ctx context.Context, resourceGroupName string, topologyResourceName string) (result TopologyResource, err error) { +func (client TopologyClient) Get(ctx context.Context, resourceGroupName string, ascLocation string, topologyResourceName string) (result TopologyResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TopologyClient.Get") defer func() { @@ -57,7 +59,7 @@ func (client TopologyClient) Get(ctx context.Context, resourceGroupName string, return result, validation.NewError("security.TopologyClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, topologyResourceName) + req, err := client.GetPreparer(ctx, resourceGroupName, ascLocation, topologyResourceName) if err != nil { err = autorest.NewErrorWithError(err, "security.TopologyClient", "Get", nil, "Failure preparing request") return @@ -80,9 +82,9 @@ func (client TopologyClient) Get(ctx context.Context, resourceGroupName string, } // GetPreparer prepares the Get request. -func (client TopologyClient) GetPreparer(ctx context.Context, resourceGroupName string, topologyResourceName string) (*http.Request, error) { +func (client TopologyClient) GetPreparer(ctx context.Context, resourceGroupName string, ascLocation string, topologyResourceName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "topologyResourceName": autorest.Encode("path", topologyResourceName), @@ -239,7 +241,10 @@ func (client TopologyClient) ListComplete(ctx context.Context) (result TopologyL } // ListByHomeRegion gets a list that allows to build a topology view of a subscription and location. -func (client TopologyClient) ListByHomeRegion(ctx context.Context) (result TopologyListPage, err error) { +// Parameters: +// ascLocation - the location where ASC stores the data of the subscription. can be retrieved from Get +// locations +func (client TopologyClient) ListByHomeRegion(ctx context.Context, ascLocation string) (result TopologyListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TopologyClient.ListByHomeRegion") defer func() { @@ -257,7 +262,7 @@ func (client TopologyClient) ListByHomeRegion(ctx context.Context) (result Topol } result.fn = client.listByHomeRegionNextResults - req, err := client.ListByHomeRegionPreparer(ctx) + req, err := client.ListByHomeRegionPreparer(ctx, ascLocation) if err != nil { err = autorest.NewErrorWithError(err, "security.TopologyClient", "ListByHomeRegion", nil, "Failure preparing request") return @@ -284,9 +289,9 @@ func (client TopologyClient) ListByHomeRegion(ctx context.Context) (result Topol } // ListByHomeRegionPreparer prepares the ListByHomeRegion request. -func (client TopologyClient) ListByHomeRegionPreparer(ctx context.Context) (*http.Request, error) { +func (client TopologyClient) ListByHomeRegionPreparer(ctx context.Context, ascLocation string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), + "ascLocation": autorest.Encode("path", ascLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -343,7 +348,7 @@ func (client TopologyClient) listByHomeRegionNextResults(ctx context.Context, la } // ListByHomeRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client TopologyClient) ListByHomeRegionComplete(ctx context.Context) (result TopologyListIterator, err error) { +func (client TopologyClient) ListByHomeRegionComplete(ctx context.Context, ascLocation string) (result TopologyListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TopologyClient.ListByHomeRegion") defer func() { @@ -354,6 +359,6 @@ func (client TopologyClient) ListByHomeRegionComplete(ctx context.Context) (resu tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByHomeRegion(ctx) + result.page, err = client.ListByHomeRegion(ctx, ascLocation) return } diff --git a/services/preview/security/mgmt/v3.0/security/workspacesettings.go b/services/preview/security/mgmt/v3.0/security/workspacesettings.go index 8b402a5755ec..8d7642baf7e0 100644 --- a/services/preview/security/mgmt/v3.0/security/workspacesettings.go +++ b/services/preview/security/mgmt/v3.0/security/workspacesettings.go @@ -21,15 +21,15 @@ type WorkspaceSettingsClient struct { } // NewWorkspaceSettingsClient creates an instance of the WorkspaceSettingsClient client. -func NewWorkspaceSettingsClient(subscriptionID string, ascLocation string) WorkspaceSettingsClient { - return NewWorkspaceSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +func NewWorkspaceSettingsClient(subscriptionID string) WorkspaceSettingsClient { + return NewWorkspaceSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewWorkspaceSettingsClientWithBaseURI creates an instance of the WorkspaceSettingsClient 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 NewWorkspaceSettingsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) WorkspaceSettingsClient { - return WorkspaceSettingsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +func NewWorkspaceSettingsClientWithBaseURI(baseURI string, subscriptionID string) WorkspaceSettingsClient { + return WorkspaceSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Create creating settings about where we should store your security data and logs