From 386aa97f9a9d102cc59416fdfdde965952b610b4 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 11 Jan 2022 04:34:33 +0000 Subject: [PATCH] CodeGen from PR 17295 in Azure/azure-rest-api-specs add java directive to security insight (#17295) --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 102 + .../SAMPLE.md | 4608 +++++++++++++++++ .../pom.xml | 81 + .../SecurityInsightsManager.java | 625 +++ .../fluent/ActionsClient.java | 149 + .../fluent/AlertRuleTemplatesClient.java | 72 + .../fluent/AlertRulesClient.java | 133 + .../fluent/AutomationRulesClient.java | 138 + .../fluent/BookmarkOperationsClient.java | 52 + .../fluent/BookmarkRelationsClient.java | 161 + .../fluent/BookmarksClient.java | 134 + ...torsCheckRequirementsOperationsClient.java | 54 + .../fluent/DataConnectorsClient.java | 204 + .../fluent/DomainWhoisClient.java | 41 + .../fluent/EntitiesClient.java | 185 + .../fluent/EntitiesGetTimelinesClient.java | 52 + .../fluent/EntitiesRelationsClient.java | 57 + .../fluent/EntityQueriesClient.java | 142 + .../fluent/EntityQueryTemplatesClient.java | 75 + .../fluent/EntityRelationsClient.java | 46 + .../fluent/IncidentCommentsClient.java | 166 + .../fluent/IncidentRelationsClient.java | 161 + .../fluent/IncidentsClient.java | 279 + .../fluent/IpGeodatasClient.java | 41 + .../fluent/MetadatasClient.java | 188 + .../fluent/OfficeConsentsClient.java | 101 + .../fluent/OperationsClient.java | 36 + .../fluent/ProductSettingsClient.java | 133 + .../fluent/SecurityInsights.java | 270 + .../SentinelOnboardingStatesClient.java | 139 + .../fluent/SourceControlsClient.java | 45 + .../SourceControlsOperationsClient.java | 138 + ...eatIntelligenceIndicatorMetricsClient.java | 44 + .../ThreatIntelligenceIndicatorsClient.java | 267 + ...ntelligenceIndicatorsOperationsClient.java | 57 + .../fluent/WatchlistItemsClient.java | 153 + .../fluent/WatchlistsClient.java | 140 + .../AadCheckRequirementsProperties.java | 33 + .../models/AadDataConnectorProperties.java | 64 + .../AatpCheckRequirementsProperties.java | 33 + .../models/AatpDataConnectorProperties.java | 64 + .../models/AccountEntityProperties.java | 218 + .../models/ActionRequestProperties.java | 66 + .../fluent/models/ActionResponseInner.java | 100 + .../models/ActionResponseProperties.java | 60 + .../ActivityEntityQueriesProperties.java | 302 ++ ...ActivityEntityQueryTemplateProperties.java | 250 + .../fluent/models/AlertRuleInner.java | 58 + .../fluent/models/AlertRuleTemplateInner.java | 67 + .../models/AnomaliesSettingsProperties.java | 39 + .../fluent/models/ApiPollingParameters.java | 84 + .../AscCheckRequirementsProperties.java | 50 + .../models/AscDataConnectorProperties.java | 61 + .../fluent/models/AutomationRuleInner.java | 185 + .../models/AutomationRuleProperties.java | 221 + .../AwsCloudTrailDataConnectorProperties.java | 88 + .../models/AwsS3DataConnectorProperties.java | 156 + .../models/AzureResourceEntityProperties.java | 57 + .../models/BookmarkExpandResponseInner.java | 84 + .../fluent/models/BookmarkInner.java | 355 ++ .../fluent/models/BookmarkProperties.java | 385 ++ .../CloudApplicationEntityProperties.java | 75 + .../fluent/models/CodelessParameters.java | 54 + .../fluent/models/DataConnectorInner.java | 78 + .../DataConnectorRequirementsStateInner.java | 79 + .../fluent/models/DnsEntityProperties.java | 88 + ...ynamics365CheckRequirementsProperties.java | 33 + .../Dynamics365DataConnectorProperties.java | 69 + .../models/EnrichmentDomainWhoisInner.java | 185 + .../models/EnrichmentIpGeodataInner.java | 476 ++ .../models/EntityAnalyticsProperties.java | 39 + .../models/EntityExpandResponseInner.java | 84 + .../EntityGetInsightsResponseInner.java | 85 + .../fluent/models/EntityInner.java | 95 + .../fluent/models/EntityQueryInner.java | 48 + .../models/EntityQueryTemplateInner.java | 53 + .../models/EntityTimelineResponseInner.java | 85 + .../ExpansionEntityQueriesProperties.java | 183 + .../models/EyesOnSettingsProperties.java | 39 + .../fluent/models/FileEntityProperties.java | 88 + .../models/FileHashEntityProperties.java | 58 + .../models/FusionAlertRuleProperties.java | 161 + .../FusionAlertRuleTemplateProperties.java | 127 + .../models/GetQueriesResponseInner.java | 55 + .../fluent/models/HostEntityProperties.java | 179 + .../models/HuntingBookmarkProperties.java | 337 ++ .../fluent/models/IncidentAlertListInner.java | 59 + .../models/IncidentBookmarkListInner.java | 59 + .../fluent/models/IncidentCommentInner.java | 104 + .../models/IncidentCommentProperties.java | 106 + .../models/IncidentEntitiesResponseInner.java | 84 + .../fluent/models/IncidentInner.java | 437 ++ .../models/IncidentPropertiesInner.java | 515 ++ .../models/IoTDeviceEntityProperties.java | 288 ++ .../fluent/models/IpEntityProperties.java | 81 + ...LBehaviorAnalyticsAlertRuleProperties.java | 162 + ...rAnalyticsAlertRuleTemplateProperties.java | 128 + .../models/MailClusterEntityProperties.java | 254 + .../models/MailMessageEntityProperties.java | 499 ++ .../models/MailboxEntityProperties.java | 90 + .../models/MalwareEntityProperties.java | 89 + .../McasCheckRequirementsProperties.java | 33 + .../models/McasDataConnectorProperties.java | 69 + .../MdatpCheckRequirementsProperties.java | 33 + .../models/MdatpDataConnectorProperties.java | 64 + .../fluent/models/MetadataModelInner.java | 350 ++ .../fluent/models/MetadataProperties.java | 393 ++ .../models/MetadataPropertiesPatch.java | 383 ++ ...tyIncidentCreationAlertRuleProperties.java | 192 + ...ntCreationAlertRuleTemplateProperties.java | 187 + .../MstiCheckRequirementsProperties.java | 33 + .../models/MstiDataConnectorProperties.java | 69 + .../MtpCheckRequirementsProperties.java | 33 + .../models/MtpDataConnectorProperties.java | 69 + .../fluent/models/NrtAlertRuleProperties.java | 132 + .../NrtAlertRuleTemplateProperties.java | 266 + .../OfficeAtpCheckRequirementsProperties.java | 33 + .../OfficeAtpDataConnectorProperties.java | 64 + .../fluent/models/OfficeConsentInner.java | 106 + .../models/OfficeConsentProperties.java | 76 + .../models/OfficeDataConnectorProperties.java | 69 + .../OfficeIrmCheckRequirementsProperties.java | 33 + .../OfficeIrmDataConnectorProperties.java | 64 + .../fluent/models/OperationInner.java | 132 + .../models/ProcessEntityProperties.java | 175 + .../models/RegistryKeyEntityProperties.java | 58 + .../models/RegistryValueEntityProperties.java | 90 + .../fluent/models/RelationInner.java | 102 + .../fluent/models/RelationProperties.java | 101 + .../fluent/models/RepoInner.java | 103 + .../models/ScheduledAlertRuleProperties.java | 488 ++ .../ScheduledAlertRuleTemplateProperties.java | 402 ++ .../models/SecurityAlertProperties.java | 432 ++ .../models/SecurityGroupEntityProperties.java | 77 + .../models/SentinelOnboardingStateInner.java | 75 + .../SentinelOnboardingStateProperties.java | 50 + .../SentinelOnboardingStatesListInner.java | 59 + .../fluent/models/SettingListInner.java | 58 + .../fluent/models/SettingsInner.java | 52 + .../fluent/models/SourceControlInner.java | 194 + .../models/SourceControlProperties.java | 210 + .../SubmissionMailEntityProperties.java | 181 + .../models/TICheckRequirementsProperties.java | 33 + .../models/TIDataConnectorProperties.java | 96 + .../fluent/models/TeamInformationInner.java | 100 + ...ThreatIntelligenceAlertRuleProperties.java | 162 + ...telligenceAlertRuleTemplateProperties.java | 128 + ...ThreatIntelligenceIndicatorProperties.java | 779 +++ .../ThreatIntelligenceInformationInner.java | 44 + .../ThreatIntelligenceMetricsListInner.java | 60 + .../TiTaxiiCheckRequirementsProperties.java | 33 + .../TiTaxiiDataConnectorProperties.java | 285 + .../fluent/models/UebaProperties.java | 52 + .../fluent/models/UrlEntityProperties.java | 42 + .../fluent/models/WatchlistInner.java | 548 ++ .../fluent/models/WatchlistItemInner.java | 284 + .../models/WatchlistItemProperties.java | 298 ++ .../fluent/models/WatchlistProperties.java | 617 +++ .../fluent/models/package-info.java | 9 + .../securityinsights/fluent/package-info.java | 9 + .../implementation/ActionResponseImpl.java | 191 + .../implementation/ActionsClientImpl.java | 962 ++++ .../implementation/ActionsImpl.java | 221 + .../implementation/AlertRuleImpl.java | 49 + .../implementation/AlertRuleTemplateImpl.java | 46 + .../AlertRuleTemplatesClientImpl.java | 518 ++ .../AlertRuleTemplatesImpl.java | 74 + .../implementation/AlertRulesClientImpl.java | 883 ++++ .../implementation/AlertRulesImpl.java | 109 + .../implementation/AutomationRuleImpl.java | 208 + .../AutomationRulesClientImpl.java | 901 ++++ .../implementation/AutomationRulesImpl.java | 194 + .../BookmarkExpandResponseImpl.java | 39 + .../implementation/BookmarkImpl.java | 269 + .../BookmarkOperationsClientImpl.java | 265 + .../BookmarkOperationsImpl.java | 69 + .../BookmarkRelationsClientImpl.java | 1079 ++++ .../implementation/BookmarkRelationsImpl.java | 233 + .../implementation/BookmarksClientImpl.java | 883 ++++ .../implementation/BookmarksImpl.java | 190 + .../implementation/DataConnectorImpl.java | 50 + .../DataConnectorRequirementsStateImpl.java | 39 + ...CheckRequirementsOperationsClientImpl.java | 270 + ...ectorsCheckRequirementsOperationsImpl.java | 73 + .../DataConnectorsClientImpl.java | 1277 +++++ .../implementation/DataConnectorsImpl.java | 140 + .../implementation/DomainWhoisClientImpl.java | 220 + .../implementation/DomainWhoisImpl.java | 61 + .../EnrichmentDomainWhoisImpl.java | 55 + .../EnrichmentIpGeodataImpl.java | 97 + .../implementation/EntitiesClientImpl.java | 1125 ++++ .../EntitiesGetTimelinesClientImpl.java | 266 + .../EntitiesGetTimelinesImpl.java | 69 + .../implementation/EntitiesImpl.java | 168 + .../EntitiesRelationsClientImpl.java | 459 ++ .../implementation/EntitiesRelationsImpl.java | 58 + .../EntityExpandResponseImpl.java | 39 + .../EntityGetInsightsResponseImpl.java | 46 + .../implementation/EntityImpl.java | 45 + .../EntityQueriesClientImpl.java | 926 ++++ .../implementation/EntityQueriesImpl.java | 118 + .../implementation/EntityQueryImpl.java | 50 + .../EntityQueryTemplateImpl.java | 46 + .../EntityQueryTemplatesClientImpl.java | 550 ++ .../EntityQueryTemplatesImpl.java | 77 + .../EntityRelationsClientImpl.java | 252 + .../implementation/EntityRelationsImpl.java | 65 + .../EntityTimelineResponseImpl.java | 46 + .../GetQueriesResponseImpl.java | 41 + .../implementation/IncidentAlertListImpl.java | 41 + .../IncidentBookmarkListImpl.java | 41 + .../implementation/IncidentCommentImpl.java | 173 + .../IncidentCommentsClientImpl.java | 1092 ++++ .../implementation/IncidentCommentsImpl.java | 238 + .../IncidentEntitiesResponseImpl.java | 55 + .../implementation/IncidentImpl.java | 362 ++ .../IncidentPropertiesImpl.java | 136 + .../IncidentRelationsClientImpl.java | 1079 ++++ .../implementation/IncidentRelationsImpl.java | 133 + .../implementation/IncidentsClientImpl.java | 1725 ++++++ .../implementation/IncidentsImpl.java | 313 ++ .../implementation/IpGeodatasClientImpl.java | 220 + .../implementation/IpGeodatasImpl.java | 61 + .../implementation/MetadataModelImpl.java | 336 ++ .../implementation/MetadatasClientImpl.java | 1184 +++++ .../implementation/MetadatasImpl.java | 198 + .../implementation/OfficeConsentImpl.java | 54 + .../OfficeConsentsClientImpl.java | 684 +++ .../implementation/OfficeConsentsImpl.java | 82 + .../implementation/OperationImpl.java | 45 + .../implementation/OperationsClientImpl.java | 269 + .../implementation/OperationsImpl.java | 47 + .../ProductSettingsClientImpl.java | 770 +++ .../implementation/ProductSettingsImpl.java | 121 + .../implementation/RelationImpl.java | 169 + .../implementation/RepoImpl.java | 46 + .../SecurityInsightsBuilder.java | 146 + .../implementation/SecurityInsightsImpl.java | 727 +++ .../SentinelOnboardingStateImpl.java | 126 + .../SentinelOnboardingStatesClientImpl.java | 841 +++ .../SentinelOnboardingStatesImpl.java | 221 + .../SentinelOnboardingStatesListImpl.java | 48 + .../implementation/SettingListImpl.java | 48 + .../implementation/SettingsImpl.java | 49 + .../implementation/SourceControlImpl.java | 178 + .../SourceControlsClientImpl.java | 358 ++ .../implementation/SourceControlsImpl.java | 51 + .../SourceControlsOperationsClientImpl.java | 900 ++++ .../SourceControlsOperationsImpl.java | 194 + .../implementation/TeamInformationImpl.java | 50 + ...ntelligenceIndicatorMetricsClientImpl.java | 227 + ...hreatIntelligenceIndicatorMetricsImpl.java | 62 + ...hreatIntelligenceIndicatorsClientImpl.java | 1613 ++++++ .../ThreatIntelligenceIndicatorsImpl.java | 219 + ...ligenceIndicatorsOperationsClientImpl.java | 434 ++ ...tIntelligenceIndicatorsOperationsImpl.java | 56 + .../ThreatIntelligenceInformationImpl.java | 50 + .../ThreatIntelligenceMetricsListImpl.java | 41 + .../implementation/Utils.java | 204 + .../implementation/WatchlistImpl.java | 344 ++ .../implementation/WatchlistItemImpl.java | 242 + .../WatchlistItemsClientImpl.java | 1002 ++++ .../implementation/WatchlistItemsImpl.java | 241 + .../implementation/WatchlistsClientImpl.java | 897 ++++ .../implementation/WatchlistsImpl.java | 190 + .../implementation/package-info.java | 9 + .../models/AadCheckRequirements.java | 49 + .../models/AadDataConnector.java | 103 + .../models/AatpCheckRequirements.java | 49 + .../models/AatpDataConnector.java | 103 + .../models/AccountEntity.java | 185 + .../models/ActionPropertiesBase.java | 59 + .../models/ActionRequest.java | 100 + .../models/ActionResponse.java | 220 + .../securityinsights/models/Actions.java | 152 + .../securityinsights/models/ActionsList.java | 74 + .../models/ActivityCustomEntityQuery.java | 287 + ...tityQueriesPropertiesQueryDefinitions.java | 51 + .../models/ActivityEntityQuery.java | 287 + .../models/ActivityEntityQueryTemplate.java | 239 + ...eryTemplatePropertiesQueryDefinitions.java | 80 + .../models/ActivityTimelineItem.java | 252 + .../securityinsights/models/AlertDetail.java | 34 + .../models/AlertDetailsOverride.java | 128 + .../securityinsights/models/AlertRule.java | 53 + .../models/AlertRuleKind.java | 47 + .../models/AlertRuleTemplate.java | 46 + .../models/AlertRuleTemplateDataSource.java | 77 + .../AlertRuleTemplatePropertiesBase.java | 191 + .../models/AlertRuleTemplates.java | 65 + .../models/AlertRuleTemplatesList.java | 74 + .../securityinsights/models/AlertRules.java | 121 + .../models/AlertRulesList.java | 74 + .../models/AlertSeverity.java | 40 + .../securityinsights/models/AlertStatus.java | 43 + .../models/AlertsDataTypeOfDataConnector.java | 58 + .../securityinsights/models/Anomalies.java | 66 + .../models/AntispamMailDirection.java | 40 + .../models/AscCheckRequirements.java | 72 + .../models/AscDataConnector.java | 103 + .../securityinsights/models/AttackTactic.java | 67 + .../models/AutomationRule.java | 305 ++ .../models/AutomationRuleAction.java | 63 + .../models/AutomationRuleActionType.java | 34 + .../models/AutomationRuleCondition.java | 33 + .../models/AutomationRuleConditionType.java | 31 + .../AutomationRuleModifyPropertiesAction.java | 72 + ...leModifyPropertiesActionConfiguration.java | 215 + ...ulePropertyConditionSupportedOperator.java | 53 + ...ulePropertyConditionSupportedProperty.java | 215 + ...AutomationRulePropertyValuesCondition.java | 66 + ...RulePropertyValuesConditionProperties.java | 106 + .../AutomationRuleRunPlaybookAction.java | 72 + ...ionRuleRunPlaybookActionConfiguration.java | 77 + .../models/AutomationRuleTriggeringLogic.java | 177 + .../models/AutomationRules.java | 145 + .../models/AutomationRulesList.java | 74 + .../securityinsights/models/Availability.java | 76 + .../models/AvailabilityStatus.java | 48 + .../AwsCloudTrailCheckRequirements.java | 29 + .../models/AwsCloudTrailDataConnector.java | 105 + .../AwsCloudTrailDataConnectorDataTypes.java | 58 + ...sCloudTrailDataConnectorDataTypesLogs.java | 32 + .../models/AwsS3CheckRequirements.java | 29 + .../models/AwsS3DataConnector.java | 150 + .../models/AwsS3DataConnectorDataTypes.java | 58 + .../AwsS3DataConnectorDataTypesLogs.java | 32 + .../models/AzureResourceEntity.java | 89 + .../securityinsights/models/Bookmark.java | 538 ++ .../models/BookmarkExpandParameters.java | 106 + .../models/BookmarkExpandResponse.java | 31 + .../models/BookmarkExpandResponseValue.java | 84 + .../securityinsights/models/BookmarkList.java | 74 + .../models/BookmarkOperations.java | 46 + .../models/BookmarkRelations.java | 165 + .../models/BookmarkTimelineItem.java | 249 + .../securityinsights/models/Bookmarks.java | 145 + .../securityinsights/models/ClientInfo.java | 129 + .../models/CloudApplicationEntity.java | 99 + .../CodelessApiPollingDataConnector.java | 104 + ...odelessConnectorPollingAuthProperties.java | 381 ++ ...elessConnectorPollingConfigProperties.java | 176 + ...elessConnectorPollingPagingProperties.java | 270 + ...lessConnectorPollingRequestProperties.java | 359 ++ ...essConnectorPollingResponseProperties.java | 136 + .../CodelessUiConnectorConfigProperties.java | 426 ++ ...figPropertiesConnectivityCriteriaItem.java | 42 + ...onnectorConfigPropertiesDataTypesItem.java | 40 + ...ectorConfigPropertiesGraphQueriesItem.java | 47 + ...rConfigPropertiesInstructionStepsItem.java | 49 + ...ctorConfigPropertiesSampleQueriesItem.java | 40 + .../models/CodelessUiDataConnector.java | 80 + .../models/ConfidenceLevel.java | 37 + .../models/ConfidenceScoreStatus.java | 40 + .../models/ConnectAuthKind.java | 37 + .../models/ConnectedEntity.java | 76 + .../models/ConnectivityCriteria.java | 77 + .../models/ConnectivityType.java | 31 + .../models/ConnectorInstructionModelBase.java | 82 + .../securityinsights/models/Constant69.java | 44 + .../models/ContentPathMap.java | 76 + .../securityinsights/models/ContentType.java | 34 + .../models/CustomEntityQuery.java | 42 + .../models/CustomEntityQueryKind.java | 31 + .../securityinsights/models/Customs.java | 39 + .../models/CustomsPermission.java | 76 + .../models/DataConnector.java | 53 + .../DataConnectorAuthorizationState.java | 34 + .../models/DataConnectorConnectBody.java | 233 + .../models/DataConnectorDataTypeCommon.java | 56 + .../models/DataConnectorKind.java | 81 + .../models/DataConnectorLicenseState.java | 37 + .../models/DataConnectorList.java | 74 + .../DataConnectorRequirementsState.java | 32 + .../models/DataConnectorTenantId.java | 55 + .../DataConnectorWithAlertsProperties.java | 53 + .../models/DataConnectors.java | 189 + .../DataConnectorsCheckRequirements.java | 48 + ...ConnectorsCheckRequirementsOperations.java | 45 + .../models/DataTypeDefinitions.java | 50 + .../models/DataTypeState.java | 34 + .../models/DeliveryAction.java | 56 + .../models/DeliveryLocation.java | 68 + .../securityinsights/models/DnsEntity.java | 108 + .../securityinsights/models/DomainWhois.java | 36 + .../models/Dynamics365CheckRequirements.java | 49 + .../models/Dynamics365DataConnector.java | 103 + .../Dynamics365DataConnectorDataTypes.java | 60 + ...ctorDataTypesDynamics365CdsActivities.java | 34 + .../models/ElevationToken.java | 50 + .../models/EnrichmentDomainWhois.java | 60 + .../models/EnrichmentDomainWhoisContact.java | 285 + .../models/EnrichmentDomainWhoisContacts.java | 140 + .../models/EnrichmentDomainWhoisDetails.java | 135 + ...EnrichmentDomainWhoisRegistrarDetails.java | 180 + .../models/EnrichmentIpGeodata.java | 139 + .../securityinsights/models/Entities.java | 165 + .../models/EntitiesGetTimelines.java | 46 + .../models/EntitiesRelations.java | 52 + .../securityinsights/models/Entity.java | 46 + .../models/EntityAnalytics.java | 66 + .../models/EntityCommonProperties.java | 62 + .../securityinsights/models/EntityEdges.java | 82 + .../models/EntityExpandParameters.java | 106 + .../models/EntityExpandResponse.java | 31 + .../models/EntityExpandResponseValue.java | 84 + .../models/EntityGetInsightsParameters.java | 149 + .../models/EntityGetInsightsResponse.java | 32 + .../models/EntityInsightItem.java | 138 + .../EntityInsightItemQueryTimeInterval.java | 77 + .../models/EntityItemQueryKind.java | 31 + .../securityinsights/models/EntityKind.java | 91 + .../securityinsights/models/EntityList.java | 74 + .../models/EntityMapping.java | 80 + .../models/EntityMappingType.java | 82 + .../models/EntityQueries.java | 129 + .../models/EntityQueriesKind.java | 34 + .../securityinsights/models/EntityQuery.java | 53 + .../models/EntityQueryItem.java | 101 + .../models/EntityQueryItemProperties.java | 132 + ...ntityQueryItemPropertiesDataTypesItem.java | 50 + .../models/EntityQueryKind.java | 37 + .../models/EntityQueryList.java | 74 + .../models/EntityQueryTemplate.java | 46 + .../models/EntityQueryTemplateKind.java | 31 + .../models/EntityQueryTemplateList.java | 74 + .../models/EntityQueryTemplates.java | 67 + .../models/EntityRelations.java | 41 + .../models/EntityTimelineItem.java | 37 + .../models/EntityTimelineKind.java | 37 + .../models/EntityTimelineParameters.java | 142 + .../models/EntityTimelineResponse.java | 32 + .../securityinsights/models/EntityType.java | 91 + .../models/EventGroupingAggregationKind.java | 34 + .../models/EventGroupingSettings.java | 50 + .../models/ExpansionEntityQuery.java | 196 + .../models/ExpansionResultAggregation.java | 137 + .../models/ExpansionResultsMetadata.java | 54 + .../securityinsights/models/EyesOn.java | 66 + .../securityinsights/models/FieldMapping.java | 76 + .../securityinsights/models/FileEntity.java | 108 + .../models/FileHashAlgorithm.java | 43 + .../models/FileHashEntity.java | 89 + .../models/FusionAlertRule.java | 150 + .../models/FusionAlertRuleTemplate.java | 232 + .../securityinsights/models/GeoLocation.java | 141 + .../models/GetInsightsError.java | 112 + .../models/GetInsightsResultsMetadata.java | 80 + .../models/GetQueriesResponse.java | 25 + .../securityinsights/models/GraphQueries.java | 102 + .../models/GroupingConfiguration.java | 233 + .../securityinsights/models/HostEntity.java | 168 + .../models/HuntingBookmark.java | 326 ++ .../securityinsights/models/Incident.java | 694 +++ .../models/IncidentAdditionalData.java | 100 + .../models/IncidentAlertList.java | 25 + .../models/IncidentBookmarkList.java | 25 + .../models/IncidentClassification.java | 40 + .../models/IncidentClassificationReason.java | 40 + .../models/IncidentComment.java | 207 + .../models/IncidentCommentList.java | 74 + .../models/IncidentComments.java | 165 + .../models/IncidentConfiguration.java | 82 + .../models/IncidentEntitiesResponse.java | 32 + .../IncidentEntitiesResultsMetadata.java | 83 + .../securityinsights/models/IncidentInfo.java | 128 + .../models/IncidentLabel.java | 70 + .../models/IncidentLabelType.java | 34 + .../securityinsights/models/IncidentList.java | 74 + .../models/IncidentOwnerInfo.java | 144 + .../models/IncidentProperties.java | 159 + .../models/IncidentRelations.java | 151 + .../models/IncidentSeverity.java | 40 + .../models/IncidentStatus.java | 37 + .../securityinsights/models/Incidents.java | 277 + .../models/InsightQueryItem.java | 73 + .../models/InsightQueryItemProperties.java | 277 + ...ghtQueryItemPropertiesAdditionalQuery.java | 76 + ...htQueryItemPropertiesDefaultTimeRange.java | 76 + ...QueryItemPropertiesReferenceTimeRange.java | 51 + .../InsightQueryItemPropertiesTableQuery.java | 85 + ...rtiesTableQueryColumnsDefinitionsItem.java | 104 + ...rtiesTableQueryQueriesDefinitionsItem.java | 135 + ...QueriesDefinitionsPropertiesItemsItem.java | 79 + .../models/InsightsTableResult.java | 80 + .../InsightsTableResultColumnsItem.java | 76 + .../models/InstructionSteps.java | 106 + .../InstructionStepsInstructionsItem.java | 39 + .../models/IoTDeviceEntity.java | 226 + .../securityinsights/models/IpEntity.java | 99 + .../securityinsights/models/IpGeodatas.java | 36 + .../models/KillChainIntent.java | 70 + .../securityinsights/models/Kind.java | 70 + .../models/LastDataReceivedDataType.java | 79 + .../models/MLBehaviorAnalyticsAlertRule.java | 150 + .../MLBehaviorAnalyticsAlertRuleTemplate.java | 233 + .../models/MailClusterEntity.java | 208 + .../models/MailMessageEntity.java | 412 ++ .../models/MailboxEntity.java | 109 + .../models/MalwareEntity.java | 108 + .../models/MatchingMethod.java | 37 + .../models/McasCheckRequirements.java | 49 + .../models/McasDataConnector.java | 103 + .../models/McasDataConnectorDataTypes.java | 62 + .../models/MdatpCheckRequirements.java | 51 + .../models/MdatpDataConnector.java | 105 + .../models/MetadataAuthor.java | 102 + .../models/MetadataCategories.java | 77 + .../models/MetadataDependencies.java | 196 + .../securityinsights/models/MetadataList.java | 74 + .../models/MetadataModel.java | 544 ++ .../models/MetadataPatch.java | 344 ++ .../models/MetadataSource.java | 108 + .../models/MetadataSupport.java | 133 + .../securityinsights/models/Metadatas.java | 157 + ...softSecurityIncidentCreationAlertRule.java | 253 + ...dentCreationAlertRuleCommonProperties.java | 142 + ...rityIncidentCreationAlertRuleTemplate.java | 283 + .../models/MicrosoftSecurityProductName.java | 55 + .../models/MstiCheckRequirements.java | 49 + .../models/MstiDataConnector.java | 103 + .../models/MstiDataConnectorDataTypes.java | 96 + ...nnectorDataTypesBingSafetyPhishingUrl.java | 67 + ...rDataTypesMicrosoftEmergingThreatFeed.java | 67 + .../models/MtpCheckRequirements.java | 49 + .../models/MtpDataConnector.java | 103 + .../models/MtpDataConnectorDataTypes.java | 58 + .../MtpDataConnectorDataTypesIncidents.java | 32 + .../securityinsights/models/NrtAlertRule.java | 57 + .../models/NrtAlertRuleTemplate.java | 349 ++ .../securityinsights/models/OSFamily.java | 56 + .../models/OfficeAtpCheckRequirements.java | 51 + .../models/OfficeAtpDataConnector.java | 104 + .../models/OfficeConsent.java | 60 + .../models/OfficeConsentList.java | 74 + .../models/OfficeConsents.java | 92 + .../models/OfficeDataConnector.java | 103 + .../models/OfficeDataConnectorDataTypes.java | 126 + .../OfficeDataConnectorDataTypesExchange.java | 32 + ...fficeDataConnectorDataTypesSharePoint.java | 32 + .../OfficeDataConnectorDataTypesTeams.java | 32 + .../models/OfficeIrmCheckRequirements.java | 50 + .../models/OfficeIrmDataConnector.java | 103 + .../securityinsights/models/Operation.java | 45 + .../models/OperationDisplay.java | 128 + .../securityinsights/models/Operations.java | 31 + .../models/OperationsList.java | 74 + .../securityinsights/models/Operator.java | 34 + .../securityinsights/models/OutputType.java | 40 + .../securityinsights/models/OwnerType.java | 37 + .../models/PermissionProviderScope.java | 37 + .../securityinsights/models/Permissions.java | 83 + .../models/PermissionsCustomsItem.java | 39 + .../PermissionsResourceProviderItem.java | 60 + .../models/PollingFrequency.java | 37 + .../models/ProcessEntity.java | 167 + .../models/ProductSettings.java | 122 + .../securityinsights/models/ProviderName.java | 52 + .../models/QueryBasedAlertRuleProperties.java | 443 ++ ...QueryBasedAlertRuleTemplateProperties.java | 220 + .../securityinsights/models/RegistryHive.java | 58 + .../models/RegistryKeyEntity.java | 89 + .../models/RegistryValueEntity.java | 108 + .../models/RegistryValueKind.java | 52 + .../securityinsights/models/Relation.java | 206 + .../securityinsights/models/RelationList.java | 74 + .../securityinsights/models/Repo.java | 39 + .../securityinsights/models/RepoList.java | 73 + .../securityinsights/models/RepoType.java | 34 + .../securityinsights/models/Repository.java | 158 + .../models/RequiredPermissions.java | 128 + .../models/ResourceProvider.java | 157 + .../models/ResourceWithEtag.java | 68 + .../models/SampleQueries.java | 76 + .../models/ScheduledAlertRule.java | 515 ++ .../ScheduledAlertRuleCommonProperties.java | 158 + .../models/ScheduledAlertRuleTemplate.java | 466 ++ .../models/SecurityAlert.java | 315 ++ ...yAlertPropertiesConfidenceReasonsItem.java | 55 + .../models/SecurityAlertTimelineItem.java | 307 ++ .../models/SecurityGroupEntity.java | 101 + .../models/SentinelOnboardingState.java | 137 + .../models/SentinelOnboardingStates.java | 145 + .../models/SentinelOnboardingStatesList.java | 25 + .../securityinsights/models/SettingKind.java | 40 + .../securityinsights/models/SettingList.java | 25 + .../securityinsights/models/SettingType.java | 37 + .../securityinsights/models/Settings.java | 53 + .../securityinsights/models/Source.java | 34 + .../models/SourceControl.java | 230 + .../models/SourceControlList.java | 74 + .../models/SourceControls.java | 39 + .../models/SourceControlsOperations.java | 145 + .../securityinsights/models/SourceKind.java | 40 + .../models/SubmissionMailEntity.java | 164 + .../securityinsights/models/SupportTier.java | 37 + .../models/TICheckRequirements.java | 49 + .../models/TIDataConnector.java | 127 + .../models/TIDataConnectorDataTypes.java | 58 + .../TIDataConnectorDataTypesIndicators.java | 32 + .../models/TeamInformation.java | 53 + .../models/TeamProperties.java | 135 + .../models/TemplateStatus.java | 37 + .../models/ThreatIntelligence.java | 115 + .../models/ThreatIntelligenceAlertRule.java | 150 + .../ThreatIntelligenceAlertRuleTemplate.java | 233 + .../models/ThreatIntelligenceAppendTags.java | 51 + .../ThreatIntelligenceExternalReference.java | 157 + .../ThreatIntelligenceFilteringCriteria.java | 366 ++ ...hreatIntelligenceGranularMarkingModel.java | 103 + .../ThreatIntelligenceIndicatorMetrics.java | 37 + .../ThreatIntelligenceIndicatorModel.java | 726 +++ ...elligenceIndicatorModelForRequestBody.java | 751 +++ .../models/ThreatIntelligenceIndicators.java | 247 + ...hreatIntelligenceIndicatorsOperations.java | 49 + .../models/ThreatIntelligenceInformation.java | 54 + .../ThreatIntelligenceInformationList.java | 75 + .../ThreatIntelligenceKillChainPhase.java | 76 + .../models/ThreatIntelligenceMetric.java | 138 + .../ThreatIntelligenceMetricEntity.java | 76 + .../models/ThreatIntelligenceMetrics.java | 53 + .../models/ThreatIntelligenceMetricsList.java | 26 + .../ThreatIntelligenceParsedPattern.java | 81 + ...eatIntelligenceParsedPatternTypeValue.java | 76 + .../ThreatIntelligenceResourceKind.java | 56 + .../ThreatIntelligenceResourceKindEnum.java | 31 + .../ThreatIntelligenceSortingCriteria.java | 76 + ...ThreatIntelligenceSortingCriteriaEnum.java | 38 + .../models/TiTaxiiCheckRequirements.java | 49 + .../models/TiTaxiiDataConnector.java | 288 ++ .../models/TiTaxiiDataConnectorDataTypes.java | 58 + ...axiiDataConnectorDataTypesTaxiiClient.java | 32 + .../models/TimelineAggregation.java | 81 + .../models/TimelineError.java | 112 + .../models/TimelineResultsMetadata.java | 114 + .../models/TriggerOperator.java | 53 + .../securityinsights/models/TriggersOn.java | 31 + .../securityinsights/models/TriggersWhen.java | 31 + .../securityinsights/models/Ueba.java | 81 + .../models/UebaDataSources.java | 40 + .../securityinsights/models/UrlEntity.java | 80 + .../securityinsights/models/UserInfo.java | 81 + .../securityinsights/models/Watchlist.java | 795 +++ .../models/WatchlistItem.java | 451 ++ .../models/WatchlistItemList.java | 74 + .../models/WatchlistItems.java | 152 + .../models/WatchlistList.java | 74 + .../securityinsights/models/Watchlists.java | 145 + .../securityinsights/models/package-info.java | 9 + .../securityinsights/package-info.java | 9 + .../src/main/java/module-info.java | 19 + .../ActionsCreateOrUpdateSamples.java | 30 + .../generated/ActionsDeleteSamples.java | 30 + .../generated/ActionsGetSamples.java | 30 + .../ActionsListByAlertRuleSamples.java | 23 + .../AlertRuleTemplatesGetSamples.java | 25 + .../AlertRuleTemplatesListSamples.java | 23 + .../AlertRulesCreateOrUpdateSamples.java | 182 + .../generated/AlertRulesDeleteSamples.java | 24 + .../generated/AlertRulesGetSamples.java | 66 + .../generated/AlertRulesListSamples.java | 22 + .../AutomationRulesCreateOrUpdateSamples.java | 77 + .../AutomationRulesDeleteSamples.java | 25 + .../generated/AutomationRulesGetSamples.java | 24 + .../generated/AutomationRulesListSamples.java | 23 + .../BookmarkOperationExpandSamples.java | 35 + ...ookmarkRelationsCreateOrUpdateSamples.java | 27 + .../BookmarkRelationsDeleteSamples.java | 30 + .../BookmarkRelationsGetSamples.java | 30 + .../BookmarkRelationsListSamples.java | 25 + .../BookmarksCreateOrUpdateSamples.java | 40 + .../generated/BookmarksDeleteSamples.java | 24 + .../generated/BookmarksGetSamples.java | 24 + .../generated/BookmarksListSamples.java | 22 + ...CheckRequirementsOperationPostSamples.java | 219 + .../DataConnectorsConnectSamples.java | 48 + .../DataConnectorsCreateOrUpdateSamples.java | 633 +++ .../DataConnectorsDeleteSamples.java | 55 + .../DataConnectorsDisconnectSamples.java | 25 + .../generated/DataConnectorsGetSamples.java | 264 + .../generated/DataConnectorsListSamples.java | 23 + .../generated/DomainWhoisGetSamples.java | 23 + .../generated/EntitiesExpandSamples.java | 35 + .../generated/EntitiesGetInsightsSamples.java | 37 + .../generated/EntitiesGetSamples.java | 260 + .../EntitiesGetTimelineListSamples.java | 34 + .../generated/EntitiesListSamples.java | 22 + .../generated/EntitiesQueriesSamples.java | 30 + .../EntitiesRelationsListSamples.java | 25 + .../EntityQueriesCreateOrUpdateSamples.java | 101 + .../generated/EntityQueriesDeleteSamples.java | 24 + .../generated/EntityQueriesGetSamples.java | 40 + .../generated/EntityQueriesListSamples.java | 23 + .../EntityQueryTemplatesGetSamples.java | 25 + .../EntityQueryTemplatesListSamples.java | 24 + .../EntityRelationsGetRelationSamples.java | 29 + ...IncidentCommentsCreateOrUpdateSamples.java | 26 + .../IncidentCommentsDeleteSamples.java | 30 + .../generated/IncidentCommentsGetSamples.java | 30 + .../IncidentCommentsListSamples.java | 25 + ...ncidentRelationsCreateOrUpdateSamples.java | 34 + .../IncidentRelationsDeleteSamples.java | 30 + .../IncidentRelationsGetSamples.java | 30 + .../IncidentRelationsListSamples.java | 25 + .../IncidentsCreateOrUpdateSamples.java | 44 + .../generated/IncidentsCreateTeamSamples.java | 31 + .../generated/IncidentsDeleteSamples.java | 24 + .../generated/IncidentsGetSamples.java | 24 + .../generated/IncidentsListAlertsSamples.java | 25 + .../IncidentsListBookmarksSamples.java | 25 + .../IncidentsListEntitiesSamples.java | 25 + .../generated/IncidentsListSamples.java | 22 + .../generated/IpGeodataGetSamples.java | 23 + .../generated/MetadataCreateSamples.java | 111 + .../generated/MetadataDeleteSamples.java | 22 + .../generated/MetadataGetSamples.java | 23 + .../generated/MetadataListSamples.java | 35 + .../generated/MetadataUpdateSamples.java | 29 + .../OfficeConsentsDeleteSamples.java | 25 + .../generated/OfficeConsentsGetSamples.java | 24 + .../generated/OfficeConsentsListSamples.java | 23 + .../ProductSettingsDeleteSamples.java | 23 + .../generated/ProductSettingsGetSamples.java | 22 + .../generated/ProductSettingsListSamples.java | 22 + .../ProductSettingsUpdateSamples.java | 31 + ...SentinelOnboardingStatesCreateSamples.java | 26 + ...SentinelOnboardingStatesDeleteSamples.java | 23 + .../SentinelOnboardingStatesGetSamples.java | 23 + .../SentinelOnboardingStatesListSamples.java | 23 + .../SourceControlListRepositoriesSamples.java | 23 + .../SourceControlsOperationCreateSamples.java | 50 + .../SourceControlsOperationDeleteSamples.java | 25 + .../SourceControlsOperationGetSamples.java | 24 + .../SourceControlsOperationListSamples.java | 23 + ...ntelligenceIndicatorAppendTagsSamples.java | 32 + ...igenceIndicatorCreateIndicatorSamples.java | 50 + ...eatIntelligenceIndicatorCreateSamples.java | 51 + ...eatIntelligenceIndicatorDeleteSamples.java | 25 + ...ThreatIntelligenceIndicatorGetSamples.java | 25 + ...telligenceIndicatorMetricsListSamples.java | 23 + ...igenceIndicatorQueryIndicatorsSamples.java | 45 + ...telligenceIndicatorReplaceTagsSamples.java | 36 + ...ligenceIndicatorsOperationListSamples.java | 25 + .../WatchlistItemsCreateOrUpdateSamples.java | 39 + .../WatchlistItemsDeleteSamples.java | 26 + .../generated/WatchlistItemsGetSamples.java | 25 + .../generated/WatchlistItemsListSamples.java | 23 + .../WatchlistsCreateOrUpdateSamples.java | 59 + .../generated/WatchlistsDeleteSamples.java | 22 + .../generated/WatchlistsGetSamples.java | 22 + .../generated/WatchlistsListSamples.java | 22 + sdk/securityinsights/ci.yml | 39 + sdk/securityinsights/pom.xml | 53 + 756 files changed, 108123 insertions(+) create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/README.md create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/SAMPLE.md create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/pom.xml create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/SecurityInsightsManager.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ActionsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/AlertRuleTemplatesClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/AlertRulesClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/AutomationRulesClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BookmarkOperationsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BookmarkRelationsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BookmarksClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/DataConnectorsCheckRequirementsOperationsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/DataConnectorsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/DomainWhoisClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntitiesClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntitiesGetTimelinesClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntitiesRelationsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntityQueriesClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntityQueryTemplatesClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntityRelationsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IncidentCommentsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IncidentRelationsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IncidentsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IpGeodatasClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/MetadatasClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/OfficeConsentsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/OperationsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductSettingsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SecurityInsights.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SentinelOnboardingStatesClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SourceControlsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SourceControlsOperationsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ThreatIntelligenceIndicatorMetricsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ThreatIntelligenceIndicatorsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ThreatIntelligenceIndicatorsOperationsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WatchlistItemsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WatchlistsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AadCheckRequirementsProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AadDataConnectorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AatpCheckRequirementsProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AatpDataConnectorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AccountEntityProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActionRequestProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActionResponseInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActionResponseProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActivityEntityQueriesProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActivityEntityQueryTemplateProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AlertRuleInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AlertRuleTemplateInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AnomaliesSettingsProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ApiPollingParameters.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AscCheckRequirementsProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AscDataConnectorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AutomationRuleInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AutomationRuleProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AwsCloudTrailDataConnectorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AwsS3DataConnectorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AzureResourceEntityProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BookmarkExpandResponseInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BookmarkInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BookmarkProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/CloudApplicationEntityProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/CodelessParameters.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DataConnectorInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DataConnectorRequirementsStateInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DnsEntityProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/Dynamics365CheckRequirementsProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/Dynamics365DataConnectorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EnrichmentDomainWhoisInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EnrichmentIpGeodataInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityAnalyticsProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityExpandResponseInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityGetInsightsResponseInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityQueryInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityQueryTemplateInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityTimelineResponseInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ExpansionEntityQueriesProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EyesOnSettingsProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FileEntityProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FileHashEntityProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FusionAlertRuleProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FusionAlertRuleTemplateProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/GetQueriesResponseInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HostEntityProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntingBookmarkProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentAlertListInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentBookmarkListInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentCommentInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentCommentProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentEntitiesResponseInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentPropertiesInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IoTDeviceEntityProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IpEntityProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MLBehaviorAnalyticsAlertRuleProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MLBehaviorAnalyticsAlertRuleTemplateProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MailClusterEntityProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MailMessageEntityProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MailboxEntityProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MalwareEntityProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/McasCheckRequirementsProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/McasDataConnectorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MdatpCheckRequirementsProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MdatpDataConnectorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MetadataModelInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MetadataProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MetadataPropertiesPatch.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MicrosoftSecurityIncidentCreationAlertRuleProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MstiCheckRequirementsProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MstiDataConnectorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MtpCheckRequirementsProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MtpDataConnectorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/NrtAlertRuleProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/NrtAlertRuleTemplateProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeAtpCheckRequirementsProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeAtpDataConnectorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeConsentInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeConsentProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeDataConnectorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeIrmCheckRequirementsProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeIrmDataConnectorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OperationInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProcessEntityProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RegistryKeyEntityProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RegistryValueEntityProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RelationInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RelationProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RepoInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ScheduledAlertRuleProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ScheduledAlertRuleTemplateProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SecurityAlertProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SecurityGroupEntityProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SentinelOnboardingStateInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SentinelOnboardingStateProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SentinelOnboardingStatesListInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SettingListInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SettingsInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SourceControlInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SourceControlProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SubmissionMailEntityProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TICheckRequirementsProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TIDataConnectorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TeamInformationInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceAlertRuleProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceAlertRuleTemplateProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceIndicatorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceInformationInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceMetricsListInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TiTaxiiCheckRequirementsProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TiTaxiiDataConnectorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/UebaProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/UrlEntityProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistItemInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistItemProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/package-info.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/package-info.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ActionResponseImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ActionsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ActionsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleTemplateImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleTemplatesClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleTemplatesImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRulesClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRulesImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AutomationRuleImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AutomationRulesClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AutomationRulesImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkExpandResponseImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkOperationsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkOperationsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkRelationsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkRelationsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarksClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarksImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorRequirementsStateImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsCheckRequirementsOperationsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsCheckRequirementsOperationsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DomainWhoisClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DomainWhoisImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EnrichmentDomainWhoisImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EnrichmentIpGeodataImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesGetTimelinesClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesGetTimelinesImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesRelationsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesRelationsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityExpandResponseImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityGetInsightsResponseImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueriesClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueriesImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryTemplateImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryTemplatesClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryTemplatesImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityRelationsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityRelationsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityTimelineResponseImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetQueriesResponseImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentAlertListImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentBookmarkListImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentCommentImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentCommentsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentCommentsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentEntitiesResponseImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentPropertiesImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentRelationsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentRelationsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IpGeodatasClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IpGeodatasImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/MetadataModelImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/MetadatasClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/MetadatasImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OfficeConsentImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OfficeConsentsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OfficeConsentsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OperationImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OperationsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OperationsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductSettingsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductSettingsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/RelationImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/RepoImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityInsightsBuilder.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityInsightsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SentinelOnboardingStateImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SentinelOnboardingStatesClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SentinelOnboardingStatesImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SentinelOnboardingStatesListImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SettingListImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SettingsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsOperationsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsOperationsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TeamInformationImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorMetricsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorMetricsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsOperationsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsOperationsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceInformationImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceMetricsListImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/Utils.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistItemImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistItemsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistItemsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/package-info.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AadCheckRequirements.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AadDataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AatpCheckRequirements.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AatpDataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AccountEntity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionPropertiesBase.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionRequest.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionResponse.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Actions.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionsList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityCustomEntityQuery.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQueriesPropertiesQueryDefinitions.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQuery.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQueryTemplate.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQueryTemplatePropertiesQueryDefinitions.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityTimelineItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertDetail.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertDetailsOverride.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRule.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleKind.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplate.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplateDataSource.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplatePropertiesBase.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplates.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplatesList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRules.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRulesList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertSeverity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertStatus.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertsDataTypeOfDataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Anomalies.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AntispamMailDirection.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AscCheckRequirements.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AscDataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AttackTactic.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRule.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleAction.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleActionType.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleCondition.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleConditionType.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleModifyPropertiesAction.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleModifyPropertiesActionConfiguration.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyConditionSupportedOperator.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyConditionSupportedProperty.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyValuesCondition.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyValuesConditionProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleRunPlaybookAction.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleRunPlaybookActionConfiguration.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleTriggeringLogic.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRules.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulesList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Availability.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AvailabilityStatus.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsCloudTrailCheckRequirements.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsCloudTrailDataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsCloudTrailDataConnectorDataTypes.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsCloudTrailDataConnectorDataTypesLogs.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3CheckRequirements.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3DataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3DataConnectorDataTypes.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3DataConnectorDataTypesLogs.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AzureResourceEntity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Bookmark.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkExpandParameters.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkExpandResponse.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkExpandResponseValue.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkOperations.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkRelations.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkTimelineItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Bookmarks.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ClientInfo.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CloudApplicationEntity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessApiPollingDataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingAuthProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingConfigProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingPagingProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingRequestProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingResponseProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesDataTypesItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesGraphQueriesItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesInstructionStepsItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesSampleQueriesItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiDataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConfidenceLevel.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConfidenceScoreStatus.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectAuthKind.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectedEntity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectivityCriteria.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectivityType.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorInstructionModelBase.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Constant69.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentPathMap.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentType.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomEntityQuery.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomEntityQueryKind.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Customs.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomsPermission.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorAuthorizationState.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorConnectBody.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDataTypeCommon.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorKind.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorLicenseState.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorRequirementsState.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorTenantId.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorWithAlertsProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectors.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorsCheckRequirements.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorsCheckRequirementsOperations.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataTypeDefinitions.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataTypeState.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeliveryAction.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeliveryLocation.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DnsEntity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DomainWhois.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365CheckRequirements.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365DataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365DataConnectorDataTypes.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365DataConnectorDataTypesDynamics365CdsActivities.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ElevationToken.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhois.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisContact.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisContacts.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisDetails.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisRegistrarDetails.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentIpGeodata.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Entities.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntitiesGetTimelines.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntitiesRelations.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Entity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityAnalytics.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityCommonProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityEdges.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityExpandParameters.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityExpandResponse.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityExpandResponseValue.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityGetInsightsParameters.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityGetInsightsResponse.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityInsightItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityInsightItemQueryTimeInterval.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityItemQueryKind.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityKind.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityMapping.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityMappingType.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueries.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueriesKind.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQuery.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryItemProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryItemPropertiesDataTypesItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryKind.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplate.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplateKind.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplateList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplates.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityRelations.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineKind.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineParameters.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineResponse.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityType.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EventGroupingAggregationKind.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EventGroupingSettings.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ExpansionEntityQuery.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ExpansionResultAggregation.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ExpansionResultsMetadata.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EyesOn.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FieldMapping.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileEntity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileHashAlgorithm.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileHashEntity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionAlertRule.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionAlertRuleTemplate.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GeoLocation.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetInsightsError.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetInsightsResultsMetadata.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetQueriesResponse.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GraphQueries.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GroupingConfiguration.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HostEntity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntingBookmark.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Incident.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentAdditionalData.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentAlertList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentBookmarkList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentClassification.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentClassificationReason.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentComment.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentCommentList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentComments.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentConfiguration.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentEntitiesResponse.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentEntitiesResultsMetadata.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentInfo.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentLabel.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentLabelType.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentOwnerInfo.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentRelations.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentSeverity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentStatus.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Incidents.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesAdditionalQuery.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesDefaultTimeRange.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesReferenceTimeRange.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQuery.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightsTableResult.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightsTableResultColumnsItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionSteps.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionStepsInstructionsItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IoTDeviceEntity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IpEntity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IpGeodatas.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/KillChainIntent.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Kind.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/LastDataReceivedDataType.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MLBehaviorAnalyticsAlertRule.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MLBehaviorAnalyticsAlertRuleTemplate.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MailClusterEntity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MailMessageEntity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MailboxEntity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MalwareEntity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MatchingMethod.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/McasCheckRequirements.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/McasDataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/McasDataConnectorDataTypes.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MdatpCheckRequirements.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MdatpDataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataAuthor.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataCategories.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataDependencies.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataModel.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataPatch.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataSource.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataSupport.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Metadatas.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftSecurityIncidentCreationAlertRule.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftSecurityIncidentCreationAlertRuleCommonProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftSecurityIncidentCreationAlertRuleTemplate.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftSecurityProductName.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiCheckRequirements.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiDataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiDataConnectorDataTypes.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiDataConnectorDataTypesBingSafetyPhishingUrl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpCheckRequirements.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpDataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpDataConnectorDataTypes.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpDataConnectorDataTypesIncidents.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/NrtAlertRule.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/NrtAlertRuleTemplate.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OSFamily.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeAtpCheckRequirements.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeAtpDataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeConsent.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeConsentList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeConsents.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnectorDataTypes.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnectorDataTypesExchange.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnectorDataTypesSharePoint.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnectorDataTypesTeams.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeIrmCheckRequirements.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeIrmDataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Operation.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OperationDisplay.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Operations.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OperationsList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Operator.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OutputType.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OwnerType.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PermissionProviderScope.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Permissions.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PermissionsCustomsItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PermissionsResourceProviderItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PollingFrequency.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProcessEntity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductSettings.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProviderName.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QueryBasedAlertRuleProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QueryBasedAlertRuleTemplateProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RegistryHive.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RegistryKeyEntity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RegistryValueEntity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RegistryValueKind.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Relation.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RelationList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Repo.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepoList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepoType.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Repository.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RequiredPermissions.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceProvider.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceWithEtag.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SampleQueries.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ScheduledAlertRule.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ScheduledAlertRuleCommonProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ScheduledAlertRuleTemplate.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityAlert.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityAlertPropertiesConfidenceReasonsItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityAlertTimelineItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityGroupEntity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SentinelOnboardingState.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SentinelOnboardingStates.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SentinelOnboardingStatesList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingKind.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingType.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Settings.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Source.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControlList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControls.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControlsOperations.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceKind.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SubmissionMailEntity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SupportTier.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TICheckRequirements.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TIDataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TIDataConnectorDataTypes.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TIDataConnectorDataTypesIndicators.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TeamInformation.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TeamProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TemplateStatus.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligence.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceAlertRule.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceAlertRuleTemplate.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceAppendTags.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceExternalReference.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceFilteringCriteria.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceGranularMarkingModel.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicatorMetrics.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicatorModel.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicatorModelForRequestBody.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicators.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicatorsOperations.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceInformation.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceInformationList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceKillChainPhase.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceMetric.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceMetricEntity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceMetrics.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceMetricsList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceParsedPattern.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceParsedPatternTypeValue.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceResourceKind.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceResourceKindEnum.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceSortingCriteria.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceSortingCriteriaEnum.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiCheckRequirements.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiDataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiDataConnectorDataTypes.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiDataConnectorDataTypesTaxiiClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TimelineAggregation.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TimelineError.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TimelineResultsMetadata.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TriggerOperator.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TriggersOn.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TriggersWhen.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Ueba.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/UebaDataSources.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/UrlEntity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/UserInfo.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Watchlist.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistItemList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistItems.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Watchlists.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/package-info.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/package-info.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/module-info.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ActionsCreateOrUpdateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ActionsDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ActionsGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ActionsListByAlertRuleSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatesGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatesListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesCreateOrUpdateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesCreateOrUpdateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkOperationExpandSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsCreateOrUpdateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarksCreateOrUpdateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarksDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarksGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarksListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsCheckRequirementsOperationPostSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsConnectSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsCreateOrUpdateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsDisconnectSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DomainWhoisGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesExpandSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetInsightsSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetTimelineListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesQueriesSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesRelationsListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesCreateOrUpdateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplatesGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplatesListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityRelationsGetRelationSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsCreateOrUpdateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsCreateOrUpdateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsCreateOrUpdateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsCreateTeamSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListAlertsSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListBookmarksSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListEntitiesSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IpGeodataGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/MetadataCreateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/MetadataDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/MetadataGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/MetadataListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/MetadataUpdateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsUpdateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesCreateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlListRepositoriesSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationCreateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorAppendTagsSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorCreateIndicatorSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorCreateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorMetricsListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorQueryIndicatorsSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorReplaceTagsSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsOperationListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsCreateOrUpdateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistsCreateOrUpdateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistsDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistsGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistsListSamples.java create mode 100644 sdk/securityinsights/ci.yml create mode 100644 sdk/securityinsights/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index f164a2864061..de28bf2171dd 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -331,6 +331,7 @@ com.azure.resourcemanager:azure-resourcemanager-desktopvirtualization;1.0.0-beta com.azure.resourcemanager:azure-resourcemanager-loadtestservice;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-automanage;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-edgeorder;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-securityinsights;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.0.0 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current diff --git a/pom.xml b/pom.xml index 9cb3ad482fa8..24a6e66997ad 100644 --- a/pom.xml +++ b/pom.xml @@ -824,6 +824,7 @@ sdk/schemaregistry sdk/search sdk/security + sdk/securityinsights sdk/servicebus sdk/servicefabric sdk/signalr diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md b/sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md new file mode 100644 index 000000000000..6173d7d62ff5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-01-11) + +- Azure Resource Manager SecurityInsights client library for Java. This package contains Microsoft Azure SDK for SecurityInsights Management SDK. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2021-09. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/README.md b/sdk/securityinsights/azure-resourcemanager-securityinsights/README.md new file mode 100644 index 000000000000..1b93d3a71614 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager SecurityInsights client library for Java + +Azure Resource Manager SecurityInsights client library for Java. + +This package contains Microsoft Azure SDK for SecurityInsights Management SDK. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2021-09. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-securityinsights;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-securityinsights + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +SecurityInsightsManager manager = SecurityInsightsManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/securityinsights/azure-resourcemanager-securityinsights/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/SAMPLE.md b/sdk/securityinsights/azure-resourcemanager-securityinsights/SAMPLE.md new file mode 100644 index 000000000000..639641490bec --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/SAMPLE.md @@ -0,0 +1,4608 @@ +# Code snippets and samples + + +## Actions + +- [CreateOrUpdate](#actions_createorupdate) +- [Delete](#actions_delete) +- [Get](#actions_get) +- [ListByAlertRule](#actions_listbyalertrule) + +## AlertRuleTemplates + +- [Get](#alertruletemplates_get) +- [List](#alertruletemplates_list) + +## AlertRules + +- [CreateOrUpdate](#alertrules_createorupdate) +- [Delete](#alertrules_delete) +- [Get](#alertrules_get) +- [List](#alertrules_list) + +## AutomationRules + +- [CreateOrUpdate](#automationrules_createorupdate) +- [Delete](#automationrules_delete) +- [Get](#automationrules_get) +- [List](#automationrules_list) + +## BookmarkOperation + +- [Expand](#bookmarkoperation_expand) + +## BookmarkRelations + +- [CreateOrUpdate](#bookmarkrelations_createorupdate) +- [Delete](#bookmarkrelations_delete) +- [Get](#bookmarkrelations_get) +- [List](#bookmarkrelations_list) + +## Bookmarks + +- [CreateOrUpdate](#bookmarks_createorupdate) +- [Delete](#bookmarks_delete) +- [Get](#bookmarks_get) +- [List](#bookmarks_list) + +## DataConnectors + +- [Connect](#dataconnectors_connect) +- [CreateOrUpdate](#dataconnectors_createorupdate) +- [Delete](#dataconnectors_delete) +- [Disconnect](#dataconnectors_disconnect) +- [Get](#dataconnectors_get) +- [List](#dataconnectors_list) + +## DataConnectorsCheckRequirementsOperation + +- [Post](#dataconnectorscheckrequirementsoperation_post) + +## DomainWhois + +- [Get](#domainwhois_get) + +## Entities + +- [Expand](#entities_expand) +- [Get](#entities_get) +- [GetInsights](#entities_getinsights) +- [List](#entities_list) +- [Queries](#entities_queries) + +## EntitiesGetTimeline + +- [List](#entitiesgettimeline_list) + +## EntitiesRelations + +- [List](#entitiesrelations_list) + +## EntityQueries + +- [CreateOrUpdate](#entityqueries_createorupdate) +- [Delete](#entityqueries_delete) +- [Get](#entityqueries_get) +- [List](#entityqueries_list) + +## EntityQueryTemplates + +- [Get](#entityquerytemplates_get) +- [List](#entityquerytemplates_list) + +## EntityRelations + +- [GetRelation](#entityrelations_getrelation) + +## IncidentComments + +- [CreateOrUpdate](#incidentcomments_createorupdate) +- [Delete](#incidentcomments_delete) +- [Get](#incidentcomments_get) +- [List](#incidentcomments_list) + +## IncidentRelations + +- [CreateOrUpdate](#incidentrelations_createorupdate) +- [Delete](#incidentrelations_delete) +- [Get](#incidentrelations_get) +- [List](#incidentrelations_list) + +## Incidents + +- [CreateOrUpdate](#incidents_createorupdate) +- [CreateTeam](#incidents_createteam) +- [Delete](#incidents_delete) +- [Get](#incidents_get) +- [List](#incidents_list) +- [ListAlerts](#incidents_listalerts) +- [ListBookmarks](#incidents_listbookmarks) +- [ListEntities](#incidents_listentities) + +## IpGeodata + +- [Get](#ipgeodata_get) + +## Metadata + +- [Create](#metadata_create) +- [Delete](#metadata_delete) +- [Get](#metadata_get) +- [List](#metadata_list) +- [Update](#metadata_update) + +## OfficeConsents + +- [Delete](#officeconsents_delete) +- [Get](#officeconsents_get) +- [List](#officeconsents_list) + +## ProductSettings + +- [Delete](#productsettings_delete) +- [Get](#productsettings_get) +- [List](#productsettings_list) +- [Update](#productsettings_update) + +## SentinelOnboardingStates + +- [Create](#sentinelonboardingstates_create) +- [Delete](#sentinelonboardingstates_delete) +- [Get](#sentinelonboardingstates_get) +- [List](#sentinelonboardingstates_list) + +## SourceControl + +- [ListRepositories](#sourcecontrol_listrepositories) + +## SourceControlsOperation + +- [Create](#sourcecontrolsoperation_create) +- [Delete](#sourcecontrolsoperation_delete) +- [Get](#sourcecontrolsoperation_get) +- [List](#sourcecontrolsoperation_list) + +## ThreatIntelligenceIndicator + +- [AppendTags](#threatintelligenceindicator_appendtags) +- [Create](#threatintelligenceindicator_create) +- [CreateIndicator](#threatintelligenceindicator_createindicator) +- [Delete](#threatintelligenceindicator_delete) +- [Get](#threatintelligenceindicator_get) +- [QueryIndicators](#threatintelligenceindicator_queryindicators) +- [ReplaceTags](#threatintelligenceindicator_replacetags) + +## ThreatIntelligenceIndicatorMetrics + +- [List](#threatintelligenceindicatormetrics_list) + +## ThreatIntelligenceIndicatorsOperation + +- [List](#threatintelligenceindicatorsoperation_list) + +## WatchlistItems + +- [CreateOrUpdate](#watchlistitems_createorupdate) +- [Delete](#watchlistitems_delete) +- [Get](#watchlistitems_get) +- [List](#watchlistitems_list) + +## Watchlists + +- [CreateOrUpdate](#watchlists_createorupdate) +- [Delete](#watchlists_delete) +- [Get](#watchlists_get) +- [List](#watchlists_list) +### Actions_CreateOrUpdate + +```java +/** Samples for Actions CreateOrUpdate. */ +public final class ActionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/actions/CreateActionOfAlertRule.json + */ + /** + * Sample code: Creates or updates an action of alert rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAnActionOfAlertRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .actions() + .define("912bec42-cb66-4c03-ac63-1761b6898c3e") + .withExistingAlertRule("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5") + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withTriggerUri( + "https://prod-31.northcentralus.logic.azure.com:443/workflows/cd3765391efd48549fd7681ded1d48d7/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=signature") + .withLogicAppResourceId( + "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.Logic/workflows/MyAlerts") + .create(); + } +} +``` + +### Actions_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Actions Delete. */ +public final class ActionsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/actions/DeleteActionOfAlertRule.json + */ + /** + * Sample code: Delete an action of alert rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAnActionOfAlertRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .actions() + .deleteWithResponse( + "myRg", + "myWorkspace", + "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + "912bec42-cb66-4c03-ac63-1761b6898c3e", + Context.NONE); + } +} +``` + +### Actions_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Actions Get. */ +public final class ActionsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/actions/GetActionOfAlertRuleById.json + */ + /** + * Sample code: Get an action of alert rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnActionOfAlertRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .actions() + .getWithResponse( + "myRg", + "myWorkspace", + "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + "912bec42-cb66-4c03-ac63-1761b6898c3e", + Context.NONE); + } +} +``` + +### Actions_ListByAlertRule + +```java +import com.azure.core.util.Context; + +/** Samples for Actions ListByAlertRule. */ +public final class ActionsListByAlertRuleSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/actions/GetAllActionsByAlertRule.json + */ + /** + * Sample code: Get all actions of alert rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllActionsOfAlertRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.actions().listByAlertRule("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } +} +``` + +### AlertRuleTemplates_Get + +```java +import com.azure.core.util.Context; + +/** Samples for AlertRuleTemplates Get. */ +public final class AlertRuleTemplatesGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRuleTemplates/GetAlertRuleTemplateById.json + */ + /** + * Sample code: Get alert rule template by Id. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAlertRuleTemplateById( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .alertRuleTemplates() + .getWithResponse("myRg", "myWorkspace", "65360bb0-8986-4ade-a89d-af3cf44d28aa", Context.NONE); + } +} +``` + +### AlertRuleTemplates_List + +```java +import com.azure.core.util.Context; + +/** Samples for AlertRuleTemplates List. */ +public final class AlertRuleTemplatesListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRuleTemplates/GetAlertRuleTemplates.json + */ + /** + * Sample code: Get all alert rule templates. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllAlertRuleTemplates( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.alertRuleTemplates().list("myRg", "myWorkspace", Context.NONE); + } +} +``` + +### AlertRules_CreateOrUpdate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.AlertDetail; +import com.azure.resourcemanager.securityinsights.models.AlertDetailsOverride; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.EntityMapping; +import com.azure.resourcemanager.securityinsights.models.EntityMappingType; +import com.azure.resourcemanager.securityinsights.models.EventGroupingAggregationKind; +import com.azure.resourcemanager.securityinsights.models.EventGroupingSettings; +import com.azure.resourcemanager.securityinsights.models.FieldMapping; +import com.azure.resourcemanager.securityinsights.models.FusionAlertRule; +import com.azure.resourcemanager.securityinsights.models.GroupingConfiguration; +import com.azure.resourcemanager.securityinsights.models.IncidentConfiguration; +import com.azure.resourcemanager.securityinsights.models.MatchingMethod; +import com.azure.resourcemanager.securityinsights.models.MicrosoftSecurityIncidentCreationAlertRule; +import com.azure.resourcemanager.securityinsights.models.MicrosoftSecurityProductName; +import com.azure.resourcemanager.securityinsights.models.NrtAlertRule; +import com.azure.resourcemanager.securityinsights.models.ScheduledAlertRule; +import com.azure.resourcemanager.securityinsights.models.TriggerOperator; +import java.time.Duration; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AlertRules CreateOrUpdate. */ +public final class AlertRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRules/CreateFusionAlertRule.json + */ + /** + * Sample code: Creates or updates a Fusion alert rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAFusionAlertRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .alertRules() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "myFirstFusionRule", + new FusionAlertRule() + .withEtag("3d00c3ca-0000-0100-0000-5d42d5010000") + .withAlertRuleTemplateName("f71aba3d-28fb-450b-b192-4e76a83015c8") + .withEnabled(true), + Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRules/CreateMicrosoftSecurityIncidentCreationAlertRule.json + */ + /** + * Sample code: Creates or updates a MicrosoftSecurityIncidentCreation rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAMicrosoftSecurityIncidentCreationRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .alertRules() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "microsoftSecurityIncidentCreationRuleExample", + new MicrosoftSecurityIncidentCreationAlertRule() + .withEtag("\"260097e0-0000-0d00-0000-5d6fa88f0000\"") + .withDisplayName("testing displayname") + .withEnabled(true) + .withProductFilter(MicrosoftSecurityProductName.MICROSOFT_CLOUD_APP_SECURITY), + Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRules/CreateScheduledAlertRule.json + */ + /** + * Sample code: Creates or updates a Scheduled alert rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAScheduledAlertRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .alertRules() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new ScheduledAlertRule() + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDescription("An example for a scheduled rule") + .withQuery("Heartbeat") + .withDisplayName("My scheduled rule") + .withEnabled(true) + .withSuppressionDuration(Duration.parse("PT1H")) + .withSuppressionEnabled(false) + .withSeverity(AlertSeverity.HIGH) + .withTactics(Arrays.asList(AttackTactic.PERSISTENCE, AttackTactic.LATERAL_MOVEMENT)) + .withIncidentConfiguration( + new IncidentConfiguration() + .withCreateIncident(true) + .withGroupingConfiguration( + new GroupingConfiguration() + .withEnabled(true) + .withReopenClosedIncident(false) + .withLookbackDuration(Duration.parse("PT5H")) + .withMatchingMethod(MatchingMethod.SELECTED) + .withGroupByEntities(Arrays.asList(EntityMappingType.HOST)) + .withGroupByAlertDetails(Arrays.asList(AlertDetail.DISPLAY_NAME)) + .withGroupByCustomDetails( + Arrays.asList("OperatingSystemType", "OperatingSystemName")))) + .withCustomDetails(mapOf("OperatingSystemName", "OSName", "OperatingSystemType", "OSType")) + .withEntityMappings( + Arrays + .asList( + new EntityMapping() + .withEntityType(EntityMappingType.HOST) + .withFieldMappings( + Arrays + .asList( + new FieldMapping() + .withIdentifier("FullName") + .withColumnName("Computer"))), + new EntityMapping() + .withEntityType(EntityMappingType.IP) + .withFieldMappings( + Arrays + .asList( + new FieldMapping() + .withIdentifier("Address") + .withColumnName("ComputerIP"))))) + .withAlertDetailsOverride( + new AlertDetailsOverride() + .withAlertDisplayNameFormat("Alert from {{Computer}}") + .withAlertDescriptionFormat("Suspicious activity was made by {{ComputerIP}}")) + .withQueryFrequency(Duration.parse("PT1H")) + .withQueryPeriod(Duration.parse("P2DT1H30M")) + .withTriggerOperator(TriggerOperator.GREATER_THAN) + .withTriggerThreshold(0) + .withEventGroupingSettings( + new EventGroupingSettings().withAggregationKind(EventGroupingAggregationKind.ALERT_PER_RESULT)), + Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRules/CreateNrtAlertRule.json + */ + /** + * Sample code: Creates or updates a Nrt alert rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesANrtAlertRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .alertRules() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new NrtAlertRule().withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\""), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### AlertRules_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for AlertRules Delete. */ +public final class AlertRulesDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRules/DeleteAlertRule.json + */ + /** + * Sample code: Delete an alert rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAnAlertRule(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .alertRules() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } +} +``` + +### AlertRules_Get + +```java +import com.azure.core.util.Context; + +/** Samples for AlertRules Get. */ +public final class AlertRulesGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRules/GetScheduledAlertRule.json + */ + /** + * Sample code: Get a Scheduled alert rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAScheduledAlertRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .alertRules() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRules/GetNrtAlertRule.json + */ + /** + * Sample code: Get an Nrt alert rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnNrtAlertRule(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .alertRules() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRules/GetFusionAlertRule.json + */ + /** + * Sample code: Get a Fusion alert rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAFusionAlertRule(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.alertRules().getWithResponse("myRg", "myWorkspace", "myFirstFusionRule", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRules/GetMicrosoftSecurityIncidentCreationAlertRule.json + */ + /** + * Sample code: Get a MicrosoftSecurityIncidentCreation rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAMicrosoftSecurityIncidentCreationRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .alertRules() + .getWithResponse("myRg", "myWorkspace", "microsoftSecurityIncidentCreationRuleExample", Context.NONE); + } +} +``` + +### AlertRules_List + +```java +import com.azure.core.util.Context; + +/** Samples for AlertRules List. */ +public final class AlertRulesListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRules/GetAllAlertRules.json + */ + /** + * Sample code: Get all alert rules. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllAlertRules(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.alertRules().list("myRg", "myWorkspace", Context.NONE); + } +} +``` + +### AutomationRules_CreateOrUpdate + +```java +import com.azure.resourcemanager.securityinsights.models.AutomationRuleModifyPropertiesAction; +import com.azure.resourcemanager.securityinsights.models.AutomationRuleModifyPropertiesActionConfiguration; +import com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyConditionSupportedOperator; +import com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyConditionSupportedProperty; +import com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyValuesCondition; +import com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyValuesConditionProperties; +import com.azure.resourcemanager.securityinsights.models.AutomationRuleRunPlaybookAction; +import com.azure.resourcemanager.securityinsights.models.AutomationRuleRunPlaybookActionConfiguration; +import com.azure.resourcemanager.securityinsights.models.AutomationRuleTriggeringLogic; +import com.azure.resourcemanager.securityinsights.models.IncidentSeverity; +import com.azure.resourcemanager.securityinsights.models.TriggersOn; +import com.azure.resourcemanager.securityinsights.models.TriggersWhen; +import java.util.Arrays; + +/** Samples for AutomationRules CreateOrUpdate. */ +public final class AutomationRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/automationRules/CreateAutomationRule.json + */ + /** + * Sample code: Creates or updates an automation rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAnAutomationRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .automationRules() + .define("73e01a99-5cd7-4139-a149-9f2736ff2ab5") + .withExistingWorkspace("myRg", "myWorkspace") + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDisplayName("High severity incidents escalation") + .withOrder(1) + .withTriggeringLogic( + new AutomationRuleTriggeringLogic() + .withIsEnabled(true) + .withTriggersOn(TriggersOn.INCIDENTS) + .withTriggersWhen(TriggersWhen.CREATED) + .withConditions( + Arrays + .asList( + new AutomationRulePropertyValuesCondition() + .withConditionProperties( + new AutomationRulePropertyValuesConditionProperties() + .withPropertyName( + AutomationRulePropertyConditionSupportedProperty + .INCIDENT_RELATED_ANALYTIC_RULE_IDS) + .withOperator(AutomationRulePropertyConditionSupportedOperator.CONTAINS) + .withPropertyValues( + Arrays + .asList( + "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/fab3d2d4-747f-46a7-8ef0-9c0be8112bf7", + "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/8deb8303-e94d-46ff-96e0-5fd94b33df1a")))))) + .withActions( + Arrays + .asList( + new AutomationRuleModifyPropertiesAction() + .withOrder(1) + .withActionConfiguration( + new AutomationRuleModifyPropertiesActionConfiguration() + .withSeverity(IncidentSeverity.HIGH)), + new AutomationRuleRunPlaybookAction() + .withOrder(2) + .withActionConfiguration( + new AutomationRuleRunPlaybookActionConfiguration() + .withLogicAppResourceId( + "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.Logic/workflows/IncidentPlaybook") + .withTenantId("ee48efaf-50c6-411b-9345-b2bdc3eb4abc")))) + .create(); + } +} +``` + +### AutomationRules_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for AutomationRules Delete. */ +public final class AutomationRulesDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/automationRules/DeleteAutomationRule.json + */ + /** + * Sample code: Delete an automation rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAnAutomationRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .automationRules() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } +} +``` + +### AutomationRules_Get + +```java +import com.azure.core.util.Context; + +/** Samples for AutomationRules Get. */ +public final class AutomationRulesGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/automationRules/GetAutomationRule.json + */ + /** + * Sample code: Get an automation rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnAutomationRule(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .automationRules() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } +} +``` + +### AutomationRules_List + +```java +import com.azure.core.util.Context; + +/** Samples for AutomationRules List. */ +public final class AutomationRulesListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/automationRules/GetAllAutomationRules.json + */ + /** + * Sample code: Get all automation rules. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllAutomationRules( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.automationRules().list("myRg", "myWorkspace", Context.NONE); + } +} +``` + +### BookmarkOperation_Expand + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.BookmarkExpandParameters; +import java.time.OffsetDateTime; +import java.util.UUID; + +/** Samples for BookmarkOperation Expand. */ +public final class BookmarkOperationExpandSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/bookmarks/expand/PostExpandBookmark.json + */ + /** + * Sample code: Expand an bookmark. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void expandAnBookmark(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .bookmarkOperations() + .expandWithResponse( + "myRg", + "myWorkspace", + "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new BookmarkExpandParameters() + .withEndTime(OffsetDateTime.parse("2020-01-24T17:21:00.000Z")) + .withExpansionId(UUID.fromString("27f76e63-c41b-480f-bb18-12ad2e011d49")) + .withStartTime(OffsetDateTime.parse("2019-12-25T17:21:00.000Z")), + Context.NONE); + } +} +``` + +### BookmarkRelations_CreateOrUpdate + +```java +/** Samples for BookmarkRelations CreateOrUpdate. */ +public final class BookmarkRelationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/bookmarks/relations/CreateBookmarkRelation.json + */ + /** + * Sample code: Creates or updates a bookmark relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesABookmarkRelation( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .bookmarkRelations() + .define("4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014") + .withExistingBookmark("myRg", "myWorkspace", "2216d0e1-91e3-4902-89fd-d2df8c535096") + .withRelatedResourceId( + "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/incidents/afbd324f-6c48-459c-8710-8d1e1cd03812") + .create(); + } +} +``` + +### BookmarkRelations_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for BookmarkRelations Delete. */ +public final class BookmarkRelationsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/bookmarks/relations/DeleteBookmarkRelation.json + */ + /** + * Sample code: Delete the bookmark relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteTheBookmarkRelation( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .bookmarkRelations() + .deleteWithResponse( + "myRg", + "myWorkspace", + "2216d0e1-91e3-4902-89fd-d2df8c535096", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", + Context.NONE); + } +} +``` + +### BookmarkRelations_Get + +```java +import com.azure.core.util.Context; + +/** Samples for BookmarkRelations Get. */ +public final class BookmarkRelationsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/bookmarks/relations/GetBookmarkRelationByName.json + */ + /** + * Sample code: Get a bookmark relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getABookmarkRelation( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .bookmarkRelations() + .getWithResponse( + "myRg", + "myWorkspace", + "2216d0e1-91e3-4902-89fd-d2df8c535096", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", + Context.NONE); + } +} +``` + +### BookmarkRelations_List + +```java +import com.azure.core.util.Context; + +/** Samples for BookmarkRelations List. */ +public final class BookmarkRelationsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/bookmarks/relations/GetAllBookmarkRelations.json + */ + /** + * Sample code: Get all bookmark relations. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllBookmarkRelations( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .bookmarkRelations() + .list("myRg", "myWorkspace", "2216d0e1-91e3-4902-89fd-d2df8c535096", null, null, null, null, Context.NONE); + } +} +``` + +### Bookmarks_CreateOrUpdate + +```java +import com.azure.resourcemanager.securityinsights.models.UserInfo; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.UUID; + +/** Samples for Bookmarks CreateOrUpdate. */ +public final class BookmarksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/bookmarks/CreateBookmark.json + */ + /** + * Sample code: Creates or updates a bookmark. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesABookmark( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .bookmarks() + .define("73e01a99-5cd7-4139-a149-9f2736ff2ab5") + .withExistingWorkspace("myRg", "myWorkspace") + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withCreated(OffsetDateTime.parse("2021-09-01T13:15:30Z")) + .withCreatedBy(new UserInfo().withObjectId(UUID.fromString("2046feea-040d-4a46-9e2b-91c2941bfa70"))) + .withDisplayName("My bookmark") + .withLabels(Arrays.asList("Tag1", "Tag2")) + .withNotes("Found a suspicious activity") + .withQuery("SecurityEvent | where TimeGenerated > ago(1d) and TimeGenerated < ago(2d)") + .withQueryResult("Security Event query result") + .withUpdated(OffsetDateTime.parse("2021-09-01T13:15:30Z")) + .withUpdatedBy(new UserInfo().withObjectId(UUID.fromString("2046feea-040d-4a46-9e2b-91c2941bfa70"))) + .create(); + } +} +``` + +### Bookmarks_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Bookmarks Delete. */ +public final class BookmarksDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/bookmarks/DeleteBookmark.json + */ + /** + * Sample code: Delete a bookmark. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteABookmark(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .bookmarks() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } +} +``` + +### Bookmarks_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Bookmarks Get. */ +public final class BookmarksGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/bookmarks/GetBookmarkById.json + */ + /** + * Sample code: Get a bookmark. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getABookmark(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .bookmarks() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } +} +``` + +### Bookmarks_List + +```java +import com.azure.core.util.Context; + +/** Samples for Bookmarks List. */ +public final class BookmarksListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/bookmarks/GetBookmarks.json + */ + /** + * Sample code: Get all bookmarks. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllBookmarks(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.bookmarks().list("myRg", "myWorkspace", Context.NONE); + } +} +``` + +### DataConnectors_Connect + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.securityinsights.models.ConnectAuthKind; +import com.azure.resourcemanager.securityinsights.models.DataConnectorConnectBody; +import java.io.IOException; +import java.util.Arrays; + +/** Samples for DataConnectors Connect. */ +public final class DataConnectorsConnectSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/ConnectAPIPolling.json + */ + /** + * Sample code: Connect an APIPolling data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void connectAnAPIPollingDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) throws IOException { + manager + .dataConnectors() + .connectWithResponse( + "myRg", + "myWorkspace", + "316ec55e-7138-4d63-ab18-90c8a60fd1c8", + new DataConnectorConnectBody() + .withKind(ConnectAuthKind.APIKEY) + .withApiKey("123456789") + .withRequestConfigUserInputValues( + Arrays + .asList( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"displayText\":\"Organization" + + " Name\",\"placeHolderName\":\"{{placeHolder1}}\",\"placeHolderValue\":\"somePlaceHolderValue\",\"requestObjectKey\":\"apiEndpoint\"}", + Object.class, + SerializerEncoding.JSON))), + Context.NONE); + } +} +``` + +### DataConnectors_CreateOrUpdate + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.securityinsights.models.Availability; +import com.azure.resourcemanager.securityinsights.models.AvailabilityStatus; +import com.azure.resourcemanager.securityinsights.models.CodelessApiPollingDataConnector; +import com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingAuthProperties; +import com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingConfigProperties; +import com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingPagingProperties; +import com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingRequestProperties; +import com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingResponseProperties; +import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigProperties; +import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem; +import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesDataTypesItem; +import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesGraphQueriesItem; +import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesInstructionStepsItem; +import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesSampleQueriesItem; +import com.azure.resourcemanager.securityinsights.models.CodelessUiDataConnector; +import com.azure.resourcemanager.securityinsights.models.ConnectivityType; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnector; +import com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnectorDataTypesDynamics365CdsActivities; +import com.azure.resourcemanager.securityinsights.models.InstructionStepsInstructionsItem; +import com.azure.resourcemanager.securityinsights.models.OfficeDataConnector; +import com.azure.resourcemanager.securityinsights.models.OfficeDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.OfficeDataConnectorDataTypesExchange; +import com.azure.resourcemanager.securityinsights.models.OfficeDataConnectorDataTypesSharePoint; +import com.azure.resourcemanager.securityinsights.models.OfficeDataConnectorDataTypesTeams; +import com.azure.resourcemanager.securityinsights.models.PermissionProviderScope; +import com.azure.resourcemanager.securityinsights.models.Permissions; +import com.azure.resourcemanager.securityinsights.models.PermissionsCustomsItem; +import com.azure.resourcemanager.securityinsights.models.PermissionsResourceProviderItem; +import com.azure.resourcemanager.securityinsights.models.PollingFrequency; +import com.azure.resourcemanager.securityinsights.models.ProviderName; +import com.azure.resourcemanager.securityinsights.models.RequiredPermissions; +import com.azure.resourcemanager.securityinsights.models.SettingType; +import com.azure.resourcemanager.securityinsights.models.TIDataConnector; +import com.azure.resourcemanager.securityinsights.models.TIDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.TIDataConnectorDataTypesIndicators; +import com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnector; +import com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnectorDataTypesTaxiiClient; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for DataConnectors CreateOrUpdate. */ +public final class DataConnectorsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CreateOfficeDataConnetor.json + */ + /** + * Sample code: Creates or updates an Office365 data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAnOffice365DataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new OfficeDataConnector() + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDataTypes( + new OfficeDataConnectorDataTypes() + .withExchange(new OfficeDataConnectorDataTypesExchange().withState(DataTypeState.ENABLED)) + .withSharePoint( + new OfficeDataConnectorDataTypesSharePoint().withState(DataTypeState.ENABLED)) + .withTeams(new OfficeDataConnectorDataTypesTeams().withState(DataTypeState.ENABLED))) + .withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CreateThreatIntelligenceTaxiiDataConnector.json + */ + /** + * Sample code: Creates or updates a Threat Intelligence Taxii data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAThreatIntelligenceTaxiiDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new TiTaxiiDataConnector() + .withEtag("d12423f6-a60b-4ca5-88c0-feb1a182d0f0") + .withWorkspaceId("dd124572-4962-4495-9bd2-9dade12314b4") + .withFriendlyName("testTaxii") + .withTaxiiServer("https://limo.anomali.com/api/v1/taxii2/feeds") + .withCollectionId("135") + .withUsername("--") + .withPassword("--") + .withTaxiiLookbackPeriod(OffsetDateTime.parse("2020-01-01T13:00:30.123Z")) + .withPollingFrequency(PollingFrequency.ONCE_ADAY) + .withDataTypes( + new TiTaxiiDataConnectorDataTypes() + .withTaxiiClient( + new TiTaxiiDataConnectorDataTypesTaxiiClient().withState(DataTypeState.ENABLED))) + .withTenantId("06b3ccb8-1384-4bcc-aec7-852f6d57161b"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CreateThreatIntelligenceDataConnector.json + */ + /** + * Sample code: Creates or updates an Threat Intelligence Platform data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAnThreatIntelligencePlatformDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new TIDataConnector() + .withTipLookbackPeriod(OffsetDateTime.parse("2020-01-01T13:00:30.123Z")) + .withDataTypes( + new TIDataConnectorDataTypes() + .withIndicators(new TIDataConnectorDataTypesIndicators().withState(DataTypeState.ENABLED))) + .withTenantId("06b3ccb8-1384-4bcc-aec7-852f6d57161b"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CreateDynamics365DataConnetor.json + */ + /** + * Sample code: Creates or updates a Dynamics365 data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesADynamics365DataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "c2541efb-c9a6-47fe-9501-87d1017d1512", + new Dynamics365DataConnector() + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDataTypes( + new Dynamics365DataConnectorDataTypes() + .withDynamics365CdsActivities( + new Dynamics365DataConnectorDataTypesDynamics365CdsActivities() + .withState(DataTypeState.ENABLED))) + .withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CreateGenericUI.json + */ + /** + * Sample code: Creates or updates a GenericUI data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAGenericUIDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) throws IOException { + manager + .dataConnectors() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "316ec55e-7138-4d63-ab18-90c8a60fd1c8", + new CodelessUiDataConnector() + .withConnectorUiConfig( + new CodelessUiConnectorConfigProperties() + .withTitle("Qualys Vulnerability Management (CCP DEMO)") + .withPublisher("Qualys") + .withDescriptionMarkdown( + "The [Qualys Vulnerability Management" + + " (VM)](https://www.qualys.com/apps/vulnerability-management/) data connector" + + " provides the capability to ingest vulnerability host detection data into Azure" + + " Sentinel through the Qualys API. The connector provides visibility into host" + + " detection data from vulerability scans. This connector provides Azure Sentinel" + + " the capability to view dashboards, create custom alerts, and improve" + + " investigation ") + .withGraphQueriesTableName("QualysHostDetection_CL") + .withGraphQueries( + Arrays + .asList( + new CodelessUiConnectorConfigPropertiesGraphQueriesItem() + .withMetricName("Total data received") + .withLegend("{{graphQueriesTableName}}") + .withBaseQuery("{{graphQueriesTableName}}"))) + .withSampleQueries( + Arrays + .asList( + new CodelessUiConnectorConfigPropertiesSampleQueriesItem() + .withDescription("Top 10 Vulerabilities detected") + .withQuery( + "{{graphQueriesTableName}}\n" + + " | mv-expand todynamic(Detections_s)\n" + + " | extend Vulnerability = tostring(Detections_s.Results)\n" + + " | summarize count() by Vulnerability\n" + + " | top 10 by count_"))) + .withDataTypes( + Arrays + .asList( + new CodelessUiConnectorConfigPropertiesDataTypesItem() + .withName("{{graphQueriesTableName}}") + .withLastDataReceivedQuery( + "{{graphQueriesTableName}}\n" + + " | summarize Time = max(TimeGenerated)\n" + + " | where isnotempty(Time)"))) + .withConnectivityCriteria( + Arrays + .asList( + new CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem() + .withType(ConnectivityType.IS_CONNECTED_QUERY) + .withValue( + Arrays + .asList( + "{{graphQueriesTableName}}\n" + + " | summarize LastLogReceived =" + + " max(TimeGenerated)\n" + + " | project IsConnected = LastLogReceived >" + + " ago(30d)")))) + .withAvailability(new Availability().withStatus(AvailabilityStatus.ONE).withIsPreview(true)) + .withPermissions( + new Permissions() + .withResourceProvider( + Arrays + .asList( + new PermissionsResourceProviderItem() + .withProvider( + ProviderName.MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES) + .withPermissionsDisplayText( + "read and write permissions on the workspace are required.") + .withProviderDisplayName("Workspace") + .withScope(PermissionProviderScope.WORKSPACE) + .withRequiredPermissions( + new RequiredPermissions() + .withWrite(true) + .withRead(true) + .withDelete(true)), + new PermissionsResourceProviderItem() + .withProvider( + ProviderName + .MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES_SHARED_KEYS) + .withPermissionsDisplayText( + "read permissions to shared keys for the workspace are" + + " required. [See the documentation to learn more about" + + " workspace" + + " keys](https://docs.microsoft.com/azure/azure-monitor/platform/agent-windows#obtain-workspace-id-and-key).") + .withProviderDisplayName("Keys") + .withScope(PermissionProviderScope.WORKSPACE) + .withRequiredPermissions( + new RequiredPermissions().withAction(true)))) + .withCustoms( + Arrays + .asList( + new PermissionsCustomsItem() + .withName("Microsoft.Web/sites permissions") + .withDescription( + "Read and write permissions to Azure Functions to create a" + + " Function App is required. [See the documentation to" + + " learn more about Azure" + + " Functions](https://docs.microsoft.com/azure/azure-functions/)."), + new PermissionsCustomsItem() + .withName("Qualys API Key") + .withDescription( + "A Qualys VM API username and password is required. [See the" + + " documentation to learn more about Qualys VM" + + " API](https://www.qualys.com/docs/qualys-api-vmpc-user-guide.pdf).")))) + .withInstructionSteps( + Arrays + .asList( + new CodelessUiConnectorConfigPropertiesInstructionStepsItem() + .withTitle("") + .withDescription( + ">**NOTE:** This connector uses Azure Functions to connect to Qualys VM" + + " to pull its logs into Azure Sentinel. This might result in" + + " additional data ingestion costs. Check the [Azure Functions" + + " pricing" + + " page](https://azure.microsoft.com/pricing/details/functions/)" + + " for details."), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem() + .withTitle("") + .withDescription( + ">**(Optional Step)** Securely store workspace and API authorization" + + " key(s) or token(s) in Azure Key Vault. Azure Key Vault provides" + + " a secure mechanism to store and retrieve key values. [Follow" + + " these" + + " instructions](https://docs.microsoft.com/azure/app-service/app-service-key-vault-references)" + + " to use Azure Key Vault with an Azure Function App."), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem() + .withTitle("") + .withDescription( + "**STEP 1 - Configuration steps for the Qualys VM API**\n\n" + + "1. Log into the Qualys Vulnerability Management console with an" + + " administrator account, select the **Users** tab and the" + + " **Users** subtab. \n" + + "2. Click on the **New** drop-down menu and select **Users..**\n" + + "3. Create a username and password for the API account. \n" + + "4. In the **User Roles** tab, ensure the account role is set to" + + " **Manager** and access is allowed to **GUI** and **API**\n" + + "4. Log out of the administrator account and log into the console" + + " with the new API credentials for validation, then log out of" + + " the API account. \n" + + "5. Log back into the console using an administrator account and" + + " modify the API accounts User Roles, removing access to **GUI**." + + " \n" + + "6. Save all changes."), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem() + .withTitle("") + .withDescription( + "**STEP 2 - Choose ONE from the following two deployment options to" + + " deploy the connector and the associated Azure Function**\n\n" + + ">**IMPORTANT:** Before deploying the Qualys VM connector, have" + + " the Workspace ID and Workspace Primary Key (can be copied from" + + " the following), as well as the Qualys VM API Authorization" + + " Key(s), readily available.") + .withInstructions( + Arrays + .asList( + new InstructionStepsInstructionsItem() + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"fillWith\":[\"WorkspaceId\"],\"label\":\"Workspace" + + " ID\"}", + Object.class, + SerializerEncoding.JSON)) + .withType(SettingType.COPYABLE_LABEL), + new InstructionStepsInstructionsItem() + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"fillWith\":[\"PrimaryKey\"],\"label\":\"Primary" + + " Key\"}", + Object.class, + SerializerEncoding.JSON)) + .withType(SettingType.COPYABLE_LABEL))), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem() + .withTitle("Option 1 - Azure Resource Manager (ARM) Template") + .withDescription( + "Use this method for automated deployment of the Qualys VM connector" + + " using an ARM Tempate.\n\n" + + "1. Click the **Deploy to Azure** button below. \n\n" + + "\t[![Deploy To" + + " Azure](https://aka.ms/deploytoazurebutton)](https://aka.ms/sentinelqualysvmazuredeploy)\n" + + "2. Select the preferred **Subscription**, **Resource Group** and" + + " **Location**. \n" + + "3. Enter the **Workspace ID**, **Workspace Key**, **API" + + " Username**, **API Password** , update the **URI**, and any" + + " additional URI **Filter Parameters** (each filter should be" + + " separated by an \"&\" symbol, no spaces.) \n" + + "> - Enter the URI that corresponds to your region. The complete" + + " list of API Server URLs can be [found" + + " here](https://www.qualys.com/docs/qualys-api-vmpc-user-guide.pdf#G4.735348)" + + " -- There is no need to add a time suffix to the URI, the" + + " Function App will dynamically append the Time Value to the URI" + + " in the proper format. \n" + + " - The default **Time Interval** is set to pull the last five" + + " (5) minutes of data. If the time interval needs to be modified," + + " it is recommended to change the Function App Timer Trigger" + + " accordingly (in the function.json file, post deployment) to" + + " prevent overlapping data ingestion. \n" + + "> - Note: If using Azure Key Vault secrets for any of the values" + + " above, use the`@Microsoft.KeyVault(SecretUri={Security" + + " Identifier})`schema in place of the string values. Refer to" + + " [Key Vault references" + + " documentation](https://docs.microsoft.com/azure/app-service/app-service-key-vault-references)" + + " for further details. \n" + + "4. Mark the checkbox labeled **I agree to the terms and" + + " conditions stated above**. \n" + + "5. Click **Purchase** to deploy."), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem() + .withTitle("Option 2 - Manual Deployment of Azure Functions") + .withDescription( + "Use the following step-by-step instructions to deploy the Quayls VM" + + " connector manually with Azure Functions."), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem() + .withTitle("") + .withDescription( + "**1. Create a Function App**\n\n" + + "1. From the Azure Portal, navigate to [Function" + + " App](https://portal.azure.com/#blade/HubsExtension/BrowseResource/resourceType/Microsoft.Web%2Fsites/kind/functionapp)," + + " and select **+ Add**.\n" + + "2. In the **Basics** tab, ensure Runtime stack is set to" + + " **Powershell Core**. \n" + + "3. In the **Hosting** tab, ensure the **Consumption" + + " (Serverless)** plan type is selected.\n" + + "4. Make other preferrable configuration changes, if needed, then" + + " click **Create**."), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem() + .withTitle("") + .withDescription( + "**2. Import Function App Code**\n\n" + + "1. In the newly created Function App, select **Functions** on" + + " the left pane and click **+ New Function**.\n" + + "2. Select **Timer Trigger**.\n" + + "3. Enter a unique Function **Name** and leave the default cron" + + " schedule of every 5 minutes, then click **Create**.\n" + + "5. Click on **Code + Test** on the left pane. \n" + + "6. Copy the [Function App" + + " Code](https://aka.ms/sentinelqualysvmazurefunctioncode) and" + + " paste into the Function App `run.ps1` editor.\n" + + "7. Click **Save**."), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem() + .withTitle("") + .withDescription( + "**3. Configure the Function App**\n\n" + + "1. In the Function App, select the Function App Name and select" + + " **Configuration**.\n" + + "2. In the **Application settings** tab, select **+ New" + + " application setting**.\n" + + "3. Add each of the following seven (7) application settings" + + " individually, with their respective string values" + + " (case-sensitive): \n" + + "\t\tapiUsername\n" + + "\t\tapiPassword\n" + + "\t\tworkspaceID\n" + + "\t\tworkspaceKey\n" + + "\t\turi\n" + + "\t\tfilterParameters\n" + + "\t\ttimeInterval\n" + + "> - Enter the URI that corresponds to your region. The complete" + + " list of API Server URLs can be [found" + + " here](https://www.qualys.com/docs/qualys-api-vmpc-user-guide.pdf#G4.735348)." + + " The `uri` value must follow the following schema: `https:///api/2.0/fo/asset/host/vm/detection/?action=list&vm_processed_after=`" + + " -- There is no need to add a time suffix to the URI, the" + + " Function App will dynamically append the Time Value to the URI" + + " in the proper format.\n" + + "> - Add any additional filter parameters, for the" + + " `filterParameters` variable, that need to be appended to the" + + " URI. Each parameter should be seperated by an \"&\" symbol and" + + " should not include any spaces.\n" + + "> - Set the `timeInterval` (in minutes) to the value of `5` to" + + " correspond to the Timer Trigger of every `5` minutes. If the" + + " time interval needs to be modified, it is recommended to change" + + " the Function App Timer Trigger accordingly to prevent" + + " overlapping data ingestion.\n" + + "> - Note: If using Azure Key Vault, use" + + " the`@Microsoft.KeyVault(SecretUri={Security Identifier})`schema" + + " in place of the string values. Refer to [Key Vault references" + + " documentation](https://docs.microsoft.com/azure/app-service/app-service-key-vault-references)" + + " for further details.\n" + + "4. Once all application settings have been entered, click" + + " **Save**."), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem() + .withTitle("") + .withDescription( + "**4. Configure the host.json**.\n\n" + + "Due to the potentially large amount of Qualys host detection" + + " data being ingested, it can cause the execution time to surpass" + + " the default Function App timeout of five (5) minutes. Increase" + + " the default timeout duration to the maximum of ten (10)" + + " minutes, under the Consumption Plan, to allow more time for the" + + " Function App to execute.\n\n" + + "1. In the Function App, select the Function App Name and select" + + " the **App Service Editor** blade.\n" + + "2. Click **Go** to open the editor, then select the" + + " **host.json** file under the **wwwroot** directory.\n" + + "3. Add the line `\"functionTimeout\": \"00:10:00\",` above the" + + " `managedDependancy` line \n" + + "4. Ensure **SAVED** appears on the top right corner of the" + + " editor, then exit the editor.\n\n" + + "> NOTE: If a longer timeout duration is required, consider" + + " upgrading to an [App Service" + + " Plan](https://docs.microsoft.com/azure/azure-functions/functions-scale#timeout)")))), + Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CreateAPIPolling.json + */ + /** + * Sample code: Creates or updates a APIPolling data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAAPIPollingDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) throws IOException { + manager + .dataConnectors() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "316ec55e-7138-4d63-ab18-90c8a60fd1c8", + new CodelessApiPollingDataConnector() + .withConnectorUiConfig( + new CodelessUiConnectorConfigProperties() + .withTitle("GitHub Enterprise Audit Log") + .withPublisher("GitHub") + .withDescriptionMarkdown( + "The GitHub audit log connector provides the capability to ingest GitHub logs into" + + " Azure Sentinel. By connecting GitHub audit logs into Azure Sentinel, you can" + + " view this data in workbooks, use it to create custom alerts, and improve your" + + " investigation process.") + .withGraphQueriesTableName("GitHubAuditLogPolling_CL") + .withGraphQueries( + Arrays + .asList( + new CodelessUiConnectorConfigPropertiesGraphQueriesItem() + .withMetricName("Total events received") + .withLegend("GitHub audit log events") + .withBaseQuery("{{graphQueriesTableName}}"))) + .withSampleQueries( + Arrays + .asList( + new CodelessUiConnectorConfigPropertiesSampleQueriesItem() + .withDescription("All logs") + .withQuery("{{graphQueriesTableName}}\n | take 10 "))) + .withDataTypes( + Arrays + .asList( + new CodelessUiConnectorConfigPropertiesDataTypesItem() + .withName("{{graphQueriesTableName}}") + .withLastDataReceivedQuery( + "{{graphQueriesTableName}}\n" + + " | summarize Time = max(TimeGenerated)\n" + + " | where isnotempty(Time)"))) + .withConnectivityCriteria( + Arrays + .asList( + new CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem() + .withType(ConnectivityType.fromString("SentinelKindsV2")) + .withValue(Arrays.asList()))) + .withAvailability(new Availability().withStatus(AvailabilityStatus.ONE).withIsPreview(true)) + .withPermissions( + new Permissions() + .withResourceProvider( + Arrays + .asList( + new PermissionsResourceProviderItem() + .withProvider( + ProviderName.MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES) + .withPermissionsDisplayText( + "read and write permissions are required.") + .withProviderDisplayName("Workspace") + .withScope(PermissionProviderScope.WORKSPACE) + .withRequiredPermissions( + new RequiredPermissions() + .withWrite(true) + .withRead(true) + .withDelete(true)))) + .withCustoms( + Arrays + .asList( + new PermissionsCustomsItem() + .withName("GitHub API personal token Key") + .withDescription( + "You need access to GitHub personal token, the key should have" + + " 'admin:org' scope")))) + .withInstructionSteps( + Arrays + .asList( + new CodelessUiConnectorConfigPropertiesInstructionStepsItem() + .withTitle("Connect GitHub Enterprise Audit Log to Azure Sentinel") + .withDescription( + "Enable GitHub audit Logs. \n" + + " Follow" + + " [this](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token)" + + " to create or find your personal key") + .withInstructions( + Arrays + .asList( + new InstructionStepsInstructionsItem() + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"enable\":\"true\",\"userRequestPlaceHoldersInput\":[{\"displayText\":\"Organization" + + " Name\",\"placeHolderName\":\"{{placeHolder1}}\",\"placeHolderValue\":\"\",\"requestObjectKey\":\"apiEndpoint\"}]}", + Object.class, + SerializerEncoding.JSON)) + .withType(SettingType.fromString("APIKey"))))))) + .withPollingConfig( + new CodelessConnectorPollingConfigProperties() + .withAuth( + new CodelessConnectorPollingAuthProperties() + .withAuthType("APIKey") + .withApiKeyName("Authorization") + .withApiKeyIdentifier("token")) + .withRequest( + new CodelessConnectorPollingRequestProperties() + .withApiEndpoint("https://api.github.com/organizations/{{placeHolder1}}/audit-log") + .withRateLimitQps(50) + .withQueryWindowInMin(15) + .withHttpMethod("Get") + .withQueryTimeFormat("yyyy-MM-ddTHH:mm:ssZ") + .withRetryCount(2) + .withTimeoutInSeconds(60) + .withHeaders( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"Accept\":\"application/json\",\"User-Agent\":\"Scuba\"}", + Object.class, + SerializerEncoding.JSON)) + .withQueryParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"phrase\":\"created:{_QueryWindowStartTime}..{_QueryWindowEndTime}\"}", + Object.class, + SerializerEncoding.JSON))) + .withPaging( + new CodelessConnectorPollingPagingProperties() + .withPagingType("LinkHeader") + .withPageSizeParaName("per_page")) + .withResponse( + new CodelessConnectorPollingResponseProperties() + .withEventsJsonPaths(Arrays.asList("$")))), + Context.NONE); + } +} +``` + +### DataConnectors_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for DataConnectors Delete. */ +public final class DataConnectorsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/DeleteGenericUI.json + */ + /** + * Sample code: Delete a GenericUI data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAGenericUIDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/DeleteOfficeDataConnetor.json + */ + /** + * Sample code: Delete an Office365 data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAnOffice365DataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/DeleteAPIPolling.json + */ + /** + * Sample code: Delete a APIPolling data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAAPIPollingDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", Context.NONE); + } +} +``` + +### DataConnectors_Disconnect + +```java +import com.azure.core.util.Context; + +/** Samples for DataConnectors Disconnect. */ +public final class DataConnectorsDisconnectSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/DisconnectAPIPolling.json + */ + /** + * Sample code: Disconnect an APIPolling data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void disconnectAnAPIPollingDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .disconnectWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", Context.NONE); + } +} +``` + +### DataConnectors_Get + +```java +import com.azure.core.util.Context; + +/** Samples for DataConnectors Get. */ +public final class DataConnectorsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetGenericUI.json + */ + /** + * Sample code: Get a GenericUI data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAGenericUIDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetOffice365AdvancedThreatProtectionById.json + */ + /** + * Sample code: Get a Office ATP data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAOfficeATPDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "3d3e955e-33eb-401d-89a7-251c81ddd660", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetMicrosoftCloudAppSecurityById.json + */ + /** + * Sample code: Get a MCAS data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAMCASDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "b96d014d-b5c2-4a01-9aba-a8058f629d42", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetThreatIntelligenceTaxiiById.json + */ + /** + * Sample code: Get a TI Taxii data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getATITaxiiDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "c39bb458-02a7-4b3f-b0c8-71a1d2692652", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetMicrosoftThreatIntelligenceById.json + */ + /** + * Sample code: Get a MicrosoftThreatIntelligence data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAMicrosoftThreatIntelligenceDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetAzureSecurityCenterById.json + */ + /** + * Sample code: Get a ASC data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAASCDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "763f9fa1-c2d3-4fa2-93e9-bccd4899aa12", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetThreatIntelligenceById.json + */ + /** + * Sample code: Get a TI data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getATIDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetAmazonWebServicesCloudTrailById.json + */ + /** + * Sample code: Get an AwsCloudTrail data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnAwsCloudTrailDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetMicrosoftDefenderAdvancedThreatProtectionById.json + */ + /** + * Sample code: Get a MDATP data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAMDATPDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "06b3ccb8-1384-4bcc-aec7-852f6d57161b", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetMicrosoftThreatProtectionById.json + */ + /** + * Sample code: Get a MicrosoftThreatProtection data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAMicrosoftThreatProtectionDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetAzureActiveDirectoryById.json + */ + /** + * Sample code: Get an AAD data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnAADDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "f0cd27d2-5f03-4c06-ba31-d2dc82dcb51d", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetMicrosoftInsiderRiskManagementById.json + */ + /** + * Sample code: Get a Office IRM data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAOfficeIRMDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "3d3e955e-33eb-401d-89a7-251c81ddd660", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetAzureAdvancedThreatProtectionById.json + */ + /** + * Sample code: Get an AATP data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnAATPDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "07e42cb3-e658-4e90-801c-efa0f29d3d44", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetAPIPolling.json + */ + /** + * Sample code: Get a APIPolling data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAAPIPollingDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetDynamics365DataConnectorById.json + */ + /** + * Sample code: Get a Dynamics365 data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getADynamics365DataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "c2541efb-c9a6-47fe-9501-87d1017d1512", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetOfficeDataConnetorById.json + */ + /** + * Sample code: Get an Office365 data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnOffice365DataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetAmazonWebServicesS3ById.json + */ + /** + * Sample code: Get an Aws S3 data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnAwsS3DataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "afef3743-0c88-469c-84ff-ca2e87dc1e48", Context.NONE); + } +} +``` + +### DataConnectors_List + +```java +import com.azure.core.util.Context; + +/** Samples for DataConnectors List. */ +public final class DataConnectorsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetDataConnectors.json + */ + /** + * Sample code: Get all data connectors. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllDataConnectors( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors().list("myRg", "myWorkspace", Context.NONE); + } +} +``` + +### DataConnectorsCheckRequirementsOperation_Post + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.AadCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.AscCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.Dynamics365CheckRequirements; +import com.azure.resourcemanager.securityinsights.models.McasCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.MstiCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.MtpCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.OfficeAtpCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.OfficeIrmCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.TICheckRequirements; +import com.azure.resourcemanager.securityinsights.models.TiTaxiiCheckRequirements; + +/** Samples for DataConnectorsCheckRequirementsOperation Post. */ +public final class DataConnectorsCheckRequirementsOperationPostSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsOfficeATP.json + */ + /** + * Sample code: Check requirements for OfficeATP. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForOfficeATP( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new OfficeAtpCheckRequirements(), Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsAzureActiveDirectory.json + */ + /** + * Sample code: Check requirements for AAD. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForAAD( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new AadCheckRequirements(), Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsMicrosoftCloudAppSecurity.json + */ + /** + * Sample code: Check requirements for Mcas. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForMcas( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new McasCheckRequirements(), Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsMdatp.json + */ + /** + * Sample code: Check requirements for Mdatp. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForMdatp( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new McasCheckRequirements(), Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsAzureActiveDirectoryNoAuthorization.json + */ + /** + * Sample code: Check requirements for AAD - no authorization. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForAADNoAuthorization( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new AadCheckRequirements(), Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsAzureSecurityCenter.json + */ + /** + * Sample code: Check requirements for ASC. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForASC( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse( + "myRg", + "myWorkspace", + new AscCheckRequirements().withSubscriptionId("c0688291-89d7-4bed-87a2-a7b1bff43f4c"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsMicrosoftThreatProtection.json + */ + /** + * Sample code: Check requirements for MicrosoftThreatProtection. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForMicrosoftThreatProtection( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new MtpCheckRequirements(), Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsThreatIntelligenceTaxii.json + */ + /** + * Sample code: Check requirements for TI Taxii. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForTITaxii( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new TiTaxiiCheckRequirements(), Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsOfficeIRM.json + */ + /** + * Sample code: Check requirements for OfficeIRM. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForOfficeIRM( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new OfficeIrmCheckRequirements(), Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsMicrosoftThreatIntelligence.json + */ + /** + * Sample code: Check requirements for MicrosoftThreatIntelligence. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForMicrosoftThreatIntelligence( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new MstiCheckRequirements(), Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsDynamics365.json + */ + /** + * Sample code: Check requirements for Dynamics365. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForDynamics365( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new Dynamics365CheckRequirements(), Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsAzureActiveDirectoryNoLicense.json + */ + /** + * Sample code: Check requirements for AAD - no license. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForAADNoLicense( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new AadCheckRequirements(), Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsThreatIntelligence.json + */ + /** + * Sample code: Check requirements for TI. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForTI( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new TICheckRequirements(), Context.NONE); + } +} +``` + +### DomainWhois_Get + +```java +import com.azure.core.util.Context; + +/** Samples for DomainWhois Get. */ +public final class DomainWhoisGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/enrichment/GetWhoisByDomainName.json + */ + /** + * Sample code: Get whois information for a single domain name. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getWhoisInformationForASingleDomainName( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.domainWhois().getWithResponse("myRg", "microsoft.com", Context.NONE); + } +} +``` + +### Entities_Expand + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.EntityExpandParameters; +import java.time.OffsetDateTime; +import java.util.UUID; + +/** Samples for Entities Expand. */ +public final class EntitiesExpandSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/expand/PostExpandEntity.json + */ + /** + * Sample code: Expand an entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void expandAnEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .entities() + .expandWithResponse( + "myRg", + "myWorkspace", + "e1d3d618-e11f-478b-98e3-bb381539a8e1", + new EntityExpandParameters() + .withEndTime(OffsetDateTime.parse("2019-05-26T00:00:00.000Z")) + .withExpansionId(UUID.fromString("a77992f3-25e9-4d01-99a4-5ff606cc410a")) + .withStartTime(OffsetDateTime.parse("2019-04-25T00:00:00.000Z")), + Context.NONE); + } +} +``` + +### Entities_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Entities Get. */ +public final class EntitiesGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetSubmissionMailEntityById.json + */ + /** + * Sample code: Get a submissionMail entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getASubmissionMailEntity( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetDnsEntityById.json + */ + /** + * Sample code: Get a dns entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getADnsEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "f4e74920-f2c0-4412-a45f-66d94fdf01f8", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetFileHashEntityById.json + */ + /** + * Sample code: Get a file hash entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAFileHashEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "ea359fa6-c1e5-f878-e105-6344f3e399a1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetIoTDeviceEntityById.json + */ + /** + * Sample code: Get an IoT device entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnIoTDeviceEntity( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetRegistryKeyEntityById.json + */ + /** + * Sample code: Get a registry key entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getARegistryKeyEntity( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetMailboxEntityById.json + */ + /** + * Sample code: Get a mailbox entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAMailboxEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetMalwareEntityById.json + */ + /** + * Sample code: Get a malware entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAMalwareEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "af378b21-b4aa-4fe7-bc70-13f8621a322f", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetSecurityAlertEntityById.json + */ + /** + * Sample code: Get a security alert entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getASecurityAlertEntity( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "4aa486e0-6f85-41af-99ea-7acdce7be6c8", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetIpEntityById.json + */ + /** + * Sample code: Get an ip entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnIpEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetAccountEntityById.json + */ + /** + * Sample code: Get an account entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnAccountEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetCloudApplicationEntityById.json + */ + /** + * Sample code: Get a cloud application entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getACloudApplicationEntity( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetFileEntityById.json + */ + /** + * Sample code: Get a file entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAFileEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "af378b21-b4aa-4fe7-bc70-13f8621a322f", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetRegistryValueEntityById.json + */ + /** + * Sample code: Get a registry value entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getARegistryValueEntity( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "dc44bd11-b348-4d76-ad29-37bf7aa41356", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetUrlEntityById.json + */ + /** + * Sample code: Get a url entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAUrlEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetMailClusterEntityById.json + */ + /** + * Sample code: Get a mailCluster entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAMailClusterEntity( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetSecurityGroupEntityById.json + */ + /** + * Sample code: Get a security group entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getASecurityGroupEntity( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetMailMessageEntityById.json + */ + /** + * Sample code: Get a mailMessage entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAMailMessageEntity( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetAzureResourceEntityById.json + */ + /** + * Sample code: Get an azure resource entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnAzureResourceEntity( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetHostEntityById.json + */ + /** + * Sample code: Get a host entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAHostEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetProcessEntityById.json + */ + /** + * Sample code: Get a process entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAProcessEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "7264685c-038c-42c6-948c-38e14ef1fb98", Context.NONE); + } +} +``` + +### Entities_GetInsights + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.EntityGetInsightsParameters; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.UUID; + +/** Samples for Entities GetInsights. */ +public final class EntitiesGetInsightsSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/insights/PostGetInsights.json + */ + /** + * Sample code: Entity Insight. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void entityInsight(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .entities() + .getInsightsWithResponse( + "myRg", + "myWorkspace", + "e1d3d618-e11f-478b-98e3-bb381539a8e1", + new EntityGetInsightsParameters() + .withStartTime(OffsetDateTime.parse("2021-09-01T00:00:00.000Z")) + .withEndTime(OffsetDateTime.parse("2021-10-01T00:00:00.000Z")) + .withAddDefaultExtendedTimeRange(false) + .withInsightQueryIds(Arrays.asList(UUID.fromString("cae8d0aa-aa45-4d53-8d88-17dd64ffd4e4"))), + Context.NONE); + } +} +``` + +### Entities_List + +```java +import com.azure.core.util.Context; + +/** Samples for Entities List. */ +public final class EntitiesListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetEntities.json + */ + /** + * Sample code: Get all entities. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllEntities(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().list("myRg", "myWorkspace", Context.NONE); + } +} +``` + +### Entities_Queries + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.EntityItemQueryKind; + +/** Samples for Entities Queries. */ +public final class EntitiesQueriesSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetQueries.json + */ + /** + * Sample code: Get Entity Query. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getEntityQuery(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .entities() + .queriesWithResponse( + "myRg", + "myWorkspace", + "e1d3d618-e11f-478b-98e3-bb381539a8e1", + EntityItemQueryKind.INSIGHT, + Context.NONE); + } +} +``` + +### EntitiesGetTimeline_List + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.EntityTimelineParameters; +import java.time.OffsetDateTime; + +/** Samples for EntitiesGetTimeline List. */ +public final class EntitiesGetTimelineListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/timeline/PostTimelineEntity.json + */ + /** + * Sample code: Entity timeline. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void entityTimeline(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .entitiesGetTimelines() + .listWithResponse( + "myRg", + "myWorkspace", + "e1d3d618-e11f-478b-98e3-bb381539a8e1", + new EntityTimelineParameters() + .withStartTime(OffsetDateTime.parse("2021-09-01T00:00:00.000Z")) + .withEndTime(OffsetDateTime.parse("2021-10-01T00:00:00.000Z")) + .withNumberOfBucket(4), + Context.NONE); + } +} +``` + +### EntitiesRelations_List + +```java +import com.azure.core.util.Context; + +/** Samples for EntitiesRelations List. */ +public final class EntitiesRelationsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/relations/GetAllEntityRelations.json + */ + /** + * Sample code: Get all relations of an entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllRelationsOfAnEntity( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .entitiesRelations() + .list("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", null, null, null, null, Context.NONE); + } +} +``` + +### EntityQueries_CreateOrUpdate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.ActivityCustomEntityQuery; +import com.azure.resourcemanager.securityinsights.models.ActivityEntityQueriesPropertiesQueryDefinitions; +import com.azure.resourcemanager.securityinsights.models.EntityType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for EntityQueries CreateOrUpdate. */ +public final class EntityQueriesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entityQueries/CreateEntityQueryActivity.json + */ + /** + * Sample code: Creates or updates an Activity entity query. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAnActivityEntityQuery( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .entityQueries() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "07da3cc8-c8ad-4710-a44e-334cdcb7882b", + new ActivityCustomEntityQuery() + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withTitle("An account was deleted on this host") + .withContent("On '{{Computer}}' the account '{{TargetAccount}}' was deleted by '{{AddedBy}}'") + .withDescription("Account deleted on host") + .withQueryDefinitions( + new ActivityEntityQueriesPropertiesQueryDefinitions() + .withQuery( + "let GetAccountActions = (v_Host_Name:string, v_Host_NTDomain:string," + + " v_Host_DnsDomain:string, v_Host_AzureID:string, v_Host_OMSAgentID:string){\n" + + "SecurityEvent\n" + + "| where EventID in (4725, 4726, 4767, 4720, 4722, 4723, 4724)\n" + + "// parsing for Host to handle variety of conventions coming from data\n" + + "| extend Host_HostName = case(\n" + + "Computer has '@', tostring(split(Computer, '@')[0]),\n" + + "Computer has '\\\\', tostring(split(Computer, '\\\\')[1]),\n" + + "Computer has '.', tostring(split(Computer, '.')[0]),\n" + + "Computer\n" + + ")\n" + + "| extend Host_NTDomain = case(\n" + + "Computer has '\\\\', tostring(split(Computer, '\\\\')[0]), \n" + + "Computer has '.', tostring(split(Computer, '.')[-2]), \n" + + "Computer\n" + + ")\n" + + "| extend Host_DnsDomain = case(\n" + + "Computer has '\\\\', tostring(split(Computer, '\\\\')[0]), \n" + + "Computer has '.', strcat_array(array_slice(split(Computer,'.'),-2,-1),'.'), \n" + + "Computer\n" + + ")\n" + + "| where (Host_HostName =~ v_Host_Name and Host_NTDomain =~ v_Host_NTDomain) \n" + + "or (Host_HostName =~ v_Host_Name and Host_DnsDomain =~ v_Host_DnsDomain) \n" + + "or v_Host_AzureID =~ _ResourceId \n" + + "or v_Host_OMSAgentID == SourceComputerId\n" + + "| project TimeGenerated, EventID, Activity, Computer, TargetAccount," + + " TargetUserName, TargetDomainName, TargetSid, SubjectUserName, SubjectUserSid," + + " _ResourceId, SourceComputerId\n" + + "| extend AddedBy = SubjectUserName\n" + + "// Future support for Activities\n" + + "| extend timestamp = TimeGenerated, HostCustomEntity = Computer," + + " AccountCustomEntity = TargetAccount\n" + + "};\n" + + "GetAccountActions('{{Host_HostName}}', '{{Host_NTDomain}}'," + + " '{{Host_DnsDomain}}', '{{Host_AzureID}}', '{{Host_OMSAgentID}}')\n" + + " \n" + + "| where EventID == 4726 ")) + .withInputEntityType(EntityType.HOST) + .withRequiredInputFieldsSets( + Arrays + .asList( + Arrays.asList("Host_HostName", "Host_NTDomain"), + Arrays.asList("Host_HostName", "Host_DnsDomain"), + Arrays.asList("Host_AzureID"), + Arrays.asList("Host_OMSAgentID"))) + .withEntitiesFilter(mapOf("Host_OsFamily", Arrays.asList("Windows"))) + .withEnabled(true), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### EntityQueries_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for EntityQueries Delete. */ +public final class EntityQueriesDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entityQueries/DeleteEntityQuery.json + */ + /** + * Sample code: Delete an entity query. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAnEntityQuery(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .entityQueries() + .deleteWithResponse("myRg", "myWorkspace", "07da3cc8-c8ad-4710-a44e-334cdcb7882b", Context.NONE); + } +} +``` + +### EntityQueries_Get + +```java +import com.azure.core.util.Context; + +/** Samples for EntityQueries Get. */ +public final class EntityQueriesGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entityQueries/GetActivityEntityQueryById.json + */ + /** + * Sample code: Get an Activity entity query. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnActivityEntityQuery( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .entityQueries() + .getWithResponse("myRg", "myWorkspace", "07da3cc8-c8ad-4710-a44e-334cdcb7882b", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entityQueries/GetExpansionEntityQueryById.json + */ + /** + * Sample code: Get an Expansion entity query. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnExpansionEntityQuery( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .entityQueries() + .getWithResponse("myRg", "myWorkspace", "07da3cc8-c8ad-4710-a44e-334cdcb7882b", Context.NONE); + } +} +``` + +### EntityQueries_List + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.EntityQueriesKind; + +/** Samples for EntityQueries List. */ +public final class EntityQueriesListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entityQueries/GetEntityQueries.json + */ + /** + * Sample code: Get all entity queries. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllEntityQueries(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entityQueries().list("myRg", "myWorkspace", EntityQueriesKind.EXPANSION, Context.NONE); + } +} +``` + +### EntityQueryTemplates_Get + +```java +import com.azure.core.util.Context; + +/** Samples for EntityQueryTemplates Get. */ +public final class EntityQueryTemplatesGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entityQueryTemplates/GetActivityEntityQueryTemplateById.json + */ + /** + * Sample code: Get an Activity entity query template. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnActivityEntityQueryTemplate( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .entityQueryTemplates() + .getWithResponse("myRg", "myWorkspace", "07da3cc8-c8ad-4710-a44e-334cdcb7882b", Context.NONE); + } +} +``` + +### EntityQueryTemplates_List + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.Constant69; + +/** Samples for EntityQueryTemplates List. */ +public final class EntityQueryTemplatesListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entityQueryTemplates/GetEntityQueryTemplates.json + */ + /** + * Sample code: Get all entity query templates. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllEntityQueryTemplates( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entityQueryTemplates().list("myRg", "myWorkspace", Constant69.ACTIVITY, Context.NONE); + } +} +``` + +### EntityRelations_GetRelation + +```java +import com.azure.core.util.Context; + +/** Samples for EntityRelations GetRelation. */ +public final class EntityRelationsGetRelationSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/relations/GetEntityRelationByName.json + */ + /** + * Sample code: Get an entity relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnEntityRelation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .entityRelations() + .getRelationWithResponse( + "myRg", + "myWorkspace", + "afbd324f-6c48-459c-8710-8d1e1cd03812", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", + Context.NONE); + } +} +``` + +### IncidentComments_CreateOrUpdate + +```java +/** Samples for IncidentComments CreateOrUpdate. */ +public final class IncidentCommentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/comments/CreateIncidentComment.json + */ + /** + * Sample code: Creates or updates an incident comment. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAnIncidentComment( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidentComments() + .define("4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014") + .withExistingIncident("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5") + .withMessage("Some message") + .create(); + } +} +``` + +### IncidentComments_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for IncidentComments Delete. */ +public final class IncidentCommentsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/comments/DeleteIncidentComment.json + */ + /** + * Sample code: Delete the incident comment. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteTheIncidentComment( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidentComments() + .deleteWithResponse( + "myRg", + "myWorkspace", + "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", + Context.NONE); + } +} +``` + +### IncidentComments_Get + +```java +import com.azure.core.util.Context; + +/** Samples for IncidentComments Get. */ +public final class IncidentCommentsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/comments/GetIncidentCommentById.json + */ + /** + * Sample code: Get an incident comment. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnIncidentComment( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidentComments() + .getWithResponse( + "myRg", + "myWorkspace", + "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", + Context.NONE); + } +} +``` + +### IncidentComments_List + +```java +import com.azure.core.util.Context; + +/** Samples for IncidentComments List. */ +public final class IncidentCommentsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/comments/GetAllIncidentComments.json + */ + /** + * Sample code: Get all incident comments. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllIncidentComments( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidentComments() + .list("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", null, null, null, null, Context.NONE); + } +} +``` + +### IncidentRelations_CreateOrUpdate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; + +/** Samples for IncidentRelations CreateOrUpdate. */ +public final class IncidentRelationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/relations/CreateIncidentRelation.json + */ + /** + * Sample code: Creates or updates an incident relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAnIncidentRelation( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidentRelations() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "afbd324f-6c48-459c-8710-8d1e1cd03812", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", + new RelationInner() + .withRelatedResourceId( + "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalIinsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/bookmarks/2216d0e1-91e3-4902-89fd-d2df8c535096"), + Context.NONE); + } +} +``` + +### IncidentRelations_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for IncidentRelations Delete. */ +public final class IncidentRelationsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/relations/DeleteIncidentRelation.json + */ + /** + * Sample code: Delete the incident relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteTheIncidentRelation( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidentRelations() + .deleteWithResponse( + "myRg", + "myWorkspace", + "afbd324f-6c48-459c-8710-8d1e1cd03812", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", + Context.NONE); + } +} +``` + +### IncidentRelations_Get + +```java +import com.azure.core.util.Context; + +/** Samples for IncidentRelations Get. */ +public final class IncidentRelationsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/relations/GetIncidentRelationByName.json + */ + /** + * Sample code: Get an incident relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnIncidentRelation( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidentRelations() + .getWithResponse( + "myRg", + "myWorkspace", + "afbd324f-6c48-459c-8710-8d1e1cd03812", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", + Context.NONE); + } +} +``` + +### IncidentRelations_List + +```java +import com.azure.core.util.Context; + +/** Samples for IncidentRelations List. */ +public final class IncidentRelationsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/relations/GetAllIncidentRelations.json + */ + /** + * Sample code: Get all incident relations. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllIncidentRelations( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidentRelations() + .list("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", null, null, null, null, Context.NONE); + } +} +``` + +### Incidents_CreateOrUpdate + +```java +import com.azure.resourcemanager.securityinsights.models.IncidentClassification; +import com.azure.resourcemanager.securityinsights.models.IncidentClassificationReason; +import com.azure.resourcemanager.securityinsights.models.IncidentOwnerInfo; +import com.azure.resourcemanager.securityinsights.models.IncidentSeverity; +import com.azure.resourcemanager.securityinsights.models.IncidentStatus; +import java.time.OffsetDateTime; +import java.util.UUID; + +/** Samples for Incidents CreateOrUpdate. */ +public final class IncidentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/CreateIncident.json + */ + /** + * Sample code: Creates or updates an incident. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAnIncident( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidents() + .define("73e01a99-5cd7-4139-a149-9f2736ff2ab5") + .withExistingWorkspace("myRg", "myWorkspace") + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withClassification(IncidentClassification.FALSE_POSITIVE) + .withClassificationComment("Not a malicious activity") + .withClassificationReason(IncidentClassificationReason.INCORRECT_ALERT_LOGIC) + .withDescription("This is a demo incident") + .withFirstActivityTimeUtc(OffsetDateTime.parse("2019-01-01T13:00:30Z")) + .withLastActivityTimeUtc(OffsetDateTime.parse("2019-01-01T13:05:30Z")) + .withOwner(new IncidentOwnerInfo().withObjectId(UUID.fromString("2046feea-040d-4a46-9e2b-91c2941bfa70"))) + .withSeverity(IncidentSeverity.HIGH) + .withStatus(IncidentStatus.CLOSED) + .withTitle("My incident") + .create(); + } +} +``` + +### Incidents_CreateTeam + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.TeamProperties; + +/** Samples for Incidents CreateTeam. */ +public final class IncidentsCreateTeamSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/CreateTeam.json + */ + /** + * Sample code: Creates incident teams group. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsIncidentTeamsGroup( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidents() + .createTeamWithResponse( + "ambawolvese5resourcegroup", + "AmbaE5WestCentralUS", + "69a30280-6a4c-4aa7-9af0-5d63f335d600", + new TeamProperties().withTeamName("Team name").withTeamDescription("Team description"), + Context.NONE); + } +} +``` + +### Incidents_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Incidents Delete. */ +public final class IncidentsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/DeleteIncident.json + */ + /** + * Sample code: Delete an incident. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAnIncident(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidents() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } +} +``` + +### Incidents_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Incidents Get. */ +public final class IncidentsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/GetIncidentById.json + */ + /** + * Sample code: Get an incident. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnIncident(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidents() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } +} +``` + +### Incidents_List + +```java +import com.azure.core.util.Context; + +/** Samples for Incidents List. */ +public final class IncidentsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/GetIncidents.json + */ + /** + * Sample code: Get all incidents. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllIncidents(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidents().list("myRg", "myWorkspace", null, "properties/createdTimeUtc desc", 1, null, Context.NONE); + } +} +``` + +### Incidents_ListAlerts + +```java +import com.azure.core.util.Context; + +/** Samples for Incidents ListAlerts. */ +public final class IncidentsListAlertsSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/GetAllIncidentAlerts.json + */ + /** + * Sample code: Get all incident alerts. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllIncidentAlerts( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidents() + .listAlertsWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", Context.NONE); + } +} +``` + +### Incidents_ListBookmarks + +```java +import com.azure.core.util.Context; + +/** Samples for Incidents ListBookmarks. */ +public final class IncidentsListBookmarksSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/GetAllIncidentBookmarks.json + */ + /** + * Sample code: Get all incident bookmarks. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllIncidentBookmarks( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidents() + .listBookmarksWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", Context.NONE); + } +} +``` + +### Incidents_ListEntities + +```java +import com.azure.core.util.Context; + +/** Samples for Incidents ListEntities. */ +public final class IncidentsListEntitiesSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/entities/GetAllIncidentEntities.json + */ + /** + * Sample code: Gets all incident related entities. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getsAllIncidentRelatedEntities( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidents() + .listEntitiesWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", Context.NONE); + } +} +``` + +### IpGeodata_Get + +```java +import com.azure.core.util.Context; + +/** Samples for IpGeodata Get. */ +public final class IpGeodataGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/enrichment/GetGeodataByIp.json + */ + /** + * Sample code: Get geodata for a single IP address. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getGeodataForASingleIPAddress( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.ipGeodatas().getWithResponse("myRg", "1.2.3.4", Context.NONE); + } +} +``` + +### Metadata_Create + +```java +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataAuthor; +import com.azure.resourcemanager.securityinsights.models.MetadataCategories; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencies; +import com.azure.resourcemanager.securityinsights.models.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +import com.azure.resourcemanager.securityinsights.models.Operator; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.time.LocalDate; +import java.util.Arrays; + +/** Samples for Metadata Create. */ +public final class MetadataCreateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/metadata/PutMetadata.json + */ + /** + * Sample code: Create/update full metadata. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createUpdateFullMetadata( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .metadatas() + .define("metadataName") + .withExistingWorkspace("myRg", "myWorkspace") + .withContentId("c00ee137-7475-47c8-9cce-ec6f0f1bedd0") + .withParentId( + "/subscriptions/2e1dc338-d04d-4443-b721-037eff4fdcac/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/ruleName") + .withVersion("1.0.0.0") + .withKind(Kind.ANALYTICS_RULE) + .withSource( + new MetadataSource() + .withKind(SourceKind.SOLUTION) + .withName("Contoso Solution 1.0") + .withSourceId("b688a130-76f4-4a07-bf57-762222a3cadf")) + .withAuthor(new MetadataAuthor().withName("User Name").withEmail("email@microsoft.com")) + .withSupport( + new MetadataSupport() + .withTier(SupportTier.PARTNER) + .withName("Microsoft") + .withEmail("support@microsoft.com") + .withLink("https://support.microsoft.com/")) + .withDependencies( + new MetadataDependencies() + .withOperator(Operator.AND) + .withCriteria( + Arrays + .asList( + new MetadataDependencies() + .withOperator(Operator.OR) + .withCriteria( + Arrays + .asList( + new MetadataDependencies() + .withContentId("045d06d0-ee72-4794-aba4-cf5646e4c756") + .withKind(Kind.DATA_CONNECTOR) + .withName("Microsoft Defender for Endpoint"), + new MetadataDependencies() + .withContentId("dbfcb2cc-d782-40ef-8d94-fe7af58a6f2d") + .withKind(Kind.DATA_CONNECTOR), + new MetadataDependencies() + .withContentId("de4dca9b-eb37-47d6-a56f-b8b06b261593") + .withKind(Kind.DATA_CONNECTOR) + .withVersion("2.0"))), + new MetadataDependencies() + .withContentId("31ee11cc-9989-4de8-b176-5e0ef5c4dbab") + .withKind(Kind.PLAYBOOK) + .withVersion("1.0"), + new MetadataDependencies() + .withContentId("21ba424a-9438-4444-953a-7059539a7a1b") + .withKind(Kind.PARSER)))) + .withCategories( + new MetadataCategories() + .withDomains(Arrays.asList("Application", "Security – Insider Threat")) + .withVerticals(Arrays.asList("Healthcare"))) + .withProviders(Arrays.asList("Amazon", "Microsoft")) + .withFirstPublishDate(LocalDate.parse("2021-05-18")) + .withLastPublishDate(LocalDate.parse("2021-05-18")) + .create(); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/metadata/PutMetadataMinimal.json + */ + /** + * Sample code: Create/update minimal metadata. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createUpdateMinimalMetadata( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .metadatas() + .define("metadataName") + .withExistingWorkspace("myRg", "myWorkspace") + .withContentId("c00ee137-7475-47c8-9cce-ec6f0f1bedd0") + .withParentId( + "/subscriptions/2e1dc338-d04d-4443-b721-037eff4fdcac/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/ruleName") + .withKind(Kind.ANALYTICS_RULE) + .create(); + } +} +``` + +### Metadata_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Metadata Delete. */ +public final class MetadataDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/metadata/DeleteMetadata.json + */ + /** + * Sample code: Delete metadata. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteMetadata(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.metadatas().deleteWithResponse("myRg", "myWorkspace", "metadataName", Context.NONE); + } +} +``` + +### Metadata_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Metadata Get. */ +public final class MetadataGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/metadata/GetMetadata.json + */ + /** + * Sample code: Get single metadata by name. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getSingleMetadataByName( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.metadatas().getWithResponse("myRg", "myWorkspace", "metadataName", Context.NONE); + } +} +``` + +### Metadata_List + +```java +import com.azure.core.util.Context; + +/** Samples for Metadata List. */ +public final class MetadataListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/metadata/GetAllMetadata.json + */ + /** + * Sample code: Get all metadata. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllMetadata(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.metadatas().list("myRg", "myWorkspace", null, null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/metadata/GetAllMetadataOData.json + */ + /** + * Sample code: Get all metadata with OData filter/orderby/skip/top. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllMetadataWithODataFilterOrderbySkipTop( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.metadatas().list("myRg", "myWorkspace", null, null, null, null, Context.NONE); + } +} +``` + +### Metadata_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.MetadataAuthor; +import com.azure.resourcemanager.securityinsights.models.MetadataModel; + +/** Samples for Metadata Update. */ +public final class MetadataUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/metadata/PatchMetadata.json + */ + /** + * Sample code: Update metadata. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void updateMetadata(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + MetadataModel resource = + manager.metadatas().getWithResponse("myRg", "myWorkspace", "metadataName", Context.NONE).getValue(); + resource + .update() + .withAuthor(new MetadataAuthor().withName("User Name").withEmail("email@microsoft.com")) + .apply(); + } +} +``` + +### OfficeConsents_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for OfficeConsents Delete. */ +public final class OfficeConsentsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/officeConsents/DeleteOfficeConsents.json + */ + /** + * Sample code: Delete an office consent. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAnOfficeConsent( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .officeConsents() + .deleteWithResponse("myRg", "myWorkspace", "04e5fd05-ff86-4b97-b8d2-1c20933cb46c", Context.NONE); + } +} +``` + +### OfficeConsents_Get + +```java +import com.azure.core.util.Context; + +/** Samples for OfficeConsents Get. */ +public final class OfficeConsentsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/officeConsents/GetOfficeConsentsById.json + */ + /** + * Sample code: Get an office consent. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnOfficeConsent(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .officeConsents() + .getWithResponse("myRg", "myWorkspace", "04e5fd05-ff86-4b97-b8d2-1c20933cb46c", Context.NONE); + } +} +``` + +### OfficeConsents_List + +```java +import com.azure.core.util.Context; + +/** Samples for OfficeConsents List. */ +public final class OfficeConsentsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/officeConsents/GetOfficeConsents.json + */ + /** + * Sample code: Get all office consents. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllOfficeConsents( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.officeConsents().list("myRg", "myWorkspace", Context.NONE); + } +} +``` + +### ProductSettings_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ProductSettings Delete. */ +public final class ProductSettingsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/settings/DeleteEyesOnSetting.json + */ + /** + * Sample code: Delete EyesOn settings. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteEyesOnSettings( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.productSettings().deleteWithResponse("myRg", "myWorkspace", "EyesOn", Context.NONE); + } +} +``` + +### ProductSettings_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ProductSettings Get. */ +public final class ProductSettingsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/settings/GetEyesOnSetting.json + */ + /** + * Sample code: Get EyesOn settings. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getEyesOnSettings(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.productSettings().getWithResponse("myRg", "myWorkspace", "EyesOn", Context.NONE); + } +} +``` + +### ProductSettings_List + +```java +import com.azure.core.util.Context; + +/** Samples for ProductSettings List. */ +public final class ProductSettingsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/settings/GetAllSettings.json + */ + /** + * Sample code: Get all settings. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllSettings(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.productSettings().listWithResponse("myRg", "myWorkspace", Context.NONE); + } +} +``` + +### ProductSettings_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.EyesOn; + +/** Samples for ProductSettings Update. */ +public final class ProductSettingsUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/settings/UpdateEyesOnSetting.json + */ + /** + * Sample code: Update EyesOn settings. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void updateEyesOnSettings( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .productSettings() + .updateWithResponse( + "myRg", + "myWorkspace", + "EyesOn", + new EyesOn().withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\""), + Context.NONE); + } +} +``` + +### SentinelOnboardingStates_Create + +```java +/** Samples for SentinelOnboardingStates Create. */ +public final class SentinelOnboardingStatesCreateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/onboardingStates/CreateSentinelOnboardingState.json + */ + /** + * Sample code: Create Sentinel onboarding state. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createSentinelOnboardingState( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .sentinelOnboardingStates() + .define("default") + .withExistingWorkspace("myRg", "myWorkspace") + .withCustomerManagedKey(false) + .create(); + } +} +``` + +### SentinelOnboardingStates_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for SentinelOnboardingStates Delete. */ +public final class SentinelOnboardingStatesDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/onboardingStates/DeleteSentinelOnboardingState.json + */ + /** + * Sample code: Delete Sentinel onboarding state. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteSentinelOnboardingState( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sentinelOnboardingStates().deleteWithResponse("myRg", "myWorkspace", "default", Context.NONE); + } +} +``` + +### SentinelOnboardingStates_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SentinelOnboardingStates Get. */ +public final class SentinelOnboardingStatesGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/onboardingStates/GetSentinelOnboardingState.json + */ + /** + * Sample code: Get Sentinel onboarding state. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getSentinelOnboardingState( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sentinelOnboardingStates().getWithResponse("myRg", "myWorkspace", "default", Context.NONE); + } +} +``` + +### SentinelOnboardingStates_List + +```java +import com.azure.core.util.Context; + +/** Samples for SentinelOnboardingStates List. */ +public final class SentinelOnboardingStatesListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/onboardingStates/GetAllSentinelOnboardingStates.json + */ + /** + * Sample code: Get all Sentinel onboarding states. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllSentinelOnboardingStates( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sentinelOnboardingStates().listWithResponse("myRg", "myWorkspace", Context.NONE); + } +} +``` + +### SourceControl_ListRepositories + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.RepoType; + +/** Samples for SourceControl ListRepositories. */ +public final class SourceControlListRepositoriesSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/repositories/GetRepositories.json + */ + /** + * Sample code: Get repository list. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getRepositoryList(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sourceControls().listRepositories("myRg", "myWorkspace", RepoType.GITHUB, Context.NONE); + } +} +``` + +### SourceControlsOperation_Create + +```java +import com.azure.resourcemanager.securityinsights.models.ContentPathMap; +import com.azure.resourcemanager.securityinsights.models.ContentType; +import com.azure.resourcemanager.securityinsights.models.RepoType; +import com.azure.resourcemanager.securityinsights.models.Repository; +import java.util.Arrays; + +/** Samples for SourceControlsOperation Create. */ +public final class SourceControlsOperationCreateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/sourcecontrols/CreateSourceControl.json + */ + /** + * Sample code: Creates a source control. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsASourceControl( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .sourceControlsOperations() + .define("789e0c1f-4a3d-43ad-809c-e713b677b04a") + .withExistingWorkspace("myRg", "myWorkspace") + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDisplayName("My Source Control") + .withDescription("This is a source control") + .withRepoType(RepoType.GITHUB) + .withContentTypes(Arrays.asList(ContentType.fromString("AnalyticRules"), ContentType.WORKBOOK)) + .withRepository( + new Repository() + .withUrl("https://github.com/user/repo") + .withBranch("master") + .withDisplayUrl("https://github.com/user/repo") + .withPathMapping( + Arrays + .asList( + new ContentPathMap() + .withContentType(ContentType.fromString("AnalyticRules")) + .withPath("path/to/rules"), + new ContentPathMap() + .withContentType(ContentType.WORKBOOK) + .withPath("path/to/workbooks")))) + .create(); + } +} +``` + +### SourceControlsOperation_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for SourceControlsOperation Delete. */ +public final class SourceControlsOperationDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/sourcecontrols/DeleteSourceControl.json + */ + /** + * Sample code: Delete a source control. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteASourceControl( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .sourceControlsOperations() + .deleteWithResponse("myRg", "myWorkspace", "789e0c1f-4a3d-43ad-809c-e713b677b04a", Context.NONE); + } +} +``` + +### SourceControlsOperation_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SourceControlsOperation Get. */ +public final class SourceControlsOperationGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/sourcecontrols/GetSourceControlById.json + */ + /** + * Sample code: Get a source control. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getASourceControl(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .sourceControlsOperations() + .getWithResponse("myRg", "myWorkspace", "789e0c1f-4a3d-43ad-809c-e713b677b04a", Context.NONE); + } +} +``` + +### SourceControlsOperation_List + +```java +import com.azure.core.util.Context; + +/** Samples for SourceControlsOperation List. */ +public final class SourceControlsOperationListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/sourcecontrols/GetSourceControls.json + */ + /** + * Sample code: Get all source controls. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllSourceControls( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sourceControlsOperations().list("myRg", "myWorkspace", Context.NONE); + } +} +``` + +### ThreatIntelligenceIndicator_AppendTags + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAppendTags; +import java.util.Arrays; + +/** Samples for ThreatIntelligenceIndicator AppendTags. */ +public final class ThreatIntelligenceIndicatorAppendTagsSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/threatintelligence/AppendTagsThreatIntelligence.json + */ + /** + * Sample code: Append tags to a threat intelligence indicator. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void appendTagsToAThreatIntelligenceIndicator( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .threatIntelligenceIndicators() + .appendTagsWithResponse( + "myRg", + "myWorkspace", + "d9cd6f0b-96b9-3984-17cd-a779d1e15a93", + new ThreatIntelligenceAppendTags().withThreatIntelligenceTags(Arrays.asList("tag1", "tag2")), + Context.NONE); + } +} +``` + +### ThreatIntelligenceIndicator_Create + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModelForRequestBody; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceResourceKindEnum; +import java.util.Arrays; + +/** Samples for ThreatIntelligenceIndicator Create. */ +public final class ThreatIntelligenceIndicatorCreateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/threatintelligence/UpdateThreatIntelligence.json + */ + /** + * Sample code: Update a threat Intelligence indicator. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void updateAThreatIntelligenceIndicator( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .threatIntelligenceIndicators() + .createWithResponse( + "myRg", + "myWorkspace", + "d9cd6f0b-96b9-3984-17cd-a779d1e15a93", + new ThreatIntelligenceIndicatorModelForRequestBody() + .withKind(ThreatIntelligenceResourceKindEnum.INDICATOR) + .withThreatIntelligenceTags(Arrays.asList("new schema")) + .withSource("Azure Sentinel") + .withDisplayName("new schema") + .withDescription("debugging indicators") + .withPattern("[url:value = 'https://www.contoso.com']") + .withPatternType("url") + .withKillChainPhases(Arrays.asList()) + .withCreatedByRef("contoso@contoso.com") + .withExternalReferences(Arrays.asList()) + .withGranularMarkings(Arrays.asList()) + .withLabels(Arrays.asList()) + .withRevoked(false) + .withConfidence(78) + .withThreatTypes(Arrays.asList("compromised")) + .withValidFrom("2020-04-15T17:44:00.114052Z") + .withValidUntil("") + .withModified(""), + Context.NONE); + } +} +``` + +### ThreatIntelligenceIndicator_CreateIndicator + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModelForRequestBody; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceResourceKindEnum; +import java.util.Arrays; + +/** Samples for ThreatIntelligenceIndicator CreateIndicator. */ +public final class ThreatIntelligenceIndicatorCreateIndicatorSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/threatintelligence/CreateThreatIntelligence.json + */ + /** + * Sample code: Create a new Threat Intelligence. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createANewThreatIntelligence( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .threatIntelligenceIndicators() + .createIndicatorWithResponse( + "myRg", + "myWorkspace", + new ThreatIntelligenceIndicatorModelForRequestBody() + .withKind(ThreatIntelligenceResourceKindEnum.INDICATOR) + .withThreatIntelligenceTags(Arrays.asList("new schema")) + .withSource("Azure Sentinel") + .withDisplayName("new schema") + .withDescription("debugging indicators") + .withPattern("[url:value = 'https://www.contoso.com']") + .withPatternType("url") + .withKillChainPhases(Arrays.asList()) + .withCreatedByRef("contoso@contoso.com") + .withExternalReferences(Arrays.asList()) + .withGranularMarkings(Arrays.asList()) + .withLabels(Arrays.asList()) + .withRevoked(false) + .withConfidence(78) + .withThreatTypes(Arrays.asList("compromised")) + .withValidFrom("2021-09-15T17:44:00.114052Z") + .withValidUntil("") + .withModified(""), + Context.NONE); + } +} +``` + +### ThreatIntelligenceIndicator_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ThreatIntelligenceIndicator Delete. */ +public final class ThreatIntelligenceIndicatorDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/threatintelligence/DeleteThreatIntelligence.json + */ + /** + * Sample code: Delete a threat intelligence indicator. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAThreatIntelligenceIndicator( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .threatIntelligenceIndicators() + .deleteWithResponse("myRg", "myWorkspace", "d9cd6f0b-96b9-3984-17cd-a779d1e15a93", Context.NONE); + } +} +``` + +### ThreatIntelligenceIndicator_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ThreatIntelligenceIndicator Get. */ +public final class ThreatIntelligenceIndicatorGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/threatintelligence/GetThreatIntelligenceById.json + */ + /** + * Sample code: View a threat intelligence indicator by name. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void viewAThreatIntelligenceIndicatorByName( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .threatIntelligenceIndicators() + .getWithResponse("myRg", "myWorkspace", "e16ef847-962e-d7b6-9c8b-a33e4bd30e47", Context.NONE); + } +} +``` + +### ThreatIntelligenceIndicator_QueryIndicators + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceFilteringCriteria; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceSortingCriteria; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceSortingCriteriaEnum; +import java.util.Arrays; + +/** Samples for ThreatIntelligenceIndicator QueryIndicators. */ +public final class ThreatIntelligenceIndicatorQueryIndicatorsSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/threatintelligence/QueryThreatIntelligence.json + */ + /** + * Sample code: Query threat intelligence indicators as per filtering criteria. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void queryThreatIntelligenceIndicatorsAsPerFilteringCriteria( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .threatIntelligenceIndicators() + .queryIndicators( + "myRg", + "myWorkspace", + new ThreatIntelligenceFilteringCriteria() + .withPageSize(100) + .withMinConfidence(25) + .withMaxConfidence(80) + .withMinValidUntil("2021-04-05T17:44:00.114052Z") + .withMaxValidUntil("2021-04-25T17:44:00.114052Z") + .withSortBy( + Arrays + .asList( + new ThreatIntelligenceSortingCriteria() + .withItemKey("lastUpdatedTimeUtc") + .withSortOrder(ThreatIntelligenceSortingCriteriaEnum.DESCENDING))) + .withSources(Arrays.asList("Azure Sentinel")), + Context.NONE); + } +} +``` + +### ThreatIntelligenceIndicator_ReplaceTags + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModelForRequestBody; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceResourceKindEnum; +import java.util.Arrays; + +/** Samples for ThreatIntelligenceIndicator ReplaceTags. */ +public final class ThreatIntelligenceIndicatorReplaceTagsSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/threatintelligence/ReplaceTagsThreatIntelligence.json + */ + /** + * Sample code: Replace tags to a Threat Intelligence. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void replaceTagsToAThreatIntelligence( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .threatIntelligenceIndicators() + .replaceTagsWithResponse( + "myRg", + "myWorkspace", + "d9cd6f0b-96b9-3984-17cd-a779d1e15a93", + new ThreatIntelligenceIndicatorModelForRequestBody() + .withKind(ThreatIntelligenceResourceKindEnum.INDICATOR) + .withEtag("\"0000262c-0000-0800-0000-5e9767060000\"") + .withThreatIntelligenceTags(Arrays.asList("patching tags")), + Context.NONE); + } +} +``` + +### ThreatIntelligenceIndicatorMetrics_List + +```java +import com.azure.core.util.Context; + +/** Samples for ThreatIntelligenceIndicatorMetrics List. */ +public final class ThreatIntelligenceIndicatorMetricsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/threatintelligence/CollectThreatIntelligenceMetrics.json + */ + /** + * Sample code: Get threat intelligence indicators metrics. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getThreatIntelligenceIndicatorsMetrics( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.threatIntelligenceIndicatorMetrics().listWithResponse("myRg", "myWorkspace", Context.NONE); + } +} +``` + +### ThreatIntelligenceIndicatorsOperation_List + +```java +import com.azure.core.util.Context; + +/** Samples for ThreatIntelligenceIndicatorsOperation List. */ +public final class ThreatIntelligenceIndicatorsOperationListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/threatintelligence/GetThreatIntelligence.json + */ + /** + * Sample code: Get all threat intelligence indicators. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllThreatIntelligenceIndicators( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .threatIntelligenceIndicatorsOperations() + .list("myRg", "myWorkspace", null, null, null, null, Context.NONE); + } +} +``` + +### WatchlistItems_CreateOrUpdate + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** Samples for WatchlistItems CreateOrUpdate. */ +public final class WatchlistItemsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/watchlists/CreateWatchlistItem.json + */ + /** + * Sample code: Creates or updates a watchlist item. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAWatchlistItem( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) throws IOException { + manager + .watchlistItems() + .define("82ba292c-dc97-4dfc-969d-d4dd9e666842") + .withExistingWatchlist("myRg", "myWorkspace", "highValueAsset") + .withEtag("0300bf09-0000-0000-0000-5c37296e0000") + .withItemsKeyValue( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"Business tier\":\"10.0.2.0/24\",\"Data tier\":\"10.0.2.0/24\",\"Gateway" + + " subnet\":\"10.0.255.224/27\",\"Private DMZ in\":\"10.0.0.0/27\",\"Public DMZ" + + " out\":\"10.0.0.96/27\",\"Web Tier\":\"10.0.1.0/24\"}", + Object.class, + SerializerEncoding.JSON)) + .create(); + } +} +``` + +### WatchlistItems_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for WatchlistItems Delete. */ +public final class WatchlistItemsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/watchlists/DeleteWatchlistItem.json + */ + /** + * Sample code: Delete a watchlist Item. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAWatchlistItem( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .watchlistItems() + .deleteWithResponse( + "myRg", "myWorkspace", "highValueAsset", "4008512e-1d30-48b2-9ee2-d3612ed9d3ea", Context.NONE); + } +} +``` + +### WatchlistItems_Get + +```java +import com.azure.core.util.Context; + +/** Samples for WatchlistItems Get. */ +public final class WatchlistItemsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/watchlists/GetWatchlistItemById.json + */ + /** + * Sample code: Get a watchlist item. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAWatchlistItem(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .watchlistItems() + .getWithResponse( + "myRg", "myWorkspace", "highValueAsset", "3f8901fe-63d9-4875-9ad5-9fb3b8105797", Context.NONE); + } +} +``` + +### WatchlistItems_List + +```java +import com.azure.core.util.Context; + +/** Samples for WatchlistItems List. */ +public final class WatchlistItemsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/watchlists/GetWatchlistItems.json + */ + /** + * Sample code: Get all watchlist Items. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllWatchlistItems( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlistItems().list("myRg", "myWorkspace", "highValueAsset", Context.NONE); + } +} +``` + +### Watchlists_CreateOrUpdate + +```java +import com.azure.resourcemanager.securityinsights.models.Source; + +/** Samples for Watchlists CreateOrUpdate. */ +public final class WatchlistsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/watchlists/CreateWatchlistAndWatchlistItems.json + */ + /** + * Sample code: Creates or updates a watchlist and bulk creates watchlist items. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAWatchlistAndBulkCreatesWatchlistItems( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .watchlists() + .define("highValueAsset") + .withExistingWorkspace("myRg", "myWorkspace") + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDisplayName("High Value Assets Watchlist") + .withProvider("Microsoft") + .withSource(Source.LOCAL_FILE) + .withDescription("Watchlist from CSV content") + .withNumberOfLinesToSkip(1) + .withRawContent("This line will be skipped\nheader1,header2\nvalue1,value2") + .withItemsSearchKey("header1") + .withContentType("text/csv") + .create(); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/watchlists/CreateWatchlist.json + */ + /** + * Sample code: Creates or updates a watchlist. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAWatchlist( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .watchlists() + .define("highValueAsset") + .withExistingWorkspace("myRg", "myWorkspace") + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDisplayName("High Value Assets Watchlist") + .withProvider("Microsoft") + .withSource(Source.LOCAL_FILE) + .withDescription("Watchlist from CSV content") + .withItemsSearchKey("header1") + .create(); + } +} +``` + +### Watchlists_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Watchlists Delete. */ +public final class WatchlistsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/watchlists/DeleteWatchlist.json + */ + /** + * Sample code: Delete a watchlist. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAWatchlist(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlists().deleteWithResponse("myRg", "myWorkspace", "highValueAsset", Context.NONE); + } +} +``` + +### Watchlists_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Watchlists Get. */ +public final class WatchlistsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/watchlists/GetWatchlistByAlias.json + */ + /** + * Sample code: Get a watchlist. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAWatchlist(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlists().getWithResponse("myRg", "myWorkspace", "highValueAsset", Context.NONE); + } +} +``` + +### Watchlists_List + +```java +import com.azure.core.util.Context; + +/** Samples for Watchlists List. */ +public final class WatchlistsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/watchlists/GetWatchlists.json + */ + /** + * Sample code: Get all watchlists. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllWatchlists(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlists().list("myRg", "myWorkspace", Context.NONE); + } +} +``` + diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/pom.xml b/sdk/securityinsights/azure-resourcemanager-securityinsights/pom.xml new file mode 100644 index 000000000000..daef37e39edc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/pom.xml @@ -0,0 +1,81 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-securityinsights + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for SecurityInsights Management + This package contains Microsoft Azure SDK for SecurityInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2021-09. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + false + + + + + + com.azure + azure-core + 1.24.0 + + + com.azure + azure-core-management + 1.5.0 + + + + + + org.revapi + revapi-maven-plugin + 0.14.6 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + + diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/SecurityInsightsManager.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/SecurityInsightsManager.java new file mode 100644 index 000000000000..278e6696e8f0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/SecurityInsightsManager.java @@ -0,0 +1,625 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.SecurityInsights; +import com.azure.resourcemanager.securityinsights.implementation.ActionsImpl; +import com.azure.resourcemanager.securityinsights.implementation.AlertRuleTemplatesImpl; +import com.azure.resourcemanager.securityinsights.implementation.AlertRulesImpl; +import com.azure.resourcemanager.securityinsights.implementation.AutomationRulesImpl; +import com.azure.resourcemanager.securityinsights.implementation.BookmarkOperationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.BookmarkRelationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.BookmarksImpl; +import com.azure.resourcemanager.securityinsights.implementation.DataConnectorsCheckRequirementsOperationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.DataConnectorsImpl; +import com.azure.resourcemanager.securityinsights.implementation.DomainWhoisImpl; +import com.azure.resourcemanager.securityinsights.implementation.EntitiesGetTimelinesImpl; +import com.azure.resourcemanager.securityinsights.implementation.EntitiesImpl; +import com.azure.resourcemanager.securityinsights.implementation.EntitiesRelationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.EntityQueriesImpl; +import com.azure.resourcemanager.securityinsights.implementation.EntityQueryTemplatesImpl; +import com.azure.resourcemanager.securityinsights.implementation.EntityRelationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.IncidentCommentsImpl; +import com.azure.resourcemanager.securityinsights.implementation.IncidentRelationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.IncidentsImpl; +import com.azure.resourcemanager.securityinsights.implementation.IpGeodatasImpl; +import com.azure.resourcemanager.securityinsights.implementation.MetadatasImpl; +import com.azure.resourcemanager.securityinsights.implementation.OfficeConsentsImpl; +import com.azure.resourcemanager.securityinsights.implementation.OperationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.ProductSettingsImpl; +import com.azure.resourcemanager.securityinsights.implementation.SecurityInsightsBuilder; +import com.azure.resourcemanager.securityinsights.implementation.SentinelOnboardingStatesImpl; +import com.azure.resourcemanager.securityinsights.implementation.SourceControlsImpl; +import com.azure.resourcemanager.securityinsights.implementation.SourceControlsOperationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.ThreatIntelligenceIndicatorMetricsImpl; +import com.azure.resourcemanager.securityinsights.implementation.ThreatIntelligenceIndicatorsImpl; +import com.azure.resourcemanager.securityinsights.implementation.ThreatIntelligenceIndicatorsOperationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.WatchlistItemsImpl; +import com.azure.resourcemanager.securityinsights.implementation.WatchlistsImpl; +import com.azure.resourcemanager.securityinsights.models.Actions; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplates; +import com.azure.resourcemanager.securityinsights.models.AlertRules; +import com.azure.resourcemanager.securityinsights.models.AutomationRules; +import com.azure.resourcemanager.securityinsights.models.BookmarkOperations; +import com.azure.resourcemanager.securityinsights.models.BookmarkRelations; +import com.azure.resourcemanager.securityinsights.models.Bookmarks; +import com.azure.resourcemanager.securityinsights.models.DataConnectors; +import com.azure.resourcemanager.securityinsights.models.DataConnectorsCheckRequirementsOperations; +import com.azure.resourcemanager.securityinsights.models.DomainWhois; +import com.azure.resourcemanager.securityinsights.models.Entities; +import com.azure.resourcemanager.securityinsights.models.EntitiesGetTimelines; +import com.azure.resourcemanager.securityinsights.models.EntitiesRelations; +import com.azure.resourcemanager.securityinsights.models.EntityQueries; +import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplates; +import com.azure.resourcemanager.securityinsights.models.EntityRelations; +import com.azure.resourcemanager.securityinsights.models.IncidentComments; +import com.azure.resourcemanager.securityinsights.models.IncidentRelations; +import com.azure.resourcemanager.securityinsights.models.Incidents; +import com.azure.resourcemanager.securityinsights.models.IpGeodatas; +import com.azure.resourcemanager.securityinsights.models.Metadatas; +import com.azure.resourcemanager.securityinsights.models.OfficeConsents; +import com.azure.resourcemanager.securityinsights.models.Operations; +import com.azure.resourcemanager.securityinsights.models.ProductSettings; +import com.azure.resourcemanager.securityinsights.models.SentinelOnboardingStates; +import com.azure.resourcemanager.securityinsights.models.SourceControls; +import com.azure.resourcemanager.securityinsights.models.SourceControlsOperations; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorMetrics; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicators; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorsOperations; +import com.azure.resourcemanager.securityinsights.models.WatchlistItems; +import com.azure.resourcemanager.securityinsights.models.Watchlists; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to SecurityInsightsManager. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource + * provider. + */ +public final class SecurityInsightsManager { + private AlertRules alertRules; + + private Actions actions; + + private AlertRuleTemplates alertRuleTemplates; + + private AutomationRules automationRules; + + private Bookmarks bookmarks; + + private BookmarkRelations bookmarkRelations; + + private BookmarkOperations bookmarkOperations; + + private IpGeodatas ipGeodatas; + + private DomainWhois domainWhois; + + private EntityQueries entityQueries; + + private Entities entities; + + private EntitiesGetTimelines entitiesGetTimelines; + + private EntitiesRelations entitiesRelations; + + private EntityRelations entityRelations; + + private Incidents incidents; + + private IncidentComments incidentComments; + + private IncidentRelations incidentRelations; + + private Metadatas metadatas; + + private SentinelOnboardingStates sentinelOnboardingStates; + + private ProductSettings productSettings; + + private SourceControls sourceControls; + + private SourceControlsOperations sourceControlsOperations; + + private Watchlists watchlists; + + private WatchlistItems watchlistItems; + + private DataConnectors dataConnectors; + + private DataConnectorsCheckRequirementsOperations dataConnectorsCheckRequirementsOperations; + + private ThreatIntelligenceIndicators threatIntelligenceIndicators; + + private ThreatIntelligenceIndicatorsOperations threatIntelligenceIndicatorsOperations; + + private ThreatIntelligenceIndicatorMetrics threatIntelligenceIndicatorMetrics; + + private Operations operations; + + private OfficeConsents officeConsents; + + private EntityQueryTemplates entityQueryTemplates; + + private final SecurityInsights clientObject; + + private SecurityInsightsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new SecurityInsightsBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of SecurityInsights service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the SecurityInsights service API instance. + */ + public static SecurityInsightsManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create SecurityInsightsManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new SecurityInsightsManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of SecurityInsights service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the SecurityInsights service API instance. + */ + public SecurityInsightsManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.securityinsights") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new SecurityInsightsManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of AlertRules. */ + public AlertRules alertRules() { + if (this.alertRules == null) { + this.alertRules = new AlertRulesImpl(clientObject.getAlertRules(), this); + } + return alertRules; + } + + /** @return Resource collection API of Actions. */ + public Actions actions() { + if (this.actions == null) { + this.actions = new ActionsImpl(clientObject.getActions(), this); + } + return actions; + } + + /** @return Resource collection API of AlertRuleTemplates. */ + public AlertRuleTemplates alertRuleTemplates() { + if (this.alertRuleTemplates == null) { + this.alertRuleTemplates = new AlertRuleTemplatesImpl(clientObject.getAlertRuleTemplates(), this); + } + return alertRuleTemplates; + } + + /** @return Resource collection API of AutomationRules. */ + public AutomationRules automationRules() { + if (this.automationRules == null) { + this.automationRules = new AutomationRulesImpl(clientObject.getAutomationRules(), this); + } + return automationRules; + } + + /** @return Resource collection API of Bookmarks. */ + public Bookmarks bookmarks() { + if (this.bookmarks == null) { + this.bookmarks = new BookmarksImpl(clientObject.getBookmarks(), this); + } + return bookmarks; + } + + /** @return Resource collection API of BookmarkRelations. */ + public BookmarkRelations bookmarkRelations() { + if (this.bookmarkRelations == null) { + this.bookmarkRelations = new BookmarkRelationsImpl(clientObject.getBookmarkRelations(), this); + } + return bookmarkRelations; + } + + /** @return Resource collection API of BookmarkOperations. */ + public BookmarkOperations bookmarkOperations() { + if (this.bookmarkOperations == null) { + this.bookmarkOperations = new BookmarkOperationsImpl(clientObject.getBookmarkOperations(), this); + } + return bookmarkOperations; + } + + /** @return Resource collection API of IpGeodatas. */ + public IpGeodatas ipGeodatas() { + if (this.ipGeodatas == null) { + this.ipGeodatas = new IpGeodatasImpl(clientObject.getIpGeodatas(), this); + } + return ipGeodatas; + } + + /** @return Resource collection API of DomainWhois. */ + public DomainWhois domainWhois() { + if (this.domainWhois == null) { + this.domainWhois = new DomainWhoisImpl(clientObject.getDomainWhois(), this); + } + return domainWhois; + } + + /** @return Resource collection API of EntityQueries. */ + public EntityQueries entityQueries() { + if (this.entityQueries == null) { + this.entityQueries = new EntityQueriesImpl(clientObject.getEntityQueries(), this); + } + return entityQueries; + } + + /** @return Resource collection API of Entities. */ + public Entities entities() { + if (this.entities == null) { + this.entities = new EntitiesImpl(clientObject.getEntities(), this); + } + return entities; + } + + /** @return Resource collection API of EntitiesGetTimelines. */ + public EntitiesGetTimelines entitiesGetTimelines() { + if (this.entitiesGetTimelines == null) { + this.entitiesGetTimelines = new EntitiesGetTimelinesImpl(clientObject.getEntitiesGetTimelines(), this); + } + return entitiesGetTimelines; + } + + /** @return Resource collection API of EntitiesRelations. */ + public EntitiesRelations entitiesRelations() { + if (this.entitiesRelations == null) { + this.entitiesRelations = new EntitiesRelationsImpl(clientObject.getEntitiesRelations(), this); + } + return entitiesRelations; + } + + /** @return Resource collection API of EntityRelations. */ + public EntityRelations entityRelations() { + if (this.entityRelations == null) { + this.entityRelations = new EntityRelationsImpl(clientObject.getEntityRelations(), this); + } + return entityRelations; + } + + /** @return Resource collection API of Incidents. */ + public Incidents incidents() { + if (this.incidents == null) { + this.incidents = new IncidentsImpl(clientObject.getIncidents(), this); + } + return incidents; + } + + /** @return Resource collection API of IncidentComments. */ + public IncidentComments incidentComments() { + if (this.incidentComments == null) { + this.incidentComments = new IncidentCommentsImpl(clientObject.getIncidentComments(), this); + } + return incidentComments; + } + + /** @return Resource collection API of IncidentRelations. */ + public IncidentRelations incidentRelations() { + if (this.incidentRelations == null) { + this.incidentRelations = new IncidentRelationsImpl(clientObject.getIncidentRelations(), this); + } + return incidentRelations; + } + + /** @return Resource collection API of Metadatas. */ + public Metadatas metadatas() { + if (this.metadatas == null) { + this.metadatas = new MetadatasImpl(clientObject.getMetadatas(), this); + } + return metadatas; + } + + /** @return Resource collection API of SentinelOnboardingStates. */ + public SentinelOnboardingStates sentinelOnboardingStates() { + if (this.sentinelOnboardingStates == null) { + this.sentinelOnboardingStates = + new SentinelOnboardingStatesImpl(clientObject.getSentinelOnboardingStates(), this); + } + return sentinelOnboardingStates; + } + + /** @return Resource collection API of ProductSettings. */ + public ProductSettings productSettings() { + if (this.productSettings == null) { + this.productSettings = new ProductSettingsImpl(clientObject.getProductSettings(), this); + } + return productSettings; + } + + /** @return Resource collection API of SourceControls. */ + public SourceControls sourceControls() { + if (this.sourceControls == null) { + this.sourceControls = new SourceControlsImpl(clientObject.getSourceControls(), this); + } + return sourceControls; + } + + /** @return Resource collection API of SourceControlsOperations. */ + public SourceControlsOperations sourceControlsOperations() { + if (this.sourceControlsOperations == null) { + this.sourceControlsOperations = + new SourceControlsOperationsImpl(clientObject.getSourceControlsOperations(), this); + } + return sourceControlsOperations; + } + + /** @return Resource collection API of Watchlists. */ + public Watchlists watchlists() { + if (this.watchlists == null) { + this.watchlists = new WatchlistsImpl(clientObject.getWatchlists(), this); + } + return watchlists; + } + + /** @return Resource collection API of WatchlistItems. */ + public WatchlistItems watchlistItems() { + if (this.watchlistItems == null) { + this.watchlistItems = new WatchlistItemsImpl(clientObject.getWatchlistItems(), this); + } + return watchlistItems; + } + + /** @return Resource collection API of DataConnectors. */ + public DataConnectors dataConnectors() { + if (this.dataConnectors == null) { + this.dataConnectors = new DataConnectorsImpl(clientObject.getDataConnectors(), this); + } + return dataConnectors; + } + + /** @return Resource collection API of DataConnectorsCheckRequirementsOperations. */ + public DataConnectorsCheckRequirementsOperations dataConnectorsCheckRequirementsOperations() { + if (this.dataConnectorsCheckRequirementsOperations == null) { + this.dataConnectorsCheckRequirementsOperations = + new DataConnectorsCheckRequirementsOperationsImpl( + clientObject.getDataConnectorsCheckRequirementsOperations(), this); + } + return dataConnectorsCheckRequirementsOperations; + } + + /** @return Resource collection API of ThreatIntelligenceIndicators. */ + public ThreatIntelligenceIndicators threatIntelligenceIndicators() { + if (this.threatIntelligenceIndicators == null) { + this.threatIntelligenceIndicators = + new ThreatIntelligenceIndicatorsImpl(clientObject.getThreatIntelligenceIndicators(), this); + } + return threatIntelligenceIndicators; + } + + /** @return Resource collection API of ThreatIntelligenceIndicatorsOperations. */ + public ThreatIntelligenceIndicatorsOperations threatIntelligenceIndicatorsOperations() { + if (this.threatIntelligenceIndicatorsOperations == null) { + this.threatIntelligenceIndicatorsOperations = + new ThreatIntelligenceIndicatorsOperationsImpl( + clientObject.getThreatIntelligenceIndicatorsOperations(), this); + } + return threatIntelligenceIndicatorsOperations; + } + + /** @return Resource collection API of ThreatIntelligenceIndicatorMetrics. */ + public ThreatIntelligenceIndicatorMetrics threatIntelligenceIndicatorMetrics() { + if (this.threatIntelligenceIndicatorMetrics == null) { + this.threatIntelligenceIndicatorMetrics = + new ThreatIntelligenceIndicatorMetricsImpl(clientObject.getThreatIntelligenceIndicatorMetrics(), this); + } + return threatIntelligenceIndicatorMetrics; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of OfficeConsents. */ + public OfficeConsents officeConsents() { + if (this.officeConsents == null) { + this.officeConsents = new OfficeConsentsImpl(clientObject.getOfficeConsents(), this); + } + return officeConsents; + } + + /** @return Resource collection API of EntityQueryTemplates. */ + public EntityQueryTemplates entityQueryTemplates() { + if (this.entityQueryTemplates == null) { + this.entityQueryTemplates = new EntityQueryTemplatesImpl(clientObject.getEntityQueryTemplates(), this); + } + return entityQueryTemplates; + } + + /** + * @return Wrapped service client SecurityInsights providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + */ + public SecurityInsights serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ActionsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ActionsClient.java new file mode 100644 index 000000000000..da2168fd8f3d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ActionsClient.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.ActionResponseInner; +import com.azure.resourcemanager.securityinsights.models.ActionRequest; + +/** An instance of this class provides access to all the operations defined in ActionsClient. */ +public interface ActionsClient { + /** + * Gets all actions of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all actions of alert rule. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByAlertRule(String resourceGroupName, String workspaceName, String ruleId); + + /** + * Gets all actions of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all actions of alert rule. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByAlertRule( + String resourceGroupName, String workspaceName, String ruleId, Context context); + + /** + * Gets the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the action of alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ActionResponseInner get(String resourceGroupName, String workspaceName, String ruleId, String actionId); + + /** + * Gets the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the action of alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String ruleId, String actionId, Context context); + + /** + * Creates or updates the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @param action The action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return action for alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ActionResponseInner createOrUpdate( + String resourceGroupName, String workspaceName, String ruleId, String actionId, ActionRequest action); + + /** + * Creates or updates the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @param action The action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return action for alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String ruleId, + String actionId, + ActionRequest action, + Context context); + + /** + * Delete the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String ruleId, String actionId); + + /** + * Delete the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String ruleId, String actionId, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/AlertRuleTemplatesClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/AlertRuleTemplatesClient.java new file mode 100644 index 000000000000..51ed485e1fbc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/AlertRuleTemplatesClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; + +/** An instance of this class provides access to all the operations defined in AlertRuleTemplatesClient. */ +public interface AlertRuleTemplatesClient { + /** + * Gets all alert rule templates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all alert rule templates. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all alert rule templates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all alert rule templates. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets the alert rule template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param alertRuleTemplateId Alert rule template ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the alert rule template. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AlertRuleTemplateInner get(String resourceGroupName, String workspaceName, String alertRuleTemplateId); + + /** + * Gets the alert rule template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param alertRuleTemplateId Alert rule template ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the alert rule template. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String alertRuleTemplateId, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/AlertRulesClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/AlertRulesClient.java new file mode 100644 index 000000000000..62111057e2ca --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/AlertRulesClient.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; + +/** An instance of this class provides access to all the operations defined in AlertRulesClient. */ +public interface AlertRulesClient { + /** + * Gets all alert rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all alert rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all alert rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all alert rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AlertRuleInner get(String resourceGroupName, String workspaceName, String ruleId); + + /** + * Gets the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String ruleId, Context context); + + /** + * Creates or updates the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param alertRule The alert rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AlertRuleInner createOrUpdate( + String resourceGroupName, String workspaceName, String ruleId, AlertRuleInner alertRule); + + /** + * Creates or updates the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param alertRule The alert rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String workspaceName, String ruleId, AlertRuleInner alertRule, Context context); + + /** + * Delete the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String ruleId); + + /** + * Delete the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String workspaceName, String ruleId, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/AutomationRulesClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/AutomationRulesClient.java new file mode 100644 index 000000000000..9f7dfc343346 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/AutomationRulesClient.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.AutomationRuleInner; + +/** An instance of this class provides access to all the operations defined in AutomationRulesClient. */ +public interface AutomationRulesClient { + /** + * Gets all automation rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all automation rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all automation rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all automation rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the automation rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AutomationRuleInner get(String resourceGroupName, String workspaceName, String automationRuleId); + + /** + * Gets the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the automation rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String automationRuleId, Context context); + + /** + * Creates or updates the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @param automationRule The automation rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an automation rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AutomationRuleInner createOrUpdate( + String resourceGroupName, String workspaceName, String automationRuleId, AutomationRuleInner automationRule); + + /** + * Creates or updates the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @param automationRule The automation rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an automation rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String automationRuleId, + AutomationRuleInner automationRule, + Context context); + + /** + * Delete the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String automationRuleId); + + /** + * Delete the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String automationRuleId, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BookmarkOperationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BookmarkOperationsClient.java new file mode 100644 index 000000000000..3990b655bda7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BookmarkOperationsClient.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.BookmarkExpandResponseInner; +import com.azure.resourcemanager.securityinsights.models.BookmarkExpandParameters; + +/** An instance of this class provides access to all the operations defined in BookmarkOperationsClient. */ +public interface BookmarkOperationsClient { + /** + * Expand an bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param parameters The parameters required to execute an expand operation on the given bookmark. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity expansion result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BookmarkExpandResponseInner expand( + String resourceGroupName, String workspaceName, String bookmarkId, BookmarkExpandParameters parameters); + + /** + * Expand an bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param parameters The parameters required to execute an expand operation on the given bookmark. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity expansion result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response expandWithResponse( + String resourceGroupName, + String workspaceName, + String bookmarkId, + BookmarkExpandParameters parameters, + Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BookmarkRelationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BookmarkRelationsClient.java new file mode 100644 index 000000000000..342609056f32 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BookmarkRelationsClient.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; + +/** An instance of this class provides access to all the operations defined in BookmarkRelationsClient. */ +public interface BookmarkRelationsClient { + /** + * Gets all bookmark relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all bookmark relations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String bookmarkId); + + /** + * Gets all bookmark relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all bookmark relations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String workspaceName, + String bookmarkId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context); + + /** + * Gets a bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a bookmark relation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RelationInner get(String resourceGroupName, String workspaceName, String bookmarkId, String relationName); + + /** + * Gets a bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a bookmark relation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String bookmarkId, String relationName, Context context); + + /** + * Creates the bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @param relation The relation model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a relation between two resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RelationInner createOrUpdate( + String resourceGroupName, String workspaceName, String bookmarkId, String relationName, RelationInner relation); + + /** + * Creates the bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @param relation The relation model. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a relation between two resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String bookmarkId, + String relationName, + RelationInner relation, + Context context); + + /** + * Delete the bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String bookmarkId, String relationName); + + /** + * Delete the bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String bookmarkId, String relationName, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BookmarksClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BookmarksClient.java new file mode 100644 index 000000000000..e39bc994fc12 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BookmarksClient.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.BookmarkInner; + +/** An instance of this class provides access to all the operations defined in BookmarksClient. */ +public interface BookmarksClient { + /** + * Gets all bookmarks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all bookmarks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all bookmarks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all bookmarks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets a bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a bookmark. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BookmarkInner get(String resourceGroupName, String workspaceName, String bookmarkId); + + /** + * Gets a bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a bookmark. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String bookmarkId, Context context); + + /** + * Creates or updates the bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param bookmark The bookmark. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a bookmark in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BookmarkInner createOrUpdate( + String resourceGroupName, String workspaceName, String bookmarkId, BookmarkInner bookmark); + + /** + * Creates or updates the bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param bookmark The bookmark. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a bookmark in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String workspaceName, String bookmarkId, BookmarkInner bookmark, Context context); + + /** + * Delete the bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String bookmarkId); + + /** + * Delete the bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String bookmarkId, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/DataConnectorsCheckRequirementsOperationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/DataConnectorsCheckRequirementsOperationsClient.java new file mode 100644 index 000000000000..a98aa56ff1ba --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/DataConnectorsCheckRequirementsOperationsClient.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorRequirementsStateInner; +import com.azure.resourcemanager.securityinsights.models.DataConnectorsCheckRequirements; + +/** + * An instance of this class provides access to all the operations defined in + * DataConnectorsCheckRequirementsOperationsClient. + */ +public interface DataConnectorsCheckRequirementsOperationsClient { + /** + * Get requirements state for a data connector type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorsCheckRequirements The parameters for requirements check message. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return requirements state for a data connector type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataConnectorRequirementsStateInner post( + String resourceGroupName, + String workspaceName, + DataConnectorsCheckRequirements dataConnectorsCheckRequirements); + + /** + * Get requirements state for a data connector type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorsCheckRequirements The parameters for requirements check message. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return requirements state for a data connector type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response postWithResponse( + String resourceGroupName, + String workspaceName, + DataConnectorsCheckRequirements dataConnectorsCheckRequirements, + Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/DataConnectorsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/DataConnectorsClient.java new file mode 100644 index 000000000000..9707fd6a8b76 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/DataConnectorsClient.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.models.DataConnectorConnectBody; + +/** An instance of this class provides access to all the operations defined in DataConnectorsClient. */ +public interface DataConnectorsClient { + /** + * Gets all data connectors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all data connectors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all data connectors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all data connectors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a data connector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataConnectorInner get(String resourceGroupName, String workspaceName, String dataConnectorId); + + /** + * Gets a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a data connector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String dataConnectorId, Context context); + + /** + * Creates or updates the data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param dataConnector The data connector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data connector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataConnectorInner createOrUpdate( + String resourceGroupName, String workspaceName, String dataConnectorId, DataConnectorInner dataConnector); + + /** + * Creates or updates the data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param dataConnector The data connector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data connector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String dataConnectorId, + DataConnectorInner dataConnector, + Context context); + + /** + * Delete the data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String dataConnectorId); + + /** + * Delete the data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String dataConnectorId, Context context); + + /** + * Connects a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param connectBody The data connector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void connect( + String resourceGroupName, String workspaceName, String dataConnectorId, DataConnectorConnectBody connectBody); + + /** + * Connects a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param connectBody The data connector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response connectWithResponse( + String resourceGroupName, + String workspaceName, + String dataConnectorId, + DataConnectorConnectBody connectBody, + Context context); + + /** + * Disconnect a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void disconnect(String resourceGroupName, String workspaceName, String dataConnectorId); + + /** + * Disconnect a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response disconnectWithResponse( + String resourceGroupName, String workspaceName, String dataConnectorId, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/DomainWhoisClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/DomainWhoisClient.java new file mode 100644 index 000000000000..adb76edf2f2e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/DomainWhoisClient.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentDomainWhoisInner; + +/** An instance of this class provides access to all the operations defined in DomainWhoisClient. */ +public interface DomainWhoisClient { + /** + * Get whois information for a single domain name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param domain Domain name to be enriched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whois information for a single domain name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EnrichmentDomainWhoisInner get(String resourceGroupName, String domain); + + /** + * Get whois information for a single domain name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param domain Domain name to be enriched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whois information for a single domain name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String domain, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntitiesClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntitiesClient.java new file mode 100644 index 000000000000..da3d59821bf0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntitiesClient.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityExpandResponseInner; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityGetInsightsResponseInner; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.azure.resourcemanager.securityinsights.fluent.models.GetQueriesResponseInner; +import com.azure.resourcemanager.securityinsights.models.EntityExpandParameters; +import com.azure.resourcemanager.securityinsights.models.EntityGetInsightsParameters; +import com.azure.resourcemanager.securityinsights.models.EntityItemQueryKind; + +/** An instance of this class provides access to all the operations defined in EntitiesClient. */ +public interface EntitiesClient { + /** + * Gets all entities. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all entities. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EntityInner get(String resourceGroupName, String workspaceName, String entityId); + + /** + * Gets an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String entityId, Context context); + + /** + * Expands an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute an expand operation on the given entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity expansion result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EntityExpandResponseInner expand( + String resourceGroupName, String workspaceName, String entityId, EntityExpandParameters parameters); + + /** + * Expands an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute an expand operation on the given entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity expansion result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response expandWithResponse( + String resourceGroupName, + String workspaceName, + String entityId, + EntityExpandParameters parameters, + Context context); + + /** + * Get Insights and Activities for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param kind The Kind parameter for queries. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return insights and Activities for an entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GetQueriesResponseInner queries( + String resourceGroupName, String workspaceName, String entityId, EntityItemQueryKind kind); + + /** + * Get Insights and Activities for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param kind The Kind parameter for queries. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return insights and Activities for an entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response queriesWithResponse( + String resourceGroupName, String workspaceName, String entityId, EntityItemQueryKind kind, Context context); + + /** + * Execute Insights for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute insights on the given entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Get Insights result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EntityGetInsightsResponseInner getInsights( + String resourceGroupName, String workspaceName, String entityId, EntityGetInsightsParameters parameters); + + /** + * Execute Insights for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute insights on the given entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Get Insights result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getInsightsWithResponse( + String resourceGroupName, + String workspaceName, + String entityId, + EntityGetInsightsParameters parameters, + Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntitiesGetTimelinesClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntitiesGetTimelinesClient.java new file mode 100644 index 000000000000..02d19b27ed21 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntitiesGetTimelinesClient.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityTimelineResponseInner; +import com.azure.resourcemanager.securityinsights.models.EntityTimelineParameters; + +/** An instance of this class provides access to all the operations defined in EntitiesGetTimelinesClient. */ +public interface EntitiesGetTimelinesClient { + /** + * Timeline for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute an timeline operation on the given entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity timeline result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EntityTimelineResponseInner list( + String resourceGroupName, String workspaceName, String entityId, EntityTimelineParameters parameters); + + /** + * Timeline for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute an timeline operation on the given entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity timeline result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, + String workspaceName, + String entityId, + EntityTimelineParameters parameters, + Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntitiesRelationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntitiesRelationsClient.java new file mode 100644 index 000000000000..87e689d8d2ac --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntitiesRelationsClient.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; + +/** An instance of this class provides access to all the operations defined in EntitiesRelationsClient. */ +public interface EntitiesRelationsClient { + /** + * Gets all relations of an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all relations of an entity. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String entityId); + + /** + * Gets all relations of an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all relations of an entity. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String workspaceName, + String entityId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntityQueriesClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntityQueriesClient.java new file mode 100644 index 000000000000..ccdda823e5a6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntityQueriesClient.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryInner; +import com.azure.resourcemanager.securityinsights.models.CustomEntityQuery; +import com.azure.resourcemanager.securityinsights.models.EntityQueriesKind; + +/** An instance of this class provides access to all the operations defined in EntityQueriesClient. */ +public interface EntityQueriesClient { + /** + * Gets all entity queries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entity queries. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all entity queries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kind The entity query kind we want to fetch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entity queries. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName, EntityQueriesKind kind, Context context); + + /** + * Gets an entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EntityQueryInner get(String resourceGroupName, String workspaceName, String entityQueryId); + + /** + * Gets an entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String entityQueryId, Context context); + + /** + * Creates or updates the entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @param entityQuery The entity query we want to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific entity query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EntityQueryInner createOrUpdate( + String resourceGroupName, String workspaceName, String entityQueryId, CustomEntityQuery entityQuery); + + /** + * Creates or updates the entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @param entityQuery The entity query we want to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific entity query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String entityQueryId, + CustomEntityQuery entityQuery, + Context context); + + /** + * Delete the entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String entityQueryId); + + /** + * Delete the entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String entityQueryId, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntityQueryTemplatesClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntityQueryTemplatesClient.java new file mode 100644 index 000000000000..eb7e2034c46f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntityQueryTemplatesClient.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryTemplateInner; +import com.azure.resourcemanager.securityinsights.models.Constant69; + +/** An instance of this class provides access to all the operations defined in EntityQueryTemplatesClient. */ +public interface EntityQueryTemplatesClient { + /** + * Gets all entity query templates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entity query templates. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all entity query templates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kind The entity template query kind we want to fetch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entity query templates. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName, Constant69 kind, Context context); + + /** + * Gets an entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryTemplateId entity query template ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EntityQueryTemplateInner get(String resourceGroupName, String workspaceName, String entityQueryTemplateId); + + /** + * Gets an entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryTemplateId entity query template ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String entityQueryTemplateId, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntityRelationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntityRelationsClient.java new file mode 100644 index 000000000000..7b97f17e69b7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntityRelationsClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; + +/** An instance of this class provides access to all the operations defined in EntityRelationsClient. */ +public interface EntityRelationsClient { + /** + * Gets an entity relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity relation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RelationInner getRelation(String resourceGroupName, String workspaceName, String entityId, String relationName); + + /** + * Gets an entity relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param relationName Relation Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity relation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getRelationWithResponse( + String resourceGroupName, String workspaceName, String entityId, String relationName, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IncidentCommentsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IncidentCommentsClient.java new file mode 100644 index 000000000000..6f378c19e397 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IncidentCommentsClient.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentCommentInner; + +/** An instance of this class provides access to all the operations defined in IncidentCommentsClient. */ +public interface IncidentCommentsClient { + /** + * Gets all incident comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident comments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String incidentId); + + /** + * Gets all incident comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident comments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String workspaceName, + String incidentId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context); + + /** + * Gets an incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident comment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IncidentCommentInner get( + String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId); + + /** + * Gets an incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident comment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId, Context context); + + /** + * Creates or updates the incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @param incidentComment The incident comment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an incident comment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IncidentCommentInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String incidentId, + String incidentCommentId, + IncidentCommentInner incidentComment); + + /** + * Creates or updates the incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @param incidentComment The incident comment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an incident comment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String incidentId, + String incidentCommentId, + IncidentCommentInner incidentComment, + Context context); + + /** + * Delete the incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId); + + /** + * Delete the incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IncidentRelationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IncidentRelationsClient.java new file mode 100644 index 000000000000..7f2a7b005386 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IncidentRelationsClient.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; + +/** An instance of this class provides access to all the operations defined in IncidentRelationsClient. */ +public interface IncidentRelationsClient { + /** + * Gets all incident relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident relations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String incidentId); + + /** + * Gets all incident relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident relations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String workspaceName, + String incidentId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context); + + /** + * Gets an incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident relation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RelationInner get(String resourceGroupName, String workspaceName, String incidentId, String relationName); + + /** + * Gets an incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident relation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String incidentId, String relationName, Context context); + + /** + * Creates or updates the incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @param relation The relation model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a relation between two resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RelationInner createOrUpdate( + String resourceGroupName, String workspaceName, String incidentId, String relationName, RelationInner relation); + + /** + * Creates or updates the incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @param relation The relation model. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a relation between two resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String incidentId, + String relationName, + RelationInner relation, + Context context); + + /** + * Delete the incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String incidentId, String relationName); + + /** + * Delete the incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String incidentId, String relationName, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IncidentsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IncidentsClient.java new file mode 100644 index 000000000000..57e5a7d13438 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IncidentsClient.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentAlertListInner; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentBookmarkListInner; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentEntitiesResponseInner; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentInner; +import com.azure.resourcemanager.securityinsights.fluent.models.TeamInformationInner; +import com.azure.resourcemanager.securityinsights.models.TeamProperties; + +/** An instance of this class provides access to all the operations defined in IncidentsClient. */ +public interface IncidentsClient { + /** + * Gets all incidents. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incidents. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all incidents. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incidents. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String workspaceName, + String filter, + String orderby, + Integer top, + String skipToken, + Context context); + + /** + * Gets an incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IncidentInner get(String resourceGroupName, String workspaceName, String incidentId); + + /** + * Gets an incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String incidentId, Context context); + + /** + * Creates or updates the incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incident The incident. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an incident in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IncidentInner createOrUpdate( + String resourceGroupName, String workspaceName, String incidentId, IncidentInner incident); + + /** + * Creates or updates the incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incident The incident. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an incident in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String workspaceName, String incidentId, IncidentInner incident, Context context); + + /** + * Delete the incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String incidentId); + + /** + * Delete the incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String incidentId, Context context); + + /** + * Creates a Microsoft team to investigate the incident by sharing information and insights between participants. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param teamProperties Team properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes team information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TeamInformationInner createTeam( + String resourceGroupName, String workspaceName, String incidentId, TeamProperties teamProperties); + + /** + * Creates a Microsoft team to investigate the incident by sharing information and insights between participants. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param teamProperties Team properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes team information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createTeamWithResponse( + String resourceGroupName, + String workspaceName, + String incidentId, + TeamProperties teamProperties, + Context context); + + /** + * Gets all incident alerts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident alerts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IncidentAlertListInner listAlerts(String resourceGroupName, String workspaceName, String incidentId); + + /** + * Gets all incident alerts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident alerts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAlertsWithResponse( + String resourceGroupName, String workspaceName, String incidentId, Context context); + + /** + * Gets all incident bookmarks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident bookmarks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IncidentBookmarkListInner listBookmarks(String resourceGroupName, String workspaceName, String incidentId); + + /** + * Gets all incident bookmarks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident bookmarks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listBookmarksWithResponse( + String resourceGroupName, String workspaceName, String incidentId, Context context); + + /** + * Gets all incident related entities. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident related entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IncidentEntitiesResponseInner listEntities(String resourceGroupName, String workspaceName, String incidentId); + + /** + * Gets all incident related entities. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident related entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listEntitiesWithResponse( + String resourceGroupName, String workspaceName, String incidentId, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IpGeodatasClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IpGeodatasClient.java new file mode 100644 index 000000000000..7149b8d6e56b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IpGeodatasClient.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentIpGeodataInner; + +/** An instance of this class provides access to all the operations defined in IpGeodatasClient. */ +public interface IpGeodatasClient { + /** + * Get geodata for a single IP address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipAddress IP address (v4 or v6) to be enriched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return geodata for a single IP address. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EnrichmentIpGeodataInner get(String resourceGroupName, String ipAddress); + + /** + * Get geodata for a single IP address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipAddress IP address (v4 or v6) to be enriched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return geodata for a single IP address. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String ipAddress, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/MetadatasClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/MetadatasClient.java new file mode 100644 index 000000000000..eb8b02afc249 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/MetadatasClient.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.MetadataModelInner; +import com.azure.resourcemanager.securityinsights.models.MetadataPatch; + +/** An instance of this class provides access to all the operations defined in MetadatasClient. */ +public interface MetadatasClient { + /** + * List of all metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the metadata. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * List of all metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skip Used to skip n elements in the OData query (offset). Returns a nextLink to the next page of results + * if there are any left. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the metadata. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String workspaceName, + String filter, + String orderby, + Integer top, + Integer skip, + Context context); + + /** + * Get a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Metadata. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MetadataModelInner get(String resourceGroupName, String workspaceName, String metadataName); + + /** + * Get a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Metadata. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String metadataName, Context context); + + /** + * Delete a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String metadataName); + + /** + * Delete a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String metadataName, Context context); + + /** + * Create a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @param metadata Metadata resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return metadata resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MetadataModelInner create( + String resourceGroupName, String workspaceName, String metadataName, MetadataModelInner metadata); + + /** + * Create a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @param metadata Metadata resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return metadata resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String workspaceName, + String metadataName, + MetadataModelInner metadata, + Context context); + + /** + * Update an existing Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @param metadataPatch Partial metadata request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return metadata resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MetadataModelInner update( + String resourceGroupName, String workspaceName, String metadataName, MetadataPatch metadataPatch); + + /** + * Update an existing Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @param metadataPatch Partial metadata request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return metadata resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String workspaceName, + String metadataName, + MetadataPatch metadataPatch, + Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/OfficeConsentsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/OfficeConsentsClient.java new file mode 100644 index 000000000000..06937ee03715 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/OfficeConsentsClient.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficeConsentInner; + +/** An instance of this class provides access to all the operations defined in OfficeConsentsClient. */ +public interface OfficeConsentsClient { + /** + * Gets all office365 consents. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all office365 consents. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all office365 consents. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all office365 consents. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets an office365 consent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param consentId consent ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an office365 consent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OfficeConsentInner get(String resourceGroupName, String workspaceName, String consentId); + + /** + * Gets an office365 consent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param consentId consent ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an office365 consent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String consentId, Context context); + + /** + * Delete the office365 consent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param consentId consent ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String consentId); + + /** + * Delete the office365 consent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param consentId consent ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String consentId, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/OperationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/OperationsClient.java new file mode 100644 index 000000000000..86e89630ed8a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all operations available Azure Security Insights Resource Provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists the operations available in the SecurityInsights RP. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all operations available Azure Security Insights Resource Provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists the operations available in the SecurityInsights RP. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductSettingsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductSettingsClient.java new file mode 100644 index 000000000000..c8c2c3f84c35 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductSettingsClient.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.SettingListInner; +import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; + +/** An instance of this class provides access to all the operations defined in ProductSettingsClient. */ +public interface ProductSettingsClient { + /** + * List of all the settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SettingListInner list(String resourceGroupName, String workspaceName); + + /** + * List of all the settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets a setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a setting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SettingsInner get(String resourceGroupName, String workspaceName, String settingsName); + + /** + * Gets a setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a setting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String settingsName, Context context); + + /** + * Delete setting of the product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String settingsName); + + /** + * Delete setting of the product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String settingsName, Context context); + + /** + * Updates setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @param settings The setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Setting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SettingsInner update(String resourceGroupName, String workspaceName, String settingsName, SettingsInner settings); + + /** + * Updates setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @param settings The setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Setting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String workspaceName, String settingsName, SettingsInner settings, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SecurityInsights.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SecurityInsights.java new file mode 100644 index 000000000000..05ffac3147e8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SecurityInsights.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for SecurityInsights class. */ +public interface SecurityInsights { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the AlertRulesClient object to access its operations. + * + * @return the AlertRulesClient object. + */ + AlertRulesClient getAlertRules(); + + /** + * Gets the ActionsClient object to access its operations. + * + * @return the ActionsClient object. + */ + ActionsClient getActions(); + + /** + * Gets the AlertRuleTemplatesClient object to access its operations. + * + * @return the AlertRuleTemplatesClient object. + */ + AlertRuleTemplatesClient getAlertRuleTemplates(); + + /** + * Gets the AutomationRulesClient object to access its operations. + * + * @return the AutomationRulesClient object. + */ + AutomationRulesClient getAutomationRules(); + + /** + * Gets the BookmarksClient object to access its operations. + * + * @return the BookmarksClient object. + */ + BookmarksClient getBookmarks(); + + /** + * Gets the BookmarkRelationsClient object to access its operations. + * + * @return the BookmarkRelationsClient object. + */ + BookmarkRelationsClient getBookmarkRelations(); + + /** + * Gets the BookmarkOperationsClient object to access its operations. + * + * @return the BookmarkOperationsClient object. + */ + BookmarkOperationsClient getBookmarkOperations(); + + /** + * Gets the IpGeodatasClient object to access its operations. + * + * @return the IpGeodatasClient object. + */ + IpGeodatasClient getIpGeodatas(); + + /** + * Gets the DomainWhoisClient object to access its operations. + * + * @return the DomainWhoisClient object. + */ + DomainWhoisClient getDomainWhois(); + + /** + * Gets the EntityQueriesClient object to access its operations. + * + * @return the EntityQueriesClient object. + */ + EntityQueriesClient getEntityQueries(); + + /** + * Gets the EntitiesClient object to access its operations. + * + * @return the EntitiesClient object. + */ + EntitiesClient getEntities(); + + /** + * Gets the EntitiesGetTimelinesClient object to access its operations. + * + * @return the EntitiesGetTimelinesClient object. + */ + EntitiesGetTimelinesClient getEntitiesGetTimelines(); + + /** + * Gets the EntitiesRelationsClient object to access its operations. + * + * @return the EntitiesRelationsClient object. + */ + EntitiesRelationsClient getEntitiesRelations(); + + /** + * Gets the EntityRelationsClient object to access its operations. + * + * @return the EntityRelationsClient object. + */ + EntityRelationsClient getEntityRelations(); + + /** + * Gets the IncidentsClient object to access its operations. + * + * @return the IncidentsClient object. + */ + IncidentsClient getIncidents(); + + /** + * Gets the IncidentCommentsClient object to access its operations. + * + * @return the IncidentCommentsClient object. + */ + IncidentCommentsClient getIncidentComments(); + + /** + * Gets the IncidentRelationsClient object to access its operations. + * + * @return the IncidentRelationsClient object. + */ + IncidentRelationsClient getIncidentRelations(); + + /** + * Gets the MetadatasClient object to access its operations. + * + * @return the MetadatasClient object. + */ + MetadatasClient getMetadatas(); + + /** + * Gets the SentinelOnboardingStatesClient object to access its operations. + * + * @return the SentinelOnboardingStatesClient object. + */ + SentinelOnboardingStatesClient getSentinelOnboardingStates(); + + /** + * Gets the ProductSettingsClient object to access its operations. + * + * @return the ProductSettingsClient object. + */ + ProductSettingsClient getProductSettings(); + + /** + * Gets the SourceControlsClient object to access its operations. + * + * @return the SourceControlsClient object. + */ + SourceControlsClient getSourceControls(); + + /** + * Gets the SourceControlsOperationsClient object to access its operations. + * + * @return the SourceControlsOperationsClient object. + */ + SourceControlsOperationsClient getSourceControlsOperations(); + + /** + * Gets the WatchlistsClient object to access its operations. + * + * @return the WatchlistsClient object. + */ + WatchlistsClient getWatchlists(); + + /** + * Gets the WatchlistItemsClient object to access its operations. + * + * @return the WatchlistItemsClient object. + */ + WatchlistItemsClient getWatchlistItems(); + + /** + * Gets the DataConnectorsClient object to access its operations. + * + * @return the DataConnectorsClient object. + */ + DataConnectorsClient getDataConnectors(); + + /** + * Gets the DataConnectorsCheckRequirementsOperationsClient object to access its operations. + * + * @return the DataConnectorsCheckRequirementsOperationsClient object. + */ + DataConnectorsCheckRequirementsOperationsClient getDataConnectorsCheckRequirementsOperations(); + + /** + * Gets the ThreatIntelligenceIndicatorsClient object to access its operations. + * + * @return the ThreatIntelligenceIndicatorsClient object. + */ + ThreatIntelligenceIndicatorsClient getThreatIntelligenceIndicators(); + + /** + * Gets the ThreatIntelligenceIndicatorsOperationsClient object to access its operations. + * + * @return the ThreatIntelligenceIndicatorsOperationsClient object. + */ + ThreatIntelligenceIndicatorsOperationsClient getThreatIntelligenceIndicatorsOperations(); + + /** + * Gets the ThreatIntelligenceIndicatorMetricsClient object to access its operations. + * + * @return the ThreatIntelligenceIndicatorMetricsClient object. + */ + ThreatIntelligenceIndicatorMetricsClient getThreatIntelligenceIndicatorMetrics(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the OfficeConsentsClient object to access its operations. + * + * @return the OfficeConsentsClient object. + */ + OfficeConsentsClient getOfficeConsents(); + + /** + * Gets the EntityQueryTemplatesClient object to access its operations. + * + * @return the EntityQueryTemplatesClient object. + */ + EntityQueryTemplatesClient getEntityQueryTemplates(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SentinelOnboardingStatesClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SentinelOnboardingStatesClient.java new file mode 100644 index 000000000000..2e15da69662c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SentinelOnboardingStatesClient.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStateInner; +import com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStatesListInner; + +/** An instance of this class provides access to all the operations defined in SentinelOnboardingStatesClient. */ +public interface SentinelOnboardingStatesClient { + /** + * Get Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sentinel onboarding state. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SentinelOnboardingStateInner get( + String resourceGroupName, String workspaceName, String sentinelOnboardingStateName); + + /** + * Get Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sentinel onboarding state. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String sentinelOnboardingStateName, Context context); + + /** + * Create Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sentinel onboarding state. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SentinelOnboardingStateInner create( + String resourceGroupName, String workspaceName, String sentinelOnboardingStateName); + + /** + * Create Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @param sentinelOnboardingStateParameter The Sentinel onboarding state parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sentinel onboarding state. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String workspaceName, + String sentinelOnboardingStateName, + SentinelOnboardingStateInner sentinelOnboardingStateParameter, + Context context); + + /** + * Delete Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String sentinelOnboardingStateName); + + /** + * Delete Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String sentinelOnboardingStateName, Context context); + + /** + * Gets all Sentinel onboarding states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Sentinel onboarding states. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SentinelOnboardingStatesListInner list(String resourceGroupName, String workspaceName); + + /** + * Gets all Sentinel onboarding states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Sentinel onboarding states. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SourceControlsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SourceControlsClient.java new file mode 100644 index 000000000000..0f8de1a7b52e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SourceControlsClient.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.RepoInner; +import com.azure.resourcemanager.securityinsights.models.RepoType; + +/** An instance of this class provides access to all the operations defined in SourceControlsClient. */ +public interface SourceControlsClient { + /** + * Gets a list of repositories metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param repoType The repo type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of repositories metadata. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listRepositories(String resourceGroupName, String workspaceName, RepoType repoType); + + /** + * Gets a list of repositories metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param repoType The repo type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of repositories metadata. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listRepositories( + String resourceGroupName, String workspaceName, RepoType repoType, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SourceControlsOperationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SourceControlsOperationsClient.java new file mode 100644 index 000000000000..01f83fcc3cd3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SourceControlsOperationsClient.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.SourceControlInner; + +/** An instance of this class provides access to all the operations defined in SourceControlsOperationsClient. */ +public interface SourceControlsOperationsClient { + /** + * Gets all source controls, without source control items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all source controls, without source control items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all source controls, without source control items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all source controls, without source control items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets a source control byt its identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a source control byt its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SourceControlInner get(String resourceGroupName, String workspaceName, String sourceControlId); + + /** + * Gets a source control byt its identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a source control byt its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String sourceControlId, Context context); + + /** + * Delete a source control. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String sourceControlId); + + /** + * Delete a source control. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String sourceControlId, Context context); + + /** + * Creates a source control. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @param sourceControl The SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SourceControl in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SourceControlInner create( + String resourceGroupName, String workspaceName, String sourceControlId, SourceControlInner sourceControl); + + /** + * Creates a source control. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @param sourceControl The SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SourceControl in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String workspaceName, + String sourceControlId, + SourceControlInner sourceControl, + Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ThreatIntelligenceIndicatorMetricsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ThreatIntelligenceIndicatorMetricsClient.java new file mode 100644 index 000000000000..18655c1b0123 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ThreatIntelligenceIndicatorMetricsClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceMetricsListInner; + +/** + * An instance of this class provides access to all the operations defined in ThreatIntelligenceIndicatorMetricsClient. + */ +public interface ThreatIntelligenceIndicatorMetricsClient { + /** + * Get threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThreatIntelligenceMetricsListInner list(String resourceGroupName, String workspaceName); + + /** + * Get threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ThreatIntelligenceIndicatorsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ThreatIntelligenceIndicatorsClient.java new file mode 100644 index 000000000000..acccf7cd9041 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ThreatIntelligenceIndicatorsClient.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceInformationInner; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAppendTags; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceFilteringCriteria; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModelForRequestBody; + +/** An instance of this class provides access to all the operations defined in ThreatIntelligenceIndicatorsClient. */ +public interface ThreatIntelligenceIndicatorsClient { + /** + * Create a new threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThreatIntelligenceInformationInner createIndicator( + String resourceGroupName, + String workspaceName, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties); + + /** + * Create a new threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createIndicatorWithResponse( + String resourceGroupName, + String workspaceName, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties, + Context context); + + /** + * View a threat intelligence indicator by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThreatIntelligenceInformationInner get(String resourceGroupName, String workspaceName, String name); + + /** + * View a threat intelligence indicator by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String name, Context context); + + /** + * Update a threat Intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThreatIntelligenceInformationInner create( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties); + + /** + * Update a threat Intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties, + Context context); + + /** + * Delete a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String name); + + /** + * Delete a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, Context context); + + /** + * Query threat intelligence indicators as per filtering criteria. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param threatIntelligenceFilteringCriteria Filtering criteria for querying threat intelligence indicators. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the threat intelligence information objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable queryIndicators( + String resourceGroupName, + String workspaceName, + ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria); + + /** + * Query threat intelligence indicators as per filtering criteria. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param threatIntelligenceFilteringCriteria Filtering criteria for querying threat intelligence indicators. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the threat intelligence information objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable queryIndicators( + String resourceGroupName, + String workspaceName, + ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, + Context context); + + /** + * Append tags to a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceAppendTags The threat intelligence append tags request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void appendTags( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceAppendTags threatIntelligenceAppendTags); + + /** + * Append tags to a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceAppendTags The threat intelligence append tags request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response appendTagsWithResponse( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceAppendTags threatIntelligenceAppendTags, + Context context); + + /** + * Replace tags added to a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceReplaceTags Tags in the threat intelligence indicator to be replaced. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThreatIntelligenceInformationInner replaceTags( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceReplaceTags); + + /** + * Replace tags added to a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceReplaceTags Tags in the threat intelligence indicator to be replaced. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response replaceTagsWithResponse( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceReplaceTags, + Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ThreatIntelligenceIndicatorsOperationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ThreatIntelligenceIndicatorsOperationsClient.java new file mode 100644 index 000000000000..cd5635505a22 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ThreatIntelligenceIndicatorsOperationsClient.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceInformationInner; + +/** + * An instance of this class provides access to all the operations defined in + * ThreatIntelligenceIndicatorsOperationsClient. + */ +public interface ThreatIntelligenceIndicatorsOperationsClient { + /** + * Get all threat intelligence indicators. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all threat intelligence indicators. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Get all threat intelligence indicators. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all threat intelligence indicators. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String workspaceName, + String filter, + String orderby, + Integer top, + String skipToken, + Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WatchlistItemsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WatchlistItemsClient.java new file mode 100644 index 000000000000..1664ef974f36 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WatchlistItemsClient.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.WatchlistItemInner; + +/** An instance of this class provides access to all the operations defined in WatchlistItemsClient. */ +public interface WatchlistItemsClient { + /** + * Gets all watchlist Items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all watchlist Items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String watchlistAlias); + + /** + * Gets all watchlist Items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all watchlist Items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName, String watchlistAlias, Context context); + + /** + * Gets a watchlist, without its watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a watchlist, without its watchlist items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WatchlistItemInner get( + String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId); + + /** + * Gets a watchlist, without its watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a watchlist, without its watchlist items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId, Context context); + + /** + * Delete a watchlist item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId); + + /** + * Delete a watchlist item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId, Context context); + + /** + * Creates or updates a watchlist item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @param watchlistItem The watchlist item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Watchlist item in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WatchlistItemInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String watchlistAlias, + String watchlistItemId, + WatchlistItemInner watchlistItem); + + /** + * Creates or updates a watchlist item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @param watchlistItem The watchlist item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Watchlist item in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String watchlistAlias, + String watchlistItemId, + WatchlistItemInner watchlistItem, + Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WatchlistsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WatchlistsClient.java new file mode 100644 index 000000000000..f636028204bc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WatchlistsClient.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.WatchlistInner; + +/** An instance of this class provides access to all the operations defined in WatchlistsClient. */ +public interface WatchlistsClient { + /** + * Gets all watchlists, without watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all watchlists, without watchlist items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all watchlists, without watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all watchlists, without watchlist items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets a watchlist, without its watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a watchlist, without its watchlist items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WatchlistInner get(String resourceGroupName, String workspaceName, String watchlistAlias); + + /** + * Gets a watchlist, without its watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a watchlist, without its watchlist items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String watchlistAlias, Context context); + + /** + * Delete a watchlist. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String watchlistAlias); + + /** + * Delete a watchlist. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String watchlistAlias, Context context); + + /** + * Creates or updates a watchlist and its watchlist items (bulk creation, e.g. through text/csv content type). To + * create a Watchlist and its items, we should call this endpoint with rawContent and contentType properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlist The watchlist. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Watchlist in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WatchlistInner createOrUpdate( + String resourceGroupName, String workspaceName, String watchlistAlias, WatchlistInner watchlist); + + /** + * Creates or updates a watchlist and its watchlist items (bulk creation, e.g. through text/csv content type). To + * create a Watchlist and its items, we should call this endpoint with rawContent and contentType properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlist The watchlist. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Watchlist in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String watchlistAlias, + WatchlistInner watchlist, + Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AadCheckRequirementsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AadCheckRequirementsProperties.java new file mode 100644 index 000000000000..c2c7dd1915a6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AadCheckRequirementsProperties.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** AAD (Azure Active Directory) requirements check properties. */ +@Fluent +public final class AadCheckRequirementsProperties extends DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AadCheckRequirementsProperties.class); + + /** {@inheritDoc} */ + @Override + public AadCheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AadDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AadDataConnectorProperties.java new file mode 100644 index 000000000000..9b1df541da98 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AadDataConnectorProperties.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AlertsDataTypeOfDataConnector; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** AAD (Azure Active Directory) data connector properties. */ +@Fluent +public final class AadDataConnectorProperties extends DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AadDataConnectorProperties.class); + + /* + * The available data types for the connector. + */ + @JsonProperty(value = "dataTypes") + private AlertsDataTypeOfDataConnector dataTypes; + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public AlertsDataTypeOfDataConnector dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the AadDataConnectorProperties object itself. + */ + public AadDataConnectorProperties withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** {@inheritDoc} */ + @Override + public AadDataConnectorProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataTypes() != null) { + dataTypes().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AatpCheckRequirementsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AatpCheckRequirementsProperties.java new file mode 100644 index 000000000000..322132d7bc14 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AatpCheckRequirementsProperties.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** AATP (Azure Advanced Threat Protection) requirements check properties. */ +@Fluent +public final class AatpCheckRequirementsProperties extends DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AatpCheckRequirementsProperties.class); + + /** {@inheritDoc} */ + @Override + public AatpCheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AatpDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AatpDataConnectorProperties.java new file mode 100644 index 000000000000..f60cdbc90c2f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AatpDataConnectorProperties.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AlertsDataTypeOfDataConnector; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** AATP (Azure Advanced Threat Protection) data connector properties. */ +@Fluent +public final class AatpDataConnectorProperties extends DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AatpDataConnectorProperties.class); + + /* + * The available data types for the connector. + */ + @JsonProperty(value = "dataTypes") + private AlertsDataTypeOfDataConnector dataTypes; + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public AlertsDataTypeOfDataConnector dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the AatpDataConnectorProperties object itself. + */ + public AatpDataConnectorProperties withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** {@inheritDoc} */ + @Override + public AatpDataConnectorProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataTypes() != null) { + dataTypes().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AccountEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AccountEntityProperties.java new file mode 100644 index 000000000000..ef2d56b41c7e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AccountEntityProperties.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** Account entity property bag. */ +@Immutable +public final class AccountEntityProperties extends EntityCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AccountEntityProperties.class); + + /* + * The Azure Active Directory tenant id. + */ + @JsonProperty(value = "aadTenantId", access = JsonProperty.Access.WRITE_ONLY) + private String aadTenantId; + + /* + * The Azure Active Directory user id. + */ + @JsonProperty(value = "aadUserId", access = JsonProperty.Access.WRITE_ONLY) + private String aadUserId; + + /* + * The name of the account. This field should hold only the name without + * any domain added to it, i.e. administrator. + */ + @JsonProperty(value = "accountName", access = JsonProperty.Access.WRITE_ONLY) + private String accountName; + + /* + * The display name of the account. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * The Host entity id that contains the account in case it is a local + * account (not domain joined) + */ + @JsonProperty(value = "hostEntityId", access = JsonProperty.Access.WRITE_ONLY) + private String hostEntityId; + + /* + * Determines whether this is a domain account. + */ + @JsonProperty(value = "isDomainJoined", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDomainJoined; + + /* + * The NetBIOS domain name as it appears in the alert format + * domain/username. Examples: NT AUTHORITY. + */ + @JsonProperty(value = "ntDomain", access = JsonProperty.Access.WRITE_ONLY) + private String ntDomain; + + /* + * The objectGUID attribute is a single-value attribute that is the unique + * identifier for the object, assigned by active directory. + */ + @JsonProperty(value = "objectGuid", access = JsonProperty.Access.WRITE_ONLY) + private UUID objectGuid; + + /* + * The Azure Active Directory Passport User ID. + */ + @JsonProperty(value = "puid", access = JsonProperty.Access.WRITE_ONLY) + private String puid; + + /* + * The account security identifier, e.g. S-1-5-18. + */ + @JsonProperty(value = "sid", access = JsonProperty.Access.WRITE_ONLY) + private String sid; + + /* + * The user principal name suffix for the account, in some cases it is also + * the domain name. Examples: contoso.com. + */ + @JsonProperty(value = "upnSuffix", access = JsonProperty.Access.WRITE_ONLY) + private String upnSuffix; + + /* + * The fully qualified domain DNS name. + */ + @JsonProperty(value = "dnsDomain", access = JsonProperty.Access.WRITE_ONLY) + private String dnsDomain; + + /** + * Get the aadTenantId property: The Azure Active Directory tenant id. + * + * @return the aadTenantId value. + */ + public String aadTenantId() { + return this.aadTenantId; + } + + /** + * Get the aadUserId property: The Azure Active Directory user id. + * + * @return the aadUserId value. + */ + public String aadUserId() { + return this.aadUserId; + } + + /** + * Get the accountName property: The name of the account. This field should hold only the name without any domain + * added to it, i.e. administrator. + * + * @return the accountName value. + */ + public String accountName() { + return this.accountName; + } + + /** + * Get the displayName property: The display name of the account. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the hostEntityId property: The Host entity id that contains the account in case it is a local account (not + * domain joined). + * + * @return the hostEntityId value. + */ + public String hostEntityId() { + return this.hostEntityId; + } + + /** + * Get the isDomainJoined property: Determines whether this is a domain account. + * + * @return the isDomainJoined value. + */ + public Boolean isDomainJoined() { + return this.isDomainJoined; + } + + /** + * Get the ntDomain property: The NetBIOS domain name as it appears in the alert format domain/username. Examples: + * NT AUTHORITY. + * + * @return the ntDomain value. + */ + public String ntDomain() { + return this.ntDomain; + } + + /** + * Get the objectGuid property: The objectGUID attribute is a single-value attribute that is the unique identifier + * for the object, assigned by active directory. + * + * @return the objectGuid value. + */ + public UUID objectGuid() { + return this.objectGuid; + } + + /** + * Get the puid property: The Azure Active Directory Passport User ID. + * + * @return the puid value. + */ + public String puid() { + return this.puid; + } + + /** + * Get the sid property: The account security identifier, e.g. S-1-5-18. + * + * @return the sid value. + */ + public String sid() { + return this.sid; + } + + /** + * Get the upnSuffix property: The user principal name suffix for the account, in some cases it is also the domain + * name. Examples: contoso.com. + * + * @return the upnSuffix value. + */ + public String upnSuffix() { + return this.upnSuffix; + } + + /** + * Get the dnsDomain property: The fully qualified domain DNS name. + * + * @return the dnsDomain value. + */ + public String dnsDomain() { + return this.dnsDomain; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActionRequestProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActionRequestProperties.java new file mode 100644 index 000000000000..7686ffdea6da --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActionRequestProperties.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.ActionPropertiesBase; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Action property bag. */ +@Fluent +public final class ActionRequestProperties extends ActionPropertiesBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ActionRequestProperties.class); + + /* + * Logic App Callback URL for this specific workflow. + */ + @JsonProperty(value = "triggerUri", required = true) + private String triggerUri; + + /** + * Get the triggerUri property: Logic App Callback URL for this specific workflow. + * + * @return the triggerUri value. + */ + public String triggerUri() { + return this.triggerUri; + } + + /** + * Set the triggerUri property: Logic App Callback URL for this specific workflow. + * + * @param triggerUri the triggerUri value to set. + * @return the ActionRequestProperties object itself. + */ + public ActionRequestProperties withTriggerUri(String triggerUri) { + this.triggerUri = triggerUri; + return this; + } + + /** {@inheritDoc} */ + @Override + public ActionRequestProperties withLogicAppResourceId(String logicAppResourceId) { + super.withLogicAppResourceId(logicAppResourceId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (triggerUri() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property triggerUri in model ActionRequestProperties")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActionResponseInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActionResponseInner.java new file mode 100644 index 000000000000..fb8f86a0bcc6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActionResponseInner.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Action for alert rule. */ +@Fluent +public final class ActionResponseInner extends ResourceWithEtag { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ActionResponseInner.class); + + /* + * Action properties for get request + */ + @JsonProperty(value = "properties") + private ActionResponseProperties innerProperties; + + /** + * Get the innerProperties property: Action properties for get request. + * + * @return the innerProperties value. + */ + private ActionResponseProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public ActionResponseInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the workflowId property: The name of the logic app's workflow. + * + * @return the workflowId value. + */ + public String workflowId() { + return this.innerProperties() == null ? null : this.innerProperties().workflowId(); + } + + /** + * Set the workflowId property: The name of the logic app's workflow. + * + * @param workflowId the workflowId value to set. + * @return the ActionResponseInner object itself. + */ + public ActionResponseInner withWorkflowId(String workflowId) { + if (this.innerProperties() == null) { + this.innerProperties = new ActionResponseProperties(); + } + this.innerProperties().withWorkflowId(workflowId); + return this; + } + + /** + * Get the logicAppResourceId property: Logic App Resource Id, + * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. + * + * @return the logicAppResourceId value. + */ + public String logicAppResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().logicAppResourceId(); + } + + /** + * Set the logicAppResourceId property: Logic App Resource Id, + * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. + * + * @param logicAppResourceId the logicAppResourceId value to set. + * @return the ActionResponseInner object itself. + */ + public ActionResponseInner withLogicAppResourceId(String logicAppResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new ActionResponseProperties(); + } + this.innerProperties().withLogicAppResourceId(logicAppResourceId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActionResponseProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActionResponseProperties.java new file mode 100644 index 000000000000..093f13632019 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActionResponseProperties.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.ActionPropertiesBase; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Action property bag. */ +@Fluent +public final class ActionResponseProperties extends ActionPropertiesBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ActionResponseProperties.class); + + /* + * The name of the logic app's workflow. + */ + @JsonProperty(value = "workflowId") + private String workflowId; + + /** + * Get the workflowId property: The name of the logic app's workflow. + * + * @return the workflowId value. + */ + public String workflowId() { + return this.workflowId; + } + + /** + * Set the workflowId property: The name of the logic app's workflow. + * + * @param workflowId the workflowId value to set. + * @return the ActionResponseProperties object itself. + */ + public ActionResponseProperties withWorkflowId(String workflowId) { + this.workflowId = workflowId; + return this; + } + + /** {@inheritDoc} */ + @Override + public ActionResponseProperties withLogicAppResourceId(String logicAppResourceId) { + super.withLogicAppResourceId(logicAppResourceId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActivityEntityQueriesProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActivityEntityQueriesProperties.java new file mode 100644 index 000000000000..4548c723fb1b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActivityEntityQueriesProperties.java @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.ActivityEntityQueriesPropertiesQueryDefinitions; +import com.azure.resourcemanager.securityinsights.models.EntityType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Describes activity entity query properties. */ +@Fluent +public final class ActivityEntityQueriesProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ActivityEntityQueriesProperties.class); + + /* + * The entity query title + */ + @JsonProperty(value = "title") + private String title; + + /* + * The entity query content to display in timeline + */ + @JsonProperty(value = "content") + private String content; + + /* + * The entity query description + */ + @JsonProperty(value = "description") + private String description; + + /* + * The Activity query definitions + */ + @JsonProperty(value = "queryDefinitions") + private ActivityEntityQueriesPropertiesQueryDefinitions queryDefinitions; + + /* + * The type of the query's source entity + */ + @JsonProperty(value = "inputEntityType") + private EntityType inputEntityType; + + /* + * List of the fields of the source entity that are required to run the + * query + */ + @JsonProperty(value = "requiredInputFieldsSets") + private List> requiredInputFieldsSets; + + /* + * The query applied only to entities matching to all filters + */ + @JsonProperty(value = "entitiesFilter") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map> entitiesFilter; + + /* + * The template id this activity was created from + */ + @JsonProperty(value = "templateName") + private String templateName; + + /* + * Determines whether this activity is enabled or disabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The time the activity was created + */ + @JsonProperty(value = "createdTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdTimeUtc; + + /* + * The last time the activity was updated + */ + @JsonProperty(value = "lastModifiedTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTimeUtc; + + /** + * Get the title property: The entity query title. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: The entity query title. + * + * @param title the title value to set. + * @return the ActivityEntityQueriesProperties object itself. + */ + public ActivityEntityQueriesProperties withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the content property: The entity query content to display in timeline. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: The entity query content to display in timeline. + * + * @param content the content value to set. + * @return the ActivityEntityQueriesProperties object itself. + */ + public ActivityEntityQueriesProperties withContent(String content) { + this.content = content; + return this; + } + + /** + * Get the description property: The entity query description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The entity query description. + * + * @param description the description value to set. + * @return the ActivityEntityQueriesProperties object itself. + */ + public ActivityEntityQueriesProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the queryDefinitions property: The Activity query definitions. + * + * @return the queryDefinitions value. + */ + public ActivityEntityQueriesPropertiesQueryDefinitions queryDefinitions() { + return this.queryDefinitions; + } + + /** + * Set the queryDefinitions property: The Activity query definitions. + * + * @param queryDefinitions the queryDefinitions value to set. + * @return the ActivityEntityQueriesProperties object itself. + */ + public ActivityEntityQueriesProperties withQueryDefinitions( + ActivityEntityQueriesPropertiesQueryDefinitions queryDefinitions) { + this.queryDefinitions = queryDefinitions; + return this; + } + + /** + * Get the inputEntityType property: The type of the query's source entity. + * + * @return the inputEntityType value. + */ + public EntityType inputEntityType() { + return this.inputEntityType; + } + + /** + * Set the inputEntityType property: The type of the query's source entity. + * + * @param inputEntityType the inputEntityType value to set. + * @return the ActivityEntityQueriesProperties object itself. + */ + public ActivityEntityQueriesProperties withInputEntityType(EntityType inputEntityType) { + this.inputEntityType = inputEntityType; + return this; + } + + /** + * Get the requiredInputFieldsSets property: List of the fields of the source entity that are required to run the + * query. + * + * @return the requiredInputFieldsSets value. + */ + public List> requiredInputFieldsSets() { + return this.requiredInputFieldsSets; + } + + /** + * Set the requiredInputFieldsSets property: List of the fields of the source entity that are required to run the + * query. + * + * @param requiredInputFieldsSets the requiredInputFieldsSets value to set. + * @return the ActivityEntityQueriesProperties object itself. + */ + public ActivityEntityQueriesProperties withRequiredInputFieldsSets(List> requiredInputFieldsSets) { + this.requiredInputFieldsSets = requiredInputFieldsSets; + return this; + } + + /** + * Get the entitiesFilter property: The query applied only to entities matching to all filters. + * + * @return the entitiesFilter value. + */ + public Map> entitiesFilter() { + return this.entitiesFilter; + } + + /** + * Set the entitiesFilter property: The query applied only to entities matching to all filters. + * + * @param entitiesFilter the entitiesFilter value to set. + * @return the ActivityEntityQueriesProperties object itself. + */ + public ActivityEntityQueriesProperties withEntitiesFilter(Map> entitiesFilter) { + this.entitiesFilter = entitiesFilter; + return this; + } + + /** + * Get the templateName property: The template id this activity was created from. + * + * @return the templateName value. + */ + public String templateName() { + return this.templateName; + } + + /** + * Set the templateName property: The template id this activity was created from. + * + * @param templateName the templateName value to set. + * @return the ActivityEntityQueriesProperties object itself. + */ + public ActivityEntityQueriesProperties withTemplateName(String templateName) { + this.templateName = templateName; + return this; + } + + /** + * Get the enabled property: Determines whether this activity is enabled or disabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Determines whether this activity is enabled or disabled. + * + * @param enabled the enabled value to set. + * @return the ActivityEntityQueriesProperties object itself. + */ + public ActivityEntityQueriesProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the createdTimeUtc property: The time the activity was created. + * + * @return the createdTimeUtc value. + */ + public OffsetDateTime createdTimeUtc() { + return this.createdTimeUtc; + } + + /** + * Get the lastModifiedTimeUtc property: The last time the activity was updated. + * + * @return the lastModifiedTimeUtc value. + */ + public OffsetDateTime lastModifiedTimeUtc() { + return this.lastModifiedTimeUtc; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (queryDefinitions() != null) { + queryDefinitions().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActivityEntityQueryTemplateProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActivityEntityQueryTemplateProperties.java new file mode 100644 index 000000000000..c12528576def --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActivityEntityQueryTemplateProperties.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.ActivityEntityQueryTemplatePropertiesQueryDefinitions; +import com.azure.resourcemanager.securityinsights.models.DataTypeDefinitions; +import com.azure.resourcemanager.securityinsights.models.EntityType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Describes activity entity query properties. */ +@Fluent +public final class ActivityEntityQueryTemplateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ActivityEntityQueryTemplateProperties.class); + + /* + * The entity query title + */ + @JsonProperty(value = "title") + private String title; + + /* + * The entity query content to display in timeline + */ + @JsonProperty(value = "content") + private String content; + + /* + * The entity query description + */ + @JsonProperty(value = "description") + private String description; + + /* + * The Activity query definitions + */ + @JsonProperty(value = "queryDefinitions") + private ActivityEntityQueryTemplatePropertiesQueryDefinitions queryDefinitions; + + /* + * List of required data types for the given entity query template + */ + @JsonProperty(value = "dataTypes") + private List dataTypes; + + /* + * The type of the query's source entity + */ + @JsonProperty(value = "inputEntityType") + private EntityType inputEntityType; + + /* + * List of the fields of the source entity that are required to run the + * query + */ + @JsonProperty(value = "requiredInputFieldsSets") + private List> requiredInputFieldsSets; + + /* + * The query applied only to entities matching to all filters + */ + @JsonProperty(value = "entitiesFilter") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map> entitiesFilter; + + /** + * Get the title property: The entity query title. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: The entity query title. + * + * @param title the title value to set. + * @return the ActivityEntityQueryTemplateProperties object itself. + */ + public ActivityEntityQueryTemplateProperties withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the content property: The entity query content to display in timeline. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: The entity query content to display in timeline. + * + * @param content the content value to set. + * @return the ActivityEntityQueryTemplateProperties object itself. + */ + public ActivityEntityQueryTemplateProperties withContent(String content) { + this.content = content; + return this; + } + + /** + * Get the description property: The entity query description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The entity query description. + * + * @param description the description value to set. + * @return the ActivityEntityQueryTemplateProperties object itself. + */ + public ActivityEntityQueryTemplateProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the queryDefinitions property: The Activity query definitions. + * + * @return the queryDefinitions value. + */ + public ActivityEntityQueryTemplatePropertiesQueryDefinitions queryDefinitions() { + return this.queryDefinitions; + } + + /** + * Set the queryDefinitions property: The Activity query definitions. + * + * @param queryDefinitions the queryDefinitions value to set. + * @return the ActivityEntityQueryTemplateProperties object itself. + */ + public ActivityEntityQueryTemplateProperties withQueryDefinitions( + ActivityEntityQueryTemplatePropertiesQueryDefinitions queryDefinitions) { + this.queryDefinitions = queryDefinitions; + return this; + } + + /** + * Get the dataTypes property: List of required data types for the given entity query template. + * + * @return the dataTypes value. + */ + public List dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: List of required data types for the given entity query template. + * + * @param dataTypes the dataTypes value to set. + * @return the ActivityEntityQueryTemplateProperties object itself. + */ + public ActivityEntityQueryTemplateProperties withDataTypes(List dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** + * Get the inputEntityType property: The type of the query's source entity. + * + * @return the inputEntityType value. + */ + public EntityType inputEntityType() { + return this.inputEntityType; + } + + /** + * Set the inputEntityType property: The type of the query's source entity. + * + * @param inputEntityType the inputEntityType value to set. + * @return the ActivityEntityQueryTemplateProperties object itself. + */ + public ActivityEntityQueryTemplateProperties withInputEntityType(EntityType inputEntityType) { + this.inputEntityType = inputEntityType; + return this; + } + + /** + * Get the requiredInputFieldsSets property: List of the fields of the source entity that are required to run the + * query. + * + * @return the requiredInputFieldsSets value. + */ + public List> requiredInputFieldsSets() { + return this.requiredInputFieldsSets; + } + + /** + * Set the requiredInputFieldsSets property: List of the fields of the source entity that are required to run the + * query. + * + * @param requiredInputFieldsSets the requiredInputFieldsSets value to set. + * @return the ActivityEntityQueryTemplateProperties object itself. + */ + public ActivityEntityQueryTemplateProperties withRequiredInputFieldsSets( + List> requiredInputFieldsSets) { + this.requiredInputFieldsSets = requiredInputFieldsSets; + return this; + } + + /** + * Get the entitiesFilter property: The query applied only to entities matching to all filters. + * + * @return the entitiesFilter value. + */ + public Map> entitiesFilter() { + return this.entitiesFilter; + } + + /** + * Set the entitiesFilter property: The query applied only to entities matching to all filters. + * + * @param entitiesFilter the entitiesFilter value to set. + * @return the ActivityEntityQueryTemplateProperties object itself. + */ + public ActivityEntityQueryTemplateProperties withEntitiesFilter(Map> entitiesFilter) { + this.entitiesFilter = entitiesFilter; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (queryDefinitions() != null) { + queryDefinitions().validate(); + } + if (dataTypes() != null) { + dataTypes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AlertRuleInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AlertRuleInner.java new file mode 100644 index 000000000000..523dd6d8394d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AlertRuleInner.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.FusionAlertRule; +import com.azure.resourcemanager.securityinsights.models.MLBehaviorAnalyticsAlertRule; +import com.azure.resourcemanager.securityinsights.models.MicrosoftSecurityIncidentCreationAlertRule; +import com.azure.resourcemanager.securityinsights.models.NrtAlertRule; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.azure.resourcemanager.securityinsights.models.ScheduledAlertRule; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAlertRule; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Alert rule. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = AlertRuleInner.class) +@JsonTypeName("AlertRule") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "MLBehaviorAnalytics", value = MLBehaviorAnalyticsAlertRule.class), + @JsonSubTypes.Type(name = "Fusion", value = FusionAlertRule.class), + @JsonSubTypes.Type(name = "ThreatIntelligence", value = ThreatIntelligenceAlertRule.class), + @JsonSubTypes.Type( + name = "MicrosoftSecurityIncidentCreation", + value = MicrosoftSecurityIncidentCreationAlertRule.class), + @JsonSubTypes.Type(name = "Scheduled", value = ScheduledAlertRule.class), + @JsonSubTypes.Type(name = "NRT", value = NrtAlertRule.class) +}) +@Fluent +public class AlertRuleInner extends ResourceWithEtag { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertRuleInner.class); + + /** {@inheritDoc} */ + @Override + public AlertRuleInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AlertRuleTemplateInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AlertRuleTemplateInner.java new file mode 100644 index 000000000000..e9c422a5a546 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AlertRuleTemplateInner.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.FusionAlertRuleTemplate; +import com.azure.resourcemanager.securityinsights.models.MLBehaviorAnalyticsAlertRuleTemplate; +import com.azure.resourcemanager.securityinsights.models.MicrosoftSecurityIncidentCreationAlertRuleTemplate; +import com.azure.resourcemanager.securityinsights.models.NrtAlertRuleTemplate; +import com.azure.resourcemanager.securityinsights.models.ScheduledAlertRuleTemplate; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAlertRuleTemplate; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Alert rule template. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = AlertRuleTemplateInner.class) +@JsonTypeName("AlertRuleTemplate") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "MLBehaviorAnalytics", value = MLBehaviorAnalyticsAlertRuleTemplate.class), + @JsonSubTypes.Type(name = "Fusion", value = FusionAlertRuleTemplate.class), + @JsonSubTypes.Type(name = "ThreatIntelligence", value = ThreatIntelligenceAlertRuleTemplate.class), + @JsonSubTypes.Type( + name = "MicrosoftSecurityIncidentCreation", + value = MicrosoftSecurityIncidentCreationAlertRuleTemplate.class), + @JsonSubTypes.Type(name = "Scheduled", value = ScheduledAlertRuleTemplate.class), + @JsonSubTypes.Type(name = "NRT", value = NrtAlertRuleTemplate.class) +}) +@Immutable +public class AlertRuleTemplateInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertRuleTemplateInner.class); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AnomaliesSettingsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AnomaliesSettingsProperties.java new file mode 100644 index 000000000000..fbb77200af3d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AnomaliesSettingsProperties.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Anomalies property bag. */ +@Immutable +public final class AnomaliesSettingsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AnomaliesSettingsProperties.class); + + /* + * Determines whether the setting is enable or disabled. + */ + @JsonProperty(value = "isEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isEnabled; + + /** + * Get the isEnabled property: Determines whether the setting is enable or disabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ApiPollingParameters.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ApiPollingParameters.java new file mode 100644 index 000000000000..f3c0f35cd01b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ApiPollingParameters.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingConfigProperties; +import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Represents Codeless API Polling data connector. */ +@Fluent +public final class ApiPollingParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiPollingParameters.class); + + /* + * Config to describe the instructions blade + */ + @JsonProperty(value = "connectorUiConfig") + private CodelessUiConnectorConfigProperties connectorUiConfig; + + /* + * Config to describe the polling instructions + */ + @JsonProperty(value = "pollingConfig") + private CodelessConnectorPollingConfigProperties pollingConfig; + + /** + * Get the connectorUiConfig property: Config to describe the instructions blade. + * + * @return the connectorUiConfig value. + */ + public CodelessUiConnectorConfigProperties connectorUiConfig() { + return this.connectorUiConfig; + } + + /** + * Set the connectorUiConfig property: Config to describe the instructions blade. + * + * @param connectorUiConfig the connectorUiConfig value to set. + * @return the ApiPollingParameters object itself. + */ + public ApiPollingParameters withConnectorUiConfig(CodelessUiConnectorConfigProperties connectorUiConfig) { + this.connectorUiConfig = connectorUiConfig; + return this; + } + + /** + * Get the pollingConfig property: Config to describe the polling instructions. + * + * @return the pollingConfig value. + */ + public CodelessConnectorPollingConfigProperties pollingConfig() { + return this.pollingConfig; + } + + /** + * Set the pollingConfig property: Config to describe the polling instructions. + * + * @param pollingConfig the pollingConfig value to set. + * @return the ApiPollingParameters object itself. + */ + public ApiPollingParameters withPollingConfig(CodelessConnectorPollingConfigProperties pollingConfig) { + this.pollingConfig = pollingConfig; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectorUiConfig() != null) { + connectorUiConfig().validate(); + } + if (pollingConfig() != null) { + pollingConfig().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AscCheckRequirementsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AscCheckRequirementsProperties.java new file mode 100644 index 000000000000..9393a3854e0a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AscCheckRequirementsProperties.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ASC (Azure Security Center) requirements check properties. */ +@Fluent +public final class AscCheckRequirementsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AscCheckRequirementsProperties.class); + + /* + * The subscription id to connect to, and get the data from. + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + + /** + * Get the subscriptionId property: The subscription id to connect to, and get the data from. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: The subscription id to connect to, and get the data from. + * + * @param subscriptionId the subscriptionId value to set. + * @return the AscCheckRequirementsProperties object itself. + */ + public AscCheckRequirementsProperties withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AscDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AscDataConnectorProperties.java new file mode 100644 index 000000000000..ef87905d4515 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AscDataConnectorProperties.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AlertsDataTypeOfDataConnector; +import com.azure.resourcemanager.securityinsights.models.DataConnectorWithAlertsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ASC (Azure Security Center) data connector properties. */ +@Fluent +public final class AscDataConnectorProperties extends DataConnectorWithAlertsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AscDataConnectorProperties.class); + + /* + * The subscription id to connect to, and get the data from. + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + + /** + * Get the subscriptionId property: The subscription id to connect to, and get the data from. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: The subscription id to connect to, and get the data from. + * + * @param subscriptionId the subscriptionId value to set. + * @return the AscDataConnectorProperties object itself. + */ + public AscDataConnectorProperties withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** {@inheritDoc} */ + @Override + public AscDataConnectorProperties withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { + super.withDataTypes(dataTypes); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AutomationRuleInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AutomationRuleInner.java new file mode 100644 index 000000000000..e10838758cf7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AutomationRuleInner.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AutomationRuleAction; +import com.azure.resourcemanager.securityinsights.models.AutomationRuleTriggeringLogic; +import com.azure.resourcemanager.securityinsights.models.ClientInfo; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Represents an automation rule. */ +@Fluent +public final class AutomationRuleInner extends ResourceWithEtag { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutomationRuleInner.class); + + /* + * Automation rule properties + */ + @JsonProperty(value = "properties") + private AutomationRuleProperties innerProperties; + + /** + * Get the innerProperties property: Automation rule properties. + * + * @return the innerProperties value. + */ + private AutomationRuleProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public AutomationRuleInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the displayName property: The display name of the automation rule. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name of the automation rule. + * + * @param displayName the displayName value to set. + * @return the AutomationRuleInner object itself. + */ + public AutomationRuleInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new AutomationRuleProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the order property: The order of execution of the automation rule. + * + * @return the order value. + */ + public Integer order() { + return this.innerProperties() == null ? null : this.innerProperties().order(); + } + + /** + * Set the order property: The order of execution of the automation rule. + * + * @param order the order value to set. + * @return the AutomationRuleInner object itself. + */ + public AutomationRuleInner withOrder(Integer order) { + if (this.innerProperties() == null) { + this.innerProperties = new AutomationRuleProperties(); + } + this.innerProperties().withOrder(order); + return this; + } + + /** + * Get the triggeringLogic property: The triggering logic of the automation rule. + * + * @return the triggeringLogic value. + */ + public AutomationRuleTriggeringLogic triggeringLogic() { + return this.innerProperties() == null ? null : this.innerProperties().triggeringLogic(); + } + + /** + * Set the triggeringLogic property: The triggering logic of the automation rule. + * + * @param triggeringLogic the triggeringLogic value to set. + * @return the AutomationRuleInner object itself. + */ + public AutomationRuleInner withTriggeringLogic(AutomationRuleTriggeringLogic triggeringLogic) { + if (this.innerProperties() == null) { + this.innerProperties = new AutomationRuleProperties(); + } + this.innerProperties().withTriggeringLogic(triggeringLogic); + return this; + } + + /** + * Get the actions property: The actions to execute when the automation rule is triggered. + * + * @return the actions value. + */ + public List actions() { + return this.innerProperties() == null ? null : this.innerProperties().actions(); + } + + /** + * Set the actions property: The actions to execute when the automation rule is triggered. + * + * @param actions the actions value to set. + * @return the AutomationRuleInner object itself. + */ + public AutomationRuleInner withActions(List actions) { + if (this.innerProperties() == null) { + this.innerProperties = new AutomationRuleProperties(); + } + this.innerProperties().withActions(actions); + return this; + } + + /** + * Get the createdTimeUtc property: The time the automation rule was created. + * + * @return the createdTimeUtc value. + */ + public OffsetDateTime createdTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().createdTimeUtc(); + } + + /** + * Get the lastModifiedTimeUtc property: The last time the automation rule was updated. + * + * @return the lastModifiedTimeUtc value. + */ + public OffsetDateTime lastModifiedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTimeUtc(); + } + + /** + * Get the createdBy property: Describes the client that created the automation rule. + * + * @return the createdBy value. + */ + public ClientInfo createdBy() { + return this.innerProperties() == null ? null : this.innerProperties().createdBy(); + } + + /** + * Get the lastModifiedBy property: Describes the client that last updated the automation rule. + * + * @return the lastModifiedBy value. + */ + public ClientInfo lastModifiedBy() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedBy(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AutomationRuleProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AutomationRuleProperties.java new file mode 100644 index 000000000000..a6c625ec7505 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AutomationRuleProperties.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AutomationRuleAction; +import com.azure.resourcemanager.securityinsights.models.AutomationRuleTriggeringLogic; +import com.azure.resourcemanager.securityinsights.models.ClientInfo; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Describes automation rule properties. */ +@Fluent +public final class AutomationRuleProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutomationRuleProperties.class); + + /* + * The display name of the automation rule + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /* + * The order of execution of the automation rule + */ + @JsonProperty(value = "order", required = true) + private int order; + + /* + * The triggering logic of the automation rule + */ + @JsonProperty(value = "triggeringLogic", required = true) + private AutomationRuleTriggeringLogic triggeringLogic; + + /* + * The actions to execute when the automation rule is triggered + */ + @JsonProperty(value = "actions", required = true) + private List actions; + + /* + * The time the automation rule was created + */ + @JsonProperty(value = "createdTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdTimeUtc; + + /* + * The last time the automation rule was updated + */ + @JsonProperty(value = "lastModifiedTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTimeUtc; + + /* + * Describes the client that created the automation rule + */ + @JsonProperty(value = "createdBy", access = JsonProperty.Access.WRITE_ONLY) + private ClientInfo createdBy; + + /* + * Describes the client that last updated the automation rule + */ + @JsonProperty(value = "lastModifiedBy", access = JsonProperty.Access.WRITE_ONLY) + private ClientInfo lastModifiedBy; + + /** + * Get the displayName property: The display name of the automation rule. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the automation rule. + * + * @param displayName the displayName value to set. + * @return the AutomationRuleProperties object itself. + */ + public AutomationRuleProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the order property: The order of execution of the automation rule. + * + * @return the order value. + */ + public int order() { + return this.order; + } + + /** + * Set the order property: The order of execution of the automation rule. + * + * @param order the order value to set. + * @return the AutomationRuleProperties object itself. + */ + public AutomationRuleProperties withOrder(int order) { + this.order = order; + return this; + } + + /** + * Get the triggeringLogic property: The triggering logic of the automation rule. + * + * @return the triggeringLogic value. + */ + public AutomationRuleTriggeringLogic triggeringLogic() { + return this.triggeringLogic; + } + + /** + * Set the triggeringLogic property: The triggering logic of the automation rule. + * + * @param triggeringLogic the triggeringLogic value to set. + * @return the AutomationRuleProperties object itself. + */ + public AutomationRuleProperties withTriggeringLogic(AutomationRuleTriggeringLogic triggeringLogic) { + this.triggeringLogic = triggeringLogic; + return this; + } + + /** + * Get the actions property: The actions to execute when the automation rule is triggered. + * + * @return the actions value. + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions property: The actions to execute when the automation rule is triggered. + * + * @param actions the actions value to set. + * @return the AutomationRuleProperties object itself. + */ + public AutomationRuleProperties withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Get the createdTimeUtc property: The time the automation rule was created. + * + * @return the createdTimeUtc value. + */ + public OffsetDateTime createdTimeUtc() { + return this.createdTimeUtc; + } + + /** + * Get the lastModifiedTimeUtc property: The last time the automation rule was updated. + * + * @return the lastModifiedTimeUtc value. + */ + public OffsetDateTime lastModifiedTimeUtc() { + return this.lastModifiedTimeUtc; + } + + /** + * Get the createdBy property: Describes the client that created the automation rule. + * + * @return the createdBy value. + */ + public ClientInfo createdBy() { + return this.createdBy; + } + + /** + * Get the lastModifiedBy property: Describes the client that last updated the automation rule. + * + * @return the lastModifiedBy value. + */ + public ClientInfo lastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (displayName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property displayName in model AutomationRuleProperties")); + } + if (triggeringLogic() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property triggeringLogic in model AutomationRuleProperties")); + } else { + triggeringLogic().validate(); + } + if (actions() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property actions in model AutomationRuleProperties")); + } else { + actions().forEach(e -> e.validate()); + } + if (createdBy() != null) { + createdBy().validate(); + } + if (lastModifiedBy() != null) { + lastModifiedBy().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AwsCloudTrailDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AwsCloudTrailDataConnectorProperties.java new file mode 100644 index 000000000000..537c1e0f95d9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AwsCloudTrailDataConnectorProperties.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AwsCloudTrailDataConnectorDataTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Amazon Web Services CloudTrail data connector properties. */ +@Fluent +public final class AwsCloudTrailDataConnectorProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AwsCloudTrailDataConnectorProperties.class); + + /* + * The Aws Role Arn (with CloudTrailReadOnly policy) that is used to access + * the Aws account. + */ + @JsonProperty(value = "awsRoleArn") + private String awsRoleArn; + + /* + * The available data types for the connector. + */ + @JsonProperty(value = "dataTypes", required = true) + private AwsCloudTrailDataConnectorDataTypes dataTypes; + + /** + * Get the awsRoleArn property: The Aws Role Arn (with CloudTrailReadOnly policy) that is used to access the Aws + * account. + * + * @return the awsRoleArn value. + */ + public String awsRoleArn() { + return this.awsRoleArn; + } + + /** + * Set the awsRoleArn property: The Aws Role Arn (with CloudTrailReadOnly policy) that is used to access the Aws + * account. + * + * @param awsRoleArn the awsRoleArn value to set. + * @return the AwsCloudTrailDataConnectorProperties object itself. + */ + public AwsCloudTrailDataConnectorProperties withAwsRoleArn(String awsRoleArn) { + this.awsRoleArn = awsRoleArn; + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public AwsCloudTrailDataConnectorDataTypes dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the AwsCloudTrailDataConnectorProperties object itself. + */ + public AwsCloudTrailDataConnectorProperties withDataTypes(AwsCloudTrailDataConnectorDataTypes dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataTypes() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dataTypes in model AwsCloudTrailDataConnectorProperties")); + } else { + dataTypes().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AwsS3DataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AwsS3DataConnectorProperties.java new file mode 100644 index 000000000000..d65550f044fd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AwsS3DataConnectorProperties.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AwsS3DataConnectorDataTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Amazon Web Services S3 data connector properties. */ +@Fluent +public final class AwsS3DataConnectorProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AwsS3DataConnectorProperties.class); + + /* + * The logs destination table name in LogAnalytics. + */ + @JsonProperty(value = "destinationTable", required = true) + private String destinationTable; + + /* + * The AWS sqs urls for the connector. + */ + @JsonProperty(value = "sqsUrls", required = true) + private List sqsUrls; + + /* + * The Aws Role Arn that is used to access the Aws account. + */ + @JsonProperty(value = "roleArn", required = true) + private String roleArn; + + /* + * The available data types for the connector. + */ + @JsonProperty(value = "dataTypes", required = true) + private AwsS3DataConnectorDataTypes dataTypes; + + /** + * Get the destinationTable property: The logs destination table name in LogAnalytics. + * + * @return the destinationTable value. + */ + public String destinationTable() { + return this.destinationTable; + } + + /** + * Set the destinationTable property: The logs destination table name in LogAnalytics. + * + * @param destinationTable the destinationTable value to set. + * @return the AwsS3DataConnectorProperties object itself. + */ + public AwsS3DataConnectorProperties withDestinationTable(String destinationTable) { + this.destinationTable = destinationTable; + return this; + } + + /** + * Get the sqsUrls property: The AWS sqs urls for the connector. + * + * @return the sqsUrls value. + */ + public List sqsUrls() { + return this.sqsUrls; + } + + /** + * Set the sqsUrls property: The AWS sqs urls for the connector. + * + * @param sqsUrls the sqsUrls value to set. + * @return the AwsS3DataConnectorProperties object itself. + */ + public AwsS3DataConnectorProperties withSqsUrls(List sqsUrls) { + this.sqsUrls = sqsUrls; + return this; + } + + /** + * Get the roleArn property: The Aws Role Arn that is used to access the Aws account. + * + * @return the roleArn value. + */ + public String roleArn() { + return this.roleArn; + } + + /** + * Set the roleArn property: The Aws Role Arn that is used to access the Aws account. + * + * @param roleArn the roleArn value to set. + * @return the AwsS3DataConnectorProperties object itself. + */ + public AwsS3DataConnectorProperties withRoleArn(String roleArn) { + this.roleArn = roleArn; + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public AwsS3DataConnectorDataTypes dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the AwsS3DataConnectorProperties object itself. + */ + public AwsS3DataConnectorProperties withDataTypes(AwsS3DataConnectorDataTypes dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (destinationTable() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destinationTable in model AwsS3DataConnectorProperties")); + } + if (sqsUrls() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sqsUrls in model AwsS3DataConnectorProperties")); + } + if (roleArn() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property roleArn in model AwsS3DataConnectorProperties")); + } + if (dataTypes() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dataTypes in model AwsS3DataConnectorProperties")); + } else { + dataTypes().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AzureResourceEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AzureResourceEntityProperties.java new file mode 100644 index 000000000000..c6a0301e253e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AzureResourceEntityProperties.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** AzureResource entity property bag. */ +@Immutable +public final class AzureResourceEntityProperties extends EntityCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureResourceEntityProperties.class); + + /* + * The azure resource id of the resource + */ + @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceId; + + /* + * The subscription id of the resource + */ + @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private String subscriptionId; + + /** + * Get the resourceId property: The azure resource id of the resource. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the subscriptionId property: The subscription id of the resource. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BookmarkExpandResponseInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BookmarkExpandResponseInner.java new file mode 100644 index 000000000000..d66395d13aeb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BookmarkExpandResponseInner.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.BookmarkExpandResponseValue; +import com.azure.resourcemanager.securityinsights.models.ExpansionResultsMetadata; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The entity expansion result operation response. */ +@Fluent +public final class BookmarkExpandResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BookmarkExpandResponseInner.class); + + /* + * The metadata from the expansion operation results. + */ + @JsonProperty(value = "metaData") + private ExpansionResultsMetadata metadata; + + /* + * The expansion result values. + */ + @JsonProperty(value = "value") + private BookmarkExpandResponseValue value; + + /** + * Get the metadata property: The metadata from the expansion operation results. + * + * @return the metadata value. + */ + public ExpansionResultsMetadata metadata() { + return this.metadata; + } + + /** + * Set the metadata property: The metadata from the expansion operation results. + * + * @param metadata the metadata value to set. + * @return the BookmarkExpandResponseInner object itself. + */ + public BookmarkExpandResponseInner withMetadata(ExpansionResultsMetadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the value property: The expansion result values. + * + * @return the value value. + */ + public BookmarkExpandResponseValue value() { + return this.value; + } + + /** + * Set the value property: The expansion result values. + * + * @param value the value value to set. + * @return the BookmarkExpandResponseInner object itself. + */ + public BookmarkExpandResponseInner withValue(BookmarkExpandResponseValue value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metadata() != null) { + metadata().validate(); + } + if (value() != null) { + value().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BookmarkInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BookmarkInner.java new file mode 100644 index 000000000000..31ebe211aed2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BookmarkInner.java @@ -0,0 +1,355 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.IncidentInfo; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.azure.resourcemanager.securityinsights.models.UserInfo; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Represents a bookmark in Azure Security Insights. */ +@Fluent +public final class BookmarkInner extends ResourceWithEtag { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BookmarkInner.class); + + /* + * Bookmark properties + */ + @JsonProperty(value = "properties") + private BookmarkProperties innerProperties; + + /** + * Get the innerProperties property: Bookmark properties. + * + * @return the innerProperties value. + */ + private BookmarkProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public BookmarkInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the created property: The time the bookmark was created. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.innerProperties() == null ? null : this.innerProperties().created(); + } + + /** + * Set the created property: The time the bookmark was created. + * + * @param created the created value to set. + * @return the BookmarkInner object itself. + */ + public BookmarkInner withCreated(OffsetDateTime created) { + if (this.innerProperties() == null) { + this.innerProperties = new BookmarkProperties(); + } + this.innerProperties().withCreated(created); + return this; + } + + /** + * Get the createdBy property: Describes a user that created the bookmark. + * + * @return the createdBy value. + */ + public UserInfo createdBy() { + return this.innerProperties() == null ? null : this.innerProperties().createdBy(); + } + + /** + * Set the createdBy property: Describes a user that created the bookmark. + * + * @param createdBy the createdBy value to set. + * @return the BookmarkInner object itself. + */ + public BookmarkInner withCreatedBy(UserInfo createdBy) { + if (this.innerProperties() == null) { + this.innerProperties = new BookmarkProperties(); + } + this.innerProperties().withCreatedBy(createdBy); + return this; + } + + /** + * Get the displayName property: The display name of the bookmark. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name of the bookmark. + * + * @param displayName the displayName value to set. + * @return the BookmarkInner object itself. + */ + public BookmarkInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new BookmarkProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the labels property: List of labels relevant to this bookmark. + * + * @return the labels value. + */ + public List labels() { + return this.innerProperties() == null ? null : this.innerProperties().labels(); + } + + /** + * Set the labels property: List of labels relevant to this bookmark. + * + * @param labels the labels value to set. + * @return the BookmarkInner object itself. + */ + public BookmarkInner withLabels(List labels) { + if (this.innerProperties() == null) { + this.innerProperties = new BookmarkProperties(); + } + this.innerProperties().withLabels(labels); + return this; + } + + /** + * Get the notes property: The notes of the bookmark. + * + * @return the notes value. + */ + public String notes() { + return this.innerProperties() == null ? null : this.innerProperties().notes(); + } + + /** + * Set the notes property: The notes of the bookmark. + * + * @param notes the notes value to set. + * @return the BookmarkInner object itself. + */ + public BookmarkInner withNotes(String notes) { + if (this.innerProperties() == null) { + this.innerProperties = new BookmarkProperties(); + } + this.innerProperties().withNotes(notes); + return this; + } + + /** + * Get the query property: The query of the bookmark. + * + * @return the query value. + */ + public String query() { + return this.innerProperties() == null ? null : this.innerProperties().query(); + } + + /** + * Set the query property: The query of the bookmark. + * + * @param query the query value to set. + * @return the BookmarkInner object itself. + */ + public BookmarkInner withQuery(String query) { + if (this.innerProperties() == null) { + this.innerProperties = new BookmarkProperties(); + } + this.innerProperties().withQuery(query); + return this; + } + + /** + * Get the queryResult property: The query result of the bookmark. + * + * @return the queryResult value. + */ + public String queryResult() { + return this.innerProperties() == null ? null : this.innerProperties().queryResult(); + } + + /** + * Set the queryResult property: The query result of the bookmark. + * + * @param queryResult the queryResult value to set. + * @return the BookmarkInner object itself. + */ + public BookmarkInner withQueryResult(String queryResult) { + if (this.innerProperties() == null) { + this.innerProperties = new BookmarkProperties(); + } + this.innerProperties().withQueryResult(queryResult); + return this; + } + + /** + * Get the updated property: The last time the bookmark was updated. + * + * @return the updated value. + */ + public OffsetDateTime updated() { + return this.innerProperties() == null ? null : this.innerProperties().updated(); + } + + /** + * Set the updated property: The last time the bookmark was updated. + * + * @param updated the updated value to set. + * @return the BookmarkInner object itself. + */ + public BookmarkInner withUpdated(OffsetDateTime updated) { + if (this.innerProperties() == null) { + this.innerProperties = new BookmarkProperties(); + } + this.innerProperties().withUpdated(updated); + return this; + } + + /** + * Get the updatedBy property: Describes a user that updated the bookmark. + * + * @return the updatedBy value. + */ + public UserInfo updatedBy() { + return this.innerProperties() == null ? null : this.innerProperties().updatedBy(); + } + + /** + * Set the updatedBy property: Describes a user that updated the bookmark. + * + * @param updatedBy the updatedBy value to set. + * @return the BookmarkInner object itself. + */ + public BookmarkInner withUpdatedBy(UserInfo updatedBy) { + if (this.innerProperties() == null) { + this.innerProperties = new BookmarkProperties(); + } + this.innerProperties().withUpdatedBy(updatedBy); + return this; + } + + /** + * Get the eventTime property: The bookmark event time. + * + * @return the eventTime value. + */ + public OffsetDateTime eventTime() { + return this.innerProperties() == null ? null : this.innerProperties().eventTime(); + } + + /** + * Set the eventTime property: The bookmark event time. + * + * @param eventTime the eventTime value to set. + * @return the BookmarkInner object itself. + */ + public BookmarkInner withEventTime(OffsetDateTime eventTime) { + if (this.innerProperties() == null) { + this.innerProperties = new BookmarkProperties(); + } + this.innerProperties().withEventTime(eventTime); + return this; + } + + /** + * Get the queryStartTime property: The start time for the query. + * + * @return the queryStartTime value. + */ + public OffsetDateTime queryStartTime() { + return this.innerProperties() == null ? null : this.innerProperties().queryStartTime(); + } + + /** + * Set the queryStartTime property: The start time for the query. + * + * @param queryStartTime the queryStartTime value to set. + * @return the BookmarkInner object itself. + */ + public BookmarkInner withQueryStartTime(OffsetDateTime queryStartTime) { + if (this.innerProperties() == null) { + this.innerProperties = new BookmarkProperties(); + } + this.innerProperties().withQueryStartTime(queryStartTime); + return this; + } + + /** + * Get the queryEndTime property: The end time for the query. + * + * @return the queryEndTime value. + */ + public OffsetDateTime queryEndTime() { + return this.innerProperties() == null ? null : this.innerProperties().queryEndTime(); + } + + /** + * Set the queryEndTime property: The end time for the query. + * + * @param queryEndTime the queryEndTime value to set. + * @return the BookmarkInner object itself. + */ + public BookmarkInner withQueryEndTime(OffsetDateTime queryEndTime) { + if (this.innerProperties() == null) { + this.innerProperties = new BookmarkProperties(); + } + this.innerProperties().withQueryEndTime(queryEndTime); + return this; + } + + /** + * Get the incidentInfo property: Describes an incident that relates to bookmark. + * + * @return the incidentInfo value. + */ + public IncidentInfo incidentInfo() { + return this.innerProperties() == null ? null : this.innerProperties().incidentInfo(); + } + + /** + * Set the incidentInfo property: Describes an incident that relates to bookmark. + * + * @param incidentInfo the incidentInfo value to set. + * @return the BookmarkInner object itself. + */ + public BookmarkInner withIncidentInfo(IncidentInfo incidentInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new BookmarkProperties(); + } + this.innerProperties().withIncidentInfo(incidentInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BookmarkProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BookmarkProperties.java new file mode 100644 index 000000000000..3af22d683f78 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BookmarkProperties.java @@ -0,0 +1,385 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.IncidentInfo; +import com.azure.resourcemanager.securityinsights.models.UserInfo; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Describes bookmark properties. */ +@Fluent +public final class BookmarkProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BookmarkProperties.class); + + /* + * The time the bookmark was created + */ + @JsonProperty(value = "created") + private OffsetDateTime created; + + /* + * Describes a user that created the bookmark + */ + @JsonProperty(value = "createdBy") + private UserInfo createdBy; + + /* + * The display name of the bookmark + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /* + * List of labels relevant to this bookmark + */ + @JsonProperty(value = "labels") + private List labels; + + /* + * The notes of the bookmark + */ + @JsonProperty(value = "notes") + private String notes; + + /* + * The query of the bookmark. + */ + @JsonProperty(value = "query", required = true) + private String query; + + /* + * The query result of the bookmark. + */ + @JsonProperty(value = "queryResult") + private String queryResult; + + /* + * The last time the bookmark was updated + */ + @JsonProperty(value = "updated") + private OffsetDateTime updated; + + /* + * Describes a user that updated the bookmark + */ + @JsonProperty(value = "updatedBy") + private UserInfo updatedBy; + + /* + * The bookmark event time + */ + @JsonProperty(value = "eventTime") + private OffsetDateTime eventTime; + + /* + * The start time for the query + */ + @JsonProperty(value = "queryStartTime") + private OffsetDateTime queryStartTime; + + /* + * The end time for the query + */ + @JsonProperty(value = "queryEndTime") + private OffsetDateTime queryEndTime; + + /* + * Describes an incident that relates to bookmark + */ + @JsonProperty(value = "incidentInfo") + private IncidentInfo incidentInfo; + + /** + * Get the created property: The time the bookmark was created. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.created; + } + + /** + * Set the created property: The time the bookmark was created. + * + * @param created the created value to set. + * @return the BookmarkProperties object itself. + */ + public BookmarkProperties withCreated(OffsetDateTime created) { + this.created = created; + return this; + } + + /** + * Get the createdBy property: Describes a user that created the bookmark. + * + * @return the createdBy value. + */ + public UserInfo createdBy() { + return this.createdBy; + } + + /** + * Set the createdBy property: Describes a user that created the bookmark. + * + * @param createdBy the createdBy value to set. + * @return the BookmarkProperties object itself. + */ + public BookmarkProperties withCreatedBy(UserInfo createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Get the displayName property: The display name of the bookmark. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the bookmark. + * + * @param displayName the displayName value to set. + * @return the BookmarkProperties object itself. + */ + public BookmarkProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the labels property: List of labels relevant to this bookmark. + * + * @return the labels value. + */ + public List labels() { + return this.labels; + } + + /** + * Set the labels property: List of labels relevant to this bookmark. + * + * @param labels the labels value to set. + * @return the BookmarkProperties object itself. + */ + public BookmarkProperties withLabels(List labels) { + this.labels = labels; + return this; + } + + /** + * Get the notes property: The notes of the bookmark. + * + * @return the notes value. + */ + public String notes() { + return this.notes; + } + + /** + * Set the notes property: The notes of the bookmark. + * + * @param notes the notes value to set. + * @return the BookmarkProperties object itself. + */ + public BookmarkProperties withNotes(String notes) { + this.notes = notes; + return this; + } + + /** + * Get the query property: The query of the bookmark. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * Set the query property: The query of the bookmark. + * + * @param query the query value to set. + * @return the BookmarkProperties object itself. + */ + public BookmarkProperties withQuery(String query) { + this.query = query; + return this; + } + + /** + * Get the queryResult property: The query result of the bookmark. + * + * @return the queryResult value. + */ + public String queryResult() { + return this.queryResult; + } + + /** + * Set the queryResult property: The query result of the bookmark. + * + * @param queryResult the queryResult value to set. + * @return the BookmarkProperties object itself. + */ + public BookmarkProperties withQueryResult(String queryResult) { + this.queryResult = queryResult; + return this; + } + + /** + * Get the updated property: The last time the bookmark was updated. + * + * @return the updated value. + */ + public OffsetDateTime updated() { + return this.updated; + } + + /** + * Set the updated property: The last time the bookmark was updated. + * + * @param updated the updated value to set. + * @return the BookmarkProperties object itself. + */ + public BookmarkProperties withUpdated(OffsetDateTime updated) { + this.updated = updated; + return this; + } + + /** + * Get the updatedBy property: Describes a user that updated the bookmark. + * + * @return the updatedBy value. + */ + public UserInfo updatedBy() { + return this.updatedBy; + } + + /** + * Set the updatedBy property: Describes a user that updated the bookmark. + * + * @param updatedBy the updatedBy value to set. + * @return the BookmarkProperties object itself. + */ + public BookmarkProperties withUpdatedBy(UserInfo updatedBy) { + this.updatedBy = updatedBy; + return this; + } + + /** + * Get the eventTime property: The bookmark event time. + * + * @return the eventTime value. + */ + public OffsetDateTime eventTime() { + return this.eventTime; + } + + /** + * Set the eventTime property: The bookmark event time. + * + * @param eventTime the eventTime value to set. + * @return the BookmarkProperties object itself. + */ + public BookmarkProperties withEventTime(OffsetDateTime eventTime) { + this.eventTime = eventTime; + return this; + } + + /** + * Get the queryStartTime property: The start time for the query. + * + * @return the queryStartTime value. + */ + public OffsetDateTime queryStartTime() { + return this.queryStartTime; + } + + /** + * Set the queryStartTime property: The start time for the query. + * + * @param queryStartTime the queryStartTime value to set. + * @return the BookmarkProperties object itself. + */ + public BookmarkProperties withQueryStartTime(OffsetDateTime queryStartTime) { + this.queryStartTime = queryStartTime; + return this; + } + + /** + * Get the queryEndTime property: The end time for the query. + * + * @return the queryEndTime value. + */ + public OffsetDateTime queryEndTime() { + return this.queryEndTime; + } + + /** + * Set the queryEndTime property: The end time for the query. + * + * @param queryEndTime the queryEndTime value to set. + * @return the BookmarkProperties object itself. + */ + public BookmarkProperties withQueryEndTime(OffsetDateTime queryEndTime) { + this.queryEndTime = queryEndTime; + return this; + } + + /** + * Get the incidentInfo property: Describes an incident that relates to bookmark. + * + * @return the incidentInfo value. + */ + public IncidentInfo incidentInfo() { + return this.incidentInfo; + } + + /** + * Set the incidentInfo property: Describes an incident that relates to bookmark. + * + * @param incidentInfo the incidentInfo value to set. + * @return the BookmarkProperties object itself. + */ + public BookmarkProperties withIncidentInfo(IncidentInfo incidentInfo) { + this.incidentInfo = incidentInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (createdBy() != null) { + createdBy().validate(); + } + if (displayName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property displayName in model BookmarkProperties")); + } + if (query() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property query in model BookmarkProperties")); + } + if (updatedBy() != null) { + updatedBy().validate(); + } + if (incidentInfo() != null) { + incidentInfo().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/CloudApplicationEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/CloudApplicationEntityProperties.java new file mode 100644 index 000000000000..d037691c6a96 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/CloudApplicationEntityProperties.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** CloudApplication entity property bag. */ +@Immutable +public final class CloudApplicationEntityProperties extends EntityCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudApplicationEntityProperties.class); + + /* + * The technical identifier of the application. + */ + @JsonProperty(value = "appId", access = JsonProperty.Access.WRITE_ONLY) + private Integer appId; + + /* + * The name of the related cloud application. + */ + @JsonProperty(value = "appName", access = JsonProperty.Access.WRITE_ONLY) + private String appName; + + /* + * The user defined instance name of the cloud application. It is often + * used to distinguish between several applications of the same type that a + * customer has. + */ + @JsonProperty(value = "instanceName", access = JsonProperty.Access.WRITE_ONLY) + private String instanceName; + + /** + * Get the appId property: The technical identifier of the application. + * + * @return the appId value. + */ + public Integer appId() { + return this.appId; + } + + /** + * Get the appName property: The name of the related cloud application. + * + * @return the appName value. + */ + public String appName() { + return this.appName; + } + + /** + * Get the instanceName property: The user defined instance name of the cloud application. It is often used to + * distinguish between several applications of the same type that a customer has. + * + * @return the instanceName value. + */ + public String instanceName() { + return this.instanceName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/CodelessParameters.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/CodelessParameters.java new file mode 100644 index 000000000000..6ebc547ca30f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/CodelessParameters.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Represents Codeless UI data connector. */ +@Fluent +public final class CodelessParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CodelessParameters.class); + + /* + * Config to describe the instructions blade + */ + @JsonProperty(value = "connectorUiConfig") + private CodelessUiConnectorConfigProperties connectorUiConfig; + + /** + * Get the connectorUiConfig property: Config to describe the instructions blade. + * + * @return the connectorUiConfig value. + */ + public CodelessUiConnectorConfigProperties connectorUiConfig() { + return this.connectorUiConfig; + } + + /** + * Set the connectorUiConfig property: Config to describe the instructions blade. + * + * @param connectorUiConfig the connectorUiConfig value to set. + * @return the CodelessParameters object itself. + */ + public CodelessParameters withConnectorUiConfig(CodelessUiConnectorConfigProperties connectorUiConfig) { + this.connectorUiConfig = connectorUiConfig; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectorUiConfig() != null) { + connectorUiConfig().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DataConnectorInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DataConnectorInner.java new file mode 100644 index 000000000000..b5e7cfed64a3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DataConnectorInner.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AadDataConnector; +import com.azure.resourcemanager.securityinsights.models.AatpDataConnector; +import com.azure.resourcemanager.securityinsights.models.AscDataConnector; +import com.azure.resourcemanager.securityinsights.models.AwsCloudTrailDataConnector; +import com.azure.resourcemanager.securityinsights.models.AwsS3DataConnector; +import com.azure.resourcemanager.securityinsights.models.CodelessApiPollingDataConnector; +import com.azure.resourcemanager.securityinsights.models.CodelessUiDataConnector; +import com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnector; +import com.azure.resourcemanager.securityinsights.models.McasDataConnector; +import com.azure.resourcemanager.securityinsights.models.MdatpDataConnector; +import com.azure.resourcemanager.securityinsights.models.MstiDataConnector; +import com.azure.resourcemanager.securityinsights.models.MtpDataConnector; +import com.azure.resourcemanager.securityinsights.models.OfficeAtpDataConnector; +import com.azure.resourcemanager.securityinsights.models.OfficeDataConnector; +import com.azure.resourcemanager.securityinsights.models.OfficeIrmDataConnector; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.azure.resourcemanager.securityinsights.models.TIDataConnector; +import com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnector; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Data connector. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = DataConnectorInner.class) +@JsonTypeName("DataConnector") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureActiveDirectory", value = AadDataConnector.class), + @JsonSubTypes.Type(name = "MicrosoftThreatIntelligence", value = MstiDataConnector.class), + @JsonSubTypes.Type(name = "MicrosoftThreatProtection", value = MtpDataConnector.class), + @JsonSubTypes.Type(name = "AzureAdvancedThreatProtection", value = AatpDataConnector.class), + @JsonSubTypes.Type(name = "AzureSecurityCenter", value = AscDataConnector.class), + @JsonSubTypes.Type(name = "AmazonWebServicesCloudTrail", value = AwsCloudTrailDataConnector.class), + @JsonSubTypes.Type(name = "AmazonWebServicesS3", value = AwsS3DataConnector.class), + @JsonSubTypes.Type(name = "MicrosoftCloudAppSecurity", value = McasDataConnector.class), + @JsonSubTypes.Type(name = "Dynamics365", value = Dynamics365DataConnector.class), + @JsonSubTypes.Type(name = "OfficeATP", value = OfficeAtpDataConnector.class), + @JsonSubTypes.Type(name = "OfficeIRM", value = OfficeIrmDataConnector.class), + @JsonSubTypes.Type(name = "MicrosoftDefenderAdvancedThreatProtection", value = MdatpDataConnector.class), + @JsonSubTypes.Type(name = "Office365", value = OfficeDataConnector.class), + @JsonSubTypes.Type(name = "ThreatIntelligence", value = TIDataConnector.class), + @JsonSubTypes.Type(name = "ThreatIntelligenceTaxii", value = TiTaxiiDataConnector.class), + @JsonSubTypes.Type(name = "GenericUI", value = CodelessUiDataConnector.class), + @JsonSubTypes.Type(name = "APIPolling", value = CodelessApiPollingDataConnector.class) +}) +@Fluent +public class DataConnectorInner extends ResourceWithEtag { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataConnectorInner.class); + + /** {@inheritDoc} */ + @Override + public DataConnectorInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DataConnectorRequirementsStateInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DataConnectorRequirementsStateInner.java new file mode 100644 index 000000000000..3b8481e6604f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DataConnectorRequirementsStateInner.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.DataConnectorAuthorizationState; +import com.azure.resourcemanager.securityinsights.models.DataConnectorLicenseState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Data connector requirements status. */ +@Fluent +public final class DataConnectorRequirementsStateInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataConnectorRequirementsStateInner.class); + + /* + * Authorization state for this connector + */ + @JsonProperty(value = "authorizationState") + private DataConnectorAuthorizationState authorizationState; + + /* + * License state for this connector + */ + @JsonProperty(value = "licenseState") + private DataConnectorLicenseState licenseState; + + /** + * Get the authorizationState property: Authorization state for this connector. + * + * @return the authorizationState value. + */ + public DataConnectorAuthorizationState authorizationState() { + return this.authorizationState; + } + + /** + * Set the authorizationState property: Authorization state for this connector. + * + * @param authorizationState the authorizationState value to set. + * @return the DataConnectorRequirementsStateInner object itself. + */ + public DataConnectorRequirementsStateInner withAuthorizationState( + DataConnectorAuthorizationState authorizationState) { + this.authorizationState = authorizationState; + return this; + } + + /** + * Get the licenseState property: License state for this connector. + * + * @return the licenseState value. + */ + public DataConnectorLicenseState licenseState() { + return this.licenseState; + } + + /** + * Set the licenseState property: License state for this connector. + * + * @param licenseState the licenseState value to set. + * @return the DataConnectorRequirementsStateInner object itself. + */ + public DataConnectorRequirementsStateInner withLicenseState(DataConnectorLicenseState licenseState) { + this.licenseState = licenseState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DnsEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DnsEntityProperties.java new file mode 100644 index 000000000000..a7f34eb0e838 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DnsEntityProperties.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Dns entity property bag. */ +@Immutable +public final class DnsEntityProperties extends EntityCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DnsEntityProperties.class); + + /* + * An ip entity id for the dns server resolving the request + */ + @JsonProperty(value = "dnsServerIpEntityId", access = JsonProperty.Access.WRITE_ONLY) + private String dnsServerIpEntityId; + + /* + * The name of the dns record associated with the alert + */ + @JsonProperty(value = "domainName", access = JsonProperty.Access.WRITE_ONLY) + private String domainName; + + /* + * An ip entity id for the dns request client + */ + @JsonProperty(value = "hostIpAddressEntityId", access = JsonProperty.Access.WRITE_ONLY) + private String hostIpAddressEntityId; + + /* + * Ip entity identifiers for the resolved ip address. + */ + @JsonProperty(value = "ipAddressEntityIds", access = JsonProperty.Access.WRITE_ONLY) + private List ipAddressEntityIds; + + /** + * Get the dnsServerIpEntityId property: An ip entity id for the dns server resolving the request. + * + * @return the dnsServerIpEntityId value. + */ + public String dnsServerIpEntityId() { + return this.dnsServerIpEntityId; + } + + /** + * Get the domainName property: The name of the dns record associated with the alert. + * + * @return the domainName value. + */ + public String domainName() { + return this.domainName; + } + + /** + * Get the hostIpAddressEntityId property: An ip entity id for the dns request client. + * + * @return the hostIpAddressEntityId value. + */ + public String hostIpAddressEntityId() { + return this.hostIpAddressEntityId; + } + + /** + * Get the ipAddressEntityIds property: Ip entity identifiers for the resolved ip address. + * + * @return the ipAddressEntityIds value. + */ + public List ipAddressEntityIds() { + return this.ipAddressEntityIds; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/Dynamics365CheckRequirementsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/Dynamics365CheckRequirementsProperties.java new file mode 100644 index 000000000000..03efa6fbcc05 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/Dynamics365CheckRequirementsProperties.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Dynamics365 requirements check properties. */ +@Fluent +public final class Dynamics365CheckRequirementsProperties extends DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Dynamics365CheckRequirementsProperties.class); + + /** {@inheritDoc} */ + @Override + public Dynamics365CheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/Dynamics365DataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/Dynamics365DataConnectorProperties.java new file mode 100644 index 000000000000..792da73f8e5b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/Dynamics365DataConnectorProperties.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnectorDataTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Dynamics365 data connector properties. */ +@Fluent +public final class Dynamics365DataConnectorProperties extends DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Dynamics365DataConnectorProperties.class); + + /* + * The available data types for the connector. + */ + @JsonProperty(value = "dataTypes", required = true) + private Dynamics365DataConnectorDataTypes dataTypes; + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public Dynamics365DataConnectorDataTypes dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the Dynamics365DataConnectorProperties object itself. + */ + public Dynamics365DataConnectorProperties withDataTypes(Dynamics365DataConnectorDataTypes dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** {@inheritDoc} */ + @Override + public Dynamics365DataConnectorProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataTypes() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dataTypes in model Dynamics365DataConnectorProperties")); + } else { + dataTypes().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EnrichmentDomainWhoisInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EnrichmentDomainWhoisInner.java new file mode 100644 index 000000000000..881013f2721a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EnrichmentDomainWhoisInner.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EnrichmentDomainWhoisDetails; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Whois information for a given domain and associated metadata. */ +@Fluent +public final class EnrichmentDomainWhoisInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EnrichmentDomainWhoisInner.class); + + /* + * The domain for this whois record + */ + @JsonProperty(value = "domain") + private String domain; + + /* + * The hostname of this registrar's whois server + */ + @JsonProperty(value = "server") + private String server; + + /* + * The timestamp at which this record was created + */ + @JsonProperty(value = "created") + private OffsetDateTime created; + + /* + * The timestamp at which this record was last updated + */ + @JsonProperty(value = "updated") + private OffsetDateTime updated; + + /* + * The timestamp at which this record will expire + */ + @JsonProperty(value = "expires") + private OffsetDateTime expires; + + /* + * The whois record for a given domain + */ + @JsonProperty(value = "parsedWhois") + private EnrichmentDomainWhoisDetails parsedWhois; + + /** + * Get the domain property: The domain for this whois record. + * + * @return the domain value. + */ + public String domain() { + return this.domain; + } + + /** + * Set the domain property: The domain for this whois record. + * + * @param domain the domain value to set. + * @return the EnrichmentDomainWhoisInner object itself. + */ + public EnrichmentDomainWhoisInner withDomain(String domain) { + this.domain = domain; + return this; + } + + /** + * Get the server property: The hostname of this registrar's whois server. + * + * @return the server value. + */ + public String server() { + return this.server; + } + + /** + * Set the server property: The hostname of this registrar's whois server. + * + * @param server the server value to set. + * @return the EnrichmentDomainWhoisInner object itself. + */ + public EnrichmentDomainWhoisInner withServer(String server) { + this.server = server; + return this; + } + + /** + * Get the created property: The timestamp at which this record was created. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.created; + } + + /** + * Set the created property: The timestamp at which this record was created. + * + * @param created the created value to set. + * @return the EnrichmentDomainWhoisInner object itself. + */ + public EnrichmentDomainWhoisInner withCreated(OffsetDateTime created) { + this.created = created; + return this; + } + + /** + * Get the updated property: The timestamp at which this record was last updated. + * + * @return the updated value. + */ + public OffsetDateTime updated() { + return this.updated; + } + + /** + * Set the updated property: The timestamp at which this record was last updated. + * + * @param updated the updated value to set. + * @return the EnrichmentDomainWhoisInner object itself. + */ + public EnrichmentDomainWhoisInner withUpdated(OffsetDateTime updated) { + this.updated = updated; + return this; + } + + /** + * Get the expires property: The timestamp at which this record will expire. + * + * @return the expires value. + */ + public OffsetDateTime expires() { + return this.expires; + } + + /** + * Set the expires property: The timestamp at which this record will expire. + * + * @param expires the expires value to set. + * @return the EnrichmentDomainWhoisInner object itself. + */ + public EnrichmentDomainWhoisInner withExpires(OffsetDateTime expires) { + this.expires = expires; + return this; + } + + /** + * Get the parsedWhois property: The whois record for a given domain. + * + * @return the parsedWhois value. + */ + public EnrichmentDomainWhoisDetails parsedWhois() { + return this.parsedWhois; + } + + /** + * Set the parsedWhois property: The whois record for a given domain. + * + * @param parsedWhois the parsedWhois value to set. + * @return the EnrichmentDomainWhoisInner object itself. + */ + public EnrichmentDomainWhoisInner withParsedWhois(EnrichmentDomainWhoisDetails parsedWhois) { + this.parsedWhois = parsedWhois; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (parsedWhois() != null) { + parsedWhois().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EnrichmentIpGeodataInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EnrichmentIpGeodataInner.java new file mode 100644 index 000000000000..26f8e1d135ad --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EnrichmentIpGeodataInner.java @@ -0,0 +1,476 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Geodata information for a given IP address. */ +@Fluent +public final class EnrichmentIpGeodataInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EnrichmentIpGeodataInner.class); + + /* + * The autonomous system number associated with this IP address + */ + @JsonProperty(value = "asn") + private String asn; + + /* + * The name of the carrier for this IP address + */ + @JsonProperty(value = "carrier") + private String carrier; + + /* + * The city this IP address is located in + */ + @JsonProperty(value = "city") + private String city; + + /* + * A numeric rating of confidence that the value in the 'city' field is + * correct, on a scale of 0-100 + */ + @JsonProperty(value = "cityCf") + private Integer cityCf; + + /* + * The continent this IP address is located on + */ + @JsonProperty(value = "continent") + private String continent; + + /* + * The county this IP address is located in + */ + @JsonProperty(value = "country") + private String country; + + /* + * A numeric rating of confidence that the value in the 'country' field is + * correct on a scale of 0-100 + */ + @JsonProperty(value = "countryCf") + private Integer countryCf; + + /* + * The dotted-decimal or colon-separated string representation of the IP + * address + */ + @JsonProperty(value = "ipAddr") + private String ipAddr; + + /* + * A description of the connection type of this IP address + */ + @JsonProperty(value = "ipRoutingType") + private String ipRoutingType; + + /* + * The latitude of this IP address + */ + @JsonProperty(value = "latitude") + private String latitude; + + /* + * The longitude of this IP address + */ + @JsonProperty(value = "longitude") + private String longitude; + + /* + * The name of the organization for this IP address + */ + @JsonProperty(value = "organization") + private String organization; + + /* + * The type of the organization for this IP address + */ + @JsonProperty(value = "organizationType") + private String organizationType; + + /* + * The geographic region this IP address is located in + */ + @JsonProperty(value = "region") + private String region; + + /* + * The state this IP address is located in + */ + @JsonProperty(value = "state") + private String state; + + /* + * A numeric rating of confidence that the value in the 'state' field is + * correct on a scale of 0-100 + */ + @JsonProperty(value = "stateCf") + private Integer stateCf; + + /* + * The abbreviated name for the state this IP address is located in + */ + @JsonProperty(value = "stateCode") + private String stateCode; + + /** + * Get the asn property: The autonomous system number associated with this IP address. + * + * @return the asn value. + */ + public String asn() { + return this.asn; + } + + /** + * Set the asn property: The autonomous system number associated with this IP address. + * + * @param asn the asn value to set. + * @return the EnrichmentIpGeodataInner object itself. + */ + public EnrichmentIpGeodataInner withAsn(String asn) { + this.asn = asn; + return this; + } + + /** + * Get the carrier property: The name of the carrier for this IP address. + * + * @return the carrier value. + */ + public String carrier() { + return this.carrier; + } + + /** + * Set the carrier property: The name of the carrier for this IP address. + * + * @param carrier the carrier value to set. + * @return the EnrichmentIpGeodataInner object itself. + */ + public EnrichmentIpGeodataInner withCarrier(String carrier) { + this.carrier = carrier; + return this; + } + + /** + * Get the city property: The city this IP address is located in. + * + * @return the city value. + */ + public String city() { + return this.city; + } + + /** + * Set the city property: The city this IP address is located in. + * + * @param city the city value to set. + * @return the EnrichmentIpGeodataInner object itself. + */ + public EnrichmentIpGeodataInner withCity(String city) { + this.city = city; + return this; + } + + /** + * Get the cityCf property: A numeric rating of confidence that the value in the 'city' field is correct, on a scale + * of 0-100. + * + * @return the cityCf value. + */ + public Integer cityCf() { + return this.cityCf; + } + + /** + * Set the cityCf property: A numeric rating of confidence that the value in the 'city' field is correct, on a scale + * of 0-100. + * + * @param cityCf the cityCf value to set. + * @return the EnrichmentIpGeodataInner object itself. + */ + public EnrichmentIpGeodataInner withCityCf(Integer cityCf) { + this.cityCf = cityCf; + return this; + } + + /** + * Get the continent property: The continent this IP address is located on. + * + * @return the continent value. + */ + public String continent() { + return this.continent; + } + + /** + * Set the continent property: The continent this IP address is located on. + * + * @param continent the continent value to set. + * @return the EnrichmentIpGeodataInner object itself. + */ + public EnrichmentIpGeodataInner withContinent(String continent) { + this.continent = continent; + return this; + } + + /** + * Get the country property: The county this IP address is located in. + * + * @return the country value. + */ + public String country() { + return this.country; + } + + /** + * Set the country property: The county this IP address is located in. + * + * @param country the country value to set. + * @return the EnrichmentIpGeodataInner object itself. + */ + public EnrichmentIpGeodataInner withCountry(String country) { + this.country = country; + return this; + } + + /** + * Get the countryCf property: A numeric rating of confidence that the value in the 'country' field is correct on a + * scale of 0-100. + * + * @return the countryCf value. + */ + public Integer countryCf() { + return this.countryCf; + } + + /** + * Set the countryCf property: A numeric rating of confidence that the value in the 'country' field is correct on a + * scale of 0-100. + * + * @param countryCf the countryCf value to set. + * @return the EnrichmentIpGeodataInner object itself. + */ + public EnrichmentIpGeodataInner withCountryCf(Integer countryCf) { + this.countryCf = countryCf; + return this; + } + + /** + * Get the ipAddr property: The dotted-decimal or colon-separated string representation of the IP address. + * + * @return the ipAddr value. + */ + public String ipAddr() { + return this.ipAddr; + } + + /** + * Set the ipAddr property: The dotted-decimal or colon-separated string representation of the IP address. + * + * @param ipAddr the ipAddr value to set. + * @return the EnrichmentIpGeodataInner object itself. + */ + public EnrichmentIpGeodataInner withIpAddr(String ipAddr) { + this.ipAddr = ipAddr; + return this; + } + + /** + * Get the ipRoutingType property: A description of the connection type of this IP address. + * + * @return the ipRoutingType value. + */ + public String ipRoutingType() { + return this.ipRoutingType; + } + + /** + * Set the ipRoutingType property: A description of the connection type of this IP address. + * + * @param ipRoutingType the ipRoutingType value to set. + * @return the EnrichmentIpGeodataInner object itself. + */ + public EnrichmentIpGeodataInner withIpRoutingType(String ipRoutingType) { + this.ipRoutingType = ipRoutingType; + return this; + } + + /** + * Get the latitude property: The latitude of this IP address. + * + * @return the latitude value. + */ + public String latitude() { + return this.latitude; + } + + /** + * Set the latitude property: The latitude of this IP address. + * + * @param latitude the latitude value to set. + * @return the EnrichmentIpGeodataInner object itself. + */ + public EnrichmentIpGeodataInner withLatitude(String latitude) { + this.latitude = latitude; + return this; + } + + /** + * Get the longitude property: The longitude of this IP address. + * + * @return the longitude value. + */ + public String longitude() { + return this.longitude; + } + + /** + * Set the longitude property: The longitude of this IP address. + * + * @param longitude the longitude value to set. + * @return the EnrichmentIpGeodataInner object itself. + */ + public EnrichmentIpGeodataInner withLongitude(String longitude) { + this.longitude = longitude; + return this; + } + + /** + * Get the organization property: The name of the organization for this IP address. + * + * @return the organization value. + */ + public String organization() { + return this.organization; + } + + /** + * Set the organization property: The name of the organization for this IP address. + * + * @param organization the organization value to set. + * @return the EnrichmentIpGeodataInner object itself. + */ + public EnrichmentIpGeodataInner withOrganization(String organization) { + this.organization = organization; + return this; + } + + /** + * Get the organizationType property: The type of the organization for this IP address. + * + * @return the organizationType value. + */ + public String organizationType() { + return this.organizationType; + } + + /** + * Set the organizationType property: The type of the organization for this IP address. + * + * @param organizationType the organizationType value to set. + * @return the EnrichmentIpGeodataInner object itself. + */ + public EnrichmentIpGeodataInner withOrganizationType(String organizationType) { + this.organizationType = organizationType; + return this; + } + + /** + * Get the region property: The geographic region this IP address is located in. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Set the region property: The geographic region this IP address is located in. + * + * @param region the region value to set. + * @return the EnrichmentIpGeodataInner object itself. + */ + public EnrichmentIpGeodataInner withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get the state property: The state this IP address is located in. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Set the state property: The state this IP address is located in. + * + * @param state the state value to set. + * @return the EnrichmentIpGeodataInner object itself. + */ + public EnrichmentIpGeodataInner withState(String state) { + this.state = state; + return this; + } + + /** + * Get the stateCf property: A numeric rating of confidence that the value in the 'state' field is correct on a + * scale of 0-100. + * + * @return the stateCf value. + */ + public Integer stateCf() { + return this.stateCf; + } + + /** + * Set the stateCf property: A numeric rating of confidence that the value in the 'state' field is correct on a + * scale of 0-100. + * + * @param stateCf the stateCf value to set. + * @return the EnrichmentIpGeodataInner object itself. + */ + public EnrichmentIpGeodataInner withStateCf(Integer stateCf) { + this.stateCf = stateCf; + return this; + } + + /** + * Get the stateCode property: The abbreviated name for the state this IP address is located in. + * + * @return the stateCode value. + */ + public String stateCode() { + return this.stateCode; + } + + /** + * Set the stateCode property: The abbreviated name for the state this IP address is located in. + * + * @param stateCode the stateCode value to set. + * @return the EnrichmentIpGeodataInner object itself. + */ + public EnrichmentIpGeodataInner withStateCode(String stateCode) { + this.stateCode = stateCode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityAnalyticsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityAnalyticsProperties.java new file mode 100644 index 000000000000..f75e85c31ec3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityAnalyticsProperties.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** EntityAnalytics property bag. */ +@Immutable +public final class EntityAnalyticsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityAnalyticsProperties.class); + + /* + * Determines whether the setting is enable or disabled. + */ + @JsonProperty(value = "isEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isEnabled; + + /** + * Get the isEnabled property: Determines whether the setting is enable or disabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityExpandResponseInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityExpandResponseInner.java new file mode 100644 index 000000000000..a7c5592a106c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityExpandResponseInner.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityExpandResponseValue; +import com.azure.resourcemanager.securityinsights.models.ExpansionResultsMetadata; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The entity expansion result operation response. */ +@Fluent +public final class EntityExpandResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityExpandResponseInner.class); + + /* + * The metadata from the expansion operation results. + */ + @JsonProperty(value = "metaData") + private ExpansionResultsMetadata metadata; + + /* + * The expansion result values. + */ + @JsonProperty(value = "value") + private EntityExpandResponseValue value; + + /** + * Get the metadata property: The metadata from the expansion operation results. + * + * @return the metadata value. + */ + public ExpansionResultsMetadata metadata() { + return this.metadata; + } + + /** + * Set the metadata property: The metadata from the expansion operation results. + * + * @param metadata the metadata value to set. + * @return the EntityExpandResponseInner object itself. + */ + public EntityExpandResponseInner withMetadata(ExpansionResultsMetadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the value property: The expansion result values. + * + * @return the value value. + */ + public EntityExpandResponseValue value() { + return this.value; + } + + /** + * Set the value property: The expansion result values. + * + * @param value the value value to set. + * @return the EntityExpandResponseInner object itself. + */ + public EntityExpandResponseInner withValue(EntityExpandResponseValue value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metadata() != null) { + metadata().validate(); + } + if (value() != null) { + value().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityGetInsightsResponseInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityGetInsightsResponseInner.java new file mode 100644 index 000000000000..c9a7a7c6af8c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityGetInsightsResponseInner.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityInsightItem; +import com.azure.resourcemanager.securityinsights.models.GetInsightsResultsMetadata; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The Get Insights result operation response. */ +@Fluent +public final class EntityGetInsightsResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityGetInsightsResponseInner.class); + + /* + * The metadata from the get insights operation results. + */ + @JsonProperty(value = "metaData") + private GetInsightsResultsMetadata metadata; + + /* + * The insights result values. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the metadata property: The metadata from the get insights operation results. + * + * @return the metadata value. + */ + public GetInsightsResultsMetadata metadata() { + return this.metadata; + } + + /** + * Set the metadata property: The metadata from the get insights operation results. + * + * @param metadata the metadata value to set. + * @return the EntityGetInsightsResponseInner object itself. + */ + public EntityGetInsightsResponseInner withMetadata(GetInsightsResultsMetadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the value property: The insights result values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The insights result values. + * + * @param value the value value to set. + * @return the EntityGetInsightsResponseInner object itself. + */ + public EntityGetInsightsResponseInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metadata() != null) { + metadata().validate(); + } + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityInner.java new file mode 100644 index 000000000000..5db0d30d49cc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityInner.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AccountEntity; +import com.azure.resourcemanager.securityinsights.models.AzureResourceEntity; +import com.azure.resourcemanager.securityinsights.models.CloudApplicationEntity; +import com.azure.resourcemanager.securityinsights.models.DnsEntity; +import com.azure.resourcemanager.securityinsights.models.FileEntity; +import com.azure.resourcemanager.securityinsights.models.FileHashEntity; +import com.azure.resourcemanager.securityinsights.models.HostEntity; +import com.azure.resourcemanager.securityinsights.models.HuntingBookmark; +import com.azure.resourcemanager.securityinsights.models.IoTDeviceEntity; +import com.azure.resourcemanager.securityinsights.models.IpEntity; +import com.azure.resourcemanager.securityinsights.models.MailClusterEntity; +import com.azure.resourcemanager.securityinsights.models.MailMessageEntity; +import com.azure.resourcemanager.securityinsights.models.MailboxEntity; +import com.azure.resourcemanager.securityinsights.models.MalwareEntity; +import com.azure.resourcemanager.securityinsights.models.ProcessEntity; +import com.azure.resourcemanager.securityinsights.models.RegistryKeyEntity; +import com.azure.resourcemanager.securityinsights.models.RegistryValueEntity; +import com.azure.resourcemanager.securityinsights.models.SecurityAlert; +import com.azure.resourcemanager.securityinsights.models.SecurityGroupEntity; +import com.azure.resourcemanager.securityinsights.models.SubmissionMailEntity; +import com.azure.resourcemanager.securityinsights.models.UrlEntity; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Specific entity. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = EntityInner.class) +@JsonTypeName("Entity") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SecurityAlert", value = SecurityAlert.class), + @JsonSubTypes.Type(name = "Bookmark", value = HuntingBookmark.class), + @JsonSubTypes.Type(name = "Account", value = AccountEntity.class), + @JsonSubTypes.Type(name = "AzureResource", value = AzureResourceEntity.class), + @JsonSubTypes.Type(name = "CloudApplication", value = CloudApplicationEntity.class), + @JsonSubTypes.Type(name = "DnsResolution", value = DnsEntity.class), + @JsonSubTypes.Type(name = "File", value = FileEntity.class), + @JsonSubTypes.Type(name = "FileHash", value = FileHashEntity.class), + @JsonSubTypes.Type(name = "Host", value = HostEntity.class), + @JsonSubTypes.Type(name = "IoTDevice", value = IoTDeviceEntity.class), + @JsonSubTypes.Type(name = "Ip", value = IpEntity.class), + @JsonSubTypes.Type(name = "Mailbox", value = MailboxEntity.class), + @JsonSubTypes.Type(name = "MailCluster", value = MailClusterEntity.class), + @JsonSubTypes.Type(name = "MailMessage", value = MailMessageEntity.class), + @JsonSubTypes.Type(name = "Malware", value = MalwareEntity.class), + @JsonSubTypes.Type(name = "Process", value = ProcessEntity.class), + @JsonSubTypes.Type(name = "RegistryKey", value = RegistryKeyEntity.class), + @JsonSubTypes.Type(name = "RegistryValue", value = RegistryValueEntity.class), + @JsonSubTypes.Type(name = "SecurityGroup", value = SecurityGroupEntity.class), + @JsonSubTypes.Type(name = "SubmissionMail", value = SubmissionMailEntity.class), + @JsonSubTypes.Type(name = "Url", value = UrlEntity.class) +}) +@Immutable +public class EntityInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityInner.class); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityQueryInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityQueryInner.java new file mode 100644 index 000000000000..991cb8fc90b6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityQueryInner.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.ActivityEntityQuery; +import com.azure.resourcemanager.securityinsights.models.ExpansionEntityQuery; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Specific entity query. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = EntityQueryInner.class) +@JsonTypeName("EntityQuery") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Expansion", value = ExpansionEntityQuery.class), + @JsonSubTypes.Type(name = "Activity", value = ActivityEntityQuery.class) +}) +@Fluent +public class EntityQueryInner extends ResourceWithEtag { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityQueryInner.class); + + /** {@inheritDoc} */ + @Override + public EntityQueryInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityQueryTemplateInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityQueryTemplateInner.java new file mode 100644 index 000000000000..1c528778c846 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityQueryTemplateInner.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.ActivityEntityQueryTemplate; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Specific entity query template. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = EntityQueryTemplateInner.class) +@JsonTypeName("EntityQueryTemplate") +@JsonSubTypes({@JsonSubTypes.Type(name = "Activity", value = ActivityEntityQueryTemplate.class)}) +@Immutable +public class EntityQueryTemplateInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityQueryTemplateInner.class); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityTimelineResponseInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityTimelineResponseInner.java new file mode 100644 index 000000000000..2e90c4936603 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityTimelineResponseInner.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityTimelineItem; +import com.azure.resourcemanager.securityinsights.models.TimelineResultsMetadata; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The entity timeline result operation response. */ +@Fluent +public final class EntityTimelineResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityTimelineResponseInner.class); + + /* + * The metadata from the timeline operation results. + */ + @JsonProperty(value = "metaData") + private TimelineResultsMetadata metadata; + + /* + * The timeline result values. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the metadata property: The metadata from the timeline operation results. + * + * @return the metadata value. + */ + public TimelineResultsMetadata metadata() { + return this.metadata; + } + + /** + * Set the metadata property: The metadata from the timeline operation results. + * + * @param metadata the metadata value to set. + * @return the EntityTimelineResponseInner object itself. + */ + public EntityTimelineResponseInner withMetadata(TimelineResultsMetadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the value property: The timeline result values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The timeline result values. + * + * @param value the value value to set. + * @return the EntityTimelineResponseInner object itself. + */ + public EntityTimelineResponseInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metadata() != null) { + metadata().validate(); + } + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ExpansionEntityQueriesProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ExpansionEntityQueriesProperties.java new file mode 100644 index 000000000000..a74cf1871f05 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ExpansionEntityQueriesProperties.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes expansion entity query properties. */ +@Fluent +public final class ExpansionEntityQueriesProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpansionEntityQueriesProperties.class); + + /* + * List of the data sources that are required to run the query + */ + @JsonProperty(value = "dataSources") + private List dataSources; + + /* + * The query display name + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The type of the query's source entity + */ + @JsonProperty(value = "inputEntityType") + private EntityType inputEntityType; + + /* + * List of the fields of the source entity that are required to run the + * query + */ + @JsonProperty(value = "inputFields") + private List inputFields; + + /* + * List of the desired output types to be constructed from the result + */ + @JsonProperty(value = "outputEntityTypes") + private List outputEntityTypes; + + /* + * The template query string to be parsed and formatted + */ + @JsonProperty(value = "queryTemplate") + private String queryTemplate; + + /** + * Get the dataSources property: List of the data sources that are required to run the query. + * + * @return the dataSources value. + */ + public List dataSources() { + return this.dataSources; + } + + /** + * Set the dataSources property: List of the data sources that are required to run the query. + * + * @param dataSources the dataSources value to set. + * @return the ExpansionEntityQueriesProperties object itself. + */ + public ExpansionEntityQueriesProperties withDataSources(List dataSources) { + this.dataSources = dataSources; + return this; + } + + /** + * Get the displayName property: The query display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The query display name. + * + * @param displayName the displayName value to set. + * @return the ExpansionEntityQueriesProperties object itself. + */ + public ExpansionEntityQueriesProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the inputEntityType property: The type of the query's source entity. + * + * @return the inputEntityType value. + */ + public EntityType inputEntityType() { + return this.inputEntityType; + } + + /** + * Set the inputEntityType property: The type of the query's source entity. + * + * @param inputEntityType the inputEntityType value to set. + * @return the ExpansionEntityQueriesProperties object itself. + */ + public ExpansionEntityQueriesProperties withInputEntityType(EntityType inputEntityType) { + this.inputEntityType = inputEntityType; + return this; + } + + /** + * Get the inputFields property: List of the fields of the source entity that are required to run the query. + * + * @return the inputFields value. + */ + public List inputFields() { + return this.inputFields; + } + + /** + * Set the inputFields property: List of the fields of the source entity that are required to run the query. + * + * @param inputFields the inputFields value to set. + * @return the ExpansionEntityQueriesProperties object itself. + */ + public ExpansionEntityQueriesProperties withInputFields(List inputFields) { + this.inputFields = inputFields; + return this; + } + + /** + * Get the outputEntityTypes property: List of the desired output types to be constructed from the result. + * + * @return the outputEntityTypes value. + */ + public List outputEntityTypes() { + return this.outputEntityTypes; + } + + /** + * Set the outputEntityTypes property: List of the desired output types to be constructed from the result. + * + * @param outputEntityTypes the outputEntityTypes value to set. + * @return the ExpansionEntityQueriesProperties object itself. + */ + public ExpansionEntityQueriesProperties withOutputEntityTypes(List outputEntityTypes) { + this.outputEntityTypes = outputEntityTypes; + return this; + } + + /** + * Get the queryTemplate property: The template query string to be parsed and formatted. + * + * @return the queryTemplate value. + */ + public String queryTemplate() { + return this.queryTemplate; + } + + /** + * Set the queryTemplate property: The template query string to be parsed and formatted. + * + * @param queryTemplate the queryTemplate value to set. + * @return the ExpansionEntityQueriesProperties object itself. + */ + public ExpansionEntityQueriesProperties withQueryTemplate(String queryTemplate) { + this.queryTemplate = queryTemplate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EyesOnSettingsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EyesOnSettingsProperties.java new file mode 100644 index 000000000000..4f41ccc769b8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EyesOnSettingsProperties.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** EyesOn property bag. */ +@Immutable +public final class EyesOnSettingsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EyesOnSettingsProperties.class); + + /* + * Determines whether the setting is enable or disabled. + */ + @JsonProperty(value = "isEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isEnabled; + + /** + * Get the isEnabled property: Determines whether the setting is enable or disabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FileEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FileEntityProperties.java new file mode 100644 index 000000000000..e60d088ab576 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FileEntityProperties.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** File entity property bag. */ +@Immutable +public final class FileEntityProperties extends EntityCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FileEntityProperties.class); + + /* + * The full path to the file. + */ + @JsonProperty(value = "directory", access = JsonProperty.Access.WRITE_ONLY) + private String directory; + + /* + * The file hash entity identifiers associated with this file + */ + @JsonProperty(value = "fileHashEntityIds", access = JsonProperty.Access.WRITE_ONLY) + private List fileHashEntityIds; + + /* + * The file name without path (some alerts might not include path). + */ + @JsonProperty(value = "fileName", access = JsonProperty.Access.WRITE_ONLY) + private String fileName; + + /* + * The Host entity id which the file belongs to + */ + @JsonProperty(value = "hostEntityId", access = JsonProperty.Access.WRITE_ONLY) + private String hostEntityId; + + /** + * Get the directory property: The full path to the file. + * + * @return the directory value. + */ + public String directory() { + return this.directory; + } + + /** + * Get the fileHashEntityIds property: The file hash entity identifiers associated with this file. + * + * @return the fileHashEntityIds value. + */ + public List fileHashEntityIds() { + return this.fileHashEntityIds; + } + + /** + * Get the fileName property: The file name without path (some alerts might not include path). + * + * @return the fileName value. + */ + public String fileName() { + return this.fileName; + } + + /** + * Get the hostEntityId property: The Host entity id which the file belongs to. + * + * @return the hostEntityId value. + */ + public String hostEntityId() { + return this.hostEntityId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FileHashEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FileHashEntityProperties.java new file mode 100644 index 000000000000..e9dd370c0118 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FileHashEntityProperties.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; +import com.azure.resourcemanager.securityinsights.models.FileHashAlgorithm; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** FileHash entity property bag. */ +@Immutable +public final class FileHashEntityProperties extends EntityCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FileHashEntityProperties.class); + + /* + * The hash algorithm type. + */ + @JsonProperty(value = "algorithm", access = JsonProperty.Access.WRITE_ONLY) + private FileHashAlgorithm algorithm; + + /* + * The file hash value. + */ + @JsonProperty(value = "hashValue", access = JsonProperty.Access.WRITE_ONLY) + private String hashValue; + + /** + * Get the algorithm property: The hash algorithm type. + * + * @return the algorithm value. + */ + public FileHashAlgorithm algorithm() { + return this.algorithm; + } + + /** + * Get the hashValue property: The file hash value. + * + * @return the hashValue value. + */ + public String hashValue() { + return this.hashValue; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FusionAlertRuleProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FusionAlertRuleProperties.java new file mode 100644 index 000000000000..595a10752386 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FusionAlertRuleProperties.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Fusion alert rule base property bag. */ +@Fluent +public final class FusionAlertRuleProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FusionAlertRuleProperties.class); + + /* + * The Name of the alert rule template used to create this rule. + */ + @JsonProperty(value = "alertRuleTemplateName", required = true) + private String alertRuleTemplateName; + + /* + * The description of the alert rule. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The display name for alerts created by this alert rule. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * Determines whether this alert rule is enabled or disabled. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * The last time that this alert has been modified. + */ + @JsonProperty(value = "lastModifiedUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedUtc; + + /* + * The severity for alerts created by this alert rule. + */ + @JsonProperty(value = "severity", access = JsonProperty.Access.WRITE_ONLY) + private AlertSeverity severity; + + /* + * The tactics of the alert rule + */ + @JsonProperty(value = "tactics", access = JsonProperty.Access.WRITE_ONLY) + private List tactics; + + /** + * Get the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. + * + * @return the alertRuleTemplateName value. + */ + public String alertRuleTemplateName() { + return this.alertRuleTemplateName; + } + + /** + * Set the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. + * + * @param alertRuleTemplateName the alertRuleTemplateName value to set. + * @return the FusionAlertRuleProperties object itself. + */ + public FusionAlertRuleProperties withAlertRuleTemplateName(String alertRuleTemplateName) { + this.alertRuleTemplateName = alertRuleTemplateName; + return this; + } + + /** + * Get the description property: The description of the alert rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the displayName property: The display name for alerts created by this alert rule. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the enabled property: Determines whether this alert rule is enabled or disabled. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Determines whether this alert rule is enabled or disabled. + * + * @param enabled the enabled value to set. + * @return the FusionAlertRuleProperties object itself. + */ + public FusionAlertRuleProperties withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the lastModifiedUtc property: The last time that this alert has been modified. + * + * @return the lastModifiedUtc value. + */ + public OffsetDateTime lastModifiedUtc() { + return this.lastModifiedUtc; + } + + /** + * Get the severity property: The severity for alerts created by this alert rule. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.severity; + } + + /** + * Get the tactics property: The tactics of the alert rule. + * + * @return the tactics value. + */ + public List tactics() { + return this.tactics; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (alertRuleTemplateName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property alertRuleTemplateName in model FusionAlertRuleProperties")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FusionAlertRuleTemplateProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FusionAlertRuleTemplateProperties.java new file mode 100644 index 000000000000..a493c85ff427 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FusionAlertRuleTemplateProperties.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateDataSource; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplatePropertiesBase; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.TemplateStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Fusion alert rule template properties. */ +@Fluent +public final class FusionAlertRuleTemplateProperties extends AlertRuleTemplatePropertiesBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FusionAlertRuleTemplateProperties.class); + + /* + * The severity for alerts created by this alert rule. + */ + @JsonProperty(value = "severity", required = true) + private AlertSeverity severity; + + /* + * The tactics of the alert rule template + */ + @JsonProperty(value = "tactics") + private List tactics; + + /** + * Get the severity property: The severity for alerts created by this alert rule. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.severity; + } + + /** + * Set the severity property: The severity for alerts created by this alert rule. + * + * @param severity the severity value to set. + * @return the FusionAlertRuleTemplateProperties object itself. + */ + public FusionAlertRuleTemplateProperties withSeverity(AlertSeverity severity) { + this.severity = severity; + return this; + } + + /** + * Get the tactics property: The tactics of the alert rule template. + * + * @return the tactics value. + */ + public List tactics() { + return this.tactics; + } + + /** + * Set the tactics property: The tactics of the alert rule template. + * + * @param tactics the tactics value to set. + * @return the FusionAlertRuleTemplateProperties object itself. + */ + public FusionAlertRuleTemplateProperties withTactics(List tactics) { + this.tactics = tactics; + return this; + } + + /** {@inheritDoc} */ + @Override + public FusionAlertRuleTemplateProperties withAlertRulesCreatedByTemplateCount( + Integer alertRulesCreatedByTemplateCount) { + super.withAlertRulesCreatedByTemplateCount(alertRulesCreatedByTemplateCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public FusionAlertRuleTemplateProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public FusionAlertRuleTemplateProperties withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** {@inheritDoc} */ + @Override + public FusionAlertRuleTemplateProperties withRequiredDataConnectors( + List requiredDataConnectors) { + super.withRequiredDataConnectors(requiredDataConnectors); + return this; + } + + /** {@inheritDoc} */ + @Override + public FusionAlertRuleTemplateProperties withStatus(TemplateStatus status) { + super.withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (severity() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property severity in model FusionAlertRuleTemplateProperties")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/GetQueriesResponseInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/GetQueriesResponseInner.java new file mode 100644 index 000000000000..9e6fd3d5635f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/GetQueriesResponseInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityQueryItem; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Retrieve queries for entity result operation response. */ +@Fluent +public final class GetQueriesResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetQueriesResponseInner.class); + + /* + * The query result values. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The query result values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The query result values. + * + * @param value the value value to set. + * @return the GetQueriesResponseInner object itself. + */ + public GetQueriesResponseInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HostEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HostEntityProperties.java new file mode 100644 index 000000000000..eafc793fa804 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HostEntityProperties.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; +import com.azure.resourcemanager.securityinsights.models.OSFamily; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Host entity property bag. */ +@Fluent +public final class HostEntityProperties extends EntityCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HostEntityProperties.class); + + /* + * The azure resource id of the VM. + */ + @JsonProperty(value = "azureID", access = JsonProperty.Access.WRITE_ONLY) + private String azureId; + + /* + * The DNS domain that this host belongs to. Should contain the compete DNS + * suffix for the domain + */ + @JsonProperty(value = "dnsDomain", access = JsonProperty.Access.WRITE_ONLY) + private String dnsDomain; + + /* + * The hostname without the domain suffix. + */ + @JsonProperty(value = "hostName", access = JsonProperty.Access.WRITE_ONLY) + private String hostname; + + /* + * Determines whether this host belongs to a domain. + */ + @JsonProperty(value = "isDomainJoined", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDomainJoined; + + /* + * The host name (pre-windows2000). + */ + @JsonProperty(value = "netBiosName", access = JsonProperty.Access.WRITE_ONLY) + private String netBiosName; + + /* + * The NT domain that this host belongs to. + */ + @JsonProperty(value = "ntDomain", access = JsonProperty.Access.WRITE_ONLY) + private String ntDomain; + + /* + * The OMS agent id, if the host has OMS agent installed. + */ + @JsonProperty(value = "omsAgentID", access = JsonProperty.Access.WRITE_ONLY) + private String omsAgentId; + + /* + * The operating system type. + */ + @JsonProperty(value = "osFamily") + private OSFamily osFamily; + + /* + * A free text representation of the operating system. This field is meant + * to hold specific versions the are more fine grained than OSFamily or + * future values not supported by OSFamily enumeration + */ + @JsonProperty(value = "osVersion", access = JsonProperty.Access.WRITE_ONLY) + private String osVersion; + + /** + * Get the azureId property: The azure resource id of the VM. + * + * @return the azureId value. + */ + public String azureId() { + return this.azureId; + } + + /** + * Get the dnsDomain property: The DNS domain that this host belongs to. Should contain the compete DNS suffix for + * the domain. + * + * @return the dnsDomain value. + */ + public String dnsDomain() { + return this.dnsDomain; + } + + /** + * Get the hostname property: The hostname without the domain suffix. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Get the isDomainJoined property: Determines whether this host belongs to a domain. + * + * @return the isDomainJoined value. + */ + public Boolean isDomainJoined() { + return this.isDomainJoined; + } + + /** + * Get the netBiosName property: The host name (pre-windows2000). + * + * @return the netBiosName value. + */ + public String netBiosName() { + return this.netBiosName; + } + + /** + * Get the ntDomain property: The NT domain that this host belongs to. + * + * @return the ntDomain value. + */ + public String ntDomain() { + return this.ntDomain; + } + + /** + * Get the omsAgentId property: The OMS agent id, if the host has OMS agent installed. + * + * @return the omsAgentId value. + */ + public String omsAgentId() { + return this.omsAgentId; + } + + /** + * Get the osFamily property: The operating system type. + * + * @return the osFamily value. + */ + public OSFamily osFamily() { + return this.osFamily; + } + + /** + * Set the osFamily property: The operating system type. + * + * @param osFamily the osFamily value to set. + * @return the HostEntityProperties object itself. + */ + public HostEntityProperties withOsFamily(OSFamily osFamily) { + this.osFamily = osFamily; + return this; + } + + /** + * Get the osVersion property: A free text representation of the operating system. This field is meant to hold + * specific versions the are more fine grained than OSFamily or future values not supported by OSFamily enumeration. + * + * @return the osVersion value. + */ + public String osVersion() { + return this.osVersion; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntingBookmarkProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntingBookmarkProperties.java new file mode 100644 index 000000000000..4ab30dc1a759 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntingBookmarkProperties.java @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; +import com.azure.resourcemanager.securityinsights.models.IncidentInfo; +import com.azure.resourcemanager.securityinsights.models.UserInfo; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Describes bookmark properties. */ +@Fluent +public final class HuntingBookmarkProperties extends EntityCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HuntingBookmarkProperties.class); + + /* + * The time the bookmark was created + */ + @JsonProperty(value = "created") + private OffsetDateTime created; + + /* + * Describes a user that created the bookmark + */ + @JsonProperty(value = "createdBy") + private UserInfo createdBy; + + /* + * The display name of the bookmark + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /* + * The time of the event + */ + @JsonProperty(value = "eventTime") + private OffsetDateTime eventTime; + + /* + * List of labels relevant to this bookmark + */ + @JsonProperty(value = "labels") + private List labels; + + /* + * The notes of the bookmark + */ + @JsonProperty(value = "notes") + private String notes; + + /* + * The query of the bookmark. + */ + @JsonProperty(value = "query", required = true) + private String query; + + /* + * The query result of the bookmark. + */ + @JsonProperty(value = "queryResult") + private String queryResult; + + /* + * The last time the bookmark was updated + */ + @JsonProperty(value = "updated") + private OffsetDateTime updated; + + /* + * Describes a user that updated the bookmark + */ + @JsonProperty(value = "updatedBy") + private UserInfo updatedBy; + + /* + * Describes an incident that relates to bookmark + */ + @JsonProperty(value = "incidentInfo") + private IncidentInfo incidentInfo; + + /** + * Get the created property: The time the bookmark was created. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.created; + } + + /** + * Set the created property: The time the bookmark was created. + * + * @param created the created value to set. + * @return the HuntingBookmarkProperties object itself. + */ + public HuntingBookmarkProperties withCreated(OffsetDateTime created) { + this.created = created; + return this; + } + + /** + * Get the createdBy property: Describes a user that created the bookmark. + * + * @return the createdBy value. + */ + public UserInfo createdBy() { + return this.createdBy; + } + + /** + * Set the createdBy property: Describes a user that created the bookmark. + * + * @param createdBy the createdBy value to set. + * @return the HuntingBookmarkProperties object itself. + */ + public HuntingBookmarkProperties withCreatedBy(UserInfo createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Get the displayName property: The display name of the bookmark. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the bookmark. + * + * @param displayName the displayName value to set. + * @return the HuntingBookmarkProperties object itself. + */ + public HuntingBookmarkProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the eventTime property: The time of the event. + * + * @return the eventTime value. + */ + public OffsetDateTime eventTime() { + return this.eventTime; + } + + /** + * Set the eventTime property: The time of the event. + * + * @param eventTime the eventTime value to set. + * @return the HuntingBookmarkProperties object itself. + */ + public HuntingBookmarkProperties withEventTime(OffsetDateTime eventTime) { + this.eventTime = eventTime; + return this; + } + + /** + * Get the labels property: List of labels relevant to this bookmark. + * + * @return the labels value. + */ + public List labels() { + return this.labels; + } + + /** + * Set the labels property: List of labels relevant to this bookmark. + * + * @param labels the labels value to set. + * @return the HuntingBookmarkProperties object itself. + */ + public HuntingBookmarkProperties withLabels(List labels) { + this.labels = labels; + return this; + } + + /** + * Get the notes property: The notes of the bookmark. + * + * @return the notes value. + */ + public String notes() { + return this.notes; + } + + /** + * Set the notes property: The notes of the bookmark. + * + * @param notes the notes value to set. + * @return the HuntingBookmarkProperties object itself. + */ + public HuntingBookmarkProperties withNotes(String notes) { + this.notes = notes; + return this; + } + + /** + * Get the query property: The query of the bookmark. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * Set the query property: The query of the bookmark. + * + * @param query the query value to set. + * @return the HuntingBookmarkProperties object itself. + */ + public HuntingBookmarkProperties withQuery(String query) { + this.query = query; + return this; + } + + /** + * Get the queryResult property: The query result of the bookmark. + * + * @return the queryResult value. + */ + public String queryResult() { + return this.queryResult; + } + + /** + * Set the queryResult property: The query result of the bookmark. + * + * @param queryResult the queryResult value to set. + * @return the HuntingBookmarkProperties object itself. + */ + public HuntingBookmarkProperties withQueryResult(String queryResult) { + this.queryResult = queryResult; + return this; + } + + /** + * Get the updated property: The last time the bookmark was updated. + * + * @return the updated value. + */ + public OffsetDateTime updated() { + return this.updated; + } + + /** + * Set the updated property: The last time the bookmark was updated. + * + * @param updated the updated value to set. + * @return the HuntingBookmarkProperties object itself. + */ + public HuntingBookmarkProperties withUpdated(OffsetDateTime updated) { + this.updated = updated; + return this; + } + + /** + * Get the updatedBy property: Describes a user that updated the bookmark. + * + * @return the updatedBy value. + */ + public UserInfo updatedBy() { + return this.updatedBy; + } + + /** + * Set the updatedBy property: Describes a user that updated the bookmark. + * + * @param updatedBy the updatedBy value to set. + * @return the HuntingBookmarkProperties object itself. + */ + public HuntingBookmarkProperties withUpdatedBy(UserInfo updatedBy) { + this.updatedBy = updatedBy; + return this; + } + + /** + * Get the incidentInfo property: Describes an incident that relates to bookmark. + * + * @return the incidentInfo value. + */ + public IncidentInfo incidentInfo() { + return this.incidentInfo; + } + + /** + * Set the incidentInfo property: Describes an incident that relates to bookmark. + * + * @param incidentInfo the incidentInfo value to set. + * @return the HuntingBookmarkProperties object itself. + */ + public HuntingBookmarkProperties withIncidentInfo(IncidentInfo incidentInfo) { + this.incidentInfo = incidentInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (createdBy() != null) { + createdBy().validate(); + } + if (displayName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property displayName in model HuntingBookmarkProperties")); + } + if (query() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property query in model HuntingBookmarkProperties")); + } + if (updatedBy() != null) { + updatedBy().validate(); + } + if (incidentInfo() != null) { + incidentInfo().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentAlertListInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentAlertListInner.java new file mode 100644 index 000000000000..03ac8b2e3454 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentAlertListInner.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.SecurityAlert; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of incident alerts. */ +@Fluent +public final class IncidentAlertListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IncidentAlertListInner.class); + + /* + * Array of incident alerts. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the value property: Array of incident alerts. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of incident alerts. + * + * @param value the value value to set. + * @return the IncidentAlertListInner object itself. + */ + public IncidentAlertListInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model IncidentAlertListInner")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentBookmarkListInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentBookmarkListInner.java new file mode 100644 index 000000000000..bd3a2a9d225e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentBookmarkListInner.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.HuntingBookmark; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of incident bookmarks. */ +@Fluent +public final class IncidentBookmarkListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IncidentBookmarkListInner.class); + + /* + * Array of incident bookmarks. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the value property: Array of incident bookmarks. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of incident bookmarks. + * + * @param value the value value to set. + * @return the IncidentBookmarkListInner object itself. + */ + public IncidentBookmarkListInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model IncidentBookmarkListInner")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentCommentInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentCommentInner.java new file mode 100644 index 000000000000..5ee77edb8cab --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentCommentInner.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.ClientInfo; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Represents an incident comment. */ +@Fluent +public final class IncidentCommentInner extends ResourceWithEtag { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IncidentCommentInner.class); + + /* + * Incident comment properties + */ + @JsonProperty(value = "properties") + private IncidentCommentProperties innerProperties; + + /** + * Get the innerProperties property: Incident comment properties. + * + * @return the innerProperties value. + */ + private IncidentCommentProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public IncidentCommentInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the createdTimeUtc property: The time the comment was created. + * + * @return the createdTimeUtc value. + */ + public OffsetDateTime createdTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().createdTimeUtc(); + } + + /** + * Get the lastModifiedTimeUtc property: The time the comment was updated. + * + * @return the lastModifiedTimeUtc value. + */ + public OffsetDateTime lastModifiedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTimeUtc(); + } + + /** + * Get the message property: The comment message. + * + * @return the message value. + */ + public String message() { + return this.innerProperties() == null ? null : this.innerProperties().message(); + } + + /** + * Set the message property: The comment message. + * + * @param message the message value to set. + * @return the IncidentCommentInner object itself. + */ + public IncidentCommentInner withMessage(String message) { + if (this.innerProperties() == null) { + this.innerProperties = new IncidentCommentProperties(); + } + this.innerProperties().withMessage(message); + return this; + } + + /** + * Get the author property: Describes the client that created the comment. + * + * @return the author value. + */ + public ClientInfo author() { + return this.innerProperties() == null ? null : this.innerProperties().author(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentCommentProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentCommentProperties.java new file mode 100644 index 000000000000..0aa8a1fa3e91 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentCommentProperties.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.ClientInfo; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Incident comment property bag. */ +@Fluent +public final class IncidentCommentProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IncidentCommentProperties.class); + + /* + * The time the comment was created + */ + @JsonProperty(value = "createdTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdTimeUtc; + + /* + * The time the comment was updated + */ + @JsonProperty(value = "lastModifiedTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTimeUtc; + + /* + * The comment message + */ + @JsonProperty(value = "message", required = true) + private String message; + + /* + * Describes the client that created the comment + */ + @JsonProperty(value = "author", access = JsonProperty.Access.WRITE_ONLY) + private ClientInfo author; + + /** + * Get the createdTimeUtc property: The time the comment was created. + * + * @return the createdTimeUtc value. + */ + public OffsetDateTime createdTimeUtc() { + return this.createdTimeUtc; + } + + /** + * Get the lastModifiedTimeUtc property: The time the comment was updated. + * + * @return the lastModifiedTimeUtc value. + */ + public OffsetDateTime lastModifiedTimeUtc() { + return this.lastModifiedTimeUtc; + } + + /** + * Get the message property: The comment message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The comment message. + * + * @param message the message value to set. + * @return the IncidentCommentProperties object itself. + */ + public IncidentCommentProperties withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the author property: Describes the client that created the comment. + * + * @return the author value. + */ + public ClientInfo author() { + return this.author; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (message() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property message in model IncidentCommentProperties")); + } + if (author() != null) { + author().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentEntitiesResponseInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentEntitiesResponseInner.java new file mode 100644 index 000000000000..4868547c91d1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentEntitiesResponseInner.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.IncidentEntitiesResultsMetadata; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The incident related entities response. */ +@Fluent +public final class IncidentEntitiesResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IncidentEntitiesResponseInner.class); + + /* + * Array of the incident related entities. + */ + @JsonProperty(value = "entities") + private List entities; + + /* + * The metadata from the incident related entities results. + */ + @JsonProperty(value = "metaData") + private List metadata; + + /** + * Get the entities property: Array of the incident related entities. + * + * @return the entities value. + */ + public List entities() { + return this.entities; + } + + /** + * Set the entities property: Array of the incident related entities. + * + * @param entities the entities value to set. + * @return the IncidentEntitiesResponseInner object itself. + */ + public IncidentEntitiesResponseInner withEntities(List entities) { + this.entities = entities; + return this; + } + + /** + * Get the metadata property: The metadata from the incident related entities results. + * + * @return the metadata value. + */ + public List metadata() { + return this.metadata; + } + + /** + * Set the metadata property: The metadata from the incident related entities results. + * + * @param metadata the metadata value to set. + * @return the IncidentEntitiesResponseInner object itself. + */ + public IncidentEntitiesResponseInner withMetadata(List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (entities() != null) { + entities().forEach(e -> e.validate()); + } + if (metadata() != null) { + metadata().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentInner.java new file mode 100644 index 000000000000..395e2d157683 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentInner.java @@ -0,0 +1,437 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.IncidentAdditionalData; +import com.azure.resourcemanager.securityinsights.models.IncidentClassification; +import com.azure.resourcemanager.securityinsights.models.IncidentClassificationReason; +import com.azure.resourcemanager.securityinsights.models.IncidentLabel; +import com.azure.resourcemanager.securityinsights.models.IncidentOwnerInfo; +import com.azure.resourcemanager.securityinsights.models.IncidentSeverity; +import com.azure.resourcemanager.securityinsights.models.IncidentStatus; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Represents an incident in Azure Security Insights. */ +@Fluent +public final class IncidentInner extends ResourceWithEtag { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IncidentInner.class); + + /* + * Incident properties + */ + @JsonProperty(value = "properties") + private IncidentPropertiesInner innerProperties; + + /** + * Get the innerProperties property: Incident properties. + * + * @return the innerProperties value. + */ + private IncidentPropertiesInner innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public IncidentInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the additionalData property: Additional data on the incident. + * + * @return the additionalData value. + */ + public IncidentAdditionalData additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the classification property: The reason the incident was closed. + * + * @return the classification value. + */ + public IncidentClassification classification() { + return this.innerProperties() == null ? null : this.innerProperties().classification(); + } + + /** + * Set the classification property: The reason the incident was closed. + * + * @param classification the classification value to set. + * @return the IncidentInner object itself. + */ + public IncidentInner withClassification(IncidentClassification classification) { + if (this.innerProperties() == null) { + this.innerProperties = new IncidentPropertiesInner(); + } + this.innerProperties().withClassification(classification); + return this; + } + + /** + * Get the classificationComment property: Describes the reason the incident was closed. + * + * @return the classificationComment value. + */ + public String classificationComment() { + return this.innerProperties() == null ? null : this.innerProperties().classificationComment(); + } + + /** + * Set the classificationComment property: Describes the reason the incident was closed. + * + * @param classificationComment the classificationComment value to set. + * @return the IncidentInner object itself. + */ + public IncidentInner withClassificationComment(String classificationComment) { + if (this.innerProperties() == null) { + this.innerProperties = new IncidentPropertiesInner(); + } + this.innerProperties().withClassificationComment(classificationComment); + return this; + } + + /** + * Get the classificationReason property: The classification reason the incident was closed with. + * + * @return the classificationReason value. + */ + public IncidentClassificationReason classificationReason() { + return this.innerProperties() == null ? null : this.innerProperties().classificationReason(); + } + + /** + * Set the classificationReason property: The classification reason the incident was closed with. + * + * @param classificationReason the classificationReason value to set. + * @return the IncidentInner object itself. + */ + public IncidentInner withClassificationReason(IncidentClassificationReason classificationReason) { + if (this.innerProperties() == null) { + this.innerProperties = new IncidentPropertiesInner(); + } + this.innerProperties().withClassificationReason(classificationReason); + return this; + } + + /** + * Get the createdTimeUtc property: The time the incident was created. + * + * @return the createdTimeUtc value. + */ + public OffsetDateTime createdTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().createdTimeUtc(); + } + + /** + * Get the description property: The description of the incident. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of the incident. + * + * @param description the description value to set. + * @return the IncidentInner object itself. + */ + public IncidentInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new IncidentPropertiesInner(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the firstActivityTimeUtc property: The time of the first activity in the incident. + * + * @return the firstActivityTimeUtc value. + */ + public OffsetDateTime firstActivityTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().firstActivityTimeUtc(); + } + + /** + * Set the firstActivityTimeUtc property: The time of the first activity in the incident. + * + * @param firstActivityTimeUtc the firstActivityTimeUtc value to set. + * @return the IncidentInner object itself. + */ + public IncidentInner withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new IncidentPropertiesInner(); + } + this.innerProperties().withFirstActivityTimeUtc(firstActivityTimeUtc); + return this; + } + + /** + * Get the incidentUrl property: The deep-link url to the incident in Azure portal. + * + * @return the incidentUrl value. + */ + public String incidentUrl() { + return this.innerProperties() == null ? null : this.innerProperties().incidentUrl(); + } + + /** + * Get the incidentNumber property: A sequential number. + * + * @return the incidentNumber value. + */ + public Integer incidentNumber() { + return this.innerProperties() == null ? null : this.innerProperties().incidentNumber(); + } + + /** + * Get the labels property: List of labels relevant to this incident. + * + * @return the labels value. + */ + public List labels() { + return this.innerProperties() == null ? null : this.innerProperties().labels(); + } + + /** + * Set the labels property: List of labels relevant to this incident. + * + * @param labels the labels value to set. + * @return the IncidentInner object itself. + */ + public IncidentInner withLabels(List labels) { + if (this.innerProperties() == null) { + this.innerProperties = new IncidentPropertiesInner(); + } + this.innerProperties().withLabels(labels); + return this; + } + + /** + * Get the providerName property: The name of the source provider that generated the incident. + * + * @return the providerName value. + */ + public String providerName() { + return this.innerProperties() == null ? null : this.innerProperties().providerName(); + } + + /** + * Set the providerName property: The name of the source provider that generated the incident. + * + * @param providerName the providerName value to set. + * @return the IncidentInner object itself. + */ + public IncidentInner withProviderName(String providerName) { + if (this.innerProperties() == null) { + this.innerProperties = new IncidentPropertiesInner(); + } + this.innerProperties().withProviderName(providerName); + return this; + } + + /** + * Get the providerIncidentId property: The incident ID assigned by the incident provider. + * + * @return the providerIncidentId value. + */ + public String providerIncidentId() { + return this.innerProperties() == null ? null : this.innerProperties().providerIncidentId(); + } + + /** + * Set the providerIncidentId property: The incident ID assigned by the incident provider. + * + * @param providerIncidentId the providerIncidentId value to set. + * @return the IncidentInner object itself. + */ + public IncidentInner withProviderIncidentId(String providerIncidentId) { + if (this.innerProperties() == null) { + this.innerProperties = new IncidentPropertiesInner(); + } + this.innerProperties().withProviderIncidentId(providerIncidentId); + return this; + } + + /** + * Get the lastActivityTimeUtc property: The time of the last activity in the incident. + * + * @return the lastActivityTimeUtc value. + */ + public OffsetDateTime lastActivityTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastActivityTimeUtc(); + } + + /** + * Set the lastActivityTimeUtc property: The time of the last activity in the incident. + * + * @param lastActivityTimeUtc the lastActivityTimeUtc value to set. + * @return the IncidentInner object itself. + */ + public IncidentInner withLastActivityTimeUtc(OffsetDateTime lastActivityTimeUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new IncidentPropertiesInner(); + } + this.innerProperties().withLastActivityTimeUtc(lastActivityTimeUtc); + return this; + } + + /** + * Get the lastModifiedTimeUtc property: The last time the incident was updated. + * + * @return the lastModifiedTimeUtc value. + */ + public OffsetDateTime lastModifiedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTimeUtc(); + } + + /** + * Get the owner property: Describes a user that the incident is assigned to. + * + * @return the owner value. + */ + public IncidentOwnerInfo owner() { + return this.innerProperties() == null ? null : this.innerProperties().owner(); + } + + /** + * Set the owner property: Describes a user that the incident is assigned to. + * + * @param owner the owner value to set. + * @return the IncidentInner object itself. + */ + public IncidentInner withOwner(IncidentOwnerInfo owner) { + if (this.innerProperties() == null) { + this.innerProperties = new IncidentPropertiesInner(); + } + this.innerProperties().withOwner(owner); + return this; + } + + /** + * Get the relatedAnalyticRuleIds property: List of resource ids of Analytic rules related to the incident. + * + * @return the relatedAnalyticRuleIds value. + */ + public List relatedAnalyticRuleIds() { + return this.innerProperties() == null ? null : this.innerProperties().relatedAnalyticRuleIds(); + } + + /** + * Get the severity property: The severity of the incident. + * + * @return the severity value. + */ + public IncidentSeverity severity() { + return this.innerProperties() == null ? null : this.innerProperties().severity(); + } + + /** + * Set the severity property: The severity of the incident. + * + * @param severity the severity value to set. + * @return the IncidentInner object itself. + */ + public IncidentInner withSeverity(IncidentSeverity severity) { + if (this.innerProperties() == null) { + this.innerProperties = new IncidentPropertiesInner(); + } + this.innerProperties().withSeverity(severity); + return this; + } + + /** + * Get the status property: The status of the incident. + * + * @return the status value. + */ + public IncidentStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The status of the incident. + * + * @param status the status value to set. + * @return the IncidentInner object itself. + */ + public IncidentInner withStatus(IncidentStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new IncidentPropertiesInner(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the teamInformation property: Describes a team for the incident. + * + * @return the teamInformation value. + */ + public TeamInformationInner teamInformation() { + return this.innerProperties() == null ? null : this.innerProperties().teamInformation(); + } + + /** + * Set the teamInformation property: Describes a team for the incident. + * + * @param teamInformation the teamInformation value to set. + * @return the IncidentInner object itself. + */ + public IncidentInner withTeamInformation(TeamInformationInner teamInformation) { + if (this.innerProperties() == null) { + this.innerProperties = new IncidentPropertiesInner(); + } + this.innerProperties().withTeamInformation(teamInformation); + return this; + } + + /** + * Get the title property: The title of the incident. + * + * @return the title value. + */ + public String title() { + return this.innerProperties() == null ? null : this.innerProperties().title(); + } + + /** + * Set the title property: The title of the incident. + * + * @param title the title value to set. + * @return the IncidentInner object itself. + */ + public IncidentInner withTitle(String title) { + if (this.innerProperties() == null) { + this.innerProperties = new IncidentPropertiesInner(); + } + this.innerProperties().withTitle(title); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentPropertiesInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentPropertiesInner.java new file mode 100644 index 000000000000..6d01fec2cdaa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentPropertiesInner.java @@ -0,0 +1,515 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.IncidentAdditionalData; +import com.azure.resourcemanager.securityinsights.models.IncidentClassification; +import com.azure.resourcemanager.securityinsights.models.IncidentClassificationReason; +import com.azure.resourcemanager.securityinsights.models.IncidentLabel; +import com.azure.resourcemanager.securityinsights.models.IncidentOwnerInfo; +import com.azure.resourcemanager.securityinsights.models.IncidentSeverity; +import com.azure.resourcemanager.securityinsights.models.IncidentStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Describes incident properties. */ +@Fluent +public final class IncidentPropertiesInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IncidentPropertiesInner.class); + + /* + * Additional data on the incident + */ + @JsonProperty(value = "additionalData", access = JsonProperty.Access.WRITE_ONLY) + private IncidentAdditionalData additionalData; + + /* + * The reason the incident was closed + */ + @JsonProperty(value = "classification") + private IncidentClassification classification; + + /* + * Describes the reason the incident was closed + */ + @JsonProperty(value = "classificationComment") + private String classificationComment; + + /* + * The classification reason the incident was closed with + */ + @JsonProperty(value = "classificationReason") + private IncidentClassificationReason classificationReason; + + /* + * The time the incident was created + */ + @JsonProperty(value = "createdTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdTimeUtc; + + /* + * The description of the incident + */ + @JsonProperty(value = "description") + private String description; + + /* + * The time of the first activity in the incident + */ + @JsonProperty(value = "firstActivityTimeUtc") + private OffsetDateTime firstActivityTimeUtc; + + /* + * The deep-link url to the incident in Azure portal + */ + @JsonProperty(value = "incidentUrl", access = JsonProperty.Access.WRITE_ONLY) + private String incidentUrl; + + /* + * A sequential number + */ + @JsonProperty(value = "incidentNumber", access = JsonProperty.Access.WRITE_ONLY) + private Integer incidentNumber; + + /* + * List of labels relevant to this incident + */ + @JsonProperty(value = "labels") + private List labels; + + /* + * The name of the source provider that generated the incident + */ + @JsonProperty(value = "providerName") + private String providerName; + + /* + * The incident ID assigned by the incident provider + */ + @JsonProperty(value = "providerIncidentId") + private String providerIncidentId; + + /* + * The time of the last activity in the incident + */ + @JsonProperty(value = "lastActivityTimeUtc") + private OffsetDateTime lastActivityTimeUtc; + + /* + * The last time the incident was updated + */ + @JsonProperty(value = "lastModifiedTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTimeUtc; + + /* + * Describes a user that the incident is assigned to + */ + @JsonProperty(value = "owner") + private IncidentOwnerInfo owner; + + /* + * List of resource ids of Analytic rules related to the incident + */ + @JsonProperty(value = "relatedAnalyticRuleIds", access = JsonProperty.Access.WRITE_ONLY) + private List relatedAnalyticRuleIds; + + /* + * The severity of the incident + */ + @JsonProperty(value = "severity", required = true) + private IncidentSeverity severity; + + /* + * The status of the incident + */ + @JsonProperty(value = "status", required = true) + private IncidentStatus status; + + /* + * Describes a team for the incident + */ + @JsonProperty(value = "teamInformation") + private TeamInformationInner teamInformation; + + /* + * The title of the incident + */ + @JsonProperty(value = "title", required = true) + private String title; + + /** + * Get the additionalData property: Additional data on the incident. + * + * @return the additionalData value. + */ + public IncidentAdditionalData additionalData() { + return this.additionalData; + } + + /** + * Get the classification property: The reason the incident was closed. + * + * @return the classification value. + */ + public IncidentClassification classification() { + return this.classification; + } + + /** + * Set the classification property: The reason the incident was closed. + * + * @param classification the classification value to set. + * @return the IncidentPropertiesInner object itself. + */ + public IncidentPropertiesInner withClassification(IncidentClassification classification) { + this.classification = classification; + return this; + } + + /** + * Get the classificationComment property: Describes the reason the incident was closed. + * + * @return the classificationComment value. + */ + public String classificationComment() { + return this.classificationComment; + } + + /** + * Set the classificationComment property: Describes the reason the incident was closed. + * + * @param classificationComment the classificationComment value to set. + * @return the IncidentPropertiesInner object itself. + */ + public IncidentPropertiesInner withClassificationComment(String classificationComment) { + this.classificationComment = classificationComment; + return this; + } + + /** + * Get the classificationReason property: The classification reason the incident was closed with. + * + * @return the classificationReason value. + */ + public IncidentClassificationReason classificationReason() { + return this.classificationReason; + } + + /** + * Set the classificationReason property: The classification reason the incident was closed with. + * + * @param classificationReason the classificationReason value to set. + * @return the IncidentPropertiesInner object itself. + */ + public IncidentPropertiesInner withClassificationReason(IncidentClassificationReason classificationReason) { + this.classificationReason = classificationReason; + return this; + } + + /** + * Get the createdTimeUtc property: The time the incident was created. + * + * @return the createdTimeUtc value. + */ + public OffsetDateTime createdTimeUtc() { + return this.createdTimeUtc; + } + + /** + * Get the description property: The description of the incident. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the incident. + * + * @param description the description value to set. + * @return the IncidentPropertiesInner object itself. + */ + public IncidentPropertiesInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the firstActivityTimeUtc property: The time of the first activity in the incident. + * + * @return the firstActivityTimeUtc value. + */ + public OffsetDateTime firstActivityTimeUtc() { + return this.firstActivityTimeUtc; + } + + /** + * Set the firstActivityTimeUtc property: The time of the first activity in the incident. + * + * @param firstActivityTimeUtc the firstActivityTimeUtc value to set. + * @return the IncidentPropertiesInner object itself. + */ + public IncidentPropertiesInner withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc) { + this.firstActivityTimeUtc = firstActivityTimeUtc; + return this; + } + + /** + * Get the incidentUrl property: The deep-link url to the incident in Azure portal. + * + * @return the incidentUrl value. + */ + public String incidentUrl() { + return this.incidentUrl; + } + + /** + * Get the incidentNumber property: A sequential number. + * + * @return the incidentNumber value. + */ + public Integer incidentNumber() { + return this.incidentNumber; + } + + /** + * Get the labels property: List of labels relevant to this incident. + * + * @return the labels value. + */ + public List labels() { + return this.labels; + } + + /** + * Set the labels property: List of labels relevant to this incident. + * + * @param labels the labels value to set. + * @return the IncidentPropertiesInner object itself. + */ + public IncidentPropertiesInner withLabels(List labels) { + this.labels = labels; + return this; + } + + /** + * Get the providerName property: The name of the source provider that generated the incident. + * + * @return the providerName value. + */ + public String providerName() { + return this.providerName; + } + + /** + * Set the providerName property: The name of the source provider that generated the incident. + * + * @param providerName the providerName value to set. + * @return the IncidentPropertiesInner object itself. + */ + public IncidentPropertiesInner withProviderName(String providerName) { + this.providerName = providerName; + return this; + } + + /** + * Get the providerIncidentId property: The incident ID assigned by the incident provider. + * + * @return the providerIncidentId value. + */ + public String providerIncidentId() { + return this.providerIncidentId; + } + + /** + * Set the providerIncidentId property: The incident ID assigned by the incident provider. + * + * @param providerIncidentId the providerIncidentId value to set. + * @return the IncidentPropertiesInner object itself. + */ + public IncidentPropertiesInner withProviderIncidentId(String providerIncidentId) { + this.providerIncidentId = providerIncidentId; + return this; + } + + /** + * Get the lastActivityTimeUtc property: The time of the last activity in the incident. + * + * @return the lastActivityTimeUtc value. + */ + public OffsetDateTime lastActivityTimeUtc() { + return this.lastActivityTimeUtc; + } + + /** + * Set the lastActivityTimeUtc property: The time of the last activity in the incident. + * + * @param lastActivityTimeUtc the lastActivityTimeUtc value to set. + * @return the IncidentPropertiesInner object itself. + */ + public IncidentPropertiesInner withLastActivityTimeUtc(OffsetDateTime lastActivityTimeUtc) { + this.lastActivityTimeUtc = lastActivityTimeUtc; + return this; + } + + /** + * Get the lastModifiedTimeUtc property: The last time the incident was updated. + * + * @return the lastModifiedTimeUtc value. + */ + public OffsetDateTime lastModifiedTimeUtc() { + return this.lastModifiedTimeUtc; + } + + /** + * Get the owner property: Describes a user that the incident is assigned to. + * + * @return the owner value. + */ + public IncidentOwnerInfo owner() { + return this.owner; + } + + /** + * Set the owner property: Describes a user that the incident is assigned to. + * + * @param owner the owner value to set. + * @return the IncidentPropertiesInner object itself. + */ + public IncidentPropertiesInner withOwner(IncidentOwnerInfo owner) { + this.owner = owner; + return this; + } + + /** + * Get the relatedAnalyticRuleIds property: List of resource ids of Analytic rules related to the incident. + * + * @return the relatedAnalyticRuleIds value. + */ + public List relatedAnalyticRuleIds() { + return this.relatedAnalyticRuleIds; + } + + /** + * Get the severity property: The severity of the incident. + * + * @return the severity value. + */ + public IncidentSeverity severity() { + return this.severity; + } + + /** + * Set the severity property: The severity of the incident. + * + * @param severity the severity value to set. + * @return the IncidentPropertiesInner object itself. + */ + public IncidentPropertiesInner withSeverity(IncidentSeverity severity) { + this.severity = severity; + return this; + } + + /** + * Get the status property: The status of the incident. + * + * @return the status value. + */ + public IncidentStatus status() { + return this.status; + } + + /** + * Set the status property: The status of the incident. + * + * @param status the status value to set. + * @return the IncidentPropertiesInner object itself. + */ + public IncidentPropertiesInner withStatus(IncidentStatus status) { + this.status = status; + return this; + } + + /** + * Get the teamInformation property: Describes a team for the incident. + * + * @return the teamInformation value. + */ + public TeamInformationInner teamInformation() { + return this.teamInformation; + } + + /** + * Set the teamInformation property: Describes a team for the incident. + * + * @param teamInformation the teamInformation value to set. + * @return the IncidentPropertiesInner object itself. + */ + public IncidentPropertiesInner withTeamInformation(TeamInformationInner teamInformation) { + this.teamInformation = teamInformation; + return this; + } + + /** + * Get the title property: The title of the incident. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: The title of the incident. + * + * @param title the title value to set. + * @return the IncidentPropertiesInner object itself. + */ + public IncidentPropertiesInner withTitle(String title) { + this.title = title; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (additionalData() != null) { + additionalData().validate(); + } + if (labels() != null) { + labels().forEach(e -> e.validate()); + } + if (owner() != null) { + owner().validate(); + } + if (severity() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property severity in model IncidentPropertiesInner")); + } + if (status() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property status in model IncidentPropertiesInner")); + } + if (teamInformation() != null) { + teamInformation().validate(); + } + if (title() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property title in model IncidentPropertiesInner")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IoTDeviceEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IoTDeviceEntityProperties.java new file mode 100644 index 000000000000..bf3f83db2a18 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IoTDeviceEntityProperties.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligence; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.UUID; + +/** IoTDevice entity property bag. */ +@Immutable +public final class IoTDeviceEntityProperties extends EntityCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IoTDeviceEntityProperties.class); + + /* + * The ID of the IoT Device in the IoT Hub + */ + @JsonProperty(value = "deviceId", access = JsonProperty.Access.WRITE_ONLY) + private String deviceId; + + /* + * The friendly name of the device + */ + @JsonProperty(value = "deviceName", access = JsonProperty.Access.WRITE_ONLY) + private String deviceName; + + /* + * The source of the device + */ + @JsonProperty(value = "source", access = JsonProperty.Access.WRITE_ONLY) + private String source; + + /* + * The ID of the security agent running on the device + */ + @JsonProperty(value = "iotSecurityAgentId", access = JsonProperty.Access.WRITE_ONLY) + private UUID iotSecurityAgentId; + + /* + * The type of the device + */ + @JsonProperty(value = "deviceType", access = JsonProperty.Access.WRITE_ONLY) + private String deviceType; + + /* + * The vendor of the device + */ + @JsonProperty(value = "vendor", access = JsonProperty.Access.WRITE_ONLY) + private String vendor; + + /* + * The ID of the edge device + */ + @JsonProperty(value = "edgeId", access = JsonProperty.Access.WRITE_ONLY) + private String edgeId; + + /* + * The MAC address of the device + */ + @JsonProperty(value = "macAddress", access = JsonProperty.Access.WRITE_ONLY) + private String macAddress; + + /* + * The model of the device + */ + @JsonProperty(value = "model", access = JsonProperty.Access.WRITE_ONLY) + private String model; + + /* + * The serial number of the device + */ + @JsonProperty(value = "serialNumber", access = JsonProperty.Access.WRITE_ONLY) + private String serialNumber; + + /* + * The firmware version of the device + */ + @JsonProperty(value = "firmwareVersion", access = JsonProperty.Access.WRITE_ONLY) + private String firmwareVersion; + + /* + * The operating system of the device + */ + @JsonProperty(value = "operatingSystem", access = JsonProperty.Access.WRITE_ONLY) + private String operatingSystem; + + /* + * The AzureResource entity id of the IoT Hub + */ + @JsonProperty(value = "iotHubEntityId", access = JsonProperty.Access.WRITE_ONLY) + private String iotHubEntityId; + + /* + * The Host entity id of this device + */ + @JsonProperty(value = "hostEntityId", access = JsonProperty.Access.WRITE_ONLY) + private String hostEntityId; + + /* + * The IP entity if of this device + */ + @JsonProperty(value = "ipAddressEntityId", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddressEntityId; + + /* + * A list of TI contexts attached to the IoTDevice entity. + */ + @JsonProperty(value = "threatIntelligence", access = JsonProperty.Access.WRITE_ONLY) + private List threatIntelligence; + + /* + * A list of protocols of the IoTDevice entity. + */ + @JsonProperty(value = "protocols", access = JsonProperty.Access.WRITE_ONLY) + private List protocols; + + /** + * Get the deviceId property: The ID of the IoT Device in the IoT Hub. + * + * @return the deviceId value. + */ + public String deviceId() { + return this.deviceId; + } + + /** + * Get the deviceName property: The friendly name of the device. + * + * @return the deviceName value. + */ + public String deviceName() { + return this.deviceName; + } + + /** + * Get the source property: The source of the device. + * + * @return the source value. + */ + public String source() { + return this.source; + } + + /** + * Get the iotSecurityAgentId property: The ID of the security agent running on the device. + * + * @return the iotSecurityAgentId value. + */ + public UUID iotSecurityAgentId() { + return this.iotSecurityAgentId; + } + + /** + * Get the deviceType property: The type of the device. + * + * @return the deviceType value. + */ + public String deviceType() { + return this.deviceType; + } + + /** + * Get the vendor property: The vendor of the device. + * + * @return the vendor value. + */ + public String vendor() { + return this.vendor; + } + + /** + * Get the edgeId property: The ID of the edge device. + * + * @return the edgeId value. + */ + public String edgeId() { + return this.edgeId; + } + + /** + * Get the macAddress property: The MAC address of the device. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Get the model property: The model of the device. + * + * @return the model value. + */ + public String model() { + return this.model; + } + + /** + * Get the serialNumber property: The serial number of the device. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Get the firmwareVersion property: The firmware version of the device. + * + * @return the firmwareVersion value. + */ + public String firmwareVersion() { + return this.firmwareVersion; + } + + /** + * Get the operatingSystem property: The operating system of the device. + * + * @return the operatingSystem value. + */ + public String operatingSystem() { + return this.operatingSystem; + } + + /** + * Get the iotHubEntityId property: The AzureResource entity id of the IoT Hub. + * + * @return the iotHubEntityId value. + */ + public String iotHubEntityId() { + return this.iotHubEntityId; + } + + /** + * Get the hostEntityId property: The Host entity id of this device. + * + * @return the hostEntityId value. + */ + public String hostEntityId() { + return this.hostEntityId; + } + + /** + * Get the ipAddressEntityId property: The IP entity if of this device. + * + * @return the ipAddressEntityId value. + */ + public String ipAddressEntityId() { + return this.ipAddressEntityId; + } + + /** + * Get the threatIntelligence property: A list of TI contexts attached to the IoTDevice entity. + * + * @return the threatIntelligence value. + */ + public List threatIntelligence() { + return this.threatIntelligence; + } + + /** + * Get the protocols property: A list of protocols of the IoTDevice entity. + * + * @return the protocols value. + */ + public List protocols() { + return this.protocols; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (threatIntelligence() != null) { + threatIntelligence().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IpEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IpEntityProperties.java new file mode 100644 index 000000000000..18a7a844f955 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IpEntityProperties.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; +import com.azure.resourcemanager.securityinsights.models.GeoLocation; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligence; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Ip entity property bag. */ +@Immutable +public final class IpEntityProperties extends EntityCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpEntityProperties.class); + + /* + * The IP address as string, e.g. 127.0.0.1 (either in Ipv4 or Ipv6) + */ + @JsonProperty(value = "address", access = JsonProperty.Access.WRITE_ONLY) + private String address; + + /* + * The geo-location context attached to the ip entity + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private GeoLocation location; + + /* + * A list of TI contexts attached to the ip entity. + */ + @JsonProperty(value = "threatIntelligence", access = JsonProperty.Access.WRITE_ONLY) + private List threatIntelligence; + + /** + * Get the address property: The IP address as string, e.g. 127.0.0.1 (either in Ipv4 or Ipv6). + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Get the location property: The geo-location context attached to the ip entity. + * + * @return the location value. + */ + public GeoLocation location() { + return this.location; + } + + /** + * Get the threatIntelligence property: A list of TI contexts attached to the ip entity. + * + * @return the threatIntelligence value. + */ + public List threatIntelligence() { + return this.threatIntelligence; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (location() != null) { + location().validate(); + } + if (threatIntelligence() != null) { + threatIntelligence().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MLBehaviorAnalyticsAlertRuleProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MLBehaviorAnalyticsAlertRuleProperties.java new file mode 100644 index 000000000000..6959672a8068 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MLBehaviorAnalyticsAlertRuleProperties.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** MLBehaviorAnalytics alert rule base property bag. */ +@Fluent +public final class MLBehaviorAnalyticsAlertRuleProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MLBehaviorAnalyticsAlertRuleProperties.class); + + /* + * The Name of the alert rule template used to create this rule. + */ + @JsonProperty(value = "alertRuleTemplateName", required = true) + private String alertRuleTemplateName; + + /* + * The description of the alert rule. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The display name for alerts created by this alert rule. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * Determines whether this alert rule is enabled or disabled. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * The last time that this alert rule has been modified. + */ + @JsonProperty(value = "lastModifiedUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedUtc; + + /* + * The severity for alerts created by this alert rule. + */ + @JsonProperty(value = "severity", access = JsonProperty.Access.WRITE_ONLY) + private AlertSeverity severity; + + /* + * The tactics of the alert rule + */ + @JsonProperty(value = "tactics", access = JsonProperty.Access.WRITE_ONLY) + private List tactics; + + /** + * Get the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. + * + * @return the alertRuleTemplateName value. + */ + public String alertRuleTemplateName() { + return this.alertRuleTemplateName; + } + + /** + * Set the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. + * + * @param alertRuleTemplateName the alertRuleTemplateName value to set. + * @return the MLBehaviorAnalyticsAlertRuleProperties object itself. + */ + public MLBehaviorAnalyticsAlertRuleProperties withAlertRuleTemplateName(String alertRuleTemplateName) { + this.alertRuleTemplateName = alertRuleTemplateName; + return this; + } + + /** + * Get the description property: The description of the alert rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the displayName property: The display name for alerts created by this alert rule. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the enabled property: Determines whether this alert rule is enabled or disabled. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Determines whether this alert rule is enabled or disabled. + * + * @param enabled the enabled value to set. + * @return the MLBehaviorAnalyticsAlertRuleProperties object itself. + */ + public MLBehaviorAnalyticsAlertRuleProperties withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the lastModifiedUtc property: The last time that this alert rule has been modified. + * + * @return the lastModifiedUtc value. + */ + public OffsetDateTime lastModifiedUtc() { + return this.lastModifiedUtc; + } + + /** + * Get the severity property: The severity for alerts created by this alert rule. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.severity; + } + + /** + * Get the tactics property: The tactics of the alert rule. + * + * @return the tactics value. + */ + public List tactics() { + return this.tactics; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (alertRuleTemplateName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property alertRuleTemplateName in model" + + " MLBehaviorAnalyticsAlertRuleProperties")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MLBehaviorAnalyticsAlertRuleTemplateProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MLBehaviorAnalyticsAlertRuleTemplateProperties.java new file mode 100644 index 000000000000..288c148dc9a3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MLBehaviorAnalyticsAlertRuleTemplateProperties.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateDataSource; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplatePropertiesBase; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.TemplateStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** MLBehaviorAnalytics alert rule template properties. */ +@Fluent +public final class MLBehaviorAnalyticsAlertRuleTemplateProperties extends AlertRuleTemplatePropertiesBase { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MLBehaviorAnalyticsAlertRuleTemplateProperties.class); + + /* + * The severity for alerts created by this alert rule. + */ + @JsonProperty(value = "severity", required = true) + private AlertSeverity severity; + + /* + * The tactics of the alert rule template. + */ + @JsonProperty(value = "tactics") + private List tactics; + + /** + * Get the severity property: The severity for alerts created by this alert rule. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.severity; + } + + /** + * Set the severity property: The severity for alerts created by this alert rule. + * + * @param severity the severity value to set. + * @return the MLBehaviorAnalyticsAlertRuleTemplateProperties object itself. + */ + public MLBehaviorAnalyticsAlertRuleTemplateProperties withSeverity(AlertSeverity severity) { + this.severity = severity; + return this; + } + + /** + * Get the tactics property: The tactics of the alert rule template. + * + * @return the tactics value. + */ + public List tactics() { + return this.tactics; + } + + /** + * Set the tactics property: The tactics of the alert rule template. + * + * @param tactics the tactics value to set. + * @return the MLBehaviorAnalyticsAlertRuleTemplateProperties object itself. + */ + public MLBehaviorAnalyticsAlertRuleTemplateProperties withTactics(List tactics) { + this.tactics = tactics; + return this; + } + + /** {@inheritDoc} */ + @Override + public MLBehaviorAnalyticsAlertRuleTemplateProperties withAlertRulesCreatedByTemplateCount( + Integer alertRulesCreatedByTemplateCount) { + super.withAlertRulesCreatedByTemplateCount(alertRulesCreatedByTemplateCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public MLBehaviorAnalyticsAlertRuleTemplateProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public MLBehaviorAnalyticsAlertRuleTemplateProperties withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** {@inheritDoc} */ + @Override + public MLBehaviorAnalyticsAlertRuleTemplateProperties withRequiredDataConnectors( + List requiredDataConnectors) { + super.withRequiredDataConnectors(requiredDataConnectors); + return this; + } + + /** {@inheritDoc} */ + @Override + public MLBehaviorAnalyticsAlertRuleTemplateProperties withStatus(TemplateStatus status) { + super.withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (severity() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property severity in model MLBehaviorAnalyticsAlertRuleTemplateProperties")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MailClusterEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MailClusterEntityProperties.java new file mode 100644 index 000000000000..637a9c1baab7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MailClusterEntityProperties.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Mail cluster entity property bag. */ +@Immutable +public final class MailClusterEntityProperties extends EntityCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MailClusterEntityProperties.class); + + /* + * The mail message IDs that are part of the mail cluster + */ + @JsonProperty(value = "networkMessageIds", access = JsonProperty.Access.WRITE_ONLY) + private List networkMessageIds; + + /* + * Count of mail messages by DeliveryStatus string representation + */ + @JsonProperty(value = "countByDeliveryStatus", access = JsonProperty.Access.WRITE_ONLY) + private Object countByDeliveryStatus; + + /* + * Count of mail messages by ThreatType string representation + */ + @JsonProperty(value = "countByThreatType", access = JsonProperty.Access.WRITE_ONLY) + private Object countByThreatType; + + /* + * Count of mail messages by ProtectionStatus string representation + */ + @JsonProperty(value = "countByProtectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private Object countByProtectionStatus; + + /* + * The threats of mail messages that are part of the mail cluster + */ + @JsonProperty(value = "threats", access = JsonProperty.Access.WRITE_ONLY) + private List threats; + + /* + * The query that was used to identify the messages of the mail cluster + */ + @JsonProperty(value = "query", access = JsonProperty.Access.WRITE_ONLY) + private String query; + + /* + * The query time + */ + @JsonProperty(value = "queryTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime queryTime; + + /* + * The number of mail messages that are part of the mail cluster + */ + @JsonProperty(value = "mailCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer mailCount; + + /* + * Is this a volume anomaly mail cluster + */ + @JsonProperty(value = "isVolumeAnomaly", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isVolumeAnomaly; + + /* + * The source of the mail cluster (default is 'O365 ATP') + */ + @JsonProperty(value = "source", access = JsonProperty.Access.WRITE_ONLY) + private String source; + + /* + * The id of the cluster source + */ + @JsonProperty(value = "clusterSourceIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String clusterSourceIdentifier; + + /* + * The type of the cluster source + */ + @JsonProperty(value = "clusterSourceType", access = JsonProperty.Access.WRITE_ONLY) + private String clusterSourceType; + + /* + * The cluster query start time + */ + @JsonProperty(value = "clusterQueryStartTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime clusterQueryStartTime; + + /* + * The cluster query end time + */ + @JsonProperty(value = "clusterQueryEndTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime clusterQueryEndTime; + + /* + * The cluster group + */ + @JsonProperty(value = "clusterGroup", access = JsonProperty.Access.WRITE_ONLY) + private String clusterGroup; + + /** + * Get the networkMessageIds property: The mail message IDs that are part of the mail cluster. + * + * @return the networkMessageIds value. + */ + public List networkMessageIds() { + return this.networkMessageIds; + } + + /** + * Get the countByDeliveryStatus property: Count of mail messages by DeliveryStatus string representation. + * + * @return the countByDeliveryStatus value. + */ + public Object countByDeliveryStatus() { + return this.countByDeliveryStatus; + } + + /** + * Get the countByThreatType property: Count of mail messages by ThreatType string representation. + * + * @return the countByThreatType value. + */ + public Object countByThreatType() { + return this.countByThreatType; + } + + /** + * Get the countByProtectionStatus property: Count of mail messages by ProtectionStatus string representation. + * + * @return the countByProtectionStatus value. + */ + public Object countByProtectionStatus() { + return this.countByProtectionStatus; + } + + /** + * Get the threats property: The threats of mail messages that are part of the mail cluster. + * + * @return the threats value. + */ + public List threats() { + return this.threats; + } + + /** + * Get the query property: The query that was used to identify the messages of the mail cluster. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * Get the queryTime property: The query time. + * + * @return the queryTime value. + */ + public OffsetDateTime queryTime() { + return this.queryTime; + } + + /** + * Get the mailCount property: The number of mail messages that are part of the mail cluster. + * + * @return the mailCount value. + */ + public Integer mailCount() { + return this.mailCount; + } + + /** + * Get the isVolumeAnomaly property: Is this a volume anomaly mail cluster. + * + * @return the isVolumeAnomaly value. + */ + public Boolean isVolumeAnomaly() { + return this.isVolumeAnomaly; + } + + /** + * Get the source property: The source of the mail cluster (default is 'O365 ATP'). + * + * @return the source value. + */ + public String source() { + return this.source; + } + + /** + * Get the clusterSourceIdentifier property: The id of the cluster source. + * + * @return the clusterSourceIdentifier value. + */ + public String clusterSourceIdentifier() { + return this.clusterSourceIdentifier; + } + + /** + * Get the clusterSourceType property: The type of the cluster source. + * + * @return the clusterSourceType value. + */ + public String clusterSourceType() { + return this.clusterSourceType; + } + + /** + * Get the clusterQueryStartTime property: The cluster query start time. + * + * @return the clusterQueryStartTime value. + */ + public OffsetDateTime clusterQueryStartTime() { + return this.clusterQueryStartTime; + } + + /** + * Get the clusterQueryEndTime property: The cluster query end time. + * + * @return the clusterQueryEndTime value. + */ + public OffsetDateTime clusterQueryEndTime() { + return this.clusterQueryEndTime; + } + + /** + * Get the clusterGroup property: The cluster group. + * + * @return the clusterGroup value. + */ + public String clusterGroup() { + return this.clusterGroup; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MailMessageEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MailMessageEntityProperties.java new file mode 100644 index 000000000000..472408e6c2e9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MailMessageEntityProperties.java @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AntispamMailDirection; +import com.azure.resourcemanager.securityinsights.models.DeliveryAction; +import com.azure.resourcemanager.securityinsights.models.DeliveryLocation; +import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.UUID; + +/** Mail message entity property bag. */ +@Fluent +public final class MailMessageEntityProperties extends EntityCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MailMessageEntityProperties.class); + + /* + * The File entity ids of this mail message's attachments + */ + @JsonProperty(value = "fileEntityIds", access = JsonProperty.Access.WRITE_ONLY) + private List fileEntityIds; + + /* + * The recipient of this mail message. Note that in case of multiple + * recipients the mail message is forked and each copy has one recipient + */ + @JsonProperty(value = "recipient", access = JsonProperty.Access.WRITE_ONLY) + private String recipient; + + /* + * The Urls contained in this mail message + */ + @JsonProperty(value = "urls", access = JsonProperty.Access.WRITE_ONLY) + private List urls; + + /* + * The threats of this mail message + */ + @JsonProperty(value = "threats", access = JsonProperty.Access.WRITE_ONLY) + private List threats; + + /* + * The p1 sender's email address + */ + @JsonProperty(value = "p1Sender", access = JsonProperty.Access.WRITE_ONLY) + private String p1Sender; + + /* + * The p1 sender's display name + */ + @JsonProperty(value = "p1SenderDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String p1SenderDisplayName; + + /* + * The p1 sender's domain + */ + @JsonProperty(value = "p1SenderDomain", access = JsonProperty.Access.WRITE_ONLY) + private String p1SenderDomain; + + /* + * The sender's IP address + */ + @JsonProperty(value = "senderIP", access = JsonProperty.Access.WRITE_ONLY) + private String senderIp; + + /* + * The p2 sender's email address + */ + @JsonProperty(value = "p2Sender", access = JsonProperty.Access.WRITE_ONLY) + private String p2Sender; + + /* + * The p2 sender's display name + */ + @JsonProperty(value = "p2SenderDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String p2SenderDisplayName; + + /* + * The p2 sender's domain + */ + @JsonProperty(value = "p2SenderDomain", access = JsonProperty.Access.WRITE_ONLY) + private String p2SenderDomain; + + /* + * The receive date of this message + */ + @JsonProperty(value = "receiveDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime receiveDate; + + /* + * The network message id of this mail message + */ + @JsonProperty(value = "networkMessageId", access = JsonProperty.Access.WRITE_ONLY) + private UUID networkMessageId; + + /* + * The internet message id of this mail message + */ + @JsonProperty(value = "internetMessageId", access = JsonProperty.Access.WRITE_ONLY) + private String internetMessageId; + + /* + * The subject of this mail message + */ + @JsonProperty(value = "subject", access = JsonProperty.Access.WRITE_ONLY) + private String subject; + + /* + * The language of this mail message + */ + @JsonProperty(value = "language", access = JsonProperty.Access.WRITE_ONLY) + private String language; + + /* + * The threat detection methods + */ + @JsonProperty(value = "threatDetectionMethods", access = JsonProperty.Access.WRITE_ONLY) + private List threatDetectionMethods; + + /* + * The bodyFingerprintBin1 + */ + @JsonProperty(value = "bodyFingerprintBin1") + private Integer bodyFingerprintBin1; + + /* + * The bodyFingerprintBin2 + */ + @JsonProperty(value = "bodyFingerprintBin2") + private Integer bodyFingerprintBin2; + + /* + * The bodyFingerprintBin3 + */ + @JsonProperty(value = "bodyFingerprintBin3") + private Integer bodyFingerprintBin3; + + /* + * The bodyFingerprintBin4 + */ + @JsonProperty(value = "bodyFingerprintBin4") + private Integer bodyFingerprintBin4; + + /* + * The bodyFingerprintBin5 + */ + @JsonProperty(value = "bodyFingerprintBin5") + private Integer bodyFingerprintBin5; + + /* + * The directionality of this mail message + */ + @JsonProperty(value = "antispamDirection") + private AntispamMailDirection antispamDirection; + + /* + * The delivery action of this mail message like Delivered, Blocked, + * Replaced etc + */ + @JsonProperty(value = "deliveryAction") + private DeliveryAction deliveryAction; + + /* + * The delivery location of this mail message like Inbox, JunkFolder etc + */ + @JsonProperty(value = "deliveryLocation") + private DeliveryLocation deliveryLocation; + + /** + * Get the fileEntityIds property: The File entity ids of this mail message's attachments. + * + * @return the fileEntityIds value. + */ + public List fileEntityIds() { + return this.fileEntityIds; + } + + /** + * Get the recipient property: The recipient of this mail message. Note that in case of multiple recipients the mail + * message is forked and each copy has one recipient. + * + * @return the recipient value. + */ + public String recipient() { + return this.recipient; + } + + /** + * Get the urls property: The Urls contained in this mail message. + * + * @return the urls value. + */ + public List urls() { + return this.urls; + } + + /** + * Get the threats property: The threats of this mail message. + * + * @return the threats value. + */ + public List threats() { + return this.threats; + } + + /** + * Get the p1Sender property: The p1 sender's email address. + * + * @return the p1Sender value. + */ + public String p1Sender() { + return this.p1Sender; + } + + /** + * Get the p1SenderDisplayName property: The p1 sender's display name. + * + * @return the p1SenderDisplayName value. + */ + public String p1SenderDisplayName() { + return this.p1SenderDisplayName; + } + + /** + * Get the p1SenderDomain property: The p1 sender's domain. + * + * @return the p1SenderDomain value. + */ + public String p1SenderDomain() { + return this.p1SenderDomain; + } + + /** + * Get the senderIp property: The sender's IP address. + * + * @return the senderIp value. + */ + public String senderIp() { + return this.senderIp; + } + + /** + * Get the p2Sender property: The p2 sender's email address. + * + * @return the p2Sender value. + */ + public String p2Sender() { + return this.p2Sender; + } + + /** + * Get the p2SenderDisplayName property: The p2 sender's display name. + * + * @return the p2SenderDisplayName value. + */ + public String p2SenderDisplayName() { + return this.p2SenderDisplayName; + } + + /** + * Get the p2SenderDomain property: The p2 sender's domain. + * + * @return the p2SenderDomain value. + */ + public String p2SenderDomain() { + return this.p2SenderDomain; + } + + /** + * Get the receiveDate property: The receive date of this message. + * + * @return the receiveDate value. + */ + public OffsetDateTime receiveDate() { + return this.receiveDate; + } + + /** + * Get the networkMessageId property: The network message id of this mail message. + * + * @return the networkMessageId value. + */ + public UUID networkMessageId() { + return this.networkMessageId; + } + + /** + * Get the internetMessageId property: The internet message id of this mail message. + * + * @return the internetMessageId value. + */ + public String internetMessageId() { + return this.internetMessageId; + } + + /** + * Get the subject property: The subject of this mail message. + * + * @return the subject value. + */ + public String subject() { + return this.subject; + } + + /** + * Get the language property: The language of this mail message. + * + * @return the language value. + */ + public String language() { + return this.language; + } + + /** + * Get the threatDetectionMethods property: The threat detection methods. + * + * @return the threatDetectionMethods value. + */ + public List threatDetectionMethods() { + return this.threatDetectionMethods; + } + + /** + * Get the bodyFingerprintBin1 property: The bodyFingerprintBin1. + * + * @return the bodyFingerprintBin1 value. + */ + public Integer bodyFingerprintBin1() { + return this.bodyFingerprintBin1; + } + + /** + * Set the bodyFingerprintBin1 property: The bodyFingerprintBin1. + * + * @param bodyFingerprintBin1 the bodyFingerprintBin1 value to set. + * @return the MailMessageEntityProperties object itself. + */ + public MailMessageEntityProperties withBodyFingerprintBin1(Integer bodyFingerprintBin1) { + this.bodyFingerprintBin1 = bodyFingerprintBin1; + return this; + } + + /** + * Get the bodyFingerprintBin2 property: The bodyFingerprintBin2. + * + * @return the bodyFingerprintBin2 value. + */ + public Integer bodyFingerprintBin2() { + return this.bodyFingerprintBin2; + } + + /** + * Set the bodyFingerprintBin2 property: The bodyFingerprintBin2. + * + * @param bodyFingerprintBin2 the bodyFingerprintBin2 value to set. + * @return the MailMessageEntityProperties object itself. + */ + public MailMessageEntityProperties withBodyFingerprintBin2(Integer bodyFingerprintBin2) { + this.bodyFingerprintBin2 = bodyFingerprintBin2; + return this; + } + + /** + * Get the bodyFingerprintBin3 property: The bodyFingerprintBin3. + * + * @return the bodyFingerprintBin3 value. + */ + public Integer bodyFingerprintBin3() { + return this.bodyFingerprintBin3; + } + + /** + * Set the bodyFingerprintBin3 property: The bodyFingerprintBin3. + * + * @param bodyFingerprintBin3 the bodyFingerprintBin3 value to set. + * @return the MailMessageEntityProperties object itself. + */ + public MailMessageEntityProperties withBodyFingerprintBin3(Integer bodyFingerprintBin3) { + this.bodyFingerprintBin3 = bodyFingerprintBin3; + return this; + } + + /** + * Get the bodyFingerprintBin4 property: The bodyFingerprintBin4. + * + * @return the bodyFingerprintBin4 value. + */ + public Integer bodyFingerprintBin4() { + return this.bodyFingerprintBin4; + } + + /** + * Set the bodyFingerprintBin4 property: The bodyFingerprintBin4. + * + * @param bodyFingerprintBin4 the bodyFingerprintBin4 value to set. + * @return the MailMessageEntityProperties object itself. + */ + public MailMessageEntityProperties withBodyFingerprintBin4(Integer bodyFingerprintBin4) { + this.bodyFingerprintBin4 = bodyFingerprintBin4; + return this; + } + + /** + * Get the bodyFingerprintBin5 property: The bodyFingerprintBin5. + * + * @return the bodyFingerprintBin5 value. + */ + public Integer bodyFingerprintBin5() { + return this.bodyFingerprintBin5; + } + + /** + * Set the bodyFingerprintBin5 property: The bodyFingerprintBin5. + * + * @param bodyFingerprintBin5 the bodyFingerprintBin5 value to set. + * @return the MailMessageEntityProperties object itself. + */ + public MailMessageEntityProperties withBodyFingerprintBin5(Integer bodyFingerprintBin5) { + this.bodyFingerprintBin5 = bodyFingerprintBin5; + return this; + } + + /** + * Get the antispamDirection property: The directionality of this mail message. + * + * @return the antispamDirection value. + */ + public AntispamMailDirection antispamDirection() { + return this.antispamDirection; + } + + /** + * Set the antispamDirection property: The directionality of this mail message. + * + * @param antispamDirection the antispamDirection value to set. + * @return the MailMessageEntityProperties object itself. + */ + public MailMessageEntityProperties withAntispamDirection(AntispamMailDirection antispamDirection) { + this.antispamDirection = antispamDirection; + return this; + } + + /** + * Get the deliveryAction property: The delivery action of this mail message like Delivered, Blocked, Replaced etc. + * + * @return the deliveryAction value. + */ + public DeliveryAction deliveryAction() { + return this.deliveryAction; + } + + /** + * Set the deliveryAction property: The delivery action of this mail message like Delivered, Blocked, Replaced etc. + * + * @param deliveryAction the deliveryAction value to set. + * @return the MailMessageEntityProperties object itself. + */ + public MailMessageEntityProperties withDeliveryAction(DeliveryAction deliveryAction) { + this.deliveryAction = deliveryAction; + return this; + } + + /** + * Get the deliveryLocation property: The delivery location of this mail message like Inbox, JunkFolder etc. + * + * @return the deliveryLocation value. + */ + public DeliveryLocation deliveryLocation() { + return this.deliveryLocation; + } + + /** + * Set the deliveryLocation property: The delivery location of this mail message like Inbox, JunkFolder etc. + * + * @param deliveryLocation the deliveryLocation value to set. + * @return the MailMessageEntityProperties object itself. + */ + public MailMessageEntityProperties withDeliveryLocation(DeliveryLocation deliveryLocation) { + this.deliveryLocation = deliveryLocation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MailboxEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MailboxEntityProperties.java new file mode 100644 index 000000000000..323052891ea4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MailboxEntityProperties.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** Mailbox entity property bag. */ +@Immutable +public final class MailboxEntityProperties extends EntityCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MailboxEntityProperties.class); + + /* + * The mailbox's primary address + */ + @JsonProperty(value = "mailboxPrimaryAddress", access = JsonProperty.Access.WRITE_ONLY) + private String mailboxPrimaryAddress; + + /* + * The mailbox's display name + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * The mailbox's UPN + */ + @JsonProperty(value = "upn", access = JsonProperty.Access.WRITE_ONLY) + private String upn; + + /* + * The AzureAD identifier of mailbox. Similar to AadUserId in account + * entity but this property is specific to mailbox object on office side + */ + @JsonProperty(value = "externalDirectoryObjectId", access = JsonProperty.Access.WRITE_ONLY) + private UUID externalDirectoryObjectId; + + /** + * Get the mailboxPrimaryAddress property: The mailbox's primary address. + * + * @return the mailboxPrimaryAddress value. + */ + public String mailboxPrimaryAddress() { + return this.mailboxPrimaryAddress; + } + + /** + * Get the displayName property: The mailbox's display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the upn property: The mailbox's UPN. + * + * @return the upn value. + */ + public String upn() { + return this.upn; + } + + /** + * Get the externalDirectoryObjectId property: The AzureAD identifier of mailbox. Similar to AadUserId in account + * entity but this property is specific to mailbox object on office side. + * + * @return the externalDirectoryObjectId value. + */ + public UUID externalDirectoryObjectId() { + return this.externalDirectoryObjectId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MalwareEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MalwareEntityProperties.java new file mode 100644 index 000000000000..a0a57424dcad --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MalwareEntityProperties.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Malware entity property bag. */ +@Immutable +public final class MalwareEntityProperties extends EntityCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MalwareEntityProperties.class); + + /* + * The malware category by the vendor, e.g. Trojan + */ + @JsonProperty(value = "category", access = JsonProperty.Access.WRITE_ONLY) + private String category; + + /* + * List of linked file entity identifiers on which the malware was found + */ + @JsonProperty(value = "fileEntityIds", access = JsonProperty.Access.WRITE_ONLY) + private List fileEntityIds; + + /* + * The malware name by the vendor, e.g. Win32/Toga!rfn + */ + @JsonProperty(value = "malwareName", access = JsonProperty.Access.WRITE_ONLY) + private String malwareName; + + /* + * List of linked process entity identifiers on which the malware was + * found. + */ + @JsonProperty(value = "processEntityIds", access = JsonProperty.Access.WRITE_ONLY) + private List processEntityIds; + + /** + * Get the category property: The malware category by the vendor, e.g. Trojan. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Get the fileEntityIds property: List of linked file entity identifiers on which the malware was found. + * + * @return the fileEntityIds value. + */ + public List fileEntityIds() { + return this.fileEntityIds; + } + + /** + * Get the malwareName property: The malware name by the vendor, e.g. Win32/Toga!rfn. + * + * @return the malwareName value. + */ + public String malwareName() { + return this.malwareName; + } + + /** + * Get the processEntityIds property: List of linked process entity identifiers on which the malware was found. + * + * @return the processEntityIds value. + */ + public List processEntityIds() { + return this.processEntityIds; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/McasCheckRequirementsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/McasCheckRequirementsProperties.java new file mode 100644 index 000000000000..8ac513683c89 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/McasCheckRequirementsProperties.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** MCAS (Microsoft Cloud App Security) requirements check properties. */ +@Fluent +public final class McasCheckRequirementsProperties extends DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(McasCheckRequirementsProperties.class); + + /** {@inheritDoc} */ + @Override + public McasCheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/McasDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/McasDataConnectorProperties.java new file mode 100644 index 000000000000..0bbae456829f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/McasDataConnectorProperties.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.azure.resourcemanager.securityinsights.models.McasDataConnectorDataTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** MCAS (Microsoft Cloud App Security) data connector properties. */ +@Fluent +public final class McasDataConnectorProperties extends DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(McasDataConnectorProperties.class); + + /* + * The available data types for the connector. + */ + @JsonProperty(value = "dataTypes", required = true) + private McasDataConnectorDataTypes dataTypes; + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public McasDataConnectorDataTypes dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the McasDataConnectorProperties object itself. + */ + public McasDataConnectorProperties withDataTypes(McasDataConnectorDataTypes dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** {@inheritDoc} */ + @Override + public McasDataConnectorProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataTypes() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dataTypes in model McasDataConnectorProperties")); + } else { + dataTypes().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MdatpCheckRequirementsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MdatpCheckRequirementsProperties.java new file mode 100644 index 000000000000..a3f0661421d2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MdatpCheckRequirementsProperties.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** MDATP (Microsoft Defender Advanced Threat Protection) requirements check properties. */ +@Fluent +public final class MdatpCheckRequirementsProperties extends DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MdatpCheckRequirementsProperties.class); + + /** {@inheritDoc} */ + @Override + public MdatpCheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MdatpDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MdatpDataConnectorProperties.java new file mode 100644 index 000000000000..bb14bcbdd994 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MdatpDataConnectorProperties.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AlertsDataTypeOfDataConnector; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** MDATP (Microsoft Defender Advanced Threat Protection) data connector properties. */ +@Fluent +public final class MdatpDataConnectorProperties extends DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MdatpDataConnectorProperties.class); + + /* + * The available data types for the connector. + */ + @JsonProperty(value = "dataTypes") + private AlertsDataTypeOfDataConnector dataTypes; + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public AlertsDataTypeOfDataConnector dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the MdatpDataConnectorProperties object itself. + */ + public MdatpDataConnectorProperties withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** {@inheritDoc} */ + @Override + public MdatpDataConnectorProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataTypes() != null) { + dataTypes().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MetadataModelInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MetadataModelInner.java new file mode 100644 index 000000000000..23b926bf7937 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MetadataModelInner.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataAuthor; +import com.azure.resourcemanager.securityinsights.models.MetadataCategories; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencies; +import com.azure.resourcemanager.securityinsights.models.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.LocalDate; +import java.util.List; + +/** Metadata resource definition. */ +@Fluent +public final class MetadataModelInner extends ResourceWithEtag { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetadataModelInner.class); + + /* + * Metadata properties + */ + @JsonProperty(value = "properties") + private MetadataProperties innerProperties; + + /** + * Get the innerProperties property: Metadata properties. + * + * @return the innerProperties value. + */ + private MetadataProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public MetadataModelInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the contentId property: Static ID for the content. Used to identify dependencies and content from solutions + * or community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This is the + * resource name. + * + * @return the contentId value. + */ + public String contentId() { + return this.innerProperties() == null ? null : this.innerProperties().contentId(); + } + + /** + * Set the contentId property: Static ID for the content. Used to identify dependencies and content from solutions + * or community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This is the + * resource name. + * + * @param contentId the contentId value to set. + * @return the MetadataModelInner object itself. + */ + public MetadataModelInner withContentId(String contentId) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataProperties(); + } + this.innerProperties().withContentId(contentId); + return this; + } + + /** + * Get the parentId property: Full parent resource ID of the content item the metadata is for. This is the full + * resource ID including the scope (subscription and resource group). + * + * @return the parentId value. + */ + public String parentId() { + return this.innerProperties() == null ? null : this.innerProperties().parentId(); + } + + /** + * Set the parentId property: Full parent resource ID of the content item the metadata is for. This is the full + * resource ID including the scope (subscription and resource group). + * + * @param parentId the parentId value to set. + * @return the MetadataModelInner object itself. + */ + public MetadataModelInner withParentId(String parentId) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataProperties(); + } + this.innerProperties().withParentId(parentId); + return this; + } + + /** + * Get the version property: Version of the content. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0, + * 1.0.0.0), following ARM template best practices. Can also be any string, but then we cannot guarantee any version + * checks. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Set the version property: Version of the content. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0, + * 1.0.0.0), following ARM template best practices. Can also be any string, but then we cannot guarantee any version + * checks. + * + * @param version the version value to set. + * @return the MetadataModelInner object itself. + */ + public MetadataModelInner withVersion(String version) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataProperties(); + } + this.innerProperties().withVersion(version); + return this; + } + + /** + * Get the kind property: The kind of content the metadata is for. + * + * @return the kind value. + */ + public Kind kind() { + return this.innerProperties() == null ? null : this.innerProperties().kind(); + } + + /** + * Set the kind property: The kind of content the metadata is for. + * + * @param kind the kind value to set. + * @return the MetadataModelInner object itself. + */ + public MetadataModelInner withKind(Kind kind) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataProperties(); + } + this.innerProperties().withKind(kind); + return this; + } + + /** + * Get the source property: Source of the content. This is where/how it was created. + * + * @return the source value. + */ + public MetadataSource source() { + return this.innerProperties() == null ? null : this.innerProperties().source(); + } + + /** + * Set the source property: Source of the content. This is where/how it was created. + * + * @param source the source value to set. + * @return the MetadataModelInner object itself. + */ + public MetadataModelInner withSource(MetadataSource source) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataProperties(); + } + this.innerProperties().withSource(source); + return this; + } + + /** + * Get the author property: The creator of the content item. + * + * @return the author value. + */ + public MetadataAuthor author() { + return this.innerProperties() == null ? null : this.innerProperties().author(); + } + + /** + * Set the author property: The creator of the content item. + * + * @param author the author value to set. + * @return the MetadataModelInner object itself. + */ + public MetadataModelInner withAuthor(MetadataAuthor author) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataProperties(); + } + this.innerProperties().withAuthor(author); + return this; + } + + /** + * Get the support property: Support information for the metadata - type, name, contact information. + * + * @return the support value. + */ + public MetadataSupport support() { + return this.innerProperties() == null ? null : this.innerProperties().support(); + } + + /** + * Set the support property: Support information for the metadata - type, name, contact information. + * + * @param support the support value to set. + * @return the MetadataModelInner object itself. + */ + public MetadataModelInner withSupport(MetadataSupport support) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataProperties(); + } + this.innerProperties().withSupport(support); + return this; + } + + /** + * Get the dependencies property: Dependencies for the content item, what other content items it requires to work. + * Can describe more complex dependencies using a recursive/nested structure. For a single dependency an + * id/kind/version can be supplied or operator/criteria for complex formats. + * + * @return the dependencies value. + */ + public MetadataDependencies dependencies() { + return this.innerProperties() == null ? null : this.innerProperties().dependencies(); + } + + /** + * Set the dependencies property: Dependencies for the content item, what other content items it requires to work. + * Can describe more complex dependencies using a recursive/nested structure. For a single dependency an + * id/kind/version can be supplied or operator/criteria for complex formats. + * + * @param dependencies the dependencies value to set. + * @return the MetadataModelInner object itself. + */ + public MetadataModelInner withDependencies(MetadataDependencies dependencies) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataProperties(); + } + this.innerProperties().withDependencies(dependencies); + return this; + } + + /** + * Get the categories property: Categories for the solution content item. + * + * @return the categories value. + */ + public MetadataCategories categories() { + return this.innerProperties() == null ? null : this.innerProperties().categories(); + } + + /** + * Set the categories property: Categories for the solution content item. + * + * @param categories the categories value to set. + * @return the MetadataModelInner object itself. + */ + public MetadataModelInner withCategories(MetadataCategories categories) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataProperties(); + } + this.innerProperties().withCategories(categories); + return this; + } + + /** + * Get the providers property: Providers for the solution content item. + * + * @return the providers value. + */ + public List providers() { + return this.innerProperties() == null ? null : this.innerProperties().providers(); + } + + /** + * Set the providers property: Providers for the solution content item. + * + * @param providers the providers value to set. + * @return the MetadataModelInner object itself. + */ + public MetadataModelInner withProviders(List providers) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataProperties(); + } + this.innerProperties().withProviders(providers); + return this; + } + + /** + * Get the firstPublishDate property: first publish date solution content item. + * + * @return the firstPublishDate value. + */ + public LocalDate firstPublishDate() { + return this.innerProperties() == null ? null : this.innerProperties().firstPublishDate(); + } + + /** + * Set the firstPublishDate property: first publish date solution content item. + * + * @param firstPublishDate the firstPublishDate value to set. + * @return the MetadataModelInner object itself. + */ + public MetadataModelInner withFirstPublishDate(LocalDate firstPublishDate) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataProperties(); + } + this.innerProperties().withFirstPublishDate(firstPublishDate); + return this; + } + + /** + * Get the lastPublishDate property: last publish date for the solution content item. + * + * @return the lastPublishDate value. + */ + public LocalDate lastPublishDate() { + return this.innerProperties() == null ? null : this.innerProperties().lastPublishDate(); + } + + /** + * Set the lastPublishDate property: last publish date for the solution content item. + * + * @param lastPublishDate the lastPublishDate value to set. + * @return the MetadataModelInner object itself. + */ + public MetadataModelInner withLastPublishDate(LocalDate lastPublishDate) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataProperties(); + } + this.innerProperties().withLastPublishDate(lastPublishDate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MetadataProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MetadataProperties.java new file mode 100644 index 000000000000..9ac1834dc3fd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MetadataProperties.java @@ -0,0 +1,393 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataAuthor; +import com.azure.resourcemanager.securityinsights.models.MetadataCategories; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencies; +import com.azure.resourcemanager.securityinsights.models.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.LocalDate; +import java.util.List; + +/** Metadata property bag. */ +@Fluent +public final class MetadataProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetadataProperties.class); + + /* + * Static ID for the content. Used to identify dependencies and content + * from solutions or community. Hard-coded/static for out of the box + * content and solutions. Dynamic for user-created. This is the resource + * name + */ + @JsonProperty(value = "contentId") + private String contentId; + + /* + * Full parent resource ID of the content item the metadata is for. This + * is the full resource ID including the scope (subscription and resource + * group) + */ + @JsonProperty(value = "parentId", required = true) + private String parentId; + + /* + * Version of the content. Default and recommended format is numeric (e.g. + * 1, 1.0, 1.0.0, 1.0.0.0), following ARM template best practices. Can + * also be any string, but then we cannot guarantee any version checks + */ + @JsonProperty(value = "version") + private String version; + + /* + * The kind of content the metadata is for. + */ + @JsonProperty(value = "kind", required = true) + private Kind kind; + + /* + * Source of the content. This is where/how it was created. + */ + @JsonProperty(value = "source") + private MetadataSource source; + + /* + * The creator of the content item. + */ + @JsonProperty(value = "author") + private MetadataAuthor author; + + /* + * Support information for the metadata - type, name, contact information + */ + @JsonProperty(value = "support") + private MetadataSupport support; + + /* + * Dependencies for the content item, what other content items it requires + * to work. Can describe more complex dependencies using a + * recursive/nested structure. For a single dependency an id/kind/version + * can be supplied or operator/criteria for complex formats. + */ + @JsonProperty(value = "dependencies") + private MetadataDependencies dependencies; + + /* + * Categories for the solution content item + */ + @JsonProperty(value = "categories") + private MetadataCategories categories; + + /* + * Providers for the solution content item + */ + @JsonProperty(value = "providers") + private List providers; + + /* + * first publish date solution content item + */ + @JsonProperty(value = "firstPublishDate") + private LocalDate firstPublishDate; + + /* + * last publish date for the solution content item + */ + @JsonProperty(value = "lastPublishDate") + private LocalDate lastPublishDate; + + /** + * Get the contentId property: Static ID for the content. Used to identify dependencies and content from solutions + * or community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This is the + * resource name. + * + * @return the contentId value. + */ + public String contentId() { + return this.contentId; + } + + /** + * Set the contentId property: Static ID for the content. Used to identify dependencies and content from solutions + * or community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This is the + * resource name. + * + * @param contentId the contentId value to set. + * @return the MetadataProperties object itself. + */ + public MetadataProperties withContentId(String contentId) { + this.contentId = contentId; + return this; + } + + /** + * Get the parentId property: Full parent resource ID of the content item the metadata is for. This is the full + * resource ID including the scope (subscription and resource group). + * + * @return the parentId value. + */ + public String parentId() { + return this.parentId; + } + + /** + * Set the parentId property: Full parent resource ID of the content item the metadata is for. This is the full + * resource ID including the scope (subscription and resource group). + * + * @param parentId the parentId value to set. + * @return the MetadataProperties object itself. + */ + public MetadataProperties withParentId(String parentId) { + this.parentId = parentId; + return this; + } + + /** + * Get the version property: Version of the content. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0, + * 1.0.0.0), following ARM template best practices. Can also be any string, but then we cannot guarantee any version + * checks. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version of the content. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0, + * 1.0.0.0), following ARM template best practices. Can also be any string, but then we cannot guarantee any version + * checks. + * + * @param version the version value to set. + * @return the MetadataProperties object itself. + */ + public MetadataProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the kind property: The kind of content the metadata is for. + * + * @return the kind value. + */ + public Kind kind() { + return this.kind; + } + + /** + * Set the kind property: The kind of content the metadata is for. + * + * @param kind the kind value to set. + * @return the MetadataProperties object itself. + */ + public MetadataProperties withKind(Kind kind) { + this.kind = kind; + return this; + } + + /** + * Get the source property: Source of the content. This is where/how it was created. + * + * @return the source value. + */ + public MetadataSource source() { + return this.source; + } + + /** + * Set the source property: Source of the content. This is where/how it was created. + * + * @param source the source value to set. + * @return the MetadataProperties object itself. + */ + public MetadataProperties withSource(MetadataSource source) { + this.source = source; + return this; + } + + /** + * Get the author property: The creator of the content item. + * + * @return the author value. + */ + public MetadataAuthor author() { + return this.author; + } + + /** + * Set the author property: The creator of the content item. + * + * @param author the author value to set. + * @return the MetadataProperties object itself. + */ + public MetadataProperties withAuthor(MetadataAuthor author) { + this.author = author; + return this; + } + + /** + * Get the support property: Support information for the metadata - type, name, contact information. + * + * @return the support value. + */ + public MetadataSupport support() { + return this.support; + } + + /** + * Set the support property: Support information for the metadata - type, name, contact information. + * + * @param support the support value to set. + * @return the MetadataProperties object itself. + */ + public MetadataProperties withSupport(MetadataSupport support) { + this.support = support; + return this; + } + + /** + * Get the dependencies property: Dependencies for the content item, what other content items it requires to work. + * Can describe more complex dependencies using a recursive/nested structure. For a single dependency an + * id/kind/version can be supplied or operator/criteria for complex formats. + * + * @return the dependencies value. + */ + public MetadataDependencies dependencies() { + return this.dependencies; + } + + /** + * Set the dependencies property: Dependencies for the content item, what other content items it requires to work. + * Can describe more complex dependencies using a recursive/nested structure. For a single dependency an + * id/kind/version can be supplied or operator/criteria for complex formats. + * + * @param dependencies the dependencies value to set. + * @return the MetadataProperties object itself. + */ + public MetadataProperties withDependencies(MetadataDependencies dependencies) { + this.dependencies = dependencies; + return this; + } + + /** + * Get the categories property: Categories for the solution content item. + * + * @return the categories value. + */ + public MetadataCategories categories() { + return this.categories; + } + + /** + * Set the categories property: Categories for the solution content item. + * + * @param categories the categories value to set. + * @return the MetadataProperties object itself. + */ + public MetadataProperties withCategories(MetadataCategories categories) { + this.categories = categories; + return this; + } + + /** + * Get the providers property: Providers for the solution content item. + * + * @return the providers value. + */ + public List providers() { + return this.providers; + } + + /** + * Set the providers property: Providers for the solution content item. + * + * @param providers the providers value to set. + * @return the MetadataProperties object itself. + */ + public MetadataProperties withProviders(List providers) { + this.providers = providers; + return this; + } + + /** + * Get the firstPublishDate property: first publish date solution content item. + * + * @return the firstPublishDate value. + */ + public LocalDate firstPublishDate() { + return this.firstPublishDate; + } + + /** + * Set the firstPublishDate property: first publish date solution content item. + * + * @param firstPublishDate the firstPublishDate value to set. + * @return the MetadataProperties object itself. + */ + public MetadataProperties withFirstPublishDate(LocalDate firstPublishDate) { + this.firstPublishDate = firstPublishDate; + return this; + } + + /** + * Get the lastPublishDate property: last publish date for the solution content item. + * + * @return the lastPublishDate value. + */ + public LocalDate lastPublishDate() { + return this.lastPublishDate; + } + + /** + * Set the lastPublishDate property: last publish date for the solution content item. + * + * @param lastPublishDate the lastPublishDate value to set. + * @return the MetadataProperties object itself. + */ + public MetadataProperties withLastPublishDate(LocalDate lastPublishDate) { + this.lastPublishDate = lastPublishDate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (parentId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property parentId in model MetadataProperties")); + } + if (kind() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property kind in model MetadataProperties")); + } + if (source() != null) { + source().validate(); + } + if (author() != null) { + author().validate(); + } + if (support() != null) { + support().validate(); + } + if (dependencies() != null) { + dependencies().validate(); + } + if (categories() != null) { + categories().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MetadataPropertiesPatch.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MetadataPropertiesPatch.java new file mode 100644 index 000000000000..1b8e5a26fae1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MetadataPropertiesPatch.java @@ -0,0 +1,383 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataAuthor; +import com.azure.resourcemanager.securityinsights.models.MetadataCategories; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencies; +import com.azure.resourcemanager.securityinsights.models.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.LocalDate; +import java.util.List; + +/** Metadata property bag for patch requests. This is the same as the MetadataProperties, but with nothing required. */ +@Fluent +public final class MetadataPropertiesPatch { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetadataPropertiesPatch.class); + + /* + * Static ID for the content. Used to identify dependencies and content + * from solutions or community. Hard-coded/static for out of the box + * content and solutions. Dynamic for user-created. This is the resource + * name + */ + @JsonProperty(value = "contentId") + private String contentId; + + /* + * Full parent resource ID of the content item the metadata is for. This + * is the full resource ID including the scope (subscription and resource + * group) + */ + @JsonProperty(value = "parentId") + private String parentId; + + /* + * Version of the content. Default and recommended format is numeric (e.g. + * 1, 1.0, 1.0.0, 1.0.0.0), following ARM template best practices. Can + * also be any string, but then we cannot guarantee any version checks + */ + @JsonProperty(value = "version") + private String version; + + /* + * The kind of content the metadata is for. + */ + @JsonProperty(value = "kind") + private Kind kind; + + /* + * Source of the content. This is where/how it was created. + */ + @JsonProperty(value = "source") + private MetadataSource source; + + /* + * The creator of the content item. + */ + @JsonProperty(value = "author") + private MetadataAuthor author; + + /* + * Support information for the metadata - type, name, contact information + */ + @JsonProperty(value = "support") + private MetadataSupport support; + + /* + * Dependencies for the content item, what other content items it requires + * to work. Can describe more complex dependencies using a + * recursive/nested structure. For a single dependency an id/kind/version + * can be supplied or operator/criteria for complex formats. + */ + @JsonProperty(value = "dependencies") + private MetadataDependencies dependencies; + + /* + * Categories for the solution content item + */ + @JsonProperty(value = "categories") + private MetadataCategories categories; + + /* + * Providers for the solution content item + */ + @JsonProperty(value = "providers") + private List providers; + + /* + * first publish date solution content item + */ + @JsonProperty(value = "firstPublishDate") + private LocalDate firstPublishDate; + + /* + * last publish date for the solution content item + */ + @JsonProperty(value = "lastPublishDate") + private LocalDate lastPublishDate; + + /** + * Get the contentId property: Static ID for the content. Used to identify dependencies and content from solutions + * or community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This is the + * resource name. + * + * @return the contentId value. + */ + public String contentId() { + return this.contentId; + } + + /** + * Set the contentId property: Static ID for the content. Used to identify dependencies and content from solutions + * or community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This is the + * resource name. + * + * @param contentId the contentId value to set. + * @return the MetadataPropertiesPatch object itself. + */ + public MetadataPropertiesPatch withContentId(String contentId) { + this.contentId = contentId; + return this; + } + + /** + * Get the parentId property: Full parent resource ID of the content item the metadata is for. This is the full + * resource ID including the scope (subscription and resource group). + * + * @return the parentId value. + */ + public String parentId() { + return this.parentId; + } + + /** + * Set the parentId property: Full parent resource ID of the content item the metadata is for. This is the full + * resource ID including the scope (subscription and resource group). + * + * @param parentId the parentId value to set. + * @return the MetadataPropertiesPatch object itself. + */ + public MetadataPropertiesPatch withParentId(String parentId) { + this.parentId = parentId; + return this; + } + + /** + * Get the version property: Version of the content. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0, + * 1.0.0.0), following ARM template best practices. Can also be any string, but then we cannot guarantee any version + * checks. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version of the content. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0, + * 1.0.0.0), following ARM template best practices. Can also be any string, but then we cannot guarantee any version + * checks. + * + * @param version the version value to set. + * @return the MetadataPropertiesPatch object itself. + */ + public MetadataPropertiesPatch withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the kind property: The kind of content the metadata is for. + * + * @return the kind value. + */ + public Kind kind() { + return this.kind; + } + + /** + * Set the kind property: The kind of content the metadata is for. + * + * @param kind the kind value to set. + * @return the MetadataPropertiesPatch object itself. + */ + public MetadataPropertiesPatch withKind(Kind kind) { + this.kind = kind; + return this; + } + + /** + * Get the source property: Source of the content. This is where/how it was created. + * + * @return the source value. + */ + public MetadataSource source() { + return this.source; + } + + /** + * Set the source property: Source of the content. This is where/how it was created. + * + * @param source the source value to set. + * @return the MetadataPropertiesPatch object itself. + */ + public MetadataPropertiesPatch withSource(MetadataSource source) { + this.source = source; + return this; + } + + /** + * Get the author property: The creator of the content item. + * + * @return the author value. + */ + public MetadataAuthor author() { + return this.author; + } + + /** + * Set the author property: The creator of the content item. + * + * @param author the author value to set. + * @return the MetadataPropertiesPatch object itself. + */ + public MetadataPropertiesPatch withAuthor(MetadataAuthor author) { + this.author = author; + return this; + } + + /** + * Get the support property: Support information for the metadata - type, name, contact information. + * + * @return the support value. + */ + public MetadataSupport support() { + return this.support; + } + + /** + * Set the support property: Support information for the metadata - type, name, contact information. + * + * @param support the support value to set. + * @return the MetadataPropertiesPatch object itself. + */ + public MetadataPropertiesPatch withSupport(MetadataSupport support) { + this.support = support; + return this; + } + + /** + * Get the dependencies property: Dependencies for the content item, what other content items it requires to work. + * Can describe more complex dependencies using a recursive/nested structure. For a single dependency an + * id/kind/version can be supplied or operator/criteria for complex formats. + * + * @return the dependencies value. + */ + public MetadataDependencies dependencies() { + return this.dependencies; + } + + /** + * Set the dependencies property: Dependencies for the content item, what other content items it requires to work. + * Can describe more complex dependencies using a recursive/nested structure. For a single dependency an + * id/kind/version can be supplied or operator/criteria for complex formats. + * + * @param dependencies the dependencies value to set. + * @return the MetadataPropertiesPatch object itself. + */ + public MetadataPropertiesPatch withDependencies(MetadataDependencies dependencies) { + this.dependencies = dependencies; + return this; + } + + /** + * Get the categories property: Categories for the solution content item. + * + * @return the categories value. + */ + public MetadataCategories categories() { + return this.categories; + } + + /** + * Set the categories property: Categories for the solution content item. + * + * @param categories the categories value to set. + * @return the MetadataPropertiesPatch object itself. + */ + public MetadataPropertiesPatch withCategories(MetadataCategories categories) { + this.categories = categories; + return this; + } + + /** + * Get the providers property: Providers for the solution content item. + * + * @return the providers value. + */ + public List providers() { + return this.providers; + } + + /** + * Set the providers property: Providers for the solution content item. + * + * @param providers the providers value to set. + * @return the MetadataPropertiesPatch object itself. + */ + public MetadataPropertiesPatch withProviders(List providers) { + this.providers = providers; + return this; + } + + /** + * Get the firstPublishDate property: first publish date solution content item. + * + * @return the firstPublishDate value. + */ + public LocalDate firstPublishDate() { + return this.firstPublishDate; + } + + /** + * Set the firstPublishDate property: first publish date solution content item. + * + * @param firstPublishDate the firstPublishDate value to set. + * @return the MetadataPropertiesPatch object itself. + */ + public MetadataPropertiesPatch withFirstPublishDate(LocalDate firstPublishDate) { + this.firstPublishDate = firstPublishDate; + return this; + } + + /** + * Get the lastPublishDate property: last publish date for the solution content item. + * + * @return the lastPublishDate value. + */ + public LocalDate lastPublishDate() { + return this.lastPublishDate; + } + + /** + * Set the lastPublishDate property: last publish date for the solution content item. + * + * @param lastPublishDate the lastPublishDate value to set. + * @return the MetadataPropertiesPatch object itself. + */ + public MetadataPropertiesPatch withLastPublishDate(LocalDate lastPublishDate) { + this.lastPublishDate = lastPublishDate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() != null) { + source().validate(); + } + if (author() != null) { + author().validate(); + } + if (support() != null) { + support().validate(); + } + if (dependencies() != null) { + dependencies().validate(); + } + if (categories() != null) { + categories().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MicrosoftSecurityIncidentCreationAlertRuleProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MicrosoftSecurityIncidentCreationAlertRuleProperties.java new file mode 100644 index 000000000000..390d57cf965a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MicrosoftSecurityIncidentCreationAlertRuleProperties.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.MicrosoftSecurityIncidentCreationAlertRuleCommonProperties; +import com.azure.resourcemanager.securityinsights.models.MicrosoftSecurityProductName; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** MicrosoftSecurityIncidentCreation rule property bag. */ +@Fluent +public final class MicrosoftSecurityIncidentCreationAlertRuleProperties + extends MicrosoftSecurityIncidentCreationAlertRuleCommonProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MicrosoftSecurityIncidentCreationAlertRuleProperties.class); + + /* + * The Name of the alert rule template used to create this rule. + */ + @JsonProperty(value = "alertRuleTemplateName") + private String alertRuleTemplateName; + + /* + * The description of the alert rule. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The display name for alerts created by this alert rule. + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /* + * Determines whether this alert rule is enabled or disabled. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * The last time that this alert has been modified. + */ + @JsonProperty(value = "lastModifiedUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedUtc; + + /** + * Get the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. + * + * @return the alertRuleTemplateName value. + */ + public String alertRuleTemplateName() { + return this.alertRuleTemplateName; + } + + /** + * Set the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. + * + * @param alertRuleTemplateName the alertRuleTemplateName value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRuleProperties object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRuleProperties withAlertRuleTemplateName( + String alertRuleTemplateName) { + this.alertRuleTemplateName = alertRuleTemplateName; + return this; + } + + /** + * Get the description property: The description of the alert rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the alert rule. + * + * @param description the description value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRuleProperties object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRuleProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the displayName property: The display name for alerts created by this alert rule. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name for alerts created by this alert rule. + * + * @param displayName the displayName value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRuleProperties object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRuleProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the enabled property: Determines whether this alert rule is enabled or disabled. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Determines whether this alert rule is enabled or disabled. + * + * @param enabled the enabled value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRuleProperties object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRuleProperties withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the lastModifiedUtc property: The last time that this alert has been modified. + * + * @return the lastModifiedUtc value. + */ + public OffsetDateTime lastModifiedUtc() { + return this.lastModifiedUtc; + } + + /** {@inheritDoc} */ + @Override + public MicrosoftSecurityIncidentCreationAlertRuleProperties withDisplayNamesFilter( + List displayNamesFilter) { + super.withDisplayNamesFilter(displayNamesFilter); + return this; + } + + /** {@inheritDoc} */ + @Override + public MicrosoftSecurityIncidentCreationAlertRuleProperties withDisplayNamesExcludeFilter( + List displayNamesExcludeFilter) { + super.withDisplayNamesExcludeFilter(displayNamesExcludeFilter); + return this; + } + + /** {@inheritDoc} */ + @Override + public MicrosoftSecurityIncidentCreationAlertRuleProperties withProductFilter( + MicrosoftSecurityProductName productFilter) { + super.withProductFilter(productFilter); + return this; + } + + /** {@inheritDoc} */ + @Override + public MicrosoftSecurityIncidentCreationAlertRuleProperties withSeveritiesFilter( + List severitiesFilter) { + super.withSeveritiesFilter(severitiesFilter); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (displayName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property displayName in model" + + " MicrosoftSecurityIncidentCreationAlertRuleProperties")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties.java new file mode 100644 index 000000000000..92d23051b625 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateDataSource; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplatePropertiesBase; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.MicrosoftSecurityProductName; +import com.azure.resourcemanager.securityinsights.models.TemplateStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** MicrosoftSecurityIncidentCreation rule template properties. */ +@Fluent +public final class MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties + extends AlertRuleTemplatePropertiesBase { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties.class); + + /* + * the alerts' displayNames on which the cases will be generated + */ + @JsonProperty(value = "displayNamesFilter") + private List displayNamesFilter; + + /* + * the alerts' displayNames on which the cases will not be generated + */ + @JsonProperty(value = "displayNamesExcludeFilter") + private List displayNamesExcludeFilter; + + /* + * The alerts' productName on which the cases will be generated + */ + @JsonProperty(value = "productFilter", required = true) + private MicrosoftSecurityProductName productFilter; + + /* + * the alerts' severities on which the cases will be generated + */ + @JsonProperty(value = "severitiesFilter") + private List severitiesFilter; + + /** + * Get the displayNamesFilter property: the alerts' displayNames on which the cases will be generated. + * + * @return the displayNamesFilter value. + */ + public List displayNamesFilter() { + return this.displayNamesFilter; + } + + /** + * Set the displayNamesFilter property: the alerts' displayNames on which the cases will be generated. + * + * @param displayNamesFilter the displayNamesFilter value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties withDisplayNamesFilter( + List displayNamesFilter) { + this.displayNamesFilter = displayNamesFilter; + return this; + } + + /** + * Get the displayNamesExcludeFilter property: the alerts' displayNames on which the cases will not be generated. + * + * @return the displayNamesExcludeFilter value. + */ + public List displayNamesExcludeFilter() { + return this.displayNamesExcludeFilter; + } + + /** + * Set the displayNamesExcludeFilter property: the alerts' displayNames on which the cases will not be generated. + * + * @param displayNamesExcludeFilter the displayNamesExcludeFilter value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties withDisplayNamesExcludeFilter( + List displayNamesExcludeFilter) { + this.displayNamesExcludeFilter = displayNamesExcludeFilter; + return this; + } + + /** + * Get the productFilter property: The alerts' productName on which the cases will be generated. + * + * @return the productFilter value. + */ + public MicrosoftSecurityProductName productFilter() { + return this.productFilter; + } + + /** + * Set the productFilter property: The alerts' productName on which the cases will be generated. + * + * @param productFilter the productFilter value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties withProductFilter( + MicrosoftSecurityProductName productFilter) { + this.productFilter = productFilter; + return this; + } + + /** + * Get the severitiesFilter property: the alerts' severities on which the cases will be generated. + * + * @return the severitiesFilter value. + */ + public List severitiesFilter() { + return this.severitiesFilter; + } + + /** + * Set the severitiesFilter property: the alerts' severities on which the cases will be generated. + * + * @param severitiesFilter the severitiesFilter value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties withSeveritiesFilter( + List severitiesFilter) { + this.severitiesFilter = severitiesFilter; + return this; + } + + /** {@inheritDoc} */ + @Override + public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties withAlertRulesCreatedByTemplateCount( + Integer alertRulesCreatedByTemplateCount) { + super.withAlertRulesCreatedByTemplateCount(alertRulesCreatedByTemplateCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** {@inheritDoc} */ + @Override + public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties withRequiredDataConnectors( + List requiredDataConnectors) { + super.withRequiredDataConnectors(requiredDataConnectors); + return this; + } + + /** {@inheritDoc} */ + @Override + public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties withStatus(TemplateStatus status) { + super.withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (productFilter() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property productFilter in model" + + " MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MstiCheckRequirementsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MstiCheckRequirementsProperties.java new file mode 100644 index 000000000000..777a5a6e27a6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MstiCheckRequirementsProperties.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Microsoft Threat Intelligence requirements check properties. */ +@Fluent +public final class MstiCheckRequirementsProperties extends DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MstiCheckRequirementsProperties.class); + + /** {@inheritDoc} */ + @Override + public MstiCheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MstiDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MstiDataConnectorProperties.java new file mode 100644 index 000000000000..d4b5539349a6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MstiDataConnectorProperties.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.azure.resourcemanager.securityinsights.models.MstiDataConnectorDataTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Microsoft Threat Intelligence data connector properties. */ +@Fluent +public final class MstiDataConnectorProperties extends DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MstiDataConnectorProperties.class); + + /* + * The available data types for the connector. + */ + @JsonProperty(value = "dataTypes", required = true) + private MstiDataConnectorDataTypes dataTypes; + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public MstiDataConnectorDataTypes dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the MstiDataConnectorProperties object itself. + */ + public MstiDataConnectorProperties withDataTypes(MstiDataConnectorDataTypes dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** {@inheritDoc} */ + @Override + public MstiDataConnectorProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataTypes() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dataTypes in model MstiDataConnectorProperties")); + } else { + dataTypes().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MtpCheckRequirementsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MtpCheckRequirementsProperties.java new file mode 100644 index 000000000000..85c531289f3c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MtpCheckRequirementsProperties.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** MTP (Microsoft Threat Protection) requirements check properties. */ +@Fluent +public final class MtpCheckRequirementsProperties extends DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MtpCheckRequirementsProperties.class); + + /** {@inheritDoc} */ + @Override + public MtpCheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MtpDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MtpDataConnectorProperties.java new file mode 100644 index 000000000000..e4e352315287 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MtpDataConnectorProperties.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.azure.resourcemanager.securityinsights.models.MtpDataConnectorDataTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** MTP (Microsoft Threat Protection) data connector properties. */ +@Fluent +public final class MtpDataConnectorProperties extends DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MtpDataConnectorProperties.class); + + /* + * The available data types for the connector. + */ + @JsonProperty(value = "dataTypes", required = true) + private MtpDataConnectorDataTypes dataTypes; + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public MtpDataConnectorDataTypes dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the MtpDataConnectorProperties object itself. + */ + public MtpDataConnectorProperties withDataTypes(MtpDataConnectorDataTypes dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** {@inheritDoc} */ + @Override + public MtpDataConnectorProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataTypes() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dataTypes in model MtpDataConnectorProperties")); + } else { + dataTypes().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/NrtAlertRuleProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/NrtAlertRuleProperties.java new file mode 100644 index 000000000000..60491523dceb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/NrtAlertRuleProperties.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AlertDetailsOverride; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.EntityMapping; +import com.azure.resourcemanager.securityinsights.models.IncidentConfiguration; +import com.azure.resourcemanager.securityinsights.models.QueryBasedAlertRuleProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +/** Nrt alert rule base property bag. */ +@Fluent +public final class NrtAlertRuleProperties extends QueryBasedAlertRuleProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NrtAlertRuleProperties.class); + + /** {@inheritDoc} */ + @Override + public NrtAlertRuleProperties withAlertRuleTemplateName(String alertRuleTemplateName) { + super.withAlertRuleTemplateName(alertRuleTemplateName); + return this; + } + + /** {@inheritDoc} */ + @Override + public NrtAlertRuleProperties withTemplateVersion(String templateVersion) { + super.withTemplateVersion(templateVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public NrtAlertRuleProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public NrtAlertRuleProperties withQuery(String query) { + super.withQuery(query); + return this; + } + + /** {@inheritDoc} */ + @Override + public NrtAlertRuleProperties withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** {@inheritDoc} */ + @Override + public NrtAlertRuleProperties withEnabled(boolean enabled) { + super.withEnabled(enabled); + return this; + } + + /** {@inheritDoc} */ + @Override + public NrtAlertRuleProperties withSuppressionDuration(Duration suppressionDuration) { + super.withSuppressionDuration(suppressionDuration); + return this; + } + + /** {@inheritDoc} */ + @Override + public NrtAlertRuleProperties withSuppressionEnabled(boolean suppressionEnabled) { + super.withSuppressionEnabled(suppressionEnabled); + return this; + } + + /** {@inheritDoc} */ + @Override + public NrtAlertRuleProperties withSeverity(AlertSeverity severity) { + super.withSeverity(severity); + return this; + } + + /** {@inheritDoc} */ + @Override + public NrtAlertRuleProperties withTactics(List tactics) { + super.withTactics(tactics); + return this; + } + + /** {@inheritDoc} */ + @Override + public NrtAlertRuleProperties withIncidentConfiguration(IncidentConfiguration incidentConfiguration) { + super.withIncidentConfiguration(incidentConfiguration); + return this; + } + + /** {@inheritDoc} */ + @Override + public NrtAlertRuleProperties withCustomDetails(Map customDetails) { + super.withCustomDetails(customDetails); + return this; + } + + /** {@inheritDoc} */ + @Override + public NrtAlertRuleProperties withEntityMappings(List entityMappings) { + super.withEntityMappings(entityMappings); + return this; + } + + /** {@inheritDoc} */ + @Override + public NrtAlertRuleProperties withAlertDetailsOverride(AlertDetailsOverride alertDetailsOverride) { + super.withAlertDetailsOverride(alertDetailsOverride); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/NrtAlertRuleTemplateProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/NrtAlertRuleTemplateProperties.java new file mode 100644 index 000000000000..bd42d5c6f5ab --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/NrtAlertRuleTemplateProperties.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AlertDetailsOverride; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateDataSource; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplatePropertiesBase; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.EntityMapping; +import com.azure.resourcemanager.securityinsights.models.TemplateStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** NRT alert rule template properties. */ +@Fluent +public final class NrtAlertRuleTemplateProperties extends AlertRuleTemplatePropertiesBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NrtAlertRuleTemplateProperties.class); + + /* + * The query that creates alerts for this rule. + */ + @JsonProperty(value = "query") + private String query; + + /* + * The severity for alerts created by this alert rule. + */ + @JsonProperty(value = "severity") + private AlertSeverity severity; + + /* + * The tactics of the alert rule + */ + @JsonProperty(value = "tactics") + private List tactics; + + /* + * The version of this template - in format , where all are numbers. + * For example <1.0.2>. + */ + @JsonProperty(value = "version") + private String version; + + /* + * Dictionary of string key-value pairs of columns to be attached to the + * alert + */ + @JsonProperty(value = "customDetails") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map customDetails; + + /* + * Array of the entity mappings of the alert rule + */ + @JsonProperty(value = "entityMappings") + private List entityMappings; + + /* + * The alert details override settings + */ + @JsonProperty(value = "alertDetailsOverride") + private AlertDetailsOverride alertDetailsOverride; + + /** + * Get the query property: The query that creates alerts for this rule. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * Set the query property: The query that creates alerts for this rule. + * + * @param query the query value to set. + * @return the NrtAlertRuleTemplateProperties object itself. + */ + public NrtAlertRuleTemplateProperties withQuery(String query) { + this.query = query; + return this; + } + + /** + * Get the severity property: The severity for alerts created by this alert rule. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.severity; + } + + /** + * Set the severity property: The severity for alerts created by this alert rule. + * + * @param severity the severity value to set. + * @return the NrtAlertRuleTemplateProperties object itself. + */ + public NrtAlertRuleTemplateProperties withSeverity(AlertSeverity severity) { + this.severity = severity; + return this; + } + + /** + * Get the tactics property: The tactics of the alert rule. + * + * @return the tactics value. + */ + public List tactics() { + return this.tactics; + } + + /** + * Set the tactics property: The tactics of the alert rule. + * + * @param tactics the tactics value to set. + * @return the NrtAlertRuleTemplateProperties object itself. + */ + public NrtAlertRuleTemplateProperties withTactics(List tactics) { + this.tactics = tactics; + return this; + } + + /** + * Get the version property: The version of this template - in format <a.b.c>, where all are numbers. For + * example <1.0.2>. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of this template - in format <a.b.c>, where all are numbers. For + * example <1.0.2>. + * + * @param version the version value to set. + * @return the NrtAlertRuleTemplateProperties object itself. + */ + public NrtAlertRuleTemplateProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the customDetails property: Dictionary of string key-value pairs of columns to be attached to the alert. + * + * @return the customDetails value. + */ + public Map customDetails() { + return this.customDetails; + } + + /** + * Set the customDetails property: Dictionary of string key-value pairs of columns to be attached to the alert. + * + * @param customDetails the customDetails value to set. + * @return the NrtAlertRuleTemplateProperties object itself. + */ + public NrtAlertRuleTemplateProperties withCustomDetails(Map customDetails) { + this.customDetails = customDetails; + return this; + } + + /** + * Get the entityMappings property: Array of the entity mappings of the alert rule. + * + * @return the entityMappings value. + */ + public List entityMappings() { + return this.entityMappings; + } + + /** + * Set the entityMappings property: Array of the entity mappings of the alert rule. + * + * @param entityMappings the entityMappings value to set. + * @return the NrtAlertRuleTemplateProperties object itself. + */ + public NrtAlertRuleTemplateProperties withEntityMappings(List entityMappings) { + this.entityMappings = entityMappings; + return this; + } + + /** + * Get the alertDetailsOverride property: The alert details override settings. + * + * @return the alertDetailsOverride value. + */ + public AlertDetailsOverride alertDetailsOverride() { + return this.alertDetailsOverride; + } + + /** + * Set the alertDetailsOverride property: The alert details override settings. + * + * @param alertDetailsOverride the alertDetailsOverride value to set. + * @return the NrtAlertRuleTemplateProperties object itself. + */ + public NrtAlertRuleTemplateProperties withAlertDetailsOverride(AlertDetailsOverride alertDetailsOverride) { + this.alertDetailsOverride = alertDetailsOverride; + return this; + } + + /** {@inheritDoc} */ + @Override + public NrtAlertRuleTemplateProperties withAlertRulesCreatedByTemplateCount( + Integer alertRulesCreatedByTemplateCount) { + super.withAlertRulesCreatedByTemplateCount(alertRulesCreatedByTemplateCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public NrtAlertRuleTemplateProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public NrtAlertRuleTemplateProperties withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** {@inheritDoc} */ + @Override + public NrtAlertRuleTemplateProperties withRequiredDataConnectors( + List requiredDataConnectors) { + super.withRequiredDataConnectors(requiredDataConnectors); + return this; + } + + /** {@inheritDoc} */ + @Override + public NrtAlertRuleTemplateProperties withStatus(TemplateStatus status) { + super.withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (entityMappings() != null) { + entityMappings().forEach(e -> e.validate()); + } + if (alertDetailsOverride() != null) { + alertDetailsOverride().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeAtpCheckRequirementsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeAtpCheckRequirementsProperties.java new file mode 100644 index 000000000000..bb3f6a39cdb1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeAtpCheckRequirementsProperties.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** OfficeATP (Office 365 Advanced Threat Protection) requirements check properties. */ +@Fluent +public final class OfficeAtpCheckRequirementsProperties extends DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OfficeAtpCheckRequirementsProperties.class); + + /** {@inheritDoc} */ + @Override + public OfficeAtpCheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeAtpDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeAtpDataConnectorProperties.java new file mode 100644 index 000000000000..536240820222 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeAtpDataConnectorProperties.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AlertsDataTypeOfDataConnector; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** OfficeATP (Office 365 Advanced Threat Protection) data connector properties. */ +@Fluent +public final class OfficeAtpDataConnectorProperties extends DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OfficeAtpDataConnectorProperties.class); + + /* + * The available data types for the connector. + */ + @JsonProperty(value = "dataTypes") + private AlertsDataTypeOfDataConnector dataTypes; + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public AlertsDataTypeOfDataConnector dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the OfficeAtpDataConnectorProperties object itself. + */ + public OfficeAtpDataConnectorProperties withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** {@inheritDoc} */ + @Override + public OfficeAtpDataConnectorProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataTypes() != null) { + dataTypes().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeConsentInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeConsentInner.java new file mode 100644 index 000000000000..a9844e53a2bb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeConsentInner.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Consent for Office365 tenant that already made. */ +@Fluent +public final class OfficeConsentInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OfficeConsentInner.class); + + /* + * Office consent properties + */ + @JsonProperty(value = "properties") + private OfficeConsentProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Office consent properties. + * + * @return the innerProperties value. + */ + private OfficeConsentProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the tenantId property: The tenantId of the Office365 with the consent. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Set the tenantId property: The tenantId of the Office365 with the consent. + * + * @param tenantId the tenantId value to set. + * @return the OfficeConsentInner object itself. + */ + public OfficeConsentInner withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new OfficeConsentProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * Get the consentId property: Help to easily cascade among the data layers. + * + * @return the consentId value. + */ + public String consentId() { + return this.innerProperties() == null ? null : this.innerProperties().consentId(); + } + + /** + * Set the consentId property: Help to easily cascade among the data layers. + * + * @param consentId the consentId value to set. + * @return the OfficeConsentInner object itself. + */ + public OfficeConsentInner withConsentId(String consentId) { + if (this.innerProperties() == null) { + this.innerProperties = new OfficeConsentProperties(); + } + this.innerProperties().withConsentId(consentId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeConsentProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeConsentProperties.java new file mode 100644 index 000000000000..4dfdef450dae --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeConsentProperties.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Consent property bag. */ +@Fluent +public final class OfficeConsentProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OfficeConsentProperties.class); + + /* + * The tenantId of the Office365 with the consent. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /* + * Help to easily cascade among the data layers. + */ + @JsonProperty(value = "consentId") + private String consentId; + + /** + * Get the tenantId property: The tenantId of the Office365 with the consent. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenantId of the Office365 with the consent. + * + * @param tenantId the tenantId value to set. + * @return the OfficeConsentProperties object itself. + */ + public OfficeConsentProperties withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the consentId property: Help to easily cascade among the data layers. + * + * @return the consentId value. + */ + public String consentId() { + return this.consentId; + } + + /** + * Set the consentId property: Help to easily cascade among the data layers. + * + * @param consentId the consentId value to set. + * @return the OfficeConsentProperties object itself. + */ + public OfficeConsentProperties withConsentId(String consentId) { + this.consentId = consentId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeDataConnectorProperties.java new file mode 100644 index 000000000000..e27ff4f31230 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeDataConnectorProperties.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.azure.resourcemanager.securityinsights.models.OfficeDataConnectorDataTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Office data connector properties. */ +@Fluent +public final class OfficeDataConnectorProperties extends DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OfficeDataConnectorProperties.class); + + /* + * The available data types for the connector. + */ + @JsonProperty(value = "dataTypes", required = true) + private OfficeDataConnectorDataTypes dataTypes; + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public OfficeDataConnectorDataTypes dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the OfficeDataConnectorProperties object itself. + */ + public OfficeDataConnectorProperties withDataTypes(OfficeDataConnectorDataTypes dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** {@inheritDoc} */ + @Override + public OfficeDataConnectorProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataTypes() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dataTypes in model OfficeDataConnectorProperties")); + } else { + dataTypes().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeIrmCheckRequirementsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeIrmCheckRequirementsProperties.java new file mode 100644 index 000000000000..3e2c9081a0c4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeIrmCheckRequirementsProperties.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** OfficeIRM (Microsoft Insider Risk Management) requirements check properties. */ +@Fluent +public final class OfficeIrmCheckRequirementsProperties extends DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OfficeIrmCheckRequirementsProperties.class); + + /** {@inheritDoc} */ + @Override + public OfficeIrmCheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeIrmDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeIrmDataConnectorProperties.java new file mode 100644 index 000000000000..d2ec7e3557cf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeIrmDataConnectorProperties.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AlertsDataTypeOfDataConnector; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** OfficeIRM (Microsoft Insider Risk Management) data connector properties. */ +@Fluent +public final class OfficeIrmDataConnectorProperties extends DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OfficeIrmDataConnectorProperties.class); + + /* + * The available data types for the connector. + */ + @JsonProperty(value = "dataTypes") + private AlertsDataTypeOfDataConnector dataTypes; + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public AlertsDataTypeOfDataConnector dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the OfficeIrmDataConnectorProperties object itself. + */ + public OfficeIrmDataConnectorProperties withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** {@inheritDoc} */ + @Override + public OfficeIrmDataConnectorProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataTypes() != null) { + dataTypes().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OperationInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OperationInner.java new file mode 100644 index 000000000000..023f88023ca6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OperationInner.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operation provided by provider. */ +@Fluent +public final class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * Properties of the operation + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * Name of the operation + */ + @JsonProperty(value = "name") + private String name; + + /* + * The origin of the operation + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Indicates whether the operation is a data action + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /** + * Get the display property: Properties of the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Properties of the operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the name property: Name of the operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the operation. + * + * @param name the name value to set. + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the origin property: The origin of the operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: The origin of the operation. + * + * @param origin the origin value to set. + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Indicates whether the operation is a data action. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationInner object itself. + */ + public OperationInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProcessEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProcessEntityProperties.java new file mode 100644 index 000000000000..11d3b3e4f6dd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProcessEntityProperties.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.ElevationToken; +import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Process entity property bag. */ +@Fluent +public final class ProcessEntityProperties extends EntityCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProcessEntityProperties.class); + + /* + * The account entity id running the processes. + */ + @JsonProperty(value = "accountEntityId", access = JsonProperty.Access.WRITE_ONLY) + private String accountEntityId; + + /* + * The command line used to create the process + */ + @JsonProperty(value = "commandLine", access = JsonProperty.Access.WRITE_ONLY) + private String commandLine; + + /* + * The time when the process started to run + */ + @JsonProperty(value = "creationTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationTimeUtc; + + /* + * The elevation token associated with the process. + */ + @JsonProperty(value = "elevationToken") + private ElevationToken elevationToken; + + /* + * The host entity id on which the process was running + */ + @JsonProperty(value = "hostEntityId", access = JsonProperty.Access.WRITE_ONLY) + private String hostEntityId; + + /* + * The session entity id in which the process was running + */ + @JsonProperty(value = "hostLogonSessionEntityId", access = JsonProperty.Access.WRITE_ONLY) + private String hostLogonSessionEntityId; + + /* + * Image file entity id + */ + @JsonProperty(value = "imageFileEntityId", access = JsonProperty.Access.WRITE_ONLY) + private String imageFileEntityId; + + /* + * The parent process entity id. + */ + @JsonProperty(value = "parentProcessEntityId", access = JsonProperty.Access.WRITE_ONLY) + private String parentProcessEntityId; + + /* + * The process ID + */ + @JsonProperty(value = "processId", access = JsonProperty.Access.WRITE_ONLY) + private String processId; + + /** + * Get the accountEntityId property: The account entity id running the processes. + * + * @return the accountEntityId value. + */ + public String accountEntityId() { + return this.accountEntityId; + } + + /** + * Get the commandLine property: The command line used to create the process. + * + * @return the commandLine value. + */ + public String commandLine() { + return this.commandLine; + } + + /** + * Get the creationTimeUtc property: The time when the process started to run. + * + * @return the creationTimeUtc value. + */ + public OffsetDateTime creationTimeUtc() { + return this.creationTimeUtc; + } + + /** + * Get the elevationToken property: The elevation token associated with the process. + * + * @return the elevationToken value. + */ + public ElevationToken elevationToken() { + return this.elevationToken; + } + + /** + * Set the elevationToken property: The elevation token associated with the process. + * + * @param elevationToken the elevationToken value to set. + * @return the ProcessEntityProperties object itself. + */ + public ProcessEntityProperties withElevationToken(ElevationToken elevationToken) { + this.elevationToken = elevationToken; + return this; + } + + /** + * Get the hostEntityId property: The host entity id on which the process was running. + * + * @return the hostEntityId value. + */ + public String hostEntityId() { + return this.hostEntityId; + } + + /** + * Get the hostLogonSessionEntityId property: The session entity id in which the process was running. + * + * @return the hostLogonSessionEntityId value. + */ + public String hostLogonSessionEntityId() { + return this.hostLogonSessionEntityId; + } + + /** + * Get the imageFileEntityId property: Image file entity id. + * + * @return the imageFileEntityId value. + */ + public String imageFileEntityId() { + return this.imageFileEntityId; + } + + /** + * Get the parentProcessEntityId property: The parent process entity id. + * + * @return the parentProcessEntityId value. + */ + public String parentProcessEntityId() { + return this.parentProcessEntityId; + } + + /** + * Get the processId property: The process ID. + * + * @return the processId value. + */ + public String processId() { + return this.processId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RegistryKeyEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RegistryKeyEntityProperties.java new file mode 100644 index 000000000000..d8629a83a945 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RegistryKeyEntityProperties.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; +import com.azure.resourcemanager.securityinsights.models.RegistryHive; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** RegistryKey entity property bag. */ +@Immutable +public final class RegistryKeyEntityProperties extends EntityCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistryKeyEntityProperties.class); + + /* + * the hive that holds the registry key. + */ + @JsonProperty(value = "hive", access = JsonProperty.Access.WRITE_ONLY) + private RegistryHive hive; + + /* + * The registry key path. + */ + @JsonProperty(value = "key", access = JsonProperty.Access.WRITE_ONLY) + private String key; + + /** + * Get the hive property: the hive that holds the registry key. + * + * @return the hive value. + */ + public RegistryHive hive() { + return this.hive; + } + + /** + * Get the key property: The registry key path. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RegistryValueEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RegistryValueEntityProperties.java new file mode 100644 index 000000000000..695da86d26b9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RegistryValueEntityProperties.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; +import com.azure.resourcemanager.securityinsights.models.RegistryValueKind; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** RegistryValue entity property bag. */ +@Immutable +public final class RegistryValueEntityProperties extends EntityCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistryValueEntityProperties.class); + + /* + * The registry key entity id. + */ + @JsonProperty(value = "keyEntityId", access = JsonProperty.Access.WRITE_ONLY) + private String keyEntityId; + + /* + * String formatted representation of the value data. + */ + @JsonProperty(value = "valueData", access = JsonProperty.Access.WRITE_ONLY) + private String valueData; + + /* + * The registry value name. + */ + @JsonProperty(value = "valueName", access = JsonProperty.Access.WRITE_ONLY) + private String valueName; + + /* + * Specifies the data types to use when storing values in the registry, or + * identifies the data type of a value in the registry. + */ + @JsonProperty(value = "valueType", access = JsonProperty.Access.WRITE_ONLY) + private RegistryValueKind valueType; + + /** + * Get the keyEntityId property: The registry key entity id. + * + * @return the keyEntityId value. + */ + public String keyEntityId() { + return this.keyEntityId; + } + + /** + * Get the valueData property: String formatted representation of the value data. + * + * @return the valueData value. + */ + public String valueData() { + return this.valueData; + } + + /** + * Get the valueName property: The registry value name. + * + * @return the valueName value. + */ + public String valueName() { + return this.valueName; + } + + /** + * Get the valueType property: Specifies the data types to use when storing values in the registry, or identifies + * the data type of a value in the registry. + * + * @return the valueType value. + */ + public RegistryValueKind valueType() { + return this.valueType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RelationInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RelationInner.java new file mode 100644 index 000000000000..02458bfd9811 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RelationInner.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Represents a relation between two resources. */ +@Fluent +public final class RelationInner extends ResourceWithEtag { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RelationInner.class); + + /* + * Relation properties + */ + @JsonProperty(value = "properties") + private RelationProperties innerProperties; + + /** + * Get the innerProperties property: Relation properties. + * + * @return the innerProperties value. + */ + private RelationProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public RelationInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the relatedResourceId property: The resource ID of the related resource. + * + * @return the relatedResourceId value. + */ + public String relatedResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().relatedResourceId(); + } + + /** + * Set the relatedResourceId property: The resource ID of the related resource. + * + * @param relatedResourceId the relatedResourceId value to set. + * @return the RelationInner object itself. + */ + public RelationInner withRelatedResourceId(String relatedResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new RelationProperties(); + } + this.innerProperties().withRelatedResourceId(relatedResourceId); + return this; + } + + /** + * Get the relatedResourceName property: The name of the related resource. + * + * @return the relatedResourceName value. + */ + public String relatedResourceName() { + return this.innerProperties() == null ? null : this.innerProperties().relatedResourceName(); + } + + /** + * Get the relatedResourceType property: The resource type of the related resource. + * + * @return the relatedResourceType value. + */ + public String relatedResourceType() { + return this.innerProperties() == null ? null : this.innerProperties().relatedResourceType(); + } + + /** + * Get the relatedResourceKind property: The resource kind of the related resource. + * + * @return the relatedResourceKind value. + */ + public String relatedResourceKind() { + return this.innerProperties() == null ? null : this.innerProperties().relatedResourceKind(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RelationProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RelationProperties.java new file mode 100644 index 000000000000..09d0883d8a85 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RelationProperties.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Relation property bag. */ +@Fluent +public final class RelationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RelationProperties.class); + + /* + * The resource ID of the related resource + */ + @JsonProperty(value = "relatedResourceId", required = true) + private String relatedResourceId; + + /* + * The name of the related resource + */ + @JsonProperty(value = "relatedResourceName", access = JsonProperty.Access.WRITE_ONLY) + private String relatedResourceName; + + /* + * The resource type of the related resource + */ + @JsonProperty(value = "relatedResourceType", access = JsonProperty.Access.WRITE_ONLY) + private String relatedResourceType; + + /* + * The resource kind of the related resource + */ + @JsonProperty(value = "relatedResourceKind", access = JsonProperty.Access.WRITE_ONLY) + private String relatedResourceKind; + + /** + * Get the relatedResourceId property: The resource ID of the related resource. + * + * @return the relatedResourceId value. + */ + public String relatedResourceId() { + return this.relatedResourceId; + } + + /** + * Set the relatedResourceId property: The resource ID of the related resource. + * + * @param relatedResourceId the relatedResourceId value to set. + * @return the RelationProperties object itself. + */ + public RelationProperties withRelatedResourceId(String relatedResourceId) { + this.relatedResourceId = relatedResourceId; + return this; + } + + /** + * Get the relatedResourceName property: The name of the related resource. + * + * @return the relatedResourceName value. + */ + public String relatedResourceName() { + return this.relatedResourceName; + } + + /** + * Get the relatedResourceType property: The resource type of the related resource. + * + * @return the relatedResourceType value. + */ + public String relatedResourceType() { + return this.relatedResourceType; + } + + /** + * Get the relatedResourceKind property: The resource kind of the related resource. + * + * @return the relatedResourceKind value. + */ + public String relatedResourceKind() { + return this.relatedResourceKind; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (relatedResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property relatedResourceId in model RelationProperties")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RepoInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RepoInner.java new file mode 100644 index 000000000000..d2e01e62edbc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RepoInner.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents a repository. */ +@Fluent +public final class RepoInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RepoInner.class); + + /* + * The url to access the repository. + */ + @JsonProperty(value = "url") + private String url; + + /* + * The name of the repository. + */ + @JsonProperty(value = "fullName") + private String fullName; + + /* + * Array of branches. + */ + @JsonProperty(value = "branches") + private List branches; + + /** + * Get the url property: The url to access the repository. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: The url to access the repository. + * + * @param url the url value to set. + * @return the RepoInner object itself. + */ + public RepoInner withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the fullName property: The name of the repository. + * + * @return the fullName value. + */ + public String fullName() { + return this.fullName; + } + + /** + * Set the fullName property: The name of the repository. + * + * @param fullName the fullName value to set. + * @return the RepoInner object itself. + */ + public RepoInner withFullName(String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Get the branches property: Array of branches. + * + * @return the branches value. + */ + public List branches() { + return this.branches; + } + + /** + * Set the branches property: Array of branches. + * + * @param branches the branches value to set. + * @return the RepoInner object itself. + */ + public RepoInner withBranches(List branches) { + this.branches = branches; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ScheduledAlertRuleProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ScheduledAlertRuleProperties.java new file mode 100644 index 000000000000..18a3698bfaa3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ScheduledAlertRuleProperties.java @@ -0,0 +1,488 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AlertDetailsOverride; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.EntityMapping; +import com.azure.resourcemanager.securityinsights.models.EventGroupingSettings; +import com.azure.resourcemanager.securityinsights.models.IncidentConfiguration; +import com.azure.resourcemanager.securityinsights.models.ScheduledAlertRuleCommonProperties; +import com.azure.resourcemanager.securityinsights.models.TriggerOperator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Scheduled alert rule base property bag. */ +@Fluent +public final class ScheduledAlertRuleProperties extends ScheduledAlertRuleCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduledAlertRuleProperties.class); + + /* + * The Name of the alert rule template used to create this rule. + */ + @JsonProperty(value = "alertRuleTemplateName") + private String alertRuleTemplateName; + + /* + * The version of the alert rule template used to create this rule - in + * format , where all are numbers, for example 0 <1.0.2> + */ + @JsonProperty(value = "templateVersion") + private String templateVersion; + + /* + * The description of the alert rule. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The query that creates alerts for this rule. + */ + @JsonProperty(value = "query") + private String query; + + /* + * The display name for alerts created by this alert rule. + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /* + * Determines whether this alert rule is enabled or disabled. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * The last time that this alert rule has been modified. + */ + @JsonProperty(value = "lastModifiedUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedUtc; + + /* + * The suppression (in ISO 8601 duration format) to wait since last time + * this alert rule been triggered. + */ + @JsonProperty(value = "suppressionDuration", required = true) + private Duration suppressionDuration; + + /* + * Determines whether the suppression for this alert rule is enabled or + * disabled. + */ + @JsonProperty(value = "suppressionEnabled", required = true) + private boolean suppressionEnabled; + + /* + * The severity for alerts created by this alert rule. + */ + @JsonProperty(value = "severity") + private AlertSeverity severity; + + /* + * The tactics of the alert rule + */ + @JsonProperty(value = "tactics") + private List tactics; + + /* + * The settings of the incidents that created from alerts triggered by this + * analytics rule + */ + @JsonProperty(value = "incidentConfiguration") + private IncidentConfiguration incidentConfiguration; + + /* + * Dictionary of string key-value pairs of columns to be attached to the + * alert + */ + @JsonProperty(value = "customDetails") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map customDetails; + + /* + * Array of the entity mappings of the alert rule + */ + @JsonProperty(value = "entityMappings") + private List entityMappings; + + /* + * The alert details override settings + */ + @JsonProperty(value = "alertDetailsOverride") + private AlertDetailsOverride alertDetailsOverride; + + /** + * Get the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. + * + * @return the alertRuleTemplateName value. + */ + public String alertRuleTemplateName() { + return this.alertRuleTemplateName; + } + + /** + * Set the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. + * + * @param alertRuleTemplateName the alertRuleTemplateName value to set. + * @return the ScheduledAlertRuleProperties object itself. + */ + public ScheduledAlertRuleProperties withAlertRuleTemplateName(String alertRuleTemplateName) { + this.alertRuleTemplateName = alertRuleTemplateName; + return this; + } + + /** + * Get the templateVersion property: The version of the alert rule template used to create this rule - in format + * <a.b.c>, where all are numbers, for example 0 <1.0.2>. + * + * @return the templateVersion value. + */ + public String templateVersion() { + return this.templateVersion; + } + + /** + * Set the templateVersion property: The version of the alert rule template used to create this rule - in format + * <a.b.c>, where all are numbers, for example 0 <1.0.2>. + * + * @param templateVersion the templateVersion value to set. + * @return the ScheduledAlertRuleProperties object itself. + */ + public ScheduledAlertRuleProperties withTemplateVersion(String templateVersion) { + this.templateVersion = templateVersion; + return this; + } + + /** + * Get the description property: The description of the alert rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the alert rule. + * + * @param description the description value to set. + * @return the ScheduledAlertRuleProperties object itself. + */ + public ScheduledAlertRuleProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the query property: The query that creates alerts for this rule. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * Set the query property: The query that creates alerts for this rule. + * + * @param query the query value to set. + * @return the ScheduledAlertRuleProperties object itself. + */ + public ScheduledAlertRuleProperties withQuery(String query) { + this.query = query; + return this; + } + + /** + * Get the displayName property: The display name for alerts created by this alert rule. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name for alerts created by this alert rule. + * + * @param displayName the displayName value to set. + * @return the ScheduledAlertRuleProperties object itself. + */ + public ScheduledAlertRuleProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the enabled property: Determines whether this alert rule is enabled or disabled. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Determines whether this alert rule is enabled or disabled. + * + * @param enabled the enabled value to set. + * @return the ScheduledAlertRuleProperties object itself. + */ + public ScheduledAlertRuleProperties withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the lastModifiedUtc property: The last time that this alert rule has been modified. + * + * @return the lastModifiedUtc value. + */ + public OffsetDateTime lastModifiedUtc() { + return this.lastModifiedUtc; + } + + /** + * Get the suppressionDuration property: The suppression (in ISO 8601 duration format) to wait since last time this + * alert rule been triggered. + * + * @return the suppressionDuration value. + */ + public Duration suppressionDuration() { + return this.suppressionDuration; + } + + /** + * Set the suppressionDuration property: The suppression (in ISO 8601 duration format) to wait since last time this + * alert rule been triggered. + * + * @param suppressionDuration the suppressionDuration value to set. + * @return the ScheduledAlertRuleProperties object itself. + */ + public ScheduledAlertRuleProperties withSuppressionDuration(Duration suppressionDuration) { + this.suppressionDuration = suppressionDuration; + return this; + } + + /** + * Get the suppressionEnabled property: Determines whether the suppression for this alert rule is enabled or + * disabled. + * + * @return the suppressionEnabled value. + */ + public boolean suppressionEnabled() { + return this.suppressionEnabled; + } + + /** + * Set the suppressionEnabled property: Determines whether the suppression for this alert rule is enabled or + * disabled. + * + * @param suppressionEnabled the suppressionEnabled value to set. + * @return the ScheduledAlertRuleProperties object itself. + */ + public ScheduledAlertRuleProperties withSuppressionEnabled(boolean suppressionEnabled) { + this.suppressionEnabled = suppressionEnabled; + return this; + } + + /** + * Get the severity property: The severity for alerts created by this alert rule. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.severity; + } + + /** + * Set the severity property: The severity for alerts created by this alert rule. + * + * @param severity the severity value to set. + * @return the ScheduledAlertRuleProperties object itself. + */ + public ScheduledAlertRuleProperties withSeverity(AlertSeverity severity) { + this.severity = severity; + return this; + } + + /** + * Get the tactics property: The tactics of the alert rule. + * + * @return the tactics value. + */ + public List tactics() { + return this.tactics; + } + + /** + * Set the tactics property: The tactics of the alert rule. + * + * @param tactics the tactics value to set. + * @return the ScheduledAlertRuleProperties object itself. + */ + public ScheduledAlertRuleProperties withTactics(List tactics) { + this.tactics = tactics; + return this; + } + + /** + * Get the incidentConfiguration property: The settings of the incidents that created from alerts triggered by this + * analytics rule. + * + * @return the incidentConfiguration value. + */ + public IncidentConfiguration incidentConfiguration() { + return this.incidentConfiguration; + } + + /** + * Set the incidentConfiguration property: The settings of the incidents that created from alerts triggered by this + * analytics rule. + * + * @param incidentConfiguration the incidentConfiguration value to set. + * @return the ScheduledAlertRuleProperties object itself. + */ + public ScheduledAlertRuleProperties withIncidentConfiguration(IncidentConfiguration incidentConfiguration) { + this.incidentConfiguration = incidentConfiguration; + return this; + } + + /** + * Get the customDetails property: Dictionary of string key-value pairs of columns to be attached to the alert. + * + * @return the customDetails value. + */ + public Map customDetails() { + return this.customDetails; + } + + /** + * Set the customDetails property: Dictionary of string key-value pairs of columns to be attached to the alert. + * + * @param customDetails the customDetails value to set. + * @return the ScheduledAlertRuleProperties object itself. + */ + public ScheduledAlertRuleProperties withCustomDetails(Map customDetails) { + this.customDetails = customDetails; + return this; + } + + /** + * Get the entityMappings property: Array of the entity mappings of the alert rule. + * + * @return the entityMappings value. + */ + public List entityMappings() { + return this.entityMappings; + } + + /** + * Set the entityMappings property: Array of the entity mappings of the alert rule. + * + * @param entityMappings the entityMappings value to set. + * @return the ScheduledAlertRuleProperties object itself. + */ + public ScheduledAlertRuleProperties withEntityMappings(List entityMappings) { + this.entityMappings = entityMappings; + return this; + } + + /** + * Get the alertDetailsOverride property: The alert details override settings. + * + * @return the alertDetailsOverride value. + */ + public AlertDetailsOverride alertDetailsOverride() { + return this.alertDetailsOverride; + } + + /** + * Set the alertDetailsOverride property: The alert details override settings. + * + * @param alertDetailsOverride the alertDetailsOverride value to set. + * @return the ScheduledAlertRuleProperties object itself. + */ + public ScheduledAlertRuleProperties withAlertDetailsOverride(AlertDetailsOverride alertDetailsOverride) { + this.alertDetailsOverride = alertDetailsOverride; + return this; + } + + /** {@inheritDoc} */ + @Override + public ScheduledAlertRuleProperties withQueryFrequency(Duration queryFrequency) { + super.withQueryFrequency(queryFrequency); + return this; + } + + /** {@inheritDoc} */ + @Override + public ScheduledAlertRuleProperties withQueryPeriod(Duration queryPeriod) { + super.withQueryPeriod(queryPeriod); + return this; + } + + /** {@inheritDoc} */ + @Override + public ScheduledAlertRuleProperties withTriggerOperator(TriggerOperator triggerOperator) { + super.withTriggerOperator(triggerOperator); + return this; + } + + /** {@inheritDoc} */ + @Override + public ScheduledAlertRuleProperties withTriggerThreshold(Integer triggerThreshold) { + super.withTriggerThreshold(triggerThreshold); + return this; + } + + /** {@inheritDoc} */ + @Override + public ScheduledAlertRuleProperties withEventGroupingSettings(EventGroupingSettings eventGroupingSettings) { + super.withEventGroupingSettings(eventGroupingSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (displayName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property displayName in model ScheduledAlertRuleProperties")); + } + if (suppressionDuration() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property suppressionDuration in model ScheduledAlertRuleProperties")); + } + if (incidentConfiguration() != null) { + incidentConfiguration().validate(); + } + if (entityMappings() != null) { + entityMappings().forEach(e -> e.validate()); + } + if (alertDetailsOverride() != null) { + alertDetailsOverride().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ScheduledAlertRuleTemplateProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ScheduledAlertRuleTemplateProperties.java new file mode 100644 index 000000000000..fc9447094d18 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ScheduledAlertRuleTemplateProperties.java @@ -0,0 +1,402 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AlertDetailsOverride; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateDataSource; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplatePropertiesBase; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.EntityMapping; +import com.azure.resourcemanager.securityinsights.models.EventGroupingSettings; +import com.azure.resourcemanager.securityinsights.models.TemplateStatus; +import com.azure.resourcemanager.securityinsights.models.TriggerOperator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +/** Scheduled alert rule template properties. */ +@Fluent +public final class ScheduledAlertRuleTemplateProperties extends AlertRuleTemplatePropertiesBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduledAlertRuleTemplateProperties.class); + + /* + * The query that creates alerts for this rule. + */ + @JsonProperty(value = "query") + private String query; + + /* + * The severity for alerts created by this alert rule. + */ + @JsonProperty(value = "severity") + private AlertSeverity severity; + + /* + * The tactics of the alert rule + */ + @JsonProperty(value = "tactics") + private List tactics; + + /* + * The version of this template - in format , where all are numbers. + * For example <1.0.2>. + */ + @JsonProperty(value = "version") + private String version; + + /* + * Dictionary of string key-value pairs of columns to be attached to the + * alert + */ + @JsonProperty(value = "customDetails") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map customDetails; + + /* + * Array of the entity mappings of the alert rule + */ + @JsonProperty(value = "entityMappings") + private List entityMappings; + + /* + * The alert details override settings + */ + @JsonProperty(value = "alertDetailsOverride") + private AlertDetailsOverride alertDetailsOverride; + + /* + * The frequency (in ISO 8601 duration format) for this alert rule to run. + */ + @JsonProperty(value = "queryFrequency") + private Duration queryFrequency; + + /* + * The period (in ISO 8601 duration format) that this alert rule looks at. + */ + @JsonProperty(value = "queryPeriod") + private Duration queryPeriod; + + /* + * The operation against the threshold that triggers alert rule. + */ + @JsonProperty(value = "triggerOperator") + private TriggerOperator triggerOperator; + + /* + * The threshold triggers this alert rule. + */ + @JsonProperty(value = "triggerThreshold") + private Integer triggerThreshold; + + /* + * The event grouping settings. + */ + @JsonProperty(value = "eventGroupingSettings") + private EventGroupingSettings eventGroupingSettings; + + /** + * Get the query property: The query that creates alerts for this rule. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * Set the query property: The query that creates alerts for this rule. + * + * @param query the query value to set. + * @return the ScheduledAlertRuleTemplateProperties object itself. + */ + public ScheduledAlertRuleTemplateProperties withQuery(String query) { + this.query = query; + return this; + } + + /** + * Get the severity property: The severity for alerts created by this alert rule. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.severity; + } + + /** + * Set the severity property: The severity for alerts created by this alert rule. + * + * @param severity the severity value to set. + * @return the ScheduledAlertRuleTemplateProperties object itself. + */ + public ScheduledAlertRuleTemplateProperties withSeverity(AlertSeverity severity) { + this.severity = severity; + return this; + } + + /** + * Get the tactics property: The tactics of the alert rule. + * + * @return the tactics value. + */ + public List tactics() { + return this.tactics; + } + + /** + * Set the tactics property: The tactics of the alert rule. + * + * @param tactics the tactics value to set. + * @return the ScheduledAlertRuleTemplateProperties object itself. + */ + public ScheduledAlertRuleTemplateProperties withTactics(List tactics) { + this.tactics = tactics; + return this; + } + + /** + * Get the version property: The version of this template - in format <a.b.c>, where all are numbers. For + * example <1.0.2>. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of this template - in format <a.b.c>, where all are numbers. For + * example <1.0.2>. + * + * @param version the version value to set. + * @return the ScheduledAlertRuleTemplateProperties object itself. + */ + public ScheduledAlertRuleTemplateProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the customDetails property: Dictionary of string key-value pairs of columns to be attached to the alert. + * + * @return the customDetails value. + */ + public Map customDetails() { + return this.customDetails; + } + + /** + * Set the customDetails property: Dictionary of string key-value pairs of columns to be attached to the alert. + * + * @param customDetails the customDetails value to set. + * @return the ScheduledAlertRuleTemplateProperties object itself. + */ + public ScheduledAlertRuleTemplateProperties withCustomDetails(Map customDetails) { + this.customDetails = customDetails; + return this; + } + + /** + * Get the entityMappings property: Array of the entity mappings of the alert rule. + * + * @return the entityMappings value. + */ + public List entityMappings() { + return this.entityMappings; + } + + /** + * Set the entityMappings property: Array of the entity mappings of the alert rule. + * + * @param entityMappings the entityMappings value to set. + * @return the ScheduledAlertRuleTemplateProperties object itself. + */ + public ScheduledAlertRuleTemplateProperties withEntityMappings(List entityMappings) { + this.entityMappings = entityMappings; + return this; + } + + /** + * Get the alertDetailsOverride property: The alert details override settings. + * + * @return the alertDetailsOverride value. + */ + public AlertDetailsOverride alertDetailsOverride() { + return this.alertDetailsOverride; + } + + /** + * Set the alertDetailsOverride property: The alert details override settings. + * + * @param alertDetailsOverride the alertDetailsOverride value to set. + * @return the ScheduledAlertRuleTemplateProperties object itself. + */ + public ScheduledAlertRuleTemplateProperties withAlertDetailsOverride(AlertDetailsOverride alertDetailsOverride) { + this.alertDetailsOverride = alertDetailsOverride; + return this; + } + + /** + * Get the queryFrequency property: The frequency (in ISO 8601 duration format) for this alert rule to run. + * + * @return the queryFrequency value. + */ + public Duration queryFrequency() { + return this.queryFrequency; + } + + /** + * Set the queryFrequency property: The frequency (in ISO 8601 duration format) for this alert rule to run. + * + * @param queryFrequency the queryFrequency value to set. + * @return the ScheduledAlertRuleTemplateProperties object itself. + */ + public ScheduledAlertRuleTemplateProperties withQueryFrequency(Duration queryFrequency) { + this.queryFrequency = queryFrequency; + return this; + } + + /** + * Get the queryPeriod property: The period (in ISO 8601 duration format) that this alert rule looks at. + * + * @return the queryPeriod value. + */ + public Duration queryPeriod() { + return this.queryPeriod; + } + + /** + * Set the queryPeriod property: The period (in ISO 8601 duration format) that this alert rule looks at. + * + * @param queryPeriod the queryPeriod value to set. + * @return the ScheduledAlertRuleTemplateProperties object itself. + */ + public ScheduledAlertRuleTemplateProperties withQueryPeriod(Duration queryPeriod) { + this.queryPeriod = queryPeriod; + return this; + } + + /** + * Get the triggerOperator property: The operation against the threshold that triggers alert rule. + * + * @return the triggerOperator value. + */ + public TriggerOperator triggerOperator() { + return this.triggerOperator; + } + + /** + * Set the triggerOperator property: The operation against the threshold that triggers alert rule. + * + * @param triggerOperator the triggerOperator value to set. + * @return the ScheduledAlertRuleTemplateProperties object itself. + */ + public ScheduledAlertRuleTemplateProperties withTriggerOperator(TriggerOperator triggerOperator) { + this.triggerOperator = triggerOperator; + return this; + } + + /** + * Get the triggerThreshold property: The threshold triggers this alert rule. + * + * @return the triggerThreshold value. + */ + public Integer triggerThreshold() { + return this.triggerThreshold; + } + + /** + * Set the triggerThreshold property: The threshold triggers this alert rule. + * + * @param triggerThreshold the triggerThreshold value to set. + * @return the ScheduledAlertRuleTemplateProperties object itself. + */ + public ScheduledAlertRuleTemplateProperties withTriggerThreshold(Integer triggerThreshold) { + this.triggerThreshold = triggerThreshold; + return this; + } + + /** + * Get the eventGroupingSettings property: The event grouping settings. + * + * @return the eventGroupingSettings value. + */ + public EventGroupingSettings eventGroupingSettings() { + return this.eventGroupingSettings; + } + + /** + * Set the eventGroupingSettings property: The event grouping settings. + * + * @param eventGroupingSettings the eventGroupingSettings value to set. + * @return the ScheduledAlertRuleTemplateProperties object itself. + */ + public ScheduledAlertRuleTemplateProperties withEventGroupingSettings(EventGroupingSettings eventGroupingSettings) { + this.eventGroupingSettings = eventGroupingSettings; + return this; + } + + /** {@inheritDoc} */ + @Override + public ScheduledAlertRuleTemplateProperties withAlertRulesCreatedByTemplateCount( + Integer alertRulesCreatedByTemplateCount) { + super.withAlertRulesCreatedByTemplateCount(alertRulesCreatedByTemplateCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public ScheduledAlertRuleTemplateProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public ScheduledAlertRuleTemplateProperties withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** {@inheritDoc} */ + @Override + public ScheduledAlertRuleTemplateProperties withRequiredDataConnectors( + List requiredDataConnectors) { + super.withRequiredDataConnectors(requiredDataConnectors); + return this; + } + + /** {@inheritDoc} */ + @Override + public ScheduledAlertRuleTemplateProperties withStatus(TemplateStatus status) { + super.withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (entityMappings() != null) { + entityMappings().forEach(e -> e.validate()); + } + if (alertDetailsOverride() != null) { + alertDetailsOverride().validate(); + } + if (eventGroupingSettings() != null) { + eventGroupingSettings().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SecurityAlertProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SecurityAlertProperties.java new file mode 100644 index 000000000000..55d3fdab26f2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SecurityAlertProperties.java @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.AlertStatus; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.ConfidenceLevel; +import com.azure.resourcemanager.securityinsights.models.ConfidenceScoreStatus; +import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; +import com.azure.resourcemanager.securityinsights.models.KillChainIntent; +import com.azure.resourcemanager.securityinsights.models.SecurityAlertPropertiesConfidenceReasonsItem; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** SecurityAlert entity property bag. */ +@Fluent +public final class SecurityAlertProperties extends EntityCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAlertProperties.class); + + /* + * The display name of the alert. + */ + @JsonProperty(value = "alertDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String alertDisplayName; + + /* + * The type name of the alert. + */ + @JsonProperty(value = "alertType", access = JsonProperty.Access.WRITE_ONLY) + private String alertType; + + /* + * Display name of the main entity being reported on. + */ + @JsonProperty(value = "compromisedEntity", access = JsonProperty.Access.WRITE_ONLY) + private String compromisedEntity; + + /* + * The confidence level of this alert. + */ + @JsonProperty(value = "confidenceLevel", access = JsonProperty.Access.WRITE_ONLY) + private ConfidenceLevel confidenceLevel; + + /* + * The confidence reasons + */ + @JsonProperty(value = "confidenceReasons", access = JsonProperty.Access.WRITE_ONLY) + private List confidenceReasons; + + /* + * The confidence score of the alert. + */ + @JsonProperty(value = "confidenceScore", access = JsonProperty.Access.WRITE_ONLY) + private Double confidenceScore; + + /* + * The confidence score calculation status, i.e. indicating if score + * calculation is pending for this alert, not applicable or final. + */ + @JsonProperty(value = "confidenceScoreStatus", access = JsonProperty.Access.WRITE_ONLY) + private ConfidenceScoreStatus confidenceScoreStatus; + + /* + * Alert description. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The impact end time of the alert (the time of the last event + * contributing to the alert). + */ + @JsonProperty(value = "endTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endTimeUtc; + + /* + * Holds the alert intent stage(s) mapping for this alert. + */ + @JsonProperty(value = "intent", access = JsonProperty.Access.WRITE_ONLY) + private KillChainIntent intent; + + /* + * The identifier of the alert inside the product which generated the + * alert. + */ + @JsonProperty(value = "providerAlertId", access = JsonProperty.Access.WRITE_ONLY) + private String providerAlertId; + + /* + * The time the alert was made available for consumption. + */ + @JsonProperty(value = "processingEndTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime processingEndTime; + + /* + * The name of a component inside the product which generated the alert. + */ + @JsonProperty(value = "productComponentName", access = JsonProperty.Access.WRITE_ONLY) + private String productComponentName; + + /* + * The name of the product which published this alert. + */ + @JsonProperty(value = "productName", access = JsonProperty.Access.WRITE_ONLY) + private String productName; + + /* + * The version of the product generating the alert. + */ + @JsonProperty(value = "productVersion", access = JsonProperty.Access.WRITE_ONLY) + private String productVersion; + + /* + * Manual action items to take to remediate the alert. + */ + @JsonProperty(value = "remediationSteps", access = JsonProperty.Access.WRITE_ONLY) + private List remediationSteps; + + /* + * The severity of the alert + */ + @JsonProperty(value = "severity") + private AlertSeverity severity; + + /* + * The impact start time of the alert (the time of the first event + * contributing to the alert). + */ + @JsonProperty(value = "startTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTimeUtc; + + /* + * The lifecycle status of the alert. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private AlertStatus status; + + /* + * Holds the product identifier of the alert for the product. + */ + @JsonProperty(value = "systemAlertId", access = JsonProperty.Access.WRITE_ONLY) + private String systemAlertId; + + /* + * The tactics of the alert + */ + @JsonProperty(value = "tactics", access = JsonProperty.Access.WRITE_ONLY) + private List tactics; + + /* + * The time the alert was generated. + */ + @JsonProperty(value = "timeGenerated", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timeGenerated; + + /* + * The name of the vendor that raise the alert. + */ + @JsonProperty(value = "vendorName", access = JsonProperty.Access.WRITE_ONLY) + private String vendorName; + + /* + * The uri link of the alert. + */ + @JsonProperty(value = "alertLink", access = JsonProperty.Access.WRITE_ONLY) + private String alertLink; + + /* + * The list of resource identifiers of the alert. + */ + @JsonProperty(value = "resourceIdentifiers", access = JsonProperty.Access.WRITE_ONLY) + private List resourceIdentifiers; + + /** + * Get the alertDisplayName property: The display name of the alert. + * + * @return the alertDisplayName value. + */ + public String alertDisplayName() { + return this.alertDisplayName; + } + + /** + * Get the alertType property: The type name of the alert. + * + * @return the alertType value. + */ + public String alertType() { + return this.alertType; + } + + /** + * Get the compromisedEntity property: Display name of the main entity being reported on. + * + * @return the compromisedEntity value. + */ + public String compromisedEntity() { + return this.compromisedEntity; + } + + /** + * Get the confidenceLevel property: The confidence level of this alert. + * + * @return the confidenceLevel value. + */ + public ConfidenceLevel confidenceLevel() { + return this.confidenceLevel; + } + + /** + * Get the confidenceReasons property: The confidence reasons. + * + * @return the confidenceReasons value. + */ + public List confidenceReasons() { + return this.confidenceReasons; + } + + /** + * Get the confidenceScore property: The confidence score of the alert. + * + * @return the confidenceScore value. + */ + public Double confidenceScore() { + return this.confidenceScore; + } + + /** + * Get the confidenceScoreStatus property: The confidence score calculation status, i.e. indicating if score + * calculation is pending for this alert, not applicable or final. + * + * @return the confidenceScoreStatus value. + */ + public ConfidenceScoreStatus confidenceScoreStatus() { + return this.confidenceScoreStatus; + } + + /** + * Get the description property: Alert description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the endTimeUtc property: The impact end time of the alert (the time of the last event contributing to the + * alert). + * + * @return the endTimeUtc value. + */ + public OffsetDateTime endTimeUtc() { + return this.endTimeUtc; + } + + /** + * Get the intent property: Holds the alert intent stage(s) mapping for this alert. + * + * @return the intent value. + */ + public KillChainIntent intent() { + return this.intent; + } + + /** + * Get the providerAlertId property: The identifier of the alert inside the product which generated the alert. + * + * @return the providerAlertId value. + */ + public String providerAlertId() { + return this.providerAlertId; + } + + /** + * Get the processingEndTime property: The time the alert was made available for consumption. + * + * @return the processingEndTime value. + */ + public OffsetDateTime processingEndTime() { + return this.processingEndTime; + } + + /** + * Get the productComponentName property: The name of a component inside the product which generated the alert. + * + * @return the productComponentName value. + */ + public String productComponentName() { + return this.productComponentName; + } + + /** + * Get the productName property: The name of the product which published this alert. + * + * @return the productName value. + */ + public String productName() { + return this.productName; + } + + /** + * Get the productVersion property: The version of the product generating the alert. + * + * @return the productVersion value. + */ + public String productVersion() { + return this.productVersion; + } + + /** + * Get the remediationSteps property: Manual action items to take to remediate the alert. + * + * @return the remediationSteps value. + */ + public List remediationSteps() { + return this.remediationSteps; + } + + /** + * Get the severity property: The severity of the alert. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.severity; + } + + /** + * Set the severity property: The severity of the alert. + * + * @param severity the severity value to set. + * @return the SecurityAlertProperties object itself. + */ + public SecurityAlertProperties withSeverity(AlertSeverity severity) { + this.severity = severity; + return this; + } + + /** + * Get the startTimeUtc property: The impact start time of the alert (the time of the first event contributing to + * the alert). + * + * @return the startTimeUtc value. + */ + public OffsetDateTime startTimeUtc() { + return this.startTimeUtc; + } + + /** + * Get the status property: The lifecycle status of the alert. + * + * @return the status value. + */ + public AlertStatus status() { + return this.status; + } + + /** + * Get the systemAlertId property: Holds the product identifier of the alert for the product. + * + * @return the systemAlertId value. + */ + public String systemAlertId() { + return this.systemAlertId; + } + + /** + * Get the tactics property: The tactics of the alert. + * + * @return the tactics value. + */ + public List tactics() { + return this.tactics; + } + + /** + * Get the timeGenerated property: The time the alert was generated. + * + * @return the timeGenerated value. + */ + public OffsetDateTime timeGenerated() { + return this.timeGenerated; + } + + /** + * Get the vendorName property: The name of the vendor that raise the alert. + * + * @return the vendorName value. + */ + public String vendorName() { + return this.vendorName; + } + + /** + * Get the alertLink property: The uri link of the alert. + * + * @return the alertLink value. + */ + public String alertLink() { + return this.alertLink; + } + + /** + * Get the resourceIdentifiers property: The list of resource identifiers of the alert. + * + * @return the resourceIdentifiers value. + */ + public List resourceIdentifiers() { + return this.resourceIdentifiers; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (confidenceReasons() != null) { + confidenceReasons().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SecurityGroupEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SecurityGroupEntityProperties.java new file mode 100644 index 000000000000..882887957775 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SecurityGroupEntityProperties.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** SecurityGroup entity property bag. */ +@Immutable +public final class SecurityGroupEntityProperties extends EntityCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityGroupEntityProperties.class); + + /* + * The group distinguished name + */ + @JsonProperty(value = "distinguishedName", access = JsonProperty.Access.WRITE_ONLY) + private String distinguishedName; + + /* + * A single-value attribute that is the unique identifier for the object, + * assigned by active directory. + */ + @JsonProperty(value = "objectGuid", access = JsonProperty.Access.WRITE_ONLY) + private UUID objectGuid; + + /* + * The SID attribute is a single-value attribute that specifies the + * security identifier (SID) of the group + */ + @JsonProperty(value = "sid", access = JsonProperty.Access.WRITE_ONLY) + private String sid; + + /** + * Get the distinguishedName property: The group distinguished name. + * + * @return the distinguishedName value. + */ + public String distinguishedName() { + return this.distinguishedName; + } + + /** + * Get the objectGuid property: A single-value attribute that is the unique identifier for the object, assigned by + * active directory. + * + * @return the objectGuid value. + */ + public UUID objectGuid() { + return this.objectGuid; + } + + /** + * Get the sid property: The SID attribute is a single-value attribute that specifies the security identifier (SID) + * of the group. + * + * @return the sid value. + */ + public String sid() { + return this.sid; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SentinelOnboardingStateInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SentinelOnboardingStateInner.java new file mode 100644 index 000000000000..993d74cad856 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SentinelOnboardingStateInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Sentinel onboarding state. */ +@Fluent +public final class SentinelOnboardingStateInner extends ResourceWithEtag { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SentinelOnboardingStateInner.class); + + /* + * The Sentinel onboarding state object + */ + @JsonProperty(value = "properties") + private SentinelOnboardingStateProperties innerProperties; + + /** + * Get the innerProperties property: The Sentinel onboarding state object. + * + * @return the innerProperties value. + */ + private SentinelOnboardingStateProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public SentinelOnboardingStateInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the customerManagedKey property: Flag that indicates the status of the CMK setting. + * + * @return the customerManagedKey value. + */ + public Boolean customerManagedKey() { + return this.innerProperties() == null ? null : this.innerProperties().customerManagedKey(); + } + + /** + * Set the customerManagedKey property: Flag that indicates the status of the CMK setting. + * + * @param customerManagedKey the customerManagedKey value to set. + * @return the SentinelOnboardingStateInner object itself. + */ + public SentinelOnboardingStateInner withCustomerManagedKey(Boolean customerManagedKey) { + if (this.innerProperties() == null) { + this.innerProperties = new SentinelOnboardingStateProperties(); + } + this.innerProperties().withCustomerManagedKey(customerManagedKey); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SentinelOnboardingStateProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SentinelOnboardingStateProperties.java new file mode 100644 index 000000000000..db843d12eefb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SentinelOnboardingStateProperties.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Sentinel onboarding state properties. */ +@Fluent +public final class SentinelOnboardingStateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SentinelOnboardingStateProperties.class); + + /* + * Flag that indicates the status of the CMK setting + */ + @JsonProperty(value = "customerManagedKey") + private Boolean customerManagedKey; + + /** + * Get the customerManagedKey property: Flag that indicates the status of the CMK setting. + * + * @return the customerManagedKey value. + */ + public Boolean customerManagedKey() { + return this.customerManagedKey; + } + + /** + * Set the customerManagedKey property: Flag that indicates the status of the CMK setting. + * + * @param customerManagedKey the customerManagedKey value to set. + * @return the SentinelOnboardingStateProperties object itself. + */ + public SentinelOnboardingStateProperties withCustomerManagedKey(Boolean customerManagedKey) { + this.customerManagedKey = customerManagedKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SentinelOnboardingStatesListInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SentinelOnboardingStatesListInner.java new file mode 100644 index 000000000000..8b302e572fe6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SentinelOnboardingStatesListInner.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of the Sentinel onboarding states. */ +@Fluent +public final class SentinelOnboardingStatesListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SentinelOnboardingStatesListInner.class); + + /* + * Array of Sentinel onboarding states + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the value property: Array of Sentinel onboarding states. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of Sentinel onboarding states. + * + * @param value the value value to set. + * @return the SentinelOnboardingStatesListInner object itself. + */ + public SentinelOnboardingStatesListInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model SentinelOnboardingStatesListInner")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SettingListInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SettingListInner.java new file mode 100644 index 000000000000..d9eb032bf917 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SettingListInner.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of all the settings. */ +@Fluent +public final class SettingListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SettingListInner.class); + + /* + * Array of settings. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the value property: Array of settings. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of settings. + * + * @param value the value value to set. + * @return the SettingListInner object itself. + */ + public SettingListInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model SettingListInner")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SettingsInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SettingsInner.java new file mode 100644 index 000000000000..f6772220dde5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SettingsInner.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.Anomalies; +import com.azure.resourcemanager.securityinsights.models.EntityAnalytics; +import com.azure.resourcemanager.securityinsights.models.EyesOn; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.azure.resourcemanager.securityinsights.models.Ueba; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The Setting. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = SettingsInner.class) +@JsonTypeName("Settings") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Anomalies", value = Anomalies.class), + @JsonSubTypes.Type(name = "EyesOn", value = EyesOn.class), + @JsonSubTypes.Type(name = "EntityAnalytics", value = EntityAnalytics.class), + @JsonSubTypes.Type(name = "Ueba", value = Ueba.class) +}) +@Fluent +public class SettingsInner extends ResourceWithEtag { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SettingsInner.class); + + /** {@inheritDoc} */ + @Override + public SettingsInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SourceControlInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SourceControlInner.java new file mode 100644 index 000000000000..bb38f600bee9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SourceControlInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.ContentType; +import com.azure.resourcemanager.securityinsights.models.RepoType; +import com.azure.resourcemanager.securityinsights.models.Repository; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents a SourceControl in Azure Security Insights. */ +@Fluent +public final class SourceControlInner extends ResourceWithEtag { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceControlInner.class); + + /* + * source control properties + */ + @JsonProperty(value = "properties") + private SourceControlProperties innerProperties; + + /** + * Get the innerProperties property: source control properties. + * + * @return the innerProperties value. + */ + private SourceControlProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public SourceControlInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the id property: The id (a Guid) of the source control. + * + * @return the id value. + */ + public String idPropertiesId() { + return this.innerProperties() == null ? null : this.innerProperties().id(); + } + + /** + * Set the id property: The id (a Guid) of the source control. + * + * @param id the id value to set. + * @return the SourceControlInner object itself. + */ + public SourceControlInner withIdPropertiesId(String id) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlProperties(); + } + this.innerProperties().withId(id); + return this; + } + + /** + * Get the displayName property: The display name of the source control. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name of the source control. + * + * @param displayName the displayName value to set. + * @return the SourceControlInner object itself. + */ + public SourceControlInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the description property: A description of the source control. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: A description of the source control. + * + * @param description the description value to set. + * @return the SourceControlInner object itself. + */ + public SourceControlInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the repoType property: The repository type of the source control. + * + * @return the repoType value. + */ + public RepoType repoType() { + return this.innerProperties() == null ? null : this.innerProperties().repoType(); + } + + /** + * Set the repoType property: The repository type of the source control. + * + * @param repoType the repoType value to set. + * @return the SourceControlInner object itself. + */ + public SourceControlInner withRepoType(RepoType repoType) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlProperties(); + } + this.innerProperties().withRepoType(repoType); + return this; + } + + /** + * Get the contentTypes property: Array of source control content types. + * + * @return the contentTypes value. + */ + public List contentTypes() { + return this.innerProperties() == null ? null : this.innerProperties().contentTypes(); + } + + /** + * Set the contentTypes property: Array of source control content types. + * + * @param contentTypes the contentTypes value to set. + * @return the SourceControlInner object itself. + */ + public SourceControlInner withContentTypes(List contentTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlProperties(); + } + this.innerProperties().withContentTypes(contentTypes); + return this; + } + + /** + * Get the repository property: Repository metadata. + * + * @return the repository value. + */ + public Repository repository() { + return this.innerProperties() == null ? null : this.innerProperties().repository(); + } + + /** + * Set the repository property: Repository metadata. + * + * @param repository the repository value to set. + * @return the SourceControlInner object itself. + */ + public SourceControlInner withRepository(Repository repository) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlProperties(); + } + this.innerProperties().withRepository(repository); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SourceControlProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SourceControlProperties.java new file mode 100644 index 000000000000..9083d5b3fd3f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SourceControlProperties.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.ContentType; +import com.azure.resourcemanager.securityinsights.models.RepoType; +import com.azure.resourcemanager.securityinsights.models.Repository; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes source control properties. */ +@Fluent +public final class SourceControlProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceControlProperties.class); + + /* + * The id (a Guid) of the source control + */ + @JsonProperty(value = "id") + private String id; + + /* + * The display name of the source control + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /* + * A description of the source control + */ + @JsonProperty(value = "description") + private String description; + + /* + * The repository type of the source control + */ + @JsonProperty(value = "repoType", required = true) + private RepoType repoType; + + /* + * Array of source control content types. + */ + @JsonProperty(value = "contentTypes", required = true) + private List contentTypes; + + /* + * Repository metadata. + */ + @JsonProperty(value = "repository", required = true) + private Repository repository; + + /** + * Get the id property: The id (a Guid) of the source control. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The id (a Guid) of the source control. + * + * @param id the id value to set. + * @return the SourceControlProperties object itself. + */ + public SourceControlProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the displayName property: The display name of the source control. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the source control. + * + * @param displayName the displayName value to set. + * @return the SourceControlProperties object itself. + */ + public SourceControlProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description property: A description of the source control. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description of the source control. + * + * @param description the description value to set. + * @return the SourceControlProperties object itself. + */ + public SourceControlProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the repoType property: The repository type of the source control. + * + * @return the repoType value. + */ + public RepoType repoType() { + return this.repoType; + } + + /** + * Set the repoType property: The repository type of the source control. + * + * @param repoType the repoType value to set. + * @return the SourceControlProperties object itself. + */ + public SourceControlProperties withRepoType(RepoType repoType) { + this.repoType = repoType; + return this; + } + + /** + * Get the contentTypes property: Array of source control content types. + * + * @return the contentTypes value. + */ + public List contentTypes() { + return this.contentTypes; + } + + /** + * Set the contentTypes property: Array of source control content types. + * + * @param contentTypes the contentTypes value to set. + * @return the SourceControlProperties object itself. + */ + public SourceControlProperties withContentTypes(List contentTypes) { + this.contentTypes = contentTypes; + return this; + } + + /** + * Get the repository property: Repository metadata. + * + * @return the repository value. + */ + public Repository repository() { + return this.repository; + } + + /** + * Set the repository property: Repository metadata. + * + * @param repository the repository value to set. + * @return the SourceControlProperties object itself. + */ + public SourceControlProperties withRepository(Repository repository) { + this.repository = repository; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (displayName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property displayName in model SourceControlProperties")); + } + if (repoType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property repoType in model SourceControlProperties")); + } + if (contentTypes() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property contentTypes in model SourceControlProperties")); + } + if (repository() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property repository in model SourceControlProperties")); + } else { + repository().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SubmissionMailEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SubmissionMailEntityProperties.java new file mode 100644 index 000000000000..fc7ea17d9cdf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SubmissionMailEntityProperties.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.UUID; + +/** Submission mail entity property bag. */ +@Immutable +public final class SubmissionMailEntityProperties extends EntityCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubmissionMailEntityProperties.class); + + /* + * The network message id of email to which submission belongs + */ + @JsonProperty(value = "networkMessageId", access = JsonProperty.Access.WRITE_ONLY) + private UUID networkMessageId; + + /* + * The submission id + */ + @JsonProperty(value = "submissionId", access = JsonProperty.Access.WRITE_ONLY) + private UUID submissionId; + + /* + * The submitter + */ + @JsonProperty(value = "submitter", access = JsonProperty.Access.WRITE_ONLY) + private String submitter; + + /* + * The submission date + */ + @JsonProperty(value = "submissionDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime submissionDate; + + /* + * The Time stamp when the message is received (Mail) + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timestamp; + + /* + * The recipient of the mail + */ + @JsonProperty(value = "recipient", access = JsonProperty.Access.WRITE_ONLY) + private String recipient; + + /* + * The sender of the mail + */ + @JsonProperty(value = "sender", access = JsonProperty.Access.WRITE_ONLY) + private String sender; + + /* + * The sender's IP + */ + @JsonProperty(value = "senderIp", access = JsonProperty.Access.WRITE_ONLY) + private String senderIp; + + /* + * The subject of submission mail + */ + @JsonProperty(value = "subject", access = JsonProperty.Access.WRITE_ONLY) + private String subject; + + /* + * The submission type for the given instance. This maps to Junk, Phish, + * Malware or NotJunk. + */ + @JsonProperty(value = "reportType", access = JsonProperty.Access.WRITE_ONLY) + private String reportType; + + /** + * Get the networkMessageId property: The network message id of email to which submission belongs. + * + * @return the networkMessageId value. + */ + public UUID networkMessageId() { + return this.networkMessageId; + } + + /** + * Get the submissionId property: The submission id. + * + * @return the submissionId value. + */ + public UUID submissionId() { + return this.submissionId; + } + + /** + * Get the submitter property: The submitter. + * + * @return the submitter value. + */ + public String submitter() { + return this.submitter; + } + + /** + * Get the submissionDate property: The submission date. + * + * @return the submissionDate value. + */ + public OffsetDateTime submissionDate() { + return this.submissionDate; + } + + /** + * Get the timestamp property: The Time stamp when the message is received (Mail). + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Get the recipient property: The recipient of the mail. + * + * @return the recipient value. + */ + public String recipient() { + return this.recipient; + } + + /** + * Get the sender property: The sender of the mail. + * + * @return the sender value. + */ + public String sender() { + return this.sender; + } + + /** + * Get the senderIp property: The sender's IP. + * + * @return the senderIp value. + */ + public String senderIp() { + return this.senderIp; + } + + /** + * Get the subject property: The subject of submission mail. + * + * @return the subject value. + */ + public String subject() { + return this.subject; + } + + /** + * Get the reportType property: The submission type for the given instance. This maps to Junk, Phish, Malware or + * NotJunk. + * + * @return the reportType value. + */ + public String reportType() { + return this.reportType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TICheckRequirementsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TICheckRequirementsProperties.java new file mode 100644 index 000000000000..71e773b4e6bf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TICheckRequirementsProperties.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Threat Intelligence Platforms data connector required properties. */ +@Fluent +public final class TICheckRequirementsProperties extends DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TICheckRequirementsProperties.class); + + /** {@inheritDoc} */ + @Override + public TICheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TIDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TIDataConnectorProperties.java new file mode 100644 index 000000000000..980ec2e6fed2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TIDataConnectorProperties.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.azure.resourcemanager.securityinsights.models.TIDataConnectorDataTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** TI (Threat Intelligence) data connector properties. */ +@Fluent +public final class TIDataConnectorProperties extends DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TIDataConnectorProperties.class); + + /* + * The lookback period for the feed to be imported. + */ + @JsonProperty(value = "tipLookbackPeriod") + private OffsetDateTime tipLookbackPeriod; + + /* + * The available data types for the connector. + */ + @JsonProperty(value = "dataTypes", required = true) + private TIDataConnectorDataTypes dataTypes; + + /** + * Get the tipLookbackPeriod property: The lookback period for the feed to be imported. + * + * @return the tipLookbackPeriod value. + */ + public OffsetDateTime tipLookbackPeriod() { + return this.tipLookbackPeriod; + } + + /** + * Set the tipLookbackPeriod property: The lookback period for the feed to be imported. + * + * @param tipLookbackPeriod the tipLookbackPeriod value to set. + * @return the TIDataConnectorProperties object itself. + */ + public TIDataConnectorProperties withTipLookbackPeriod(OffsetDateTime tipLookbackPeriod) { + this.tipLookbackPeriod = tipLookbackPeriod; + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public TIDataConnectorDataTypes dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the TIDataConnectorProperties object itself. + */ + public TIDataConnectorProperties withDataTypes(TIDataConnectorDataTypes dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** {@inheritDoc} */ + @Override + public TIDataConnectorProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataTypes() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dataTypes in model TIDataConnectorProperties")); + } else { + dataTypes().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TeamInformationInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TeamInformationInner.java new file mode 100644 index 000000000000..0b8aa2beb2ce --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TeamInformationInner.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Describes team information. */ +@Immutable +public final class TeamInformationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TeamInformationInner.class); + + /* + * Team ID + */ + @JsonProperty(value = "teamId", access = JsonProperty.Access.WRITE_ONLY) + private String teamId; + + /* + * The primary channel URL of the team + */ + @JsonProperty(value = "primaryChannelUrl", access = JsonProperty.Access.WRITE_ONLY) + private String primaryChannelUrl; + + /* + * The time the team was created + */ + @JsonProperty(value = "teamCreationTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime teamCreationTimeUtc; + + /* + * The name of the team + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The description of the team + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the teamId property: Team ID. + * + * @return the teamId value. + */ + public String teamId() { + return this.teamId; + } + + /** + * Get the primaryChannelUrl property: The primary channel URL of the team. + * + * @return the primaryChannelUrl value. + */ + public String primaryChannelUrl() { + return this.primaryChannelUrl; + } + + /** + * Get the teamCreationTimeUtc property: The time the team was created. + * + * @return the teamCreationTimeUtc value. + */ + public OffsetDateTime teamCreationTimeUtc() { + return this.teamCreationTimeUtc; + } + + /** + * Get the name property: The name of the team. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the description property: The description of the team. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceAlertRuleProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceAlertRuleProperties.java new file mode 100644 index 000000000000..7e2209e586ae --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceAlertRuleProperties.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Threat Intelligence alert rule base property bag. */ +@Fluent +public final class ThreatIntelligenceAlertRuleProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligenceAlertRuleProperties.class); + + /* + * The Name of the alert rule template used to create this rule. + */ + @JsonProperty(value = "alertRuleTemplateName", required = true) + private String alertRuleTemplateName; + + /* + * The description of the alert rule. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The display name for alerts created by this alert rule. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * Determines whether this alert rule is enabled or disabled. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * The last time that this alert has been modified. + */ + @JsonProperty(value = "lastModifiedUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedUtc; + + /* + * The severity for alerts created by this alert rule. + */ + @JsonProperty(value = "severity", access = JsonProperty.Access.WRITE_ONLY) + private AlertSeverity severity; + + /* + * The tactics of the alert rule + */ + @JsonProperty(value = "tactics", access = JsonProperty.Access.WRITE_ONLY) + private List tactics; + + /** + * Get the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. + * + * @return the alertRuleTemplateName value. + */ + public String alertRuleTemplateName() { + return this.alertRuleTemplateName; + } + + /** + * Set the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. + * + * @param alertRuleTemplateName the alertRuleTemplateName value to set. + * @return the ThreatIntelligenceAlertRuleProperties object itself. + */ + public ThreatIntelligenceAlertRuleProperties withAlertRuleTemplateName(String alertRuleTemplateName) { + this.alertRuleTemplateName = alertRuleTemplateName; + return this; + } + + /** + * Get the description property: The description of the alert rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the displayName property: The display name for alerts created by this alert rule. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the enabled property: Determines whether this alert rule is enabled or disabled. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Determines whether this alert rule is enabled or disabled. + * + * @param enabled the enabled value to set. + * @return the ThreatIntelligenceAlertRuleProperties object itself. + */ + public ThreatIntelligenceAlertRuleProperties withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the lastModifiedUtc property: The last time that this alert has been modified. + * + * @return the lastModifiedUtc value. + */ + public OffsetDateTime lastModifiedUtc() { + return this.lastModifiedUtc; + } + + /** + * Get the severity property: The severity for alerts created by this alert rule. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.severity; + } + + /** + * Get the tactics property: The tactics of the alert rule. + * + * @return the tactics value. + */ + public List tactics() { + return this.tactics; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (alertRuleTemplateName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property alertRuleTemplateName in model" + + " ThreatIntelligenceAlertRuleProperties")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceAlertRuleTemplateProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceAlertRuleTemplateProperties.java new file mode 100644 index 000000000000..53fe73ec3dd8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceAlertRuleTemplateProperties.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateDataSource; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplatePropertiesBase; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.TemplateStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Threat Intelligence alert rule template properties. */ +@Fluent +public final class ThreatIntelligenceAlertRuleTemplateProperties extends AlertRuleTemplatePropertiesBase { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ThreatIntelligenceAlertRuleTemplateProperties.class); + + /* + * The severity for alerts created by this alert rule. + */ + @JsonProperty(value = "severity", required = true) + private AlertSeverity severity; + + /* + * The tactics of the alert rule template + */ + @JsonProperty(value = "tactics") + private List tactics; + + /** + * Get the severity property: The severity for alerts created by this alert rule. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.severity; + } + + /** + * Set the severity property: The severity for alerts created by this alert rule. + * + * @param severity the severity value to set. + * @return the ThreatIntelligenceAlertRuleTemplateProperties object itself. + */ + public ThreatIntelligenceAlertRuleTemplateProperties withSeverity(AlertSeverity severity) { + this.severity = severity; + return this; + } + + /** + * Get the tactics property: The tactics of the alert rule template. + * + * @return the tactics value. + */ + public List tactics() { + return this.tactics; + } + + /** + * Set the tactics property: The tactics of the alert rule template. + * + * @param tactics the tactics value to set. + * @return the ThreatIntelligenceAlertRuleTemplateProperties object itself. + */ + public ThreatIntelligenceAlertRuleTemplateProperties withTactics(List tactics) { + this.tactics = tactics; + return this; + } + + /** {@inheritDoc} */ + @Override + public ThreatIntelligenceAlertRuleTemplateProperties withAlertRulesCreatedByTemplateCount( + Integer alertRulesCreatedByTemplateCount) { + super.withAlertRulesCreatedByTemplateCount(alertRulesCreatedByTemplateCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public ThreatIntelligenceAlertRuleTemplateProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public ThreatIntelligenceAlertRuleTemplateProperties withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** {@inheritDoc} */ + @Override + public ThreatIntelligenceAlertRuleTemplateProperties withRequiredDataConnectors( + List requiredDataConnectors) { + super.withRequiredDataConnectors(requiredDataConnectors); + return this; + } + + /** {@inheritDoc} */ + @Override + public ThreatIntelligenceAlertRuleTemplateProperties withStatus(TemplateStatus status) { + super.withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (severity() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property severity in model ThreatIntelligenceAlertRuleTemplateProperties")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceIndicatorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceIndicatorProperties.java new file mode 100644 index 000000000000..eda09a0fc282 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceIndicatorProperties.java @@ -0,0 +1,779 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceExternalReference; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceGranularMarkingModel; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceKillChainPhase; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceParsedPattern; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Describes threat intelligence entity properties. */ +@Fluent +public final class ThreatIntelligenceIndicatorProperties extends EntityCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligenceIndicatorProperties.class); + + /* + * List of tags + */ + @JsonProperty(value = "threatIntelligenceTags") + private List threatIntelligenceTags; + + /* + * Last updated time in UTC + */ + @JsonProperty(value = "lastUpdatedTimeUtc") + private String lastUpdatedTimeUtc; + + /* + * Source of a threat intelligence entity + */ + @JsonProperty(value = "source") + private String source; + + /* + * Display name of a threat intelligence entity + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Description of a threat intelligence entity + */ + @JsonProperty(value = "description") + private String description; + + /* + * Indicator types of threat intelligence entities + */ + @JsonProperty(value = "indicatorTypes") + private List indicatorTypes; + + /* + * Pattern of a threat intelligence entity + */ + @JsonProperty(value = "pattern") + private String pattern; + + /* + * Pattern type of a threat intelligence entity + */ + @JsonProperty(value = "patternType") + private String patternType; + + /* + * Pattern version of a threat intelligence entity + */ + @JsonProperty(value = "patternVersion") + private String patternVersion; + + /* + * Kill chain phases + */ + @JsonProperty(value = "killChainPhases") + private List killChainPhases; + + /* + * Parsed patterns + */ + @JsonProperty(value = "parsedPattern") + private List parsedPattern; + + /* + * External ID of threat intelligence entity + */ + @JsonProperty(value = "externalId") + private String externalId; + + /* + * Created by reference of threat intelligence entity + */ + @JsonProperty(value = "createdByRef") + private String createdByRef; + + /* + * Is threat intelligence entity defanged + */ + @JsonProperty(value = "defanged") + private Boolean defanged; + + /* + * External last updated time in UTC + */ + @JsonProperty(value = "externalLastUpdatedTimeUtc") + private String externalLastUpdatedTimeUtc; + + /* + * External References + */ + @JsonProperty(value = "externalReferences") + private List externalReferences; + + /* + * Granular Markings + */ + @JsonProperty(value = "granularMarkings") + private List granularMarkings; + + /* + * Labels of threat intelligence entity + */ + @JsonProperty(value = "labels") + private List labels; + + /* + * Is threat intelligence entity revoked + */ + @JsonProperty(value = "revoked") + private Boolean revoked; + + /* + * Confidence of threat intelligence entity + */ + @JsonProperty(value = "confidence") + private Integer confidence; + + /* + * Threat intelligence entity object marking references + */ + @JsonProperty(value = "objectMarkingRefs") + private List objectMarkingRefs; + + /* + * Language of threat intelligence entity + */ + @JsonProperty(value = "language") + private String language; + + /* + * Threat types + */ + @JsonProperty(value = "threatTypes") + private List threatTypes; + + /* + * Valid from + */ + @JsonProperty(value = "validFrom") + private String validFrom; + + /* + * Valid until + */ + @JsonProperty(value = "validUntil") + private String validUntil; + + /* + * Created by + */ + @JsonProperty(value = "created") + private String created; + + /* + * Modified by + */ + @JsonProperty(value = "modified") + private String modified; + + /* + * Extensions map + */ + @JsonProperty(value = "extensions") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map extensions; + + /** + * Get the threatIntelligenceTags property: List of tags. + * + * @return the threatIntelligenceTags value. + */ + public List threatIntelligenceTags() { + return this.threatIntelligenceTags; + } + + /** + * Set the threatIntelligenceTags property: List of tags. + * + * @param threatIntelligenceTags the threatIntelligenceTags value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withThreatIntelligenceTags(List threatIntelligenceTags) { + this.threatIntelligenceTags = threatIntelligenceTags; + return this; + } + + /** + * Get the lastUpdatedTimeUtc property: Last updated time in UTC. + * + * @return the lastUpdatedTimeUtc value. + */ + public String lastUpdatedTimeUtc() { + return this.lastUpdatedTimeUtc; + } + + /** + * Set the lastUpdatedTimeUtc property: Last updated time in UTC. + * + * @param lastUpdatedTimeUtc the lastUpdatedTimeUtc value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withLastUpdatedTimeUtc(String lastUpdatedTimeUtc) { + this.lastUpdatedTimeUtc = lastUpdatedTimeUtc; + return this; + } + + /** + * Get the source property: Source of a threat intelligence entity. + * + * @return the source value. + */ + public String source() { + return this.source; + } + + /** + * Set the source property: Source of a threat intelligence entity. + * + * @param source the source value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withSource(String source) { + this.source = source; + return this; + } + + /** + * Get the displayName property: Display name of a threat intelligence entity. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of a threat intelligence entity. + * + * @param displayName the displayName value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description property: Description of a threat intelligence entity. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of a threat intelligence entity. + * + * @param description the description value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the indicatorTypes property: Indicator types of threat intelligence entities. + * + * @return the indicatorTypes value. + */ + public List indicatorTypes() { + return this.indicatorTypes; + } + + /** + * Set the indicatorTypes property: Indicator types of threat intelligence entities. + * + * @param indicatorTypes the indicatorTypes value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withIndicatorTypes(List indicatorTypes) { + this.indicatorTypes = indicatorTypes; + return this; + } + + /** + * Get the pattern property: Pattern of a threat intelligence entity. + * + * @return the pattern value. + */ + public String pattern() { + return this.pattern; + } + + /** + * Set the pattern property: Pattern of a threat intelligence entity. + * + * @param pattern the pattern value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withPattern(String pattern) { + this.pattern = pattern; + return this; + } + + /** + * Get the patternType property: Pattern type of a threat intelligence entity. + * + * @return the patternType value. + */ + public String patternType() { + return this.patternType; + } + + /** + * Set the patternType property: Pattern type of a threat intelligence entity. + * + * @param patternType the patternType value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withPatternType(String patternType) { + this.patternType = patternType; + return this; + } + + /** + * Get the patternVersion property: Pattern version of a threat intelligence entity. + * + * @return the patternVersion value. + */ + public String patternVersion() { + return this.patternVersion; + } + + /** + * Set the patternVersion property: Pattern version of a threat intelligence entity. + * + * @param patternVersion the patternVersion value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withPatternVersion(String patternVersion) { + this.patternVersion = patternVersion; + return this; + } + + /** + * Get the killChainPhases property: Kill chain phases. + * + * @return the killChainPhases value. + */ + public List killChainPhases() { + return this.killChainPhases; + } + + /** + * Set the killChainPhases property: Kill chain phases. + * + * @param killChainPhases the killChainPhases value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withKillChainPhases( + List killChainPhases) { + this.killChainPhases = killChainPhases; + return this; + } + + /** + * Get the parsedPattern property: Parsed patterns. + * + * @return the parsedPattern value. + */ + public List parsedPattern() { + return this.parsedPattern; + } + + /** + * Set the parsedPattern property: Parsed patterns. + * + * @param parsedPattern the parsedPattern value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withParsedPattern( + List parsedPattern) { + this.parsedPattern = parsedPattern; + return this; + } + + /** + * Get the externalId property: External ID of threat intelligence entity. + * + * @return the externalId value. + */ + public String externalId() { + return this.externalId; + } + + /** + * Set the externalId property: External ID of threat intelligence entity. + * + * @param externalId the externalId value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withExternalId(String externalId) { + this.externalId = externalId; + return this; + } + + /** + * Get the createdByRef property: Created by reference of threat intelligence entity. + * + * @return the createdByRef value. + */ + public String createdByRef() { + return this.createdByRef; + } + + /** + * Set the createdByRef property: Created by reference of threat intelligence entity. + * + * @param createdByRef the createdByRef value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withCreatedByRef(String createdByRef) { + this.createdByRef = createdByRef; + return this; + } + + /** + * Get the defanged property: Is threat intelligence entity defanged. + * + * @return the defanged value. + */ + public Boolean defanged() { + return this.defanged; + } + + /** + * Set the defanged property: Is threat intelligence entity defanged. + * + * @param defanged the defanged value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withDefanged(Boolean defanged) { + this.defanged = defanged; + return this; + } + + /** + * Get the externalLastUpdatedTimeUtc property: External last updated time in UTC. + * + * @return the externalLastUpdatedTimeUtc value. + */ + public String externalLastUpdatedTimeUtc() { + return this.externalLastUpdatedTimeUtc; + } + + /** + * Set the externalLastUpdatedTimeUtc property: External last updated time in UTC. + * + * @param externalLastUpdatedTimeUtc the externalLastUpdatedTimeUtc value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withExternalLastUpdatedTimeUtc(String externalLastUpdatedTimeUtc) { + this.externalLastUpdatedTimeUtc = externalLastUpdatedTimeUtc; + return this; + } + + /** + * Get the externalReferences property: External References. + * + * @return the externalReferences value. + */ + public List externalReferences() { + return this.externalReferences; + } + + /** + * Set the externalReferences property: External References. + * + * @param externalReferences the externalReferences value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withExternalReferences( + List externalReferences) { + this.externalReferences = externalReferences; + return this; + } + + /** + * Get the granularMarkings property: Granular Markings. + * + * @return the granularMarkings value. + */ + public List granularMarkings() { + return this.granularMarkings; + } + + /** + * Set the granularMarkings property: Granular Markings. + * + * @param granularMarkings the granularMarkings value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withGranularMarkings( + List granularMarkings) { + this.granularMarkings = granularMarkings; + return this; + } + + /** + * Get the labels property: Labels of threat intelligence entity. + * + * @return the labels value. + */ + public List labels() { + return this.labels; + } + + /** + * Set the labels property: Labels of threat intelligence entity. + * + * @param labels the labels value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withLabels(List labels) { + this.labels = labels; + return this; + } + + /** + * Get the revoked property: Is threat intelligence entity revoked. + * + * @return the revoked value. + */ + public Boolean revoked() { + return this.revoked; + } + + /** + * Set the revoked property: Is threat intelligence entity revoked. + * + * @param revoked the revoked value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withRevoked(Boolean revoked) { + this.revoked = revoked; + return this; + } + + /** + * Get the confidence property: Confidence of threat intelligence entity. + * + * @return the confidence value. + */ + public Integer confidence() { + return this.confidence; + } + + /** + * Set the confidence property: Confidence of threat intelligence entity. + * + * @param confidence the confidence value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withConfidence(Integer confidence) { + this.confidence = confidence; + return this; + } + + /** + * Get the objectMarkingRefs property: Threat intelligence entity object marking references. + * + * @return the objectMarkingRefs value. + */ + public List objectMarkingRefs() { + return this.objectMarkingRefs; + } + + /** + * Set the objectMarkingRefs property: Threat intelligence entity object marking references. + * + * @param objectMarkingRefs the objectMarkingRefs value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withObjectMarkingRefs(List objectMarkingRefs) { + this.objectMarkingRefs = objectMarkingRefs; + return this; + } + + /** + * Get the language property: Language of threat intelligence entity. + * + * @return the language value. + */ + public String language() { + return this.language; + } + + /** + * Set the language property: Language of threat intelligence entity. + * + * @param language the language value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withLanguage(String language) { + this.language = language; + return this; + } + + /** + * Get the threatTypes property: Threat types. + * + * @return the threatTypes value. + */ + public List threatTypes() { + return this.threatTypes; + } + + /** + * Set the threatTypes property: Threat types. + * + * @param threatTypes the threatTypes value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withThreatTypes(List threatTypes) { + this.threatTypes = threatTypes; + return this; + } + + /** + * Get the validFrom property: Valid from. + * + * @return the validFrom value. + */ + public String validFrom() { + return this.validFrom; + } + + /** + * Set the validFrom property: Valid from. + * + * @param validFrom the validFrom value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withValidFrom(String validFrom) { + this.validFrom = validFrom; + return this; + } + + /** + * Get the validUntil property: Valid until. + * + * @return the validUntil value. + */ + public String validUntil() { + return this.validUntil; + } + + /** + * Set the validUntil property: Valid until. + * + * @param validUntil the validUntil value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withValidUntil(String validUntil) { + this.validUntil = validUntil; + return this; + } + + /** + * Get the created property: Created by. + * + * @return the created value. + */ + public String created() { + return this.created; + } + + /** + * Set the created property: Created by. + * + * @param created the created value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withCreated(String created) { + this.created = created; + return this; + } + + /** + * Get the modified property: Modified by. + * + * @return the modified value. + */ + public String modified() { + return this.modified; + } + + /** + * Set the modified property: Modified by. + * + * @param modified the modified value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withModified(String modified) { + this.modified = modified; + return this; + } + + /** + * Get the extensions property: Extensions map. + * + * @return the extensions value. + */ + public Map extensions() { + return this.extensions; + } + + /** + * Set the extensions property: Extensions map. + * + * @param extensions the extensions value to set. + * @return the ThreatIntelligenceIndicatorProperties object itself. + */ + public ThreatIntelligenceIndicatorProperties withExtensions(Map extensions) { + this.extensions = extensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (killChainPhases() != null) { + killChainPhases().forEach(e -> e.validate()); + } + if (parsedPattern() != null) { + parsedPattern().forEach(e -> e.validate()); + } + if (externalReferences() != null) { + externalReferences().forEach(e -> e.validate()); + } + if (granularMarkings() != null) { + granularMarkings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceInformationInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceInformationInner.java new file mode 100644 index 000000000000..9e5198057412 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceInformationInner.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModel; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Threat intelligence information object. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = ThreatIntelligenceInformationInner.class) +@JsonTypeName("ThreatIntelligenceInformation") +@JsonSubTypes({@JsonSubTypes.Type(name = "indicator", value = ThreatIntelligenceIndicatorModel.class)}) +@Fluent +public class ThreatIntelligenceInformationInner extends ResourceWithEtag { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligenceInformationInner.class); + + /** {@inheritDoc} */ + @Override + public ThreatIntelligenceInformationInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceMetricsListInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceMetricsListInner.java new file mode 100644 index 000000000000..5298842e7ff9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceMetricsListInner.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceMetrics; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of all the threat intelligence metric fields (type/threat type/source). */ +@Fluent +public final class ThreatIntelligenceMetricsListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligenceMetricsListInner.class); + + /* + * Array of threat intelligence metric fields (type/threat type/source). + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the value property: Array of threat intelligence metric fields (type/threat type/source). + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of threat intelligence metric fields (type/threat type/source). + * + * @param value the value value to set. + * @return the ThreatIntelligenceMetricsListInner object itself. + */ + public ThreatIntelligenceMetricsListInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model ThreatIntelligenceMetricsListInner")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TiTaxiiCheckRequirementsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TiTaxiiCheckRequirementsProperties.java new file mode 100644 index 000000000000..239515abb74c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TiTaxiiCheckRequirementsProperties.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Threat Intelligence TAXII data connector required properties. */ +@Fluent +public final class TiTaxiiCheckRequirementsProperties extends DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TiTaxiiCheckRequirementsProperties.class); + + /** {@inheritDoc} */ + @Override + public TiTaxiiCheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TiTaxiiDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TiTaxiiDataConnectorProperties.java new file mode 100644 index 000000000000..ac65c43bec6c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TiTaxiiDataConnectorProperties.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.azure.resourcemanager.securityinsights.models.PollingFrequency; +import com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnectorDataTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Threat Intelligence TAXII data connector properties. */ +@Fluent +public final class TiTaxiiDataConnectorProperties extends DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TiTaxiiDataConnectorProperties.class); + + /* + * The workspace id. + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /* + * The friendly name for the TAXII server. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * The API root for the TAXII server. + */ + @JsonProperty(value = "taxiiServer") + private String taxiiServer; + + /* + * The collection id of the TAXII server. + */ + @JsonProperty(value = "collectionId") + private String collectionId; + + /* + * The userName for the TAXII server. + */ + @JsonProperty(value = "userName") + private String username; + + /* + * The password for the TAXII server. + */ + @JsonProperty(value = "password") + private String password; + + /* + * The lookback period for the TAXII server. + */ + @JsonProperty(value = "taxiiLookbackPeriod") + private OffsetDateTime taxiiLookbackPeriod; + + /* + * The polling frequency for the TAXII server. + */ + @JsonProperty(value = "pollingFrequency", required = true) + private PollingFrequency pollingFrequency; + + /* + * The available data types for Threat Intelligence TAXII data connector. + */ + @JsonProperty(value = "dataTypes", required = true) + private TiTaxiiDataConnectorDataTypes dataTypes; + + /** + * Get the workspaceId property: The workspace id. + * + * @return the workspaceId value. + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspaceId property: The workspace id. + * + * @param workspaceId the workspaceId value to set. + * @return the TiTaxiiDataConnectorProperties object itself. + */ + public TiTaxiiDataConnectorProperties withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the friendlyName property: The friendly name for the TAXII server. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The friendly name for the TAXII server. + * + * @param friendlyName the friendlyName value to set. + * @return the TiTaxiiDataConnectorProperties object itself. + */ + public TiTaxiiDataConnectorProperties withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the taxiiServer property: The API root for the TAXII server. + * + * @return the taxiiServer value. + */ + public String taxiiServer() { + return this.taxiiServer; + } + + /** + * Set the taxiiServer property: The API root for the TAXII server. + * + * @param taxiiServer the taxiiServer value to set. + * @return the TiTaxiiDataConnectorProperties object itself. + */ + public TiTaxiiDataConnectorProperties withTaxiiServer(String taxiiServer) { + this.taxiiServer = taxiiServer; + return this; + } + + /** + * Get the collectionId property: The collection id of the TAXII server. + * + * @return the collectionId value. + */ + public String collectionId() { + return this.collectionId; + } + + /** + * Set the collectionId property: The collection id of the TAXII server. + * + * @param collectionId the collectionId value to set. + * @return the TiTaxiiDataConnectorProperties object itself. + */ + public TiTaxiiDataConnectorProperties withCollectionId(String collectionId) { + this.collectionId = collectionId; + return this; + } + + /** + * Get the username property: The userName for the TAXII server. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The userName for the TAXII server. + * + * @param username the username value to set. + * @return the TiTaxiiDataConnectorProperties object itself. + */ + public TiTaxiiDataConnectorProperties withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: The password for the TAXII server. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password for the TAXII server. + * + * @param password the password value to set. + * @return the TiTaxiiDataConnectorProperties object itself. + */ + public TiTaxiiDataConnectorProperties withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the taxiiLookbackPeriod property: The lookback period for the TAXII server. + * + * @return the taxiiLookbackPeriod value. + */ + public OffsetDateTime taxiiLookbackPeriod() { + return this.taxiiLookbackPeriod; + } + + /** + * Set the taxiiLookbackPeriod property: The lookback period for the TAXII server. + * + * @param taxiiLookbackPeriod the taxiiLookbackPeriod value to set. + * @return the TiTaxiiDataConnectorProperties object itself. + */ + public TiTaxiiDataConnectorProperties withTaxiiLookbackPeriod(OffsetDateTime taxiiLookbackPeriod) { + this.taxiiLookbackPeriod = taxiiLookbackPeriod; + return this; + } + + /** + * Get the pollingFrequency property: The polling frequency for the TAXII server. + * + * @return the pollingFrequency value. + */ + public PollingFrequency pollingFrequency() { + return this.pollingFrequency; + } + + /** + * Set the pollingFrequency property: The polling frequency for the TAXII server. + * + * @param pollingFrequency the pollingFrequency value to set. + * @return the TiTaxiiDataConnectorProperties object itself. + */ + public TiTaxiiDataConnectorProperties withPollingFrequency(PollingFrequency pollingFrequency) { + this.pollingFrequency = pollingFrequency; + return this; + } + + /** + * Get the dataTypes property: The available data types for Threat Intelligence TAXII data connector. + * + * @return the dataTypes value. + */ + public TiTaxiiDataConnectorDataTypes dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: The available data types for Threat Intelligence TAXII data connector. + * + * @param dataTypes the dataTypes value to set. + * @return the TiTaxiiDataConnectorProperties object itself. + */ + public TiTaxiiDataConnectorProperties withDataTypes(TiTaxiiDataConnectorDataTypes dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** {@inheritDoc} */ + @Override + public TiTaxiiDataConnectorProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (pollingFrequency() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property pollingFrequency in model TiTaxiiDataConnectorProperties")); + } + if (dataTypes() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dataTypes in model TiTaxiiDataConnectorProperties")); + } else { + dataTypes().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/UebaProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/UebaProperties.java new file mode 100644 index 000000000000..f0f77ffa8306 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/UebaProperties.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.UebaDataSources; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Ueba property bag. */ +@Fluent +public final class UebaProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UebaProperties.class); + + /* + * The relevant data sources that enriched by ueba + */ + @JsonProperty(value = "dataSources") + private List dataSources; + + /** + * Get the dataSources property: The relevant data sources that enriched by ueba. + * + * @return the dataSources value. + */ + public List dataSources() { + return this.dataSources; + } + + /** + * Set the dataSources property: The relevant data sources that enriched by ueba. + * + * @param dataSources the dataSources value to set. + * @return the UebaProperties object itself. + */ + public UebaProperties withDataSources(List dataSources) { + this.dataSources = dataSources; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/UrlEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/UrlEntityProperties.java new file mode 100644 index 000000000000..2b23c3ec2247 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/UrlEntityProperties.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Url entity property bag. */ +@Immutable +public final class UrlEntityProperties extends EntityCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UrlEntityProperties.class); + + /* + * A full URL the entity points to + */ + @JsonProperty(value = "url", access = JsonProperty.Access.WRITE_ONLY) + private String url; + + /** + * Get the url property: A full URL the entity points to. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistInner.java new file mode 100644 index 000000000000..91ebee357d57 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistInner.java @@ -0,0 +1,548 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.azure.resourcemanager.securityinsights.models.Source; +import com.azure.resourcemanager.securityinsights.models.UserInfo; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.List; + +/** Represents a Watchlist in Azure Security Insights. */ +@Fluent +public final class WatchlistInner extends ResourceWithEtag { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WatchlistInner.class); + + /* + * Watchlist properties + */ + @JsonProperty(value = "properties") + private WatchlistProperties innerProperties; + + /** + * Get the innerProperties property: Watchlist properties. + * + * @return the innerProperties value. + */ + private WatchlistProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public WatchlistInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the watchlistId property: The id (a Guid) of the watchlist. + * + * @return the watchlistId value. + */ + public String watchlistId() { + return this.innerProperties() == null ? null : this.innerProperties().watchlistId(); + } + + /** + * Set the watchlistId property: The id (a Guid) of the watchlist. + * + * @param watchlistId the watchlistId value to set. + * @return the WatchlistInner object itself. + */ + public WatchlistInner withWatchlistId(String watchlistId) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistProperties(); + } + this.innerProperties().withWatchlistId(watchlistId); + return this; + } + + /** + * Get the displayName property: The display name of the watchlist. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name of the watchlist. + * + * @param displayName the displayName value to set. + * @return the WatchlistInner object itself. + */ + public WatchlistInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the provider property: The provider of the watchlist. + * + * @return the provider value. + */ + public String provider() { + return this.innerProperties() == null ? null : this.innerProperties().provider(); + } + + /** + * Set the provider property: The provider of the watchlist. + * + * @param provider the provider value to set. + * @return the WatchlistInner object itself. + */ + public WatchlistInner withProvider(String provider) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistProperties(); + } + this.innerProperties().withProvider(provider); + return this; + } + + /** + * Get the source property: The source of the watchlist. + * + * @return the source value. + */ + public Source source() { + return this.innerProperties() == null ? null : this.innerProperties().source(); + } + + /** + * Set the source property: The source of the watchlist. + * + * @param source the source value to set. + * @return the WatchlistInner object itself. + */ + public WatchlistInner withSource(Source source) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistProperties(); + } + this.innerProperties().withSource(source); + return this; + } + + /** + * Get the created property: The time the watchlist was created. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.innerProperties() == null ? null : this.innerProperties().created(); + } + + /** + * Set the created property: The time the watchlist was created. + * + * @param created the created value to set. + * @return the WatchlistInner object itself. + */ + public WatchlistInner withCreated(OffsetDateTime created) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistProperties(); + } + this.innerProperties().withCreated(created); + return this; + } + + /** + * Get the updated property: The last time the watchlist was updated. + * + * @return the updated value. + */ + public OffsetDateTime updated() { + return this.innerProperties() == null ? null : this.innerProperties().updated(); + } + + /** + * Set the updated property: The last time the watchlist was updated. + * + * @param updated the updated value to set. + * @return the WatchlistInner object itself. + */ + public WatchlistInner withUpdated(OffsetDateTime updated) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistProperties(); + } + this.innerProperties().withUpdated(updated); + return this; + } + + /** + * Get the createdBy property: Describes a user that created the watchlist. + * + * @return the createdBy value. + */ + public UserInfo createdBy() { + return this.innerProperties() == null ? null : this.innerProperties().createdBy(); + } + + /** + * Set the createdBy property: Describes a user that created the watchlist. + * + * @param createdBy the createdBy value to set. + * @return the WatchlistInner object itself. + */ + public WatchlistInner withCreatedBy(UserInfo createdBy) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistProperties(); + } + this.innerProperties().withCreatedBy(createdBy); + return this; + } + + /** + * Get the updatedBy property: Describes a user that updated the watchlist. + * + * @return the updatedBy value. + */ + public UserInfo updatedBy() { + return this.innerProperties() == null ? null : this.innerProperties().updatedBy(); + } + + /** + * Set the updatedBy property: Describes a user that updated the watchlist. + * + * @param updatedBy the updatedBy value to set. + * @return the WatchlistInner object itself. + */ + public WatchlistInner withUpdatedBy(UserInfo updatedBy) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistProperties(); + } + this.innerProperties().withUpdatedBy(updatedBy); + return this; + } + + /** + * Get the description property: A description of the watchlist. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: A description of the watchlist. + * + * @param description the description value to set. + * @return the WatchlistInner object itself. + */ + public WatchlistInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the watchlistType property: The type of the watchlist. + * + * @return the watchlistType value. + */ + public String watchlistType() { + return this.innerProperties() == null ? null : this.innerProperties().watchlistType(); + } + + /** + * Set the watchlistType property: The type of the watchlist. + * + * @param watchlistType the watchlistType value to set. + * @return the WatchlistInner object itself. + */ + public WatchlistInner withWatchlistType(String watchlistType) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistProperties(); + } + this.innerProperties().withWatchlistType(watchlistType); + return this; + } + + /** + * Get the watchlistAlias property: The alias of the watchlist. + * + * @return the watchlistAlias value. + */ + public String watchlistAlias() { + return this.innerProperties() == null ? null : this.innerProperties().watchlistAlias(); + } + + /** + * Set the watchlistAlias property: The alias of the watchlist. + * + * @param watchlistAlias the watchlistAlias value to set. + * @return the WatchlistInner object itself. + */ + public WatchlistInner withWatchlistAlias(String watchlistAlias) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistProperties(); + } + this.innerProperties().withWatchlistAlias(watchlistAlias); + return this; + } + + /** + * Get the isDeleted property: A flag that indicates if the watchlist is deleted or not. + * + * @return the isDeleted value. + */ + public Boolean isDeleted() { + return this.innerProperties() == null ? null : this.innerProperties().isDeleted(); + } + + /** + * Set the isDeleted property: A flag that indicates if the watchlist is deleted or not. + * + * @param isDeleted the isDeleted value to set. + * @return the WatchlistInner object itself. + */ + public WatchlistInner withIsDeleted(Boolean isDeleted) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistProperties(); + } + this.innerProperties().withIsDeleted(isDeleted); + return this; + } + + /** + * Get the labels property: List of labels relevant to this watchlist. + * + * @return the labels value. + */ + public List labels() { + return this.innerProperties() == null ? null : this.innerProperties().labels(); + } + + /** + * Set the labels property: List of labels relevant to this watchlist. + * + * @param labels the labels value to set. + * @return the WatchlistInner object itself. + */ + public WatchlistInner withLabels(List labels) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistProperties(); + } + this.innerProperties().withLabels(labels); + return this; + } + + /** + * Get the defaultDuration property: The default duration of a watchlist (in ISO 8601 duration format). + * + * @return the defaultDuration value. + */ + public Duration defaultDuration() { + return this.innerProperties() == null ? null : this.innerProperties().defaultDuration(); + } + + /** + * Set the defaultDuration property: The default duration of a watchlist (in ISO 8601 duration format). + * + * @param defaultDuration the defaultDuration value to set. + * @return the WatchlistInner object itself. + */ + public WatchlistInner withDefaultDuration(Duration defaultDuration) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistProperties(); + } + this.innerProperties().withDefaultDuration(defaultDuration); + return this; + } + + /** + * Get the tenantId property: The tenantId where the watchlist belongs to. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Set the tenantId property: The tenantId where the watchlist belongs to. + * + * @param tenantId the tenantId value to set. + * @return the WatchlistInner object itself. + */ + public WatchlistInner withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * Get the numberOfLinesToSkip property: The number of lines in a csv/tsv content to skip before the header. + * + * @return the numberOfLinesToSkip value. + */ + public Integer numberOfLinesToSkip() { + return this.innerProperties() == null ? null : this.innerProperties().numberOfLinesToSkip(); + } + + /** + * Set the numberOfLinesToSkip property: The number of lines in a csv/tsv content to skip before the header. + * + * @param numberOfLinesToSkip the numberOfLinesToSkip value to set. + * @return the WatchlistInner object itself. + */ + public WatchlistInner withNumberOfLinesToSkip(Integer numberOfLinesToSkip) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistProperties(); + } + this.innerProperties().withNumberOfLinesToSkip(numberOfLinesToSkip); + return this; + } + + /** + * Get the rawContent property: The raw content that represents to watchlist items to create. In case of csv/tsv + * content type, it's the content of the file that will parsed by the endpoint. + * + * @return the rawContent value. + */ + public String rawContent() { + return this.innerProperties() == null ? null : this.innerProperties().rawContent(); + } + + /** + * Set the rawContent property: The raw content that represents to watchlist items to create. In case of csv/tsv + * content type, it's the content of the file that will parsed by the endpoint. + * + * @param rawContent the rawContent value to set. + * @return the WatchlistInner object itself. + */ + public WatchlistInner withRawContent(String rawContent) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistProperties(); + } + this.innerProperties().withRawContent(rawContent); + return this; + } + + /** + * Get the itemsSearchKey property: The search key is used to optimize query performance when using watchlists for + * joins with other data. For example, enable a column with IP addresses to be the designated SearchKey field, then + * use this field as the key field when joining to other event data by IP address. + * + * @return the itemsSearchKey value. + */ + public String itemsSearchKey() { + return this.innerProperties() == null ? null : this.innerProperties().itemsSearchKey(); + } + + /** + * Set the itemsSearchKey property: The search key is used to optimize query performance when using watchlists for + * joins with other data. For example, enable a column with IP addresses to be the designated SearchKey field, then + * use this field as the key field when joining to other event data by IP address. + * + * @param itemsSearchKey the itemsSearchKey value to set. + * @return the WatchlistInner object itself. + */ + public WatchlistInner withItemsSearchKey(String itemsSearchKey) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistProperties(); + } + this.innerProperties().withItemsSearchKey(itemsSearchKey); + return this; + } + + /** + * Get the contentType property: The content type of the raw content. Example : text/csv or text/tsv. + * + * @return the contentType value. + */ + public String contentType() { + return this.innerProperties() == null ? null : this.innerProperties().contentType(); + } + + /** + * Set the contentType property: The content type of the raw content. Example : text/csv or text/tsv. + * + * @param contentType the contentType value to set. + * @return the WatchlistInner object itself. + */ + public WatchlistInner withContentType(String contentType) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistProperties(); + } + this.innerProperties().withContentType(contentType); + return this; + } + + /** + * Get the uploadStatus property: The status of the Watchlist upload : New, InProgress or Complete. Pls note : When + * a Watchlist upload status is equal to InProgress, the Watchlist cannot be deleted. + * + * @return the uploadStatus value. + */ + public String uploadStatus() { + return this.innerProperties() == null ? null : this.innerProperties().uploadStatus(); + } + + /** + * Set the uploadStatus property: The status of the Watchlist upload : New, InProgress or Complete. Pls note : When + * a Watchlist upload status is equal to InProgress, the Watchlist cannot be deleted. + * + * @param uploadStatus the uploadStatus value to set. + * @return the WatchlistInner object itself. + */ + public WatchlistInner withUploadStatus(String uploadStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistProperties(); + } + this.innerProperties().withUploadStatus(uploadStatus); + return this; + } + + /** + * Get the watchlistItemsCount property: The number of Watchlist Items in the Watchlist. + * + * @return the watchlistItemsCount value. + */ + public Integer watchlistItemsCount() { + return this.innerProperties() == null ? null : this.innerProperties().watchlistItemsCount(); + } + + /** + * Set the watchlistItemsCount property: The number of Watchlist Items in the Watchlist. + * + * @param watchlistItemsCount the watchlistItemsCount value to set. + * @return the WatchlistInner object itself. + */ + public WatchlistInner withWatchlistItemsCount(Integer watchlistItemsCount) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistProperties(); + } + this.innerProperties().withWatchlistItemsCount(watchlistItemsCount); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistItemInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistItemInner.java new file mode 100644 index 000000000000..228360fa82a8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistItemInner.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.azure.resourcemanager.securityinsights.models.UserInfo; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Represents a Watchlist item in Azure Security Insights. */ +@Fluent +public final class WatchlistItemInner extends ResourceWithEtag { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WatchlistItemInner.class); + + /* + * Watchlist Item properties + */ + @JsonProperty(value = "properties") + private WatchlistItemProperties innerProperties; + + /** + * Get the innerProperties property: Watchlist Item properties. + * + * @return the innerProperties value. + */ + private WatchlistItemProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public WatchlistItemInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the watchlistItemType property: The type of the watchlist item. + * + * @return the watchlistItemType value. + */ + public String watchlistItemType() { + return this.innerProperties() == null ? null : this.innerProperties().watchlistItemType(); + } + + /** + * Set the watchlistItemType property: The type of the watchlist item. + * + * @param watchlistItemType the watchlistItemType value to set. + * @return the WatchlistItemInner object itself. + */ + public WatchlistItemInner withWatchlistItemType(String watchlistItemType) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistItemProperties(); + } + this.innerProperties().withWatchlistItemType(watchlistItemType); + return this; + } + + /** + * Get the watchlistItemId property: The id (a Guid) of the watchlist item. + * + * @return the watchlistItemId value. + */ + public String watchlistItemId() { + return this.innerProperties() == null ? null : this.innerProperties().watchlistItemId(); + } + + /** + * Set the watchlistItemId property: The id (a Guid) of the watchlist item. + * + * @param watchlistItemId the watchlistItemId value to set. + * @return the WatchlistItemInner object itself. + */ + public WatchlistItemInner withWatchlistItemId(String watchlistItemId) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistItemProperties(); + } + this.innerProperties().withWatchlistItemId(watchlistItemId); + return this; + } + + /** + * Get the tenantId property: The tenantId to which the watchlist item belongs to. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Set the tenantId property: The tenantId to which the watchlist item belongs to. + * + * @param tenantId the tenantId value to set. + * @return the WatchlistItemInner object itself. + */ + public WatchlistItemInner withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistItemProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * Get the isDeleted property: A flag that indicates if the watchlist item is deleted or not. + * + * @return the isDeleted value. + */ + public Boolean isDeleted() { + return this.innerProperties() == null ? null : this.innerProperties().isDeleted(); + } + + /** + * Set the isDeleted property: A flag that indicates if the watchlist item is deleted or not. + * + * @param isDeleted the isDeleted value to set. + * @return the WatchlistItemInner object itself. + */ + public WatchlistItemInner withIsDeleted(Boolean isDeleted) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistItemProperties(); + } + this.innerProperties().withIsDeleted(isDeleted); + return this; + } + + /** + * Get the created property: The time the watchlist item was created. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.innerProperties() == null ? null : this.innerProperties().created(); + } + + /** + * Set the created property: The time the watchlist item was created. + * + * @param created the created value to set. + * @return the WatchlistItemInner object itself. + */ + public WatchlistItemInner withCreated(OffsetDateTime created) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistItemProperties(); + } + this.innerProperties().withCreated(created); + return this; + } + + /** + * Get the updated property: The last time the watchlist item was updated. + * + * @return the updated value. + */ + public OffsetDateTime updated() { + return this.innerProperties() == null ? null : this.innerProperties().updated(); + } + + /** + * Set the updated property: The last time the watchlist item was updated. + * + * @param updated the updated value to set. + * @return the WatchlistItemInner object itself. + */ + public WatchlistItemInner withUpdated(OffsetDateTime updated) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistItemProperties(); + } + this.innerProperties().withUpdated(updated); + return this; + } + + /** + * Get the createdBy property: Describes a user that created the watchlist item. + * + * @return the createdBy value. + */ + public UserInfo createdBy() { + return this.innerProperties() == null ? null : this.innerProperties().createdBy(); + } + + /** + * Set the createdBy property: Describes a user that created the watchlist item. + * + * @param createdBy the createdBy value to set. + * @return the WatchlistItemInner object itself. + */ + public WatchlistItemInner withCreatedBy(UserInfo createdBy) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistItemProperties(); + } + this.innerProperties().withCreatedBy(createdBy); + return this; + } + + /** + * Get the updatedBy property: Describes a user that updated the watchlist item. + * + * @return the updatedBy value. + */ + public UserInfo updatedBy() { + return this.innerProperties() == null ? null : this.innerProperties().updatedBy(); + } + + /** + * Set the updatedBy property: Describes a user that updated the watchlist item. + * + * @param updatedBy the updatedBy value to set. + * @return the WatchlistItemInner object itself. + */ + public WatchlistItemInner withUpdatedBy(UserInfo updatedBy) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistItemProperties(); + } + this.innerProperties().withUpdatedBy(updatedBy); + return this; + } + + /** + * Get the itemsKeyValue property: key-value pairs for a watchlist item. + * + * @return the itemsKeyValue value. + */ + public Object itemsKeyValue() { + return this.innerProperties() == null ? null : this.innerProperties().itemsKeyValue(); + } + + /** + * Set the itemsKeyValue property: key-value pairs for a watchlist item. + * + * @param itemsKeyValue the itemsKeyValue value to set. + * @return the WatchlistItemInner object itself. + */ + public WatchlistItemInner withItemsKeyValue(Object itemsKeyValue) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistItemProperties(); + } + this.innerProperties().withItemsKeyValue(itemsKeyValue); + return this; + } + + /** + * Get the entityMapping property: key-value pairs for a watchlist item entity mapping. + * + * @return the entityMapping value. + */ + public Object entityMapping() { + return this.innerProperties() == null ? null : this.innerProperties().entityMapping(); + } + + /** + * Set the entityMapping property: key-value pairs for a watchlist item entity mapping. + * + * @param entityMapping the entityMapping value to set. + * @return the WatchlistItemInner object itself. + */ + public WatchlistItemInner withEntityMapping(Object entityMapping) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistItemProperties(); + } + this.innerProperties().withEntityMapping(entityMapping); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistItemProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistItemProperties.java new file mode 100644 index 000000000000..91b96606ba8c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistItemProperties.java @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.UserInfo; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Describes watchlist item properties. */ +@Fluent +public final class WatchlistItemProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WatchlistItemProperties.class); + + /* + * The type of the watchlist item + */ + @JsonProperty(value = "watchlistItemType") + private String watchlistItemType; + + /* + * The id (a Guid) of the watchlist item + */ + @JsonProperty(value = "watchlistItemId") + private String watchlistItemId; + + /* + * The tenantId to which the watchlist item belongs to + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /* + * A flag that indicates if the watchlist item is deleted or not + */ + @JsonProperty(value = "isDeleted") + private Boolean isDeleted; + + /* + * The time the watchlist item was created + */ + @JsonProperty(value = "created") + private OffsetDateTime created; + + /* + * The last time the watchlist item was updated + */ + @JsonProperty(value = "updated") + private OffsetDateTime updated; + + /* + * Describes a user that created the watchlist item + */ + @JsonProperty(value = "createdBy") + private UserInfo createdBy; + + /* + * Describes a user that updated the watchlist item + */ + @JsonProperty(value = "updatedBy") + private UserInfo updatedBy; + + /* + * key-value pairs for a watchlist item + */ + @JsonProperty(value = "itemsKeyValue", required = true) + private Object itemsKeyValue; + + /* + * key-value pairs for a watchlist item entity mapping + */ + @JsonProperty(value = "entityMapping") + private Object entityMapping; + + /** + * Get the watchlistItemType property: The type of the watchlist item. + * + * @return the watchlistItemType value. + */ + public String watchlistItemType() { + return this.watchlistItemType; + } + + /** + * Set the watchlistItemType property: The type of the watchlist item. + * + * @param watchlistItemType the watchlistItemType value to set. + * @return the WatchlistItemProperties object itself. + */ + public WatchlistItemProperties withWatchlistItemType(String watchlistItemType) { + this.watchlistItemType = watchlistItemType; + return this; + } + + /** + * Get the watchlistItemId property: The id (a Guid) of the watchlist item. + * + * @return the watchlistItemId value. + */ + public String watchlistItemId() { + return this.watchlistItemId; + } + + /** + * Set the watchlistItemId property: The id (a Guid) of the watchlist item. + * + * @param watchlistItemId the watchlistItemId value to set. + * @return the WatchlistItemProperties object itself. + */ + public WatchlistItemProperties withWatchlistItemId(String watchlistItemId) { + this.watchlistItemId = watchlistItemId; + return this; + } + + /** + * Get the tenantId property: The tenantId to which the watchlist item belongs to. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenantId to which the watchlist item belongs to. + * + * @param tenantId the tenantId value to set. + * @return the WatchlistItemProperties object itself. + */ + public WatchlistItemProperties withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the isDeleted property: A flag that indicates if the watchlist item is deleted or not. + * + * @return the isDeleted value. + */ + public Boolean isDeleted() { + return this.isDeleted; + } + + /** + * Set the isDeleted property: A flag that indicates if the watchlist item is deleted or not. + * + * @param isDeleted the isDeleted value to set. + * @return the WatchlistItemProperties object itself. + */ + public WatchlistItemProperties withIsDeleted(Boolean isDeleted) { + this.isDeleted = isDeleted; + return this; + } + + /** + * Get the created property: The time the watchlist item was created. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.created; + } + + /** + * Set the created property: The time the watchlist item was created. + * + * @param created the created value to set. + * @return the WatchlistItemProperties object itself. + */ + public WatchlistItemProperties withCreated(OffsetDateTime created) { + this.created = created; + return this; + } + + /** + * Get the updated property: The last time the watchlist item was updated. + * + * @return the updated value. + */ + public OffsetDateTime updated() { + return this.updated; + } + + /** + * Set the updated property: The last time the watchlist item was updated. + * + * @param updated the updated value to set. + * @return the WatchlistItemProperties object itself. + */ + public WatchlistItemProperties withUpdated(OffsetDateTime updated) { + this.updated = updated; + return this; + } + + /** + * Get the createdBy property: Describes a user that created the watchlist item. + * + * @return the createdBy value. + */ + public UserInfo createdBy() { + return this.createdBy; + } + + /** + * Set the createdBy property: Describes a user that created the watchlist item. + * + * @param createdBy the createdBy value to set. + * @return the WatchlistItemProperties object itself. + */ + public WatchlistItemProperties withCreatedBy(UserInfo createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Get the updatedBy property: Describes a user that updated the watchlist item. + * + * @return the updatedBy value. + */ + public UserInfo updatedBy() { + return this.updatedBy; + } + + /** + * Set the updatedBy property: Describes a user that updated the watchlist item. + * + * @param updatedBy the updatedBy value to set. + * @return the WatchlistItemProperties object itself. + */ + public WatchlistItemProperties withUpdatedBy(UserInfo updatedBy) { + this.updatedBy = updatedBy; + return this; + } + + /** + * Get the itemsKeyValue property: key-value pairs for a watchlist item. + * + * @return the itemsKeyValue value. + */ + public Object itemsKeyValue() { + return this.itemsKeyValue; + } + + /** + * Set the itemsKeyValue property: key-value pairs for a watchlist item. + * + * @param itemsKeyValue the itemsKeyValue value to set. + * @return the WatchlistItemProperties object itself. + */ + public WatchlistItemProperties withItemsKeyValue(Object itemsKeyValue) { + this.itemsKeyValue = itemsKeyValue; + return this; + } + + /** + * Get the entityMapping property: key-value pairs for a watchlist item entity mapping. + * + * @return the entityMapping value. + */ + public Object entityMapping() { + return this.entityMapping; + } + + /** + * Set the entityMapping property: key-value pairs for a watchlist item entity mapping. + * + * @param entityMapping the entityMapping value to set. + * @return the WatchlistItemProperties object itself. + */ + public WatchlistItemProperties withEntityMapping(Object entityMapping) { + this.entityMapping = entityMapping; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (createdBy() != null) { + createdBy().validate(); + } + if (updatedBy() != null) { + updatedBy().validate(); + } + if (itemsKeyValue() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property itemsKeyValue in model WatchlistItemProperties")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistProperties.java new file mode 100644 index 000000000000..e9024eb000a9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistProperties.java @@ -0,0 +1,617 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.Source; +import com.azure.resourcemanager.securityinsights.models.UserInfo; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.List; + +/** Describes watchlist properties. */ +@Fluent +public final class WatchlistProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WatchlistProperties.class); + + /* + * The id (a Guid) of the watchlist + */ + @JsonProperty(value = "watchlistId") + private String watchlistId; + + /* + * The display name of the watchlist + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /* + * The provider of the watchlist + */ + @JsonProperty(value = "provider", required = true) + private String provider; + + /* + * The source of the watchlist + */ + @JsonProperty(value = "source", required = true) + private Source source; + + /* + * The time the watchlist was created + */ + @JsonProperty(value = "created") + private OffsetDateTime created; + + /* + * The last time the watchlist was updated + */ + @JsonProperty(value = "updated") + private OffsetDateTime updated; + + /* + * Describes a user that created the watchlist + */ + @JsonProperty(value = "createdBy") + private UserInfo createdBy; + + /* + * Describes a user that updated the watchlist + */ + @JsonProperty(value = "updatedBy") + private UserInfo updatedBy; + + /* + * A description of the watchlist + */ + @JsonProperty(value = "description") + private String description; + + /* + * The type of the watchlist + */ + @JsonProperty(value = "watchlistType") + private String watchlistType; + + /* + * The alias of the watchlist + */ + @JsonProperty(value = "watchlistAlias") + private String watchlistAlias; + + /* + * A flag that indicates if the watchlist is deleted or not + */ + @JsonProperty(value = "isDeleted") + private Boolean isDeleted; + + /* + * List of labels relevant to this watchlist + */ + @JsonProperty(value = "labels") + private List labels; + + /* + * The default duration of a watchlist (in ISO 8601 duration format) + */ + @JsonProperty(value = "defaultDuration") + private Duration defaultDuration; + + /* + * The tenantId where the watchlist belongs to + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /* + * The number of lines in a csv/tsv content to skip before the header + */ + @JsonProperty(value = "numberOfLinesToSkip") + private Integer numberOfLinesToSkip; + + /* + * The raw content that represents to watchlist items to create. In case of + * csv/tsv content type, it's the content of the file that will parsed by + * the endpoint + */ + @JsonProperty(value = "rawContent") + private String rawContent; + + /* + * The search key is used to optimize query performance when using + * watchlists for joins with other data. For example, enable a column with + * IP addresses to be the designated SearchKey field, then use this field + * as the key field when joining to other event data by IP address. + */ + @JsonProperty(value = "itemsSearchKey", required = true) + private String itemsSearchKey; + + /* + * The content type of the raw content. Example : text/csv or text/tsv + */ + @JsonProperty(value = "contentType") + private String contentType; + + /* + * The status of the Watchlist upload : New, InProgress or Complete. Pls + * note : When a Watchlist upload status is equal to InProgress, the + * Watchlist cannot be deleted + */ + @JsonProperty(value = "uploadStatus") + private String uploadStatus; + + /* + * The number of Watchlist Items in the Watchlist + */ + @JsonProperty(value = "watchlistItemsCount") + private Integer watchlistItemsCount; + + /** + * Get the watchlistId property: The id (a Guid) of the watchlist. + * + * @return the watchlistId value. + */ + public String watchlistId() { + return this.watchlistId; + } + + /** + * Set the watchlistId property: The id (a Guid) of the watchlist. + * + * @param watchlistId the watchlistId value to set. + * @return the WatchlistProperties object itself. + */ + public WatchlistProperties withWatchlistId(String watchlistId) { + this.watchlistId = watchlistId; + return this; + } + + /** + * Get the displayName property: The display name of the watchlist. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the watchlist. + * + * @param displayName the displayName value to set. + * @return the WatchlistProperties object itself. + */ + public WatchlistProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the provider property: The provider of the watchlist. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: The provider of the watchlist. + * + * @param provider the provider value to set. + * @return the WatchlistProperties object itself. + */ + public WatchlistProperties withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the source property: The source of the watchlist. + * + * @return the source value. + */ + public Source source() { + return this.source; + } + + /** + * Set the source property: The source of the watchlist. + * + * @param source the source value to set. + * @return the WatchlistProperties object itself. + */ + public WatchlistProperties withSource(Source source) { + this.source = source; + return this; + } + + /** + * Get the created property: The time the watchlist was created. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.created; + } + + /** + * Set the created property: The time the watchlist was created. + * + * @param created the created value to set. + * @return the WatchlistProperties object itself. + */ + public WatchlistProperties withCreated(OffsetDateTime created) { + this.created = created; + return this; + } + + /** + * Get the updated property: The last time the watchlist was updated. + * + * @return the updated value. + */ + public OffsetDateTime updated() { + return this.updated; + } + + /** + * Set the updated property: The last time the watchlist was updated. + * + * @param updated the updated value to set. + * @return the WatchlistProperties object itself. + */ + public WatchlistProperties withUpdated(OffsetDateTime updated) { + this.updated = updated; + return this; + } + + /** + * Get the createdBy property: Describes a user that created the watchlist. + * + * @return the createdBy value. + */ + public UserInfo createdBy() { + return this.createdBy; + } + + /** + * Set the createdBy property: Describes a user that created the watchlist. + * + * @param createdBy the createdBy value to set. + * @return the WatchlistProperties object itself. + */ + public WatchlistProperties withCreatedBy(UserInfo createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Get the updatedBy property: Describes a user that updated the watchlist. + * + * @return the updatedBy value. + */ + public UserInfo updatedBy() { + return this.updatedBy; + } + + /** + * Set the updatedBy property: Describes a user that updated the watchlist. + * + * @param updatedBy the updatedBy value to set. + * @return the WatchlistProperties object itself. + */ + public WatchlistProperties withUpdatedBy(UserInfo updatedBy) { + this.updatedBy = updatedBy; + return this; + } + + /** + * Get the description property: A description of the watchlist. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description of the watchlist. + * + * @param description the description value to set. + * @return the WatchlistProperties object itself. + */ + public WatchlistProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the watchlistType property: The type of the watchlist. + * + * @return the watchlistType value. + */ + public String watchlistType() { + return this.watchlistType; + } + + /** + * Set the watchlistType property: The type of the watchlist. + * + * @param watchlistType the watchlistType value to set. + * @return the WatchlistProperties object itself. + */ + public WatchlistProperties withWatchlistType(String watchlistType) { + this.watchlistType = watchlistType; + return this; + } + + /** + * Get the watchlistAlias property: The alias of the watchlist. + * + * @return the watchlistAlias value. + */ + public String watchlistAlias() { + return this.watchlistAlias; + } + + /** + * Set the watchlistAlias property: The alias of the watchlist. + * + * @param watchlistAlias the watchlistAlias value to set. + * @return the WatchlistProperties object itself. + */ + public WatchlistProperties withWatchlistAlias(String watchlistAlias) { + this.watchlistAlias = watchlistAlias; + return this; + } + + /** + * Get the isDeleted property: A flag that indicates if the watchlist is deleted or not. + * + * @return the isDeleted value. + */ + public Boolean isDeleted() { + return this.isDeleted; + } + + /** + * Set the isDeleted property: A flag that indicates if the watchlist is deleted or not. + * + * @param isDeleted the isDeleted value to set. + * @return the WatchlistProperties object itself. + */ + public WatchlistProperties withIsDeleted(Boolean isDeleted) { + this.isDeleted = isDeleted; + return this; + } + + /** + * Get the labels property: List of labels relevant to this watchlist. + * + * @return the labels value. + */ + public List labels() { + return this.labels; + } + + /** + * Set the labels property: List of labels relevant to this watchlist. + * + * @param labels the labels value to set. + * @return the WatchlistProperties object itself. + */ + public WatchlistProperties withLabels(List labels) { + this.labels = labels; + return this; + } + + /** + * Get the defaultDuration property: The default duration of a watchlist (in ISO 8601 duration format). + * + * @return the defaultDuration value. + */ + public Duration defaultDuration() { + return this.defaultDuration; + } + + /** + * Set the defaultDuration property: The default duration of a watchlist (in ISO 8601 duration format). + * + * @param defaultDuration the defaultDuration value to set. + * @return the WatchlistProperties object itself. + */ + public WatchlistProperties withDefaultDuration(Duration defaultDuration) { + this.defaultDuration = defaultDuration; + return this; + } + + /** + * Get the tenantId property: The tenantId where the watchlist belongs to. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenantId where the watchlist belongs to. + * + * @param tenantId the tenantId value to set. + * @return the WatchlistProperties object itself. + */ + public WatchlistProperties withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the numberOfLinesToSkip property: The number of lines in a csv/tsv content to skip before the header. + * + * @return the numberOfLinesToSkip value. + */ + public Integer numberOfLinesToSkip() { + return this.numberOfLinesToSkip; + } + + /** + * Set the numberOfLinesToSkip property: The number of lines in a csv/tsv content to skip before the header. + * + * @param numberOfLinesToSkip the numberOfLinesToSkip value to set. + * @return the WatchlistProperties object itself. + */ + public WatchlistProperties withNumberOfLinesToSkip(Integer numberOfLinesToSkip) { + this.numberOfLinesToSkip = numberOfLinesToSkip; + return this; + } + + /** + * Get the rawContent property: The raw content that represents to watchlist items to create. In case of csv/tsv + * content type, it's the content of the file that will parsed by the endpoint. + * + * @return the rawContent value. + */ + public String rawContent() { + return this.rawContent; + } + + /** + * Set the rawContent property: The raw content that represents to watchlist items to create. In case of csv/tsv + * content type, it's the content of the file that will parsed by the endpoint. + * + * @param rawContent the rawContent value to set. + * @return the WatchlistProperties object itself. + */ + public WatchlistProperties withRawContent(String rawContent) { + this.rawContent = rawContent; + return this; + } + + /** + * Get the itemsSearchKey property: The search key is used to optimize query performance when using watchlists for + * joins with other data. For example, enable a column with IP addresses to be the designated SearchKey field, then + * use this field as the key field when joining to other event data by IP address. + * + * @return the itemsSearchKey value. + */ + public String itemsSearchKey() { + return this.itemsSearchKey; + } + + /** + * Set the itemsSearchKey property: The search key is used to optimize query performance when using watchlists for + * joins with other data. For example, enable a column with IP addresses to be the designated SearchKey field, then + * use this field as the key field when joining to other event data by IP address. + * + * @param itemsSearchKey the itemsSearchKey value to set. + * @return the WatchlistProperties object itself. + */ + public WatchlistProperties withItemsSearchKey(String itemsSearchKey) { + this.itemsSearchKey = itemsSearchKey; + return this; + } + + /** + * Get the contentType property: The content type of the raw content. Example : text/csv or text/tsv. + * + * @return the contentType value. + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType property: The content type of the raw content. Example : text/csv or text/tsv. + * + * @param contentType the contentType value to set. + * @return the WatchlistProperties object itself. + */ + public WatchlistProperties withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the uploadStatus property: The status of the Watchlist upload : New, InProgress or Complete. Pls note : When + * a Watchlist upload status is equal to InProgress, the Watchlist cannot be deleted. + * + * @return the uploadStatus value. + */ + public String uploadStatus() { + return this.uploadStatus; + } + + /** + * Set the uploadStatus property: The status of the Watchlist upload : New, InProgress or Complete. Pls note : When + * a Watchlist upload status is equal to InProgress, the Watchlist cannot be deleted. + * + * @param uploadStatus the uploadStatus value to set. + * @return the WatchlistProperties object itself. + */ + public WatchlistProperties withUploadStatus(String uploadStatus) { + this.uploadStatus = uploadStatus; + return this; + } + + /** + * Get the watchlistItemsCount property: The number of Watchlist Items in the Watchlist. + * + * @return the watchlistItemsCount value. + */ + public Integer watchlistItemsCount() { + return this.watchlistItemsCount; + } + + /** + * Set the watchlistItemsCount property: The number of Watchlist Items in the Watchlist. + * + * @param watchlistItemsCount the watchlistItemsCount value to set. + * @return the WatchlistProperties object itself. + */ + public WatchlistProperties withWatchlistItemsCount(Integer watchlistItemsCount) { + this.watchlistItemsCount = watchlistItemsCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (displayName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property displayName in model WatchlistProperties")); + } + if (provider() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property provider in model WatchlistProperties")); + } + if (source() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property source in model WatchlistProperties")); + } + if (createdBy() != null) { + createdBy().validate(); + } + if (updatedBy() != null) { + updatedBy().validate(); + } + if (itemsSearchKey() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property itemsSearchKey in model WatchlistProperties")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/package-info.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/package-info.java new file mode 100644 index 000000000000..d62af6071724 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for SecurityInsights. API spec for Microsoft.SecurityInsights (Azure + * Security Insights) resource provider. + */ +package com.azure.resourcemanager.securityinsights.fluent.models; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/package-info.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/package-info.java new file mode 100644 index 000000000000..99716aa0d737 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for SecurityInsights. API spec for Microsoft.SecurityInsights (Azure Security + * Insights) resource provider. + */ +package com.azure.resourcemanager.securityinsights.fluent; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ActionResponseImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ActionResponseImpl.java new file mode 100644 index 000000000000..1569ec34fe82 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ActionResponseImpl.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.ActionResponseInner; +import com.azure.resourcemanager.securityinsights.models.ActionRequest; +import com.azure.resourcemanager.securityinsights.models.ActionResponse; + +public final class ActionResponseImpl implements ActionResponse, ActionResponse.Definition, ActionResponse.Update { + private ActionResponseInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String workflowId() { + return this.innerModel().workflowId(); + } + + public String logicAppResourceId() { + return this.innerModel().logicAppResourceId(); + } + + public ActionResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String ruleId; + + private String actionId; + + private ActionRequest createAction; + + private ActionRequest updateAction; + + public ActionResponseImpl withExistingAlertRule(String resourceGroupName, String workspaceName, String ruleId) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.ruleId = ruleId; + return this; + } + + public ActionResponse create() { + this.innerObject = + serviceManager + .serviceClient() + .getActions() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, ruleId, actionId, createAction, Context.NONE) + .getValue(); + return this; + } + + public ActionResponse create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getActions() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, ruleId, actionId, createAction, context) + .getValue(); + return this; + } + + ActionResponseImpl(String name, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new ActionResponseInner(); + this.serviceManager = serviceManager; + this.actionId = name; + this.createAction = new ActionRequest(); + } + + public ActionResponseImpl update() { + this.updateAction = new ActionRequest(); + return this; + } + + public ActionResponse apply() { + this.innerObject = + serviceManager + .serviceClient() + .getActions() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, ruleId, actionId, updateAction, Context.NONE) + .getValue(); + return this; + } + + public ActionResponse apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getActions() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, ruleId, actionId, updateAction, context) + .getValue(); + return this; + } + + ActionResponseImpl( + ActionResponseInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.ruleId = Utils.getValueFromIdByName(innerObject.id(), "alertRules"); + this.actionId = Utils.getValueFromIdByName(innerObject.id(), "actions"); + } + + public ActionResponse refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getActions() + .getWithResponse(resourceGroupName, workspaceName, ruleId, actionId, Context.NONE) + .getValue(); + return this; + } + + public ActionResponse refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getActions() + .getWithResponse(resourceGroupName, workspaceName, ruleId, actionId, context) + .getValue(); + return this; + } + + public ActionResponseImpl withEtag(String etag) { + if (isInCreateMode()) { + this.createAction.withEtag(etag); + return this; + } else { + this.updateAction.withEtag(etag); + return this; + } + } + + public ActionResponseImpl withTriggerUri(String triggerUri) { + if (isInCreateMode()) { + this.createAction.withTriggerUri(triggerUri); + return this; + } else { + this.updateAction.withTriggerUri(triggerUri); + return this; + } + } + + public ActionResponseImpl withLogicAppResourceId(String logicAppResourceId) { + if (isInCreateMode()) { + this.createAction.withLogicAppResourceId(logicAppResourceId); + return this; + } else { + this.updateAction.withLogicAppResourceId(logicAppResourceId); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ActionsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ActionsClientImpl.java new file mode 100644 index 000000000000..a79078fc1ca7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ActionsClientImpl.java @@ -0,0 +1,962 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.ActionsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ActionResponseInner; +import com.azure.resourcemanager.securityinsights.models.ActionRequest; +import com.azure.resourcemanager.securityinsights.models.ActionsList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ActionsClient. */ +public final class ActionsClientImpl implements ActionsClient { + private final ClientLogger logger = new ClientLogger(ActionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ActionsService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of ActionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ActionsClientImpl(SecurityInsightsImpl client) { + this.service = RestProxy.create(ActionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsActions to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsActi") + private interface ActionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByAlertRule( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("ruleId") String ruleId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions" + + "/{actionId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("ruleId") String ruleId, + @PathParam("actionId") String actionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions" + + "/{actionId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("ruleId") String ruleId, + @PathParam("actionId") String actionId, + @BodyParam("application/json") ActionRequest action, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions" + + "/{actionId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("ruleId") String ruleId, + @PathParam("actionId") String actionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByAlertRuleNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all actions of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all actions of alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAlertRuleSinglePageAsync( + String resourceGroupName, String workspaceName, String ruleId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByAlertRule( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleId, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all actions of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all actions of alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAlertRuleSinglePageAsync( + String resourceGroupName, String workspaceName, String ruleId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByAlertRule( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleId, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all actions of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all actions of alert rule. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAlertRuleAsync( + String resourceGroupName, String workspaceName, String ruleId) { + return new PagedFlux<>( + () -> listByAlertRuleSinglePageAsync(resourceGroupName, workspaceName, ruleId), + nextLink -> listByAlertRuleNextSinglePageAsync(nextLink)); + } + + /** + * Gets all actions of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all actions of alert rule. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAlertRuleAsync( + String resourceGroupName, String workspaceName, String ruleId, Context context) { + return new PagedFlux<>( + () -> listByAlertRuleSinglePageAsync(resourceGroupName, workspaceName, ruleId, context), + nextLink -> listByAlertRuleNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all actions of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all actions of alert rule. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAlertRule( + String resourceGroupName, String workspaceName, String ruleId) { + return new PagedIterable<>(listByAlertRuleAsync(resourceGroupName, workspaceName, ruleId)); + } + + /** + * Gets all actions of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all actions of alert rule. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAlertRule( + String resourceGroupName, String workspaceName, String ruleId, Context context) { + return new PagedIterable<>(listByAlertRuleAsync(resourceGroupName, workspaceName, ruleId, context)); + } + + /** + * Gets the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the action of alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String ruleId, String actionId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + if (actionId == null) { + return Mono.error(new IllegalArgumentException("Parameter actionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleId, + actionId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the action of alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String ruleId, String actionId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + if (actionId == null) { + return Mono.error(new IllegalArgumentException("Parameter actionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleId, + actionId, + accept, + context); + } + + /** + * Gets the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the action of alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String ruleId, String actionId) { + return getWithResponseAsync(resourceGroupName, workspaceName, ruleId, actionId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the action of alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ActionResponseInner get(String resourceGroupName, String workspaceName, String ruleId, String actionId) { + return getAsync(resourceGroupName, workspaceName, ruleId, actionId).block(); + } + + /** + * Gets the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the action of alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String ruleId, String actionId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, ruleId, actionId, context).block(); + } + + /** + * Creates or updates the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @param action The action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return action for alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String ruleId, String actionId, ActionRequest action) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + if (actionId == null) { + return Mono.error(new IllegalArgumentException("Parameter actionId is required and cannot be null.")); + } + if (action == null) { + return Mono.error(new IllegalArgumentException("Parameter action is required and cannot be null.")); + } else { + action.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleId, + actionId, + action, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @param action The action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return action for alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String ruleId, + String actionId, + ActionRequest action, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + if (actionId == null) { + return Mono.error(new IllegalArgumentException("Parameter actionId is required and cannot be null.")); + } + if (action == null) { + return Mono.error(new IllegalArgumentException("Parameter action is required and cannot be null.")); + } else { + action.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleId, + actionId, + action, + accept, + context); + } + + /** + * Creates or updates the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @param action The action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return action for alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, String ruleId, String actionId, ActionRequest action) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, ruleId, actionId, action) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @param action The action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return action for alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ActionResponseInner createOrUpdate( + String resourceGroupName, String workspaceName, String ruleId, String actionId, ActionRequest action) { + return createOrUpdateAsync(resourceGroupName, workspaceName, ruleId, actionId, action).block(); + } + + /** + * Creates or updates the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @param action The action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return action for alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String ruleId, + String actionId, + ActionRequest action, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, ruleId, actionId, action, context) + .block(); + } + + /** + * Delete the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String ruleId, String actionId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + if (actionId == null) { + return Mono.error(new IllegalArgumentException("Parameter actionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleId, + actionId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String ruleId, String actionId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + if (actionId == null) { + return Mono.error(new IllegalArgumentException("Parameter actionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleId, + actionId, + accept, + context); + } + + /** + * Delete the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String ruleId, String actionId) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, ruleId, actionId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String ruleId, String actionId) { + deleteAsync(resourceGroupName, workspaceName, ruleId, actionId).block(); + } + + /** + * Delete the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String ruleId, String actionId, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, ruleId, actionId, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the actions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAlertRuleNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByAlertRuleNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the actions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAlertRuleNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByAlertRuleNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ActionsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ActionsImpl.java new file mode 100644 index 000000000000..c0627fdc5443 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ActionsImpl.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.ActionsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ActionResponseInner; +import com.azure.resourcemanager.securityinsights.models.ActionResponse; +import com.azure.resourcemanager.securityinsights.models.Actions; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ActionsImpl implements Actions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ActionsImpl.class); + + private final ActionsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public ActionsImpl( + ActionsClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByAlertRule( + String resourceGroupName, String workspaceName, String ruleId) { + PagedIterable inner = + this.serviceClient().listByAlertRule(resourceGroupName, workspaceName, ruleId); + return Utils.mapPage(inner, inner1 -> new ActionResponseImpl(inner1, this.manager())); + } + + public PagedIterable listByAlertRule( + String resourceGroupName, String workspaceName, String ruleId, Context context) { + PagedIterable inner = + this.serviceClient().listByAlertRule(resourceGroupName, workspaceName, ruleId, context); + return Utils.mapPage(inner, inner1 -> new ActionResponseImpl(inner1, this.manager())); + } + + public ActionResponse get(String resourceGroupName, String workspaceName, String ruleId, String actionId) { + ActionResponseInner inner = this.serviceClient().get(resourceGroupName, workspaceName, ruleId, actionId); + if (inner != null) { + return new ActionResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String ruleId, String actionId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, ruleId, actionId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ActionResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String ruleId, String actionId) { + this.serviceClient().delete(resourceGroupName, workspaceName, ruleId, actionId); + } + + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String ruleId, String actionId, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, ruleId, actionId, context); + } + + public ActionResponse getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String ruleId = Utils.getValueFromIdByName(id, "alertRules"); + if (ruleId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'alertRules'.", id))); + } + String actionId = Utils.getValueFromIdByName(id, "actions"); + if (actionId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'actions'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, ruleId, actionId, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String ruleId = Utils.getValueFromIdByName(id, "alertRules"); + if (ruleId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'alertRules'.", id))); + } + String actionId = Utils.getValueFromIdByName(id, "actions"); + if (actionId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'actions'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, ruleId, actionId, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String ruleId = Utils.getValueFromIdByName(id, "alertRules"); + if (ruleId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'alertRules'.", id))); + } + String actionId = Utils.getValueFromIdByName(id, "actions"); + if (actionId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'actions'.", id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, ruleId, actionId, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String ruleId = Utils.getValueFromIdByName(id, "alertRules"); + if (ruleId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'alertRules'.", id))); + } + String actionId = Utils.getValueFromIdByName(id, "actions"); + if (actionId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'actions'.", id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, ruleId, actionId, context); + } + + private ActionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public ActionResponseImpl define(String name) { + return new ActionResponseImpl(name, this.manager()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleImpl.java new file mode 100644 index 000000000000..48823696c23b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; +import com.azure.resourcemanager.securityinsights.models.AlertRule; + +public final class AlertRuleImpl implements AlertRule { + private AlertRuleInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + AlertRuleImpl( + AlertRuleInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AlertRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleTemplateImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleTemplateImpl.java new file mode 100644 index 000000000000..3ceab1ccfa28 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleTemplateImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplate; + +public final class AlertRuleTemplateImpl implements AlertRuleTemplate { + private AlertRuleTemplateInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + AlertRuleTemplateImpl( + AlertRuleTemplateInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AlertRuleTemplateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleTemplatesClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleTemplatesClientImpl.java new file mode 100644 index 000000000000..b2032d298f93 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleTemplatesClientImpl.java @@ -0,0 +1,518 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.AlertRuleTemplatesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplatesList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AlertRuleTemplatesClient. */ +public final class AlertRuleTemplatesClientImpl implements AlertRuleTemplatesClient { + private final ClientLogger logger = new ClientLogger(AlertRuleTemplatesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AlertRuleTemplatesService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of AlertRuleTemplatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AlertRuleTemplatesClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy.create(AlertRuleTemplatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsAlertRuleTemplates to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsAler") + private interface AlertRuleTemplatesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRuleTemplates") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRuleTemplates" + + "/{alertRuleTemplateId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("alertRuleTemplateId") String alertRuleTemplateId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all alert rule templates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all alert rule templates. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all alert rule templates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all alert rule templates. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all alert rule templates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all alert rule templates. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all alert rule templates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all alert rule templates. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all alert rule templates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all alert rule templates. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + } + + /** + * Gets all alert rule templates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all alert rule templates. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Gets the alert rule template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param alertRuleTemplateId Alert rule template ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the alert rule template. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String alertRuleTemplateId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (alertRuleTemplateId == null) { + return Mono + .error(new IllegalArgumentException("Parameter alertRuleTemplateId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + alertRuleTemplateId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the alert rule template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param alertRuleTemplateId Alert rule template ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the alert rule template. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String alertRuleTemplateId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (alertRuleTemplateId == null) { + return Mono + .error(new IllegalArgumentException("Parameter alertRuleTemplateId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + alertRuleTemplateId, + accept, + context); + } + + /** + * Gets the alert rule template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param alertRuleTemplateId Alert rule template ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the alert rule template. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String alertRuleTemplateId) { + return getWithResponseAsync(resourceGroupName, workspaceName, alertRuleTemplateId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the alert rule template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param alertRuleTemplateId Alert rule template ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the alert rule template. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AlertRuleTemplateInner get(String resourceGroupName, String workspaceName, String alertRuleTemplateId) { + return getAsync(resourceGroupName, workspaceName, alertRuleTemplateId).block(); + } + + /** + * Gets the alert rule template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param alertRuleTemplateId Alert rule template ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the alert rule template. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String alertRuleTemplateId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, alertRuleTemplateId, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the alert rule templates. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the alert rule templates. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleTemplatesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleTemplatesImpl.java new file mode 100644 index 000000000000..b18d8cb673bc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleTemplatesImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.AlertRuleTemplatesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplate; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplates; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AlertRuleTemplatesImpl implements AlertRuleTemplates { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertRuleTemplatesImpl.class); + + private final AlertRuleTemplatesClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public AlertRuleTemplatesImpl( + AlertRuleTemplatesClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new AlertRuleTemplateImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new AlertRuleTemplateImpl(inner1, this.manager())); + } + + public AlertRuleTemplate get(String resourceGroupName, String workspaceName, String alertRuleTemplateId) { + AlertRuleTemplateInner inner = this.serviceClient().get(resourceGroupName, workspaceName, alertRuleTemplateId); + if (inner != null) { + return new AlertRuleTemplateImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String alertRuleTemplateId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, alertRuleTemplateId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AlertRuleTemplateImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private AlertRuleTemplatesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRulesClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRulesClientImpl.java new file mode 100644 index 000000000000..f7d70e3066eb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRulesClientImpl.java @@ -0,0 +1,883 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.AlertRulesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; +import com.azure.resourcemanager.securityinsights.models.AlertRulesList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AlertRulesClient. */ +public final class AlertRulesClientImpl implements AlertRulesClient { + private final ClientLogger logger = new ClientLogger(AlertRulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AlertRulesService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of AlertRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AlertRulesClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy.create(AlertRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsAlertRules to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsAler") + private interface AlertRulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("ruleId") String ruleId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("ruleId") String ruleId, + @BodyParam("application/json") AlertRuleInner alertRule, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("ruleId") String ruleId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all alert rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all alert rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all alert rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all alert rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all alert rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all alert rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all alert rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all alert rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all alert rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all alert rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + } + + /** + * Gets all alert rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all alert rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Gets the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String ruleId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String ruleId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleId, + accept, + context); + } + + /** + * Gets the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String ruleId) { + return getWithResponseAsync(resourceGroupName, workspaceName, ruleId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AlertRuleInner get(String resourceGroupName, String workspaceName, String ruleId) { + return getAsync(resourceGroupName, workspaceName, ruleId).block(); + } + + /** + * Gets the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String ruleId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, ruleId, context).block(); + } + + /** + * Creates or updates the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param alertRule The alert rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String ruleId, AlertRuleInner alertRule) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + if (alertRule == null) { + return Mono.error(new IllegalArgumentException("Parameter alertRule is required and cannot be null.")); + } else { + alertRule.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleId, + alertRule, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param alertRule The alert rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String ruleId, AlertRuleInner alertRule, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + if (alertRule == null) { + return Mono.error(new IllegalArgumentException("Parameter alertRule is required and cannot be null.")); + } else { + alertRule.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleId, + alertRule, + accept, + context); + } + + /** + * Creates or updates the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param alertRule The alert rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, String ruleId, AlertRuleInner alertRule) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, ruleId, alertRule) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param alertRule The alert rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AlertRuleInner createOrUpdate( + String resourceGroupName, String workspaceName, String ruleId, AlertRuleInner alertRule) { + return createOrUpdateAsync(resourceGroupName, workspaceName, ruleId, alertRule).block(); + } + + /** + * Creates or updates the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param alertRule The alert rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alert rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String workspaceName, String ruleId, AlertRuleInner alertRule, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, ruleId, alertRule, context).block(); + } + + /** + * Delete the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String ruleId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String ruleId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleId, + accept, + context); + } + + /** + * Delete the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String ruleId) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, ruleId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String ruleId) { + deleteAsync(resourceGroupName, workspaceName, ruleId).block(); + } + + /** + * Delete the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String ruleId, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, ruleId, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the alert rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the alert rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRulesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRulesImpl.java new file mode 100644 index 000000000000..b9439a9c3eb2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRulesImpl.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.AlertRulesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; +import com.azure.resourcemanager.securityinsights.models.AlertRule; +import com.azure.resourcemanager.securityinsights.models.AlertRules; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AlertRulesImpl implements AlertRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertRulesImpl.class); + + private final AlertRulesClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public AlertRulesImpl( + AlertRulesClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new AlertRuleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new AlertRuleImpl(inner1, this.manager())); + } + + public AlertRule get(String resourceGroupName, String workspaceName, String ruleId) { + AlertRuleInner inner = this.serviceClient().get(resourceGroupName, workspaceName, ruleId); + if (inner != null) { + return new AlertRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String ruleId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, ruleId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AlertRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AlertRule createOrUpdate( + String resourceGroupName, String workspaceName, String ruleId, AlertRuleInner alertRule) { + AlertRuleInner inner = this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, ruleId, alertRule); + if (inner != null) { + return new AlertRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, String workspaceName, String ruleId, AlertRuleInner alertRule, Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, ruleId, alertRule, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AlertRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String ruleId) { + this.serviceClient().delete(resourceGroupName, workspaceName, ruleId); + } + + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String ruleId, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, ruleId, context); + } + + private AlertRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AutomationRuleImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AutomationRuleImpl.java new file mode 100644 index 000000000000..9f20e40e9d25 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AutomationRuleImpl.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.AutomationRuleInner; +import com.azure.resourcemanager.securityinsights.models.AutomationRule; +import com.azure.resourcemanager.securityinsights.models.AutomationRuleAction; +import com.azure.resourcemanager.securityinsights.models.AutomationRuleTriggeringLogic; +import com.azure.resourcemanager.securityinsights.models.ClientInfo; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class AutomationRuleImpl implements AutomationRule, AutomationRule.Definition, AutomationRule.Update { + private AutomationRuleInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public int order() { + return this.innerModel().order(); + } + + public AutomationRuleTriggeringLogic triggeringLogic() { + return this.innerModel().triggeringLogic(); + } + + public List actions() { + List inner = this.innerModel().actions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OffsetDateTime createdTimeUtc() { + return this.innerModel().createdTimeUtc(); + } + + public OffsetDateTime lastModifiedTimeUtc() { + return this.innerModel().lastModifiedTimeUtc(); + } + + public ClientInfo createdBy() { + return this.innerModel().createdBy(); + } + + public ClientInfo lastModifiedBy() { + return this.innerModel().lastModifiedBy(); + } + + public AutomationRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String automationRuleId; + + public AutomationRuleImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public AutomationRule create() { + this.innerObject = + serviceManager + .serviceClient() + .getAutomationRules() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, automationRuleId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public AutomationRule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAutomationRules() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, automationRuleId, this.innerModel(), context) + .getValue(); + return this; + } + + AutomationRuleImpl(String name, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new AutomationRuleInner(); + this.serviceManager = serviceManager; + this.automationRuleId = name; + } + + public AutomationRuleImpl update() { + return this; + } + + public AutomationRule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAutomationRules() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, automationRuleId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public AutomationRule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAutomationRules() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, automationRuleId, this.innerModel(), context) + .getValue(); + return this; + } + + AutomationRuleImpl( + AutomationRuleInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.automationRuleId = Utils.getValueFromIdByName(innerObject.id(), "automationRules"); + } + + public AutomationRule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAutomationRules() + .getWithResponse(resourceGroupName, workspaceName, automationRuleId, Context.NONE) + .getValue(); + return this; + } + + public AutomationRule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAutomationRules() + .getWithResponse(resourceGroupName, workspaceName, automationRuleId, context) + .getValue(); + return this; + } + + public AutomationRuleImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public AutomationRuleImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public AutomationRuleImpl withOrder(int order) { + this.innerModel().withOrder(order); + return this; + } + + public AutomationRuleImpl withTriggeringLogic(AutomationRuleTriggeringLogic triggeringLogic) { + this.innerModel().withTriggeringLogic(triggeringLogic); + return this; + } + + public AutomationRuleImpl withActions(List actions) { + this.innerModel().withActions(actions); + return this; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AutomationRulesClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AutomationRulesClientImpl.java new file mode 100644 index 000000000000..72c7d78332e2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AutomationRulesClientImpl.java @@ -0,0 +1,901 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.AutomationRulesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.AutomationRuleInner; +import com.azure.resourcemanager.securityinsights.models.AutomationRulesList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AutomationRulesClient. */ +public final class AutomationRulesClientImpl implements AutomationRulesClient { + private final ClientLogger logger = new ClientLogger(AutomationRulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AutomationRulesService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of AutomationRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AutomationRulesClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy.create(AutomationRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsAutomationRules to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsAuto") + private interface AutomationRulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules/{automationRuleId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("automationRuleId") String automationRuleId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules/{automationRuleId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("automationRuleId") String automationRuleId, + @BodyParam("application/json") AutomationRuleInner automationRule, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules/{automationRuleId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("automationRuleId") String automationRuleId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all automation rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all automation rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all automation rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all automation rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all automation rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all automation rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all automation rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all automation rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all automation rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all automation rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + } + + /** + * Gets all automation rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all automation rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Gets the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the automation rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String automationRuleId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (automationRuleId == null) { + return Mono + .error(new IllegalArgumentException("Parameter automationRuleId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + automationRuleId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the automation rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String automationRuleId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (automationRuleId == null) { + return Mono + .error(new IllegalArgumentException("Parameter automationRuleId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + automationRuleId, + accept, + context); + } + + /** + * Gets the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the automation rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String automationRuleId) { + return getWithResponseAsync(resourceGroupName, workspaceName, automationRuleId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the automation rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AutomationRuleInner get(String resourceGroupName, String workspaceName, String automationRuleId) { + return getAsync(resourceGroupName, workspaceName, automationRuleId).block(); + } + + /** + * Gets the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the automation rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String automationRuleId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, automationRuleId, context).block(); + } + + /** + * Creates or updates the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @param automationRule The automation rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an automation rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String automationRuleId, AutomationRuleInner automationRule) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (automationRuleId == null) { + return Mono + .error(new IllegalArgumentException("Parameter automationRuleId is required and cannot be null.")); + } + if (automationRule == null) { + return Mono.error(new IllegalArgumentException("Parameter automationRule is required and cannot be null.")); + } else { + automationRule.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + automationRuleId, + automationRule, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @param automationRule The automation rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an automation rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String automationRuleId, + AutomationRuleInner automationRule, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (automationRuleId == null) { + return Mono + .error(new IllegalArgumentException("Parameter automationRuleId is required and cannot be null.")); + } + if (automationRule == null) { + return Mono.error(new IllegalArgumentException("Parameter automationRule is required and cannot be null.")); + } else { + automationRule.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + automationRuleId, + automationRule, + accept, + context); + } + + /** + * Creates or updates the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @param automationRule The automation rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an automation rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, String automationRuleId, AutomationRuleInner automationRule) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, automationRuleId, automationRule) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @param automationRule The automation rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an automation rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AutomationRuleInner createOrUpdate( + String resourceGroupName, String workspaceName, String automationRuleId, AutomationRuleInner automationRule) { + return createOrUpdateAsync(resourceGroupName, workspaceName, automationRuleId, automationRule).block(); + } + + /** + * Creates or updates the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @param automationRule The automation rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an automation rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String automationRuleId, + AutomationRuleInner automationRule, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, automationRuleId, automationRule, context) + .block(); + } + + /** + * Delete the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String automationRuleId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (automationRuleId == null) { + return Mono + .error(new IllegalArgumentException("Parameter automationRuleId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + automationRuleId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String automationRuleId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (automationRuleId == null) { + return Mono + .error(new IllegalArgumentException("Parameter automationRuleId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + automationRuleId, + accept, + context); + } + + /** + * Delete the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String automationRuleId) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, automationRuleId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String automationRuleId) { + deleteAsync(resourceGroupName, workspaceName, automationRuleId).block(); + } + + /** + * Delete the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String automationRuleId, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, automationRuleId, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the automation rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the automation rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AutomationRulesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AutomationRulesImpl.java new file mode 100644 index 000000000000..1d2b6dd64ef2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AutomationRulesImpl.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.AutomationRulesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.AutomationRuleInner; +import com.azure.resourcemanager.securityinsights.models.AutomationRule; +import com.azure.resourcemanager.securityinsights.models.AutomationRules; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AutomationRulesImpl implements AutomationRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutomationRulesImpl.class); + + private final AutomationRulesClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public AutomationRulesImpl( + AutomationRulesClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new AutomationRuleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new AutomationRuleImpl(inner1, this.manager())); + } + + public AutomationRule get(String resourceGroupName, String workspaceName, String automationRuleId) { + AutomationRuleInner inner = this.serviceClient().get(resourceGroupName, workspaceName, automationRuleId); + if (inner != null) { + return new AutomationRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String automationRuleId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, automationRuleId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AutomationRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String automationRuleId) { + this.serviceClient().delete(resourceGroupName, workspaceName, automationRuleId); + } + + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String automationRuleId, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, automationRuleId, context); + } + + public AutomationRule getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String automationRuleId = Utils.getValueFromIdByName(id, "automationRules"); + if (automationRuleId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'automationRules'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, automationRuleId, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String automationRuleId = Utils.getValueFromIdByName(id, "automationRules"); + if (automationRuleId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'automationRules'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, automationRuleId, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String automationRuleId = Utils.getValueFromIdByName(id, "automationRules"); + if (automationRuleId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'automationRules'.", id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, automationRuleId, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String automationRuleId = Utils.getValueFromIdByName(id, "automationRules"); + if (automationRuleId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'automationRules'.", id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, automationRuleId, context); + } + + private AutomationRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public AutomationRuleImpl define(String name) { + return new AutomationRuleImpl(name, this.manager()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkExpandResponseImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkExpandResponseImpl.java new file mode 100644 index 000000000000..b42e787c9a3f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkExpandResponseImpl.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.BookmarkExpandResponseInner; +import com.azure.resourcemanager.securityinsights.models.BookmarkExpandResponse; +import com.azure.resourcemanager.securityinsights.models.BookmarkExpandResponseValue; +import com.azure.resourcemanager.securityinsights.models.ExpansionResultsMetadata; + +public final class BookmarkExpandResponseImpl implements BookmarkExpandResponse { + private BookmarkExpandResponseInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + BookmarkExpandResponseImpl( + BookmarkExpandResponseInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ExpansionResultsMetadata metadata() { + return this.innerModel().metadata(); + } + + public BookmarkExpandResponseValue value() { + return this.innerModel().value(); + } + + public BookmarkExpandResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkImpl.java new file mode 100644 index 000000000000..ca788723989d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkImpl.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.BookmarkInner; +import com.azure.resourcemanager.securityinsights.models.Bookmark; +import com.azure.resourcemanager.securityinsights.models.IncidentInfo; +import com.azure.resourcemanager.securityinsights.models.UserInfo; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class BookmarkImpl implements Bookmark, Bookmark.Definition, Bookmark.Update { + private BookmarkInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public OffsetDateTime created() { + return this.innerModel().created(); + } + + public UserInfo createdBy() { + return this.innerModel().createdBy(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public List labels() { + List inner = this.innerModel().labels(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String notes() { + return this.innerModel().notes(); + } + + public String query() { + return this.innerModel().query(); + } + + public String queryResult() { + return this.innerModel().queryResult(); + } + + public OffsetDateTime updated() { + return this.innerModel().updated(); + } + + public UserInfo updatedBy() { + return this.innerModel().updatedBy(); + } + + public OffsetDateTime eventTime() { + return this.innerModel().eventTime(); + } + + public OffsetDateTime queryStartTime() { + return this.innerModel().queryStartTime(); + } + + public OffsetDateTime queryEndTime() { + return this.innerModel().queryEndTime(); + } + + public IncidentInfo incidentInfo() { + return this.innerModel().incidentInfo(); + } + + public BookmarkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String bookmarkId; + + public BookmarkImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public Bookmark create() { + this.innerObject = + serviceManager + .serviceClient() + .getBookmarks() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, bookmarkId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Bookmark create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBookmarks() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, bookmarkId, this.innerModel(), context) + .getValue(); + return this; + } + + BookmarkImpl(String name, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new BookmarkInner(); + this.serviceManager = serviceManager; + this.bookmarkId = name; + } + + public BookmarkImpl update() { + return this; + } + + public Bookmark apply() { + this.innerObject = + serviceManager + .serviceClient() + .getBookmarks() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, bookmarkId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Bookmark apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBookmarks() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, bookmarkId, this.innerModel(), context) + .getValue(); + return this; + } + + BookmarkImpl( + BookmarkInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.bookmarkId = Utils.getValueFromIdByName(innerObject.id(), "bookmarks"); + } + + public Bookmark refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getBookmarks() + .getWithResponse(resourceGroupName, workspaceName, bookmarkId, Context.NONE) + .getValue(); + return this; + } + + public Bookmark refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBookmarks() + .getWithResponse(resourceGroupName, workspaceName, bookmarkId, context) + .getValue(); + return this; + } + + public BookmarkImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public BookmarkImpl withCreated(OffsetDateTime created) { + this.innerModel().withCreated(created); + return this; + } + + public BookmarkImpl withCreatedBy(UserInfo createdBy) { + this.innerModel().withCreatedBy(createdBy); + return this; + } + + public BookmarkImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public BookmarkImpl withLabels(List labels) { + this.innerModel().withLabels(labels); + return this; + } + + public BookmarkImpl withNotes(String notes) { + this.innerModel().withNotes(notes); + return this; + } + + public BookmarkImpl withQuery(String query) { + this.innerModel().withQuery(query); + return this; + } + + public BookmarkImpl withQueryResult(String queryResult) { + this.innerModel().withQueryResult(queryResult); + return this; + } + + public BookmarkImpl withUpdated(OffsetDateTime updated) { + this.innerModel().withUpdated(updated); + return this; + } + + public BookmarkImpl withUpdatedBy(UserInfo updatedBy) { + this.innerModel().withUpdatedBy(updatedBy); + return this; + } + + public BookmarkImpl withEventTime(OffsetDateTime eventTime) { + this.innerModel().withEventTime(eventTime); + return this; + } + + public BookmarkImpl withQueryStartTime(OffsetDateTime queryStartTime) { + this.innerModel().withQueryStartTime(queryStartTime); + return this; + } + + public BookmarkImpl withQueryEndTime(OffsetDateTime queryEndTime) { + this.innerModel().withQueryEndTime(queryEndTime); + return this; + } + + public BookmarkImpl withIncidentInfo(IncidentInfo incidentInfo) { + this.innerModel().withIncidentInfo(incidentInfo); + return this; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkOperationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkOperationsClientImpl.java new file mode 100644 index 000000000000..c4cbc65ca394 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkOperationsClientImpl.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.BookmarkOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.BookmarkExpandResponseInner; +import com.azure.resourcemanager.securityinsights.models.BookmarkExpandParameters; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BookmarkOperationsClient. */ +public final class BookmarkOperationsClientImpl implements BookmarkOperationsClient { + private final ClientLogger logger = new ClientLogger(BookmarkOperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BookmarkOperationsService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of BookmarkOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BookmarkOperationsClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy.create(BookmarkOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsBookmarkOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsBook") + private interface BookmarkOperationsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/expand") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> expand( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("bookmarkId") String bookmarkId, + @BodyParam("application/json") BookmarkExpandParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Expand an bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param parameters The parameters required to execute an expand operation on the given bookmark. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity expansion result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> expandWithResponseAsync( + String resourceGroupName, String workspaceName, String bookmarkId, BookmarkExpandParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bookmarkId == null) { + return Mono.error(new IllegalArgumentException("Parameter bookmarkId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .expand( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bookmarkId, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Expand an bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param parameters The parameters required to execute an expand operation on the given bookmark. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity expansion result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> expandWithResponseAsync( + String resourceGroupName, + String workspaceName, + String bookmarkId, + BookmarkExpandParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bookmarkId == null) { + return Mono.error(new IllegalArgumentException("Parameter bookmarkId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .expand( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bookmarkId, + parameters, + accept, + context); + } + + /** + * Expand an bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param parameters The parameters required to execute an expand operation on the given bookmark. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity expansion result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono expandAsync( + String resourceGroupName, String workspaceName, String bookmarkId, BookmarkExpandParameters parameters) { + return expandWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Expand an bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param parameters The parameters required to execute an expand operation on the given bookmark. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity expansion result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BookmarkExpandResponseInner expand( + String resourceGroupName, String workspaceName, String bookmarkId, BookmarkExpandParameters parameters) { + return expandAsync(resourceGroupName, workspaceName, bookmarkId, parameters).block(); + } + + /** + * Expand an bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param parameters The parameters required to execute an expand operation on the given bookmark. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity expansion result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response expandWithResponse( + String resourceGroupName, + String workspaceName, + String bookmarkId, + BookmarkExpandParameters parameters, + Context context) { + return expandWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, parameters, context).block(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkOperationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkOperationsImpl.java new file mode 100644 index 000000000000..5716710a979d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkOperationsImpl.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.BookmarkOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.BookmarkExpandResponseInner; +import com.azure.resourcemanager.securityinsights.models.BookmarkExpandParameters; +import com.azure.resourcemanager.securityinsights.models.BookmarkExpandResponse; +import com.azure.resourcemanager.securityinsights.models.BookmarkOperations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BookmarkOperationsImpl implements BookmarkOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BookmarkOperationsImpl.class); + + private final BookmarkOperationsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public BookmarkOperationsImpl( + BookmarkOperationsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public BookmarkExpandResponse expand( + String resourceGroupName, String workspaceName, String bookmarkId, BookmarkExpandParameters parameters) { + BookmarkExpandResponseInner inner = + this.serviceClient().expand(resourceGroupName, workspaceName, bookmarkId, parameters); + if (inner != null) { + return new BookmarkExpandResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response expandWithResponse( + String resourceGroupName, + String workspaceName, + String bookmarkId, + BookmarkExpandParameters parameters, + Context context) { + Response inner = + this.serviceClient().expandWithResponse(resourceGroupName, workspaceName, bookmarkId, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BookmarkExpandResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private BookmarkOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkRelationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkRelationsClientImpl.java new file mode 100644 index 000000000000..30e6dacd912d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkRelationsClientImpl.java @@ -0,0 +1,1079 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.BookmarkRelationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; +import com.azure.resourcemanager.securityinsights.models.RelationList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BookmarkRelationsClient. */ +public final class BookmarkRelationsClientImpl implements BookmarkRelationsClient { + private final ClientLogger logger = new ClientLogger(BookmarkRelationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BookmarkRelationsService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of BookmarkRelationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BookmarkRelationsClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy.create(BookmarkRelationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsBookmarkRelations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsBook") + private interface BookmarkRelationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("bookmarkId") String bookmarkId, + @QueryParam("$filter") String filter, + @QueryParam("$orderby") String orderby, + @QueryParam("$top") Integer top, + @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations" + + "/{relationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("bookmarkId") String bookmarkId, + @PathParam("relationName") String relationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations" + + "/{relationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("bookmarkId") String bookmarkId, + @PathParam("relationName") String relationName, + @BodyParam("application/json") RelationInner relation, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations" + + "/{relationName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("bookmarkId") String bookmarkId, + @PathParam("relationName") String relationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all bookmark relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all bookmark relations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String workspaceName, + String bookmarkId, + String filter, + String orderby, + Integer top, + String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bookmarkId == null) { + return Mono.error(new IllegalArgumentException("Parameter bookmarkId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bookmarkId, + filter, + orderby, + top, + skipToken, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all bookmark relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all bookmark relations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String workspaceName, + String bookmarkId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bookmarkId == null) { + return Mono.error(new IllegalArgumentException("Parameter bookmarkId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bookmarkId, + filter, + orderby, + top, + skipToken, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all bookmark relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all bookmark relations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String workspaceName, + String bookmarkId, + String filter, + String orderby, + Integer top, + String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, bookmarkId, filter, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all bookmark relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all bookmark relations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String bookmarkId) { + final String filter = null; + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, bookmarkId, filter, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all bookmark relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all bookmark relations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String workspaceName, + String bookmarkId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, workspaceName, bookmarkId, filter, orderby, top, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all bookmark relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all bookmark relations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String bookmarkId) { + final String filter = null; + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>( + listAsync(resourceGroupName, workspaceName, bookmarkId, filter, orderby, top, skipToken)); + } + + /** + * Gets all bookmark relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all bookmark relations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String bookmarkId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, workspaceName, bookmarkId, filter, orderby, top, skipToken, context)); + } + + /** + * Gets a bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a bookmark relation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String bookmarkId, String relationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bookmarkId == null) { + return Mono.error(new IllegalArgumentException("Parameter bookmarkId is required and cannot be null.")); + } + if (relationName == null) { + return Mono.error(new IllegalArgumentException("Parameter relationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bookmarkId, + relationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a bookmark relation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String bookmarkId, String relationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bookmarkId == null) { + return Mono.error(new IllegalArgumentException("Parameter bookmarkId is required and cannot be null.")); + } + if (relationName == null) { + return Mono.error(new IllegalArgumentException("Parameter relationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bookmarkId, + relationName, + accept, + context); + } + + /** + * Gets a bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a bookmark relation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String bookmarkId, String relationName) { + return getWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, relationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a bookmark relation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RelationInner get(String resourceGroupName, String workspaceName, String bookmarkId, String relationName) { + return getAsync(resourceGroupName, workspaceName, bookmarkId, relationName).block(); + } + + /** + * Gets a bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a bookmark relation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String bookmarkId, String relationName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, relationName, context).block(); + } + + /** + * Creates the bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @param relation The relation model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a relation between two resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String bookmarkId, + String relationName, + RelationInner relation) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bookmarkId == null) { + return Mono.error(new IllegalArgumentException("Parameter bookmarkId is required and cannot be null.")); + } + if (relationName == null) { + return Mono.error(new IllegalArgumentException("Parameter relationName is required and cannot be null.")); + } + if (relation == null) { + return Mono.error(new IllegalArgumentException("Parameter relation is required and cannot be null.")); + } else { + relation.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bookmarkId, + relationName, + relation, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates the bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @param relation The relation model. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a relation between two resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String bookmarkId, + String relationName, + RelationInner relation, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bookmarkId == null) { + return Mono.error(new IllegalArgumentException("Parameter bookmarkId is required and cannot be null.")); + } + if (relationName == null) { + return Mono.error(new IllegalArgumentException("Parameter relationName is required and cannot be null.")); + } + if (relation == null) { + return Mono.error(new IllegalArgumentException("Parameter relation is required and cannot be null.")); + } else { + relation.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bookmarkId, + relationName, + relation, + accept, + context); + } + + /** + * Creates the bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @param relation The relation model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a relation between two resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String bookmarkId, + String relationName, + RelationInner relation) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, relationName, relation) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates the bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @param relation The relation model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a relation between two resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RelationInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String bookmarkId, + String relationName, + RelationInner relation) { + return createOrUpdateAsync(resourceGroupName, workspaceName, bookmarkId, relationName, relation).block(); + } + + /** + * Creates the bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @param relation The relation model. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a relation between two resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String bookmarkId, + String relationName, + RelationInner relation, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, bookmarkId, relationName, relation, context) + .block(); + } + + /** + * Delete the bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String bookmarkId, String relationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bookmarkId == null) { + return Mono.error(new IllegalArgumentException("Parameter bookmarkId is required and cannot be null.")); + } + if (relationName == null) { + return Mono.error(new IllegalArgumentException("Parameter relationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bookmarkId, + relationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String bookmarkId, String relationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bookmarkId == null) { + return Mono.error(new IllegalArgumentException("Parameter bookmarkId is required and cannot be null.")); + } + if (relationName == null) { + return Mono.error(new IllegalArgumentException("Parameter relationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bookmarkId, + relationName, + accept, + context); + } + + /** + * Delete the bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String workspaceName, String bookmarkId, String relationName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, relationName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete the bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String bookmarkId, String relationName) { + deleteAsync(resourceGroupName, workspaceName, bookmarkId, relationName).block(); + } + + /** + * Delete the bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String bookmarkId, String relationName, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, relationName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of relations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of relations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkRelationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkRelationsImpl.java new file mode 100644 index 000000000000..71286e569efa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkRelationsImpl.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.BookmarkRelationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; +import com.azure.resourcemanager.securityinsights.models.BookmarkRelations; +import com.azure.resourcemanager.securityinsights.models.Relation; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BookmarkRelationsImpl implements BookmarkRelations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BookmarkRelationsImpl.class); + + private final BookmarkRelationsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public BookmarkRelationsImpl( + BookmarkRelationsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String bookmarkId) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, bookmarkId); + return Utils.mapPage(inner, inner1 -> new RelationImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String bookmarkId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + PagedIterable inner = + this + .serviceClient() + .list(resourceGroupName, workspaceName, bookmarkId, filter, orderby, top, skipToken, context); + return Utils.mapPage(inner, inner1 -> new RelationImpl(inner1, this.manager())); + } + + public Relation get(String resourceGroupName, String workspaceName, String bookmarkId, String relationName) { + RelationInner inner = this.serviceClient().get(resourceGroupName, workspaceName, bookmarkId, relationName); + if (inner != null) { + return new RelationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String bookmarkId, String relationName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RelationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String bookmarkId, String relationName) { + this.serviceClient().delete(resourceGroupName, workspaceName, bookmarkId, relationName); + } + + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String bookmarkId, String relationName, Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, context); + } + + public Relation getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String bookmarkId = Utils.getValueFromIdByName(id, "bookmarks"); + if (bookmarkId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bookmarks'.", id))); + } + String relationName = Utils.getValueFromIdByName(id, "relations"); + if (relationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'relations'.", id))); + } + return this + .getWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String bookmarkId = Utils.getValueFromIdByName(id, "bookmarks"); + if (bookmarkId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bookmarks'.", id))); + } + String relationName = Utils.getValueFromIdByName(id, "relations"); + if (relationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'relations'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String bookmarkId = Utils.getValueFromIdByName(id, "bookmarks"); + if (bookmarkId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bookmarks'.", id))); + } + String relationName = Utils.getValueFromIdByName(id, "relations"); + if (relationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'relations'.", id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String bookmarkId = Utils.getValueFromIdByName(id, "bookmarks"); + if (bookmarkId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bookmarks'.", id))); + } + String relationName = Utils.getValueFromIdByName(id, "relations"); + if (relationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'relations'.", id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, context); + } + + private BookmarkRelationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public RelationImpl define(String name) { + return new RelationImpl(name, this.manager()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarksClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarksClientImpl.java new file mode 100644 index 000000000000..a71b4fa0f768 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarksClientImpl.java @@ -0,0 +1,883 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.BookmarksClient; +import com.azure.resourcemanager.securityinsights.fluent.models.BookmarkInner; +import com.azure.resourcemanager.securityinsights.models.BookmarkList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BookmarksClient. */ +public final class BookmarksClientImpl implements BookmarksClient { + private final ClientLogger logger = new ClientLogger(BookmarksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BookmarksService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of BookmarksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BookmarksClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy.create(BookmarksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsBookmarks to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsBook") + private interface BookmarksService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("bookmarkId") String bookmarkId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("bookmarkId") String bookmarkId, + @BodyParam("application/json") BookmarkInner bookmark, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("bookmarkId") String bookmarkId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all bookmarks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all bookmarks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all bookmarks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all bookmarks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all bookmarks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all bookmarks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all bookmarks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all bookmarks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all bookmarks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all bookmarks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + } + + /** + * Gets all bookmarks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all bookmarks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Gets a bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a bookmark. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String bookmarkId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bookmarkId == null) { + return Mono.error(new IllegalArgumentException("Parameter bookmarkId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bookmarkId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a bookmark. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String bookmarkId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bookmarkId == null) { + return Mono.error(new IllegalArgumentException("Parameter bookmarkId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bookmarkId, + accept, + context); + } + + /** + * Gets a bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a bookmark. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String bookmarkId) { + return getWithResponseAsync(resourceGroupName, workspaceName, bookmarkId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a bookmark. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BookmarkInner get(String resourceGroupName, String workspaceName, String bookmarkId) { + return getAsync(resourceGroupName, workspaceName, bookmarkId).block(); + } + + /** + * Gets a bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a bookmark. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String bookmarkId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, context).block(); + } + + /** + * Creates or updates the bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param bookmark The bookmark. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a bookmark in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String bookmarkId, BookmarkInner bookmark) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bookmarkId == null) { + return Mono.error(new IllegalArgumentException("Parameter bookmarkId is required and cannot be null.")); + } + if (bookmark == null) { + return Mono.error(new IllegalArgumentException("Parameter bookmark is required and cannot be null.")); + } else { + bookmark.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bookmarkId, + bookmark, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param bookmark The bookmark. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a bookmark in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String bookmarkId, BookmarkInner bookmark, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bookmarkId == null) { + return Mono.error(new IllegalArgumentException("Parameter bookmarkId is required and cannot be null.")); + } + if (bookmark == null) { + return Mono.error(new IllegalArgumentException("Parameter bookmark is required and cannot be null.")); + } else { + bookmark.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bookmarkId, + bookmark, + accept, + context); + } + + /** + * Creates or updates the bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param bookmark The bookmark. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a bookmark in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, String bookmarkId, BookmarkInner bookmark) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, bookmark) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param bookmark The bookmark. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a bookmark in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BookmarkInner createOrUpdate( + String resourceGroupName, String workspaceName, String bookmarkId, BookmarkInner bookmark) { + return createOrUpdateAsync(resourceGroupName, workspaceName, bookmarkId, bookmark).block(); + } + + /** + * Creates or updates the bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param bookmark The bookmark. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a bookmark in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String workspaceName, String bookmarkId, BookmarkInner bookmark, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, bookmark, context).block(); + } + + /** + * Delete the bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String bookmarkId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bookmarkId == null) { + return Mono.error(new IllegalArgumentException("Parameter bookmarkId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bookmarkId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String bookmarkId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bookmarkId == null) { + return Mono.error(new IllegalArgumentException("Parameter bookmarkId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bookmarkId, + accept, + context); + } + + /** + * Delete the bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String bookmarkId) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, bookmarkId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete the bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String bookmarkId) { + deleteAsync(resourceGroupName, workspaceName, bookmarkId).block(); + } + + /** + * Delete the bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String bookmarkId, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the bookmarks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the bookmarks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarksImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarksImpl.java new file mode 100644 index 000000000000..02010e33a17f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarksImpl.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.BookmarksClient; +import com.azure.resourcemanager.securityinsights.fluent.models.BookmarkInner; +import com.azure.resourcemanager.securityinsights.models.Bookmark; +import com.azure.resourcemanager.securityinsights.models.Bookmarks; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BookmarksImpl implements Bookmarks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BookmarksImpl.class); + + private final BookmarksClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public BookmarksImpl( + BookmarksClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new BookmarkImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new BookmarkImpl(inner1, this.manager())); + } + + public Bookmark get(String resourceGroupName, String workspaceName, String bookmarkId) { + BookmarkInner inner = this.serviceClient().get(resourceGroupName, workspaceName, bookmarkId); + if (inner != null) { + return new BookmarkImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String bookmarkId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, bookmarkId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BookmarkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String bookmarkId) { + this.serviceClient().delete(resourceGroupName, workspaceName, bookmarkId); + } + + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String bookmarkId, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, bookmarkId, context); + } + + public Bookmark getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String bookmarkId = Utils.getValueFromIdByName(id, "bookmarks"); + if (bookmarkId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bookmarks'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, bookmarkId, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String bookmarkId = Utils.getValueFromIdByName(id, "bookmarks"); + if (bookmarkId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bookmarks'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, bookmarkId, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String bookmarkId = Utils.getValueFromIdByName(id, "bookmarks"); + if (bookmarkId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bookmarks'.", id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, bookmarkId, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String bookmarkId = Utils.getValueFromIdByName(id, "bookmarks"); + if (bookmarkId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bookmarks'.", id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, bookmarkId, context); + } + + private BookmarksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public BookmarkImpl define(String name) { + return new BookmarkImpl(name, this.manager()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorImpl.java new file mode 100644 index 000000000000..b07fffa9b2f0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.models.DataConnector; + +public final class DataConnectorImpl implements DataConnector { + private DataConnectorInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + DataConnectorImpl( + DataConnectorInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DataConnectorInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorRequirementsStateImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorRequirementsStateImpl.java new file mode 100644 index 000000000000..2543bc68e69c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorRequirementsStateImpl.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorRequirementsStateInner; +import com.azure.resourcemanager.securityinsights.models.DataConnectorAuthorizationState; +import com.azure.resourcemanager.securityinsights.models.DataConnectorLicenseState; +import com.azure.resourcemanager.securityinsights.models.DataConnectorRequirementsState; + +public final class DataConnectorRequirementsStateImpl implements DataConnectorRequirementsState { + private DataConnectorRequirementsStateInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + DataConnectorRequirementsStateImpl( + DataConnectorRequirementsStateInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public DataConnectorAuthorizationState authorizationState() { + return this.innerModel().authorizationState(); + } + + public DataConnectorLicenseState licenseState() { + return this.innerModel().licenseState(); + } + + public DataConnectorRequirementsStateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsCheckRequirementsOperationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsCheckRequirementsOperationsClientImpl.java new file mode 100644 index 000000000000..5780681c5832 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsCheckRequirementsOperationsClientImpl.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.DataConnectorsCheckRequirementsOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorRequirementsStateInner; +import com.azure.resourcemanager.securityinsights.models.DataConnectorsCheckRequirements; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * DataConnectorsCheckRequirementsOperationsClient. + */ +public final class DataConnectorsCheckRequirementsOperationsClientImpl + implements DataConnectorsCheckRequirementsOperationsClient { + private final ClientLogger logger = new ClientLogger(DataConnectorsCheckRequirementsOperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DataConnectorsCheckRequirementsOperationsService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of DataConnectorsCheckRequirementsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataConnectorsCheckRequirementsOperationsClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy + .create( + DataConnectorsCheckRequirementsOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsDataConnectorsCheckRequirementsOperations to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsData") + private interface DataConnectorsCheckRequirementsOperationsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectorsCheckRequirements") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> post( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @BodyParam("application/json") DataConnectorsCheckRequirements dataConnectorsCheckRequirements, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get requirements state for a data connector type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorsCheckRequirements The parameters for requirements check message. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return requirements state for a data connector type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> postWithResponseAsync( + String resourceGroupName, + String workspaceName, + DataConnectorsCheckRequirements dataConnectorsCheckRequirements) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataConnectorsCheckRequirements == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter dataConnectorsCheckRequirements is required and cannot be null.")); + } else { + dataConnectorsCheckRequirements.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .post( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + dataConnectorsCheckRequirements, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get requirements state for a data connector type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorsCheckRequirements The parameters for requirements check message. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return requirements state for a data connector type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> postWithResponseAsync( + String resourceGroupName, + String workspaceName, + DataConnectorsCheckRequirements dataConnectorsCheckRequirements, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataConnectorsCheckRequirements == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter dataConnectorsCheckRequirements is required and cannot be null.")); + } else { + dataConnectorsCheckRequirements.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .post( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + dataConnectorsCheckRequirements, + accept, + context); + } + + /** + * Get requirements state for a data connector type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorsCheckRequirements The parameters for requirements check message. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return requirements state for a data connector type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono postAsync( + String resourceGroupName, + String workspaceName, + DataConnectorsCheckRequirements dataConnectorsCheckRequirements) { + return postWithResponseAsync(resourceGroupName, workspaceName, dataConnectorsCheckRequirements) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get requirements state for a data connector type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorsCheckRequirements The parameters for requirements check message. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return requirements state for a data connector type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnectorRequirementsStateInner post( + String resourceGroupName, + String workspaceName, + DataConnectorsCheckRequirements dataConnectorsCheckRequirements) { + return postAsync(resourceGroupName, workspaceName, dataConnectorsCheckRequirements).block(); + } + + /** + * Get requirements state for a data connector type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorsCheckRequirements The parameters for requirements check message. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return requirements state for a data connector type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response postWithResponse( + String resourceGroupName, + String workspaceName, + DataConnectorsCheckRequirements dataConnectorsCheckRequirements, + Context context) { + return postWithResponseAsync(resourceGroupName, workspaceName, dataConnectorsCheckRequirements, context) + .block(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsCheckRequirementsOperationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsCheckRequirementsOperationsImpl.java new file mode 100644 index 000000000000..6e833a0e8f2a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsCheckRequirementsOperationsImpl.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.DataConnectorsCheckRequirementsOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorRequirementsStateInner; +import com.azure.resourcemanager.securityinsights.models.DataConnectorRequirementsState; +import com.azure.resourcemanager.securityinsights.models.DataConnectorsCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.DataConnectorsCheckRequirementsOperations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DataConnectorsCheckRequirementsOperationsImpl implements DataConnectorsCheckRequirementsOperations { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(DataConnectorsCheckRequirementsOperationsImpl.class); + + private final DataConnectorsCheckRequirementsOperationsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public DataConnectorsCheckRequirementsOperationsImpl( + DataConnectorsCheckRequirementsOperationsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public DataConnectorRequirementsState post( + String resourceGroupName, + String workspaceName, + DataConnectorsCheckRequirements dataConnectorsCheckRequirements) { + DataConnectorRequirementsStateInner inner = + this.serviceClient().post(resourceGroupName, workspaceName, dataConnectorsCheckRequirements); + if (inner != null) { + return new DataConnectorRequirementsStateImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response postWithResponse( + String resourceGroupName, + String workspaceName, + DataConnectorsCheckRequirements dataConnectorsCheckRequirements, + Context context) { + Response inner = + this + .serviceClient() + .postWithResponse(resourceGroupName, workspaceName, dataConnectorsCheckRequirements, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataConnectorRequirementsStateImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private DataConnectorsCheckRequirementsOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsClientImpl.java new file mode 100644 index 000000000000..d2e4a341edab --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsClientImpl.java @@ -0,0 +1,1277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.DataConnectorsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.models.DataConnectorConnectBody; +import com.azure.resourcemanager.securityinsights.models.DataConnectorList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DataConnectorsClient. */ +public final class DataConnectorsClientImpl implements DataConnectorsClient { + private final ClientLogger logger = new ClientLogger(DataConnectorsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DataConnectorsService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of DataConnectorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataConnectorsClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy.create(DataConnectorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsDataConnectors to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsData") + private interface DataConnectorsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("dataConnectorId") String dataConnectorId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("dataConnectorId") String dataConnectorId, + @BodyParam("application/json") DataConnectorInner dataConnector, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("dataConnectorId") String dataConnectorId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}" + + "/connect") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> connect( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("dataConnectorId") String dataConnectorId, + @BodyParam("application/json") DataConnectorConnectBody connectBody, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}" + + "/disconnect") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> disconnect( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("dataConnectorId") String dataConnectorId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all data connectors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all data connectors. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all data connectors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all data connectors. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all data connectors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all data connectors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all data connectors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all data connectors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all data connectors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all data connectors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + } + + /** + * Gets all data connectors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all data connectors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Gets a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a data connector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String dataConnectorId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataConnectorId == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectorId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + dataConnectorId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a data connector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String dataConnectorId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataConnectorId == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectorId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + dataConnectorId, + accept, + context); + } + + /** + * Gets a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a data connector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String dataConnectorId) { + return getWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a data connector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnectorInner get(String resourceGroupName, String workspaceName, String dataConnectorId) { + return getAsync(resourceGroupName, workspaceName, dataConnectorId).block(); + } + + /** + * Gets a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a data connector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String dataConnectorId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId, context).block(); + } + + /** + * Creates or updates the data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param dataConnector The data connector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data connector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String dataConnectorId, DataConnectorInner dataConnector) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataConnectorId == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectorId is required and cannot be null.")); + } + if (dataConnector == null) { + return Mono.error(new IllegalArgumentException("Parameter dataConnector is required and cannot be null.")); + } else { + dataConnector.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + dataConnectorId, + dataConnector, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param dataConnector The data connector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data connector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String dataConnectorId, + DataConnectorInner dataConnector, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataConnectorId == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectorId is required and cannot be null.")); + } + if (dataConnector == null) { + return Mono.error(new IllegalArgumentException("Parameter dataConnector is required and cannot be null.")); + } else { + dataConnector.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + dataConnectorId, + dataConnector, + accept, + context); + } + + /** + * Creates or updates the data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param dataConnector The data connector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data connector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, String dataConnectorId, DataConnectorInner dataConnector) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId, dataConnector) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param dataConnector The data connector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data connector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnectorInner createOrUpdate( + String resourceGroupName, String workspaceName, String dataConnectorId, DataConnectorInner dataConnector) { + return createOrUpdateAsync(resourceGroupName, workspaceName, dataConnectorId, dataConnector).block(); + } + + /** + * Creates or updates the data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param dataConnector The data connector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data connector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String dataConnectorId, + DataConnectorInner dataConnector, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, dataConnectorId, dataConnector, context) + .block(); + } + + /** + * Delete the data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String dataConnectorId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataConnectorId == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectorId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + dataConnectorId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String dataConnectorId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataConnectorId == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectorId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + dataConnectorId, + accept, + context); + } + + /** + * Delete the data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String dataConnectorId) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete the data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String dataConnectorId) { + deleteAsync(resourceGroupName, workspaceName, dataConnectorId).block(); + } + + /** + * Delete the data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String dataConnectorId, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId, context).block(); + } + + /** + * Connects a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param connectBody The data connector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> connectWithResponseAsync( + String resourceGroupName, String workspaceName, String dataConnectorId, DataConnectorConnectBody connectBody) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataConnectorId == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectorId is required and cannot be null.")); + } + if (connectBody == null) { + return Mono.error(new IllegalArgumentException("Parameter connectBody is required and cannot be null.")); + } else { + connectBody.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .connect( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + dataConnectorId, + connectBody, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Connects a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param connectBody The data connector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> connectWithResponseAsync( + String resourceGroupName, + String workspaceName, + String dataConnectorId, + DataConnectorConnectBody connectBody, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataConnectorId == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectorId is required and cannot be null.")); + } + if (connectBody == null) { + return Mono.error(new IllegalArgumentException("Parameter connectBody is required and cannot be null.")); + } else { + connectBody.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .connect( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + dataConnectorId, + connectBody, + accept, + context); + } + + /** + * Connects a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param connectBody The data connector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono connectAsync( + String resourceGroupName, String workspaceName, String dataConnectorId, DataConnectorConnectBody connectBody) { + return connectWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId, connectBody) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Connects a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param connectBody The data connector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void connect( + String resourceGroupName, String workspaceName, String dataConnectorId, DataConnectorConnectBody connectBody) { + connectAsync(resourceGroupName, workspaceName, dataConnectorId, connectBody).block(); + } + + /** + * Connects a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param connectBody The data connector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response connectWithResponse( + String resourceGroupName, + String workspaceName, + String dataConnectorId, + DataConnectorConnectBody connectBody, + Context context) { + return connectWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId, connectBody, context) + .block(); + } + + /** + * Disconnect a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> disconnectWithResponseAsync( + String resourceGroupName, String workspaceName, String dataConnectorId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataConnectorId == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectorId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .disconnect( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + dataConnectorId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Disconnect a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> disconnectWithResponseAsync( + String resourceGroupName, String workspaceName, String dataConnectorId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataConnectorId == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectorId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .disconnect( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + dataConnectorId, + accept, + context); + } + + /** + * Disconnect a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono disconnectAsync(String resourceGroupName, String workspaceName, String dataConnectorId) { + return disconnectWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Disconnect a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void disconnect(String resourceGroupName, String workspaceName, String dataConnectorId) { + disconnectAsync(resourceGroupName, workspaceName, dataConnectorId).block(); + } + + /** + * Disconnect a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response disconnectWithResponse( + String resourceGroupName, String workspaceName, String dataConnectorId, Context context) { + return disconnectWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the data connectors. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the data connectors. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsImpl.java new file mode 100644 index 000000000000..a59ea0358f07 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsImpl.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.DataConnectorsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.models.DataConnector; +import com.azure.resourcemanager.securityinsights.models.DataConnectorConnectBody; +import com.azure.resourcemanager.securityinsights.models.DataConnectors; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DataConnectorsImpl implements DataConnectors { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataConnectorsImpl.class); + + private final DataConnectorsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public DataConnectorsImpl( + DataConnectorsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new DataConnectorImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new DataConnectorImpl(inner1, this.manager())); + } + + public DataConnector get(String resourceGroupName, String workspaceName, String dataConnectorId) { + DataConnectorInner inner = this.serviceClient().get(resourceGroupName, workspaceName, dataConnectorId); + if (inner != null) { + return new DataConnectorImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String dataConnectorId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, dataConnectorId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataConnectorImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DataConnector createOrUpdate( + String resourceGroupName, String workspaceName, String dataConnectorId, DataConnectorInner dataConnector) { + DataConnectorInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, dataConnectorId, dataConnector); + if (inner != null) { + return new DataConnectorImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String dataConnectorId, + DataConnectorInner dataConnector, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, dataConnectorId, dataConnector, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataConnectorImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String dataConnectorId) { + this.serviceClient().delete(resourceGroupName, workspaceName, dataConnectorId); + } + + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String dataConnectorId, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, dataConnectorId, context); + } + + public void connect( + String resourceGroupName, String workspaceName, String dataConnectorId, DataConnectorConnectBody connectBody) { + this.serviceClient().connect(resourceGroupName, workspaceName, dataConnectorId, connectBody); + } + + public Response connectWithResponse( + String resourceGroupName, + String workspaceName, + String dataConnectorId, + DataConnectorConnectBody connectBody, + Context context) { + return this + .serviceClient() + .connectWithResponse(resourceGroupName, workspaceName, dataConnectorId, connectBody, context); + } + + public void disconnect(String resourceGroupName, String workspaceName, String dataConnectorId) { + this.serviceClient().disconnect(resourceGroupName, workspaceName, dataConnectorId); + } + + public Response disconnectWithResponse( + String resourceGroupName, String workspaceName, String dataConnectorId, Context context) { + return this.serviceClient().disconnectWithResponse(resourceGroupName, workspaceName, dataConnectorId, context); + } + + private DataConnectorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DomainWhoisClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DomainWhoisClientImpl.java new file mode 100644 index 000000000000..fbfd78027953 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DomainWhoisClientImpl.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.DomainWhoisClient; +import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentDomainWhoisInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DomainWhoisClient. */ +public final class DomainWhoisClientImpl implements DomainWhoisClient { + private final ClientLogger logger = new ClientLogger(DomainWhoisClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DomainWhoisService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of DomainWhoisClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DomainWhoisClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy.create(DomainWhoisService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsDomainWhois to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsDoma") + private interface DomainWhoisService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecurityInsights" + + "/enrichment/domain/whois/") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("domain") String domain, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get whois information for a single domain name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param domain Domain name to be enriched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whois information for a single domain name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String domain) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (domain == null) { + return Mono.error(new IllegalArgumentException("Parameter domain is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + domain, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get whois information for a single domain name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param domain Domain name to be enriched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whois information for a single domain name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String domain, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (domain == null) { + return Mono.error(new IllegalArgumentException("Parameter domain is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + domain, + accept, + context); + } + + /** + * Get whois information for a single domain name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param domain Domain name to be enriched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whois information for a single domain name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String domain) { + return getWithResponseAsync(resourceGroupName, domain) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get whois information for a single domain name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param domain Domain name to be enriched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whois information for a single domain name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EnrichmentDomainWhoisInner get(String resourceGroupName, String domain) { + return getAsync(resourceGroupName, domain).block(); + } + + /** + * Get whois information for a single domain name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param domain Domain name to be enriched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whois information for a single domain name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String domain, Context context) { + return getWithResponseAsync(resourceGroupName, domain, context).block(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DomainWhoisImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DomainWhoisImpl.java new file mode 100644 index 000000000000..c1001d44b797 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DomainWhoisImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.DomainWhoisClient; +import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentDomainWhoisInner; +import com.azure.resourcemanager.securityinsights.models.DomainWhois; +import com.azure.resourcemanager.securityinsights.models.EnrichmentDomainWhois; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DomainWhoisImpl implements DomainWhois { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DomainWhoisImpl.class); + + private final DomainWhoisClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public DomainWhoisImpl( + DomainWhoisClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public EnrichmentDomainWhois get(String resourceGroupName, String domain) { + EnrichmentDomainWhoisInner inner = this.serviceClient().get(resourceGroupName, domain); + if (inner != null) { + return new EnrichmentDomainWhoisImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String resourceGroupName, String domain, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, domain, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EnrichmentDomainWhoisImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private DomainWhoisClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EnrichmentDomainWhoisImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EnrichmentDomainWhoisImpl.java new file mode 100644 index 000000000000..4f643ea4b717 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EnrichmentDomainWhoisImpl.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentDomainWhoisInner; +import com.azure.resourcemanager.securityinsights.models.EnrichmentDomainWhois; +import com.azure.resourcemanager.securityinsights.models.EnrichmentDomainWhoisDetails; +import java.time.OffsetDateTime; + +public final class EnrichmentDomainWhoisImpl implements EnrichmentDomainWhois { + private EnrichmentDomainWhoisInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + EnrichmentDomainWhoisImpl( + EnrichmentDomainWhoisInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String domain() { + return this.innerModel().domain(); + } + + public String server() { + return this.innerModel().server(); + } + + public OffsetDateTime created() { + return this.innerModel().created(); + } + + public OffsetDateTime updated() { + return this.innerModel().updated(); + } + + public OffsetDateTime expires() { + return this.innerModel().expires(); + } + + public EnrichmentDomainWhoisDetails parsedWhois() { + return this.innerModel().parsedWhois(); + } + + public EnrichmentDomainWhoisInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EnrichmentIpGeodataImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EnrichmentIpGeodataImpl.java new file mode 100644 index 000000000000..75885149ad4d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EnrichmentIpGeodataImpl.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentIpGeodataInner; +import com.azure.resourcemanager.securityinsights.models.EnrichmentIpGeodata; + +public final class EnrichmentIpGeodataImpl implements EnrichmentIpGeodata { + private EnrichmentIpGeodataInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + EnrichmentIpGeodataImpl( + EnrichmentIpGeodataInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String asn() { + return this.innerModel().asn(); + } + + public String carrier() { + return this.innerModel().carrier(); + } + + public String city() { + return this.innerModel().city(); + } + + public Integer cityCf() { + return this.innerModel().cityCf(); + } + + public String continent() { + return this.innerModel().continent(); + } + + public String country() { + return this.innerModel().country(); + } + + public Integer countryCf() { + return this.innerModel().countryCf(); + } + + public String ipAddr() { + return this.innerModel().ipAddr(); + } + + public String ipRoutingType() { + return this.innerModel().ipRoutingType(); + } + + public String latitude() { + return this.innerModel().latitude(); + } + + public String longitude() { + return this.innerModel().longitude(); + } + + public String organization() { + return this.innerModel().organization(); + } + + public String organizationType() { + return this.innerModel().organizationType(); + } + + public String region() { + return this.innerModel().region(); + } + + public String state() { + return this.innerModel().state(); + } + + public Integer stateCf() { + return this.innerModel().stateCf(); + } + + public String stateCode() { + return this.innerModel().stateCode(); + } + + public EnrichmentIpGeodataInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesClientImpl.java new file mode 100644 index 000000000000..6effd0f05a0c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesClientImpl.java @@ -0,0 +1,1125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.EntitiesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityExpandResponseInner; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityGetInsightsResponseInner; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.azure.resourcemanager.securityinsights.fluent.models.GetQueriesResponseInner; +import com.azure.resourcemanager.securityinsights.models.EntityExpandParameters; +import com.azure.resourcemanager.securityinsights.models.EntityGetInsightsParameters; +import com.azure.resourcemanager.securityinsights.models.EntityItemQueryKind; +import com.azure.resourcemanager.securityinsights.models.EntityList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in EntitiesClient. */ +public final class EntitiesClientImpl implements EntitiesClient { + private final ClientLogger logger = new ClientLogger(EntitiesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final EntitiesService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of EntitiesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EntitiesClientImpl(SecurityInsightsImpl client) { + this.service = RestProxy.create(EntitiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsEntities to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsEnti") + private interface EntitiesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("entityId") String entityId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/expand") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> expand( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("entityId") String entityId, + @BodyParam("application/json") EntityExpandParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/queries") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> queries( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("entityId") String entityId, + @QueryParam("kind") EntityItemQueryKind kind, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/getInsights") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getInsights( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("entityId") String entityId, + @BodyParam("application/json") EntityGetInsightsParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all entities. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all entities. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all entities. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all entities. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all entities. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + } + + /** + * Gets all entities. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Gets an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String entityId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (entityId == null) { + return Mono.error(new IllegalArgumentException("Parameter entityId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + entityId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String entityId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (entityId == null) { + return Mono.error(new IllegalArgumentException("Parameter entityId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + entityId, + accept, + context); + } + + /** + * Gets an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String entityId) { + return getWithResponseAsync(resourceGroupName, workspaceName, entityId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EntityInner get(String resourceGroupName, String workspaceName, String entityId) { + return getAsync(resourceGroupName, workspaceName, entityId).block(); + } + + /** + * Gets an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String entityId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, entityId, context).block(); + } + + /** + * Expands an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute an expand operation on the given entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity expansion result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> expandWithResponseAsync( + String resourceGroupName, String workspaceName, String entityId, EntityExpandParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (entityId == null) { + return Mono.error(new IllegalArgumentException("Parameter entityId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .expand( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + entityId, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Expands an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute an expand operation on the given entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity expansion result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> expandWithResponseAsync( + String resourceGroupName, + String workspaceName, + String entityId, + EntityExpandParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (entityId == null) { + return Mono.error(new IllegalArgumentException("Parameter entityId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .expand( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + entityId, + parameters, + accept, + context); + } + + /** + * Expands an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute an expand operation on the given entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity expansion result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono expandAsync( + String resourceGroupName, String workspaceName, String entityId, EntityExpandParameters parameters) { + return expandWithResponseAsync(resourceGroupName, workspaceName, entityId, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Expands an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute an expand operation on the given entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity expansion result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EntityExpandResponseInner expand( + String resourceGroupName, String workspaceName, String entityId, EntityExpandParameters parameters) { + return expandAsync(resourceGroupName, workspaceName, entityId, parameters).block(); + } + + /** + * Expands an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute an expand operation on the given entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity expansion result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response expandWithResponse( + String resourceGroupName, + String workspaceName, + String entityId, + EntityExpandParameters parameters, + Context context) { + return expandWithResponseAsync(resourceGroupName, workspaceName, entityId, parameters, context).block(); + } + + /** + * Get Insights and Activities for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param kind The Kind parameter for queries. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return insights and Activities for an entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> queriesWithResponseAsync( + String resourceGroupName, String workspaceName, String entityId, EntityItemQueryKind kind) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (entityId == null) { + return Mono.error(new IllegalArgumentException("Parameter entityId is required and cannot be null.")); + } + if (kind == null) { + return Mono.error(new IllegalArgumentException("Parameter kind is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .queries( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + entityId, + kind, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Insights and Activities for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param kind The Kind parameter for queries. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return insights and Activities for an entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> queriesWithResponseAsync( + String resourceGroupName, String workspaceName, String entityId, EntityItemQueryKind kind, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (entityId == null) { + return Mono.error(new IllegalArgumentException("Parameter entityId is required and cannot be null.")); + } + if (kind == null) { + return Mono.error(new IllegalArgumentException("Parameter kind is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .queries( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + entityId, + kind, + accept, + context); + } + + /** + * Get Insights and Activities for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param kind The Kind parameter for queries. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return insights and Activities for an entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono queriesAsync( + String resourceGroupName, String workspaceName, String entityId, EntityItemQueryKind kind) { + return queriesWithResponseAsync(resourceGroupName, workspaceName, entityId, kind) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get Insights and Activities for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param kind The Kind parameter for queries. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return insights and Activities for an entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GetQueriesResponseInner queries( + String resourceGroupName, String workspaceName, String entityId, EntityItemQueryKind kind) { + return queriesAsync(resourceGroupName, workspaceName, entityId, kind).block(); + } + + /** + * Get Insights and Activities for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param kind The Kind parameter for queries. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return insights and Activities for an entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response queriesWithResponse( + String resourceGroupName, String workspaceName, String entityId, EntityItemQueryKind kind, Context context) { + return queriesWithResponseAsync(resourceGroupName, workspaceName, entityId, kind, context).block(); + } + + /** + * Execute Insights for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute insights on the given entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Get Insights result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getInsightsWithResponseAsync( + String resourceGroupName, String workspaceName, String entityId, EntityGetInsightsParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (entityId == null) { + return Mono.error(new IllegalArgumentException("Parameter entityId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getInsights( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + entityId, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Execute Insights for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute insights on the given entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Get Insights result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getInsightsWithResponseAsync( + String resourceGroupName, + String workspaceName, + String entityId, + EntityGetInsightsParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (entityId == null) { + return Mono.error(new IllegalArgumentException("Parameter entityId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getInsights( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + entityId, + parameters, + accept, + context); + } + + /** + * Execute Insights for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute insights on the given entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Get Insights result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getInsightsAsync( + String resourceGroupName, String workspaceName, String entityId, EntityGetInsightsParameters parameters) { + return getInsightsWithResponseAsync(resourceGroupName, workspaceName, entityId, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Execute Insights for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute insights on the given entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Get Insights result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EntityGetInsightsResponseInner getInsights( + String resourceGroupName, String workspaceName, String entityId, EntityGetInsightsParameters parameters) { + return getInsightsAsync(resourceGroupName, workspaceName, entityId, parameters).block(); + } + + /** + * Execute Insights for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute insights on the given entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Get Insights result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getInsightsWithResponse( + String resourceGroupName, + String workspaceName, + String entityId, + EntityGetInsightsParameters parameters, + Context context) { + return getInsightsWithResponseAsync(resourceGroupName, workspaceName, entityId, parameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesGetTimelinesClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesGetTimelinesClientImpl.java new file mode 100644 index 000000000000..3050b6da7c33 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesGetTimelinesClientImpl.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.EntitiesGetTimelinesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityTimelineResponseInner; +import com.azure.resourcemanager.securityinsights.models.EntityTimelineParameters; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in EntitiesGetTimelinesClient. */ +public final class EntitiesGetTimelinesClientImpl implements EntitiesGetTimelinesClient { + private final ClientLogger logger = new ClientLogger(EntitiesGetTimelinesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final EntitiesGetTimelinesService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of EntitiesGetTimelinesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EntitiesGetTimelinesClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy + .create(EntitiesGetTimelinesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsEntitiesGetTimelines to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsEnti") + private interface EntitiesGetTimelinesService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/getTimeline") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("entityId") String entityId, + @BodyParam("application/json") EntityTimelineParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Timeline for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute an timeline operation on the given entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity timeline result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String workspaceName, String entityId, EntityTimelineParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (entityId == null) { + return Mono.error(new IllegalArgumentException("Parameter entityId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + entityId, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Timeline for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute an timeline operation on the given entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity timeline result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, + String workspaceName, + String entityId, + EntityTimelineParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (entityId == null) { + return Mono.error(new IllegalArgumentException("Parameter entityId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + entityId, + parameters, + accept, + context); + } + + /** + * Timeline for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute an timeline operation on the given entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity timeline result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync( + String resourceGroupName, String workspaceName, String entityId, EntityTimelineParameters parameters) { + return listWithResponseAsync(resourceGroupName, workspaceName, entityId, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Timeline for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute an timeline operation on the given entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity timeline result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EntityTimelineResponseInner list( + String resourceGroupName, String workspaceName, String entityId, EntityTimelineParameters parameters) { + return listAsync(resourceGroupName, workspaceName, entityId, parameters).block(); + } + + /** + * Timeline for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute an timeline operation on the given entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity timeline result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, + String workspaceName, + String entityId, + EntityTimelineParameters parameters, + Context context) { + return listWithResponseAsync(resourceGroupName, workspaceName, entityId, parameters, context).block(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesGetTimelinesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesGetTimelinesImpl.java new file mode 100644 index 000000000000..5c4607c3fdcb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesGetTimelinesImpl.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.EntitiesGetTimelinesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityTimelineResponseInner; +import com.azure.resourcemanager.securityinsights.models.EntitiesGetTimelines; +import com.azure.resourcemanager.securityinsights.models.EntityTimelineParameters; +import com.azure.resourcemanager.securityinsights.models.EntityTimelineResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class EntitiesGetTimelinesImpl implements EntitiesGetTimelines { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntitiesGetTimelinesImpl.class); + + private final EntitiesGetTimelinesClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public EntitiesGetTimelinesImpl( + EntitiesGetTimelinesClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public EntityTimelineResponse list( + String resourceGroupName, String workspaceName, String entityId, EntityTimelineParameters parameters) { + EntityTimelineResponseInner inner = + this.serviceClient().list(resourceGroupName, workspaceName, entityId, parameters); + if (inner != null) { + return new EntityTimelineResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, + String workspaceName, + String entityId, + EntityTimelineParameters parameters, + Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, workspaceName, entityId, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EntityTimelineResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private EntitiesGetTimelinesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesImpl.java new file mode 100644 index 000000000000..39ff3bdc95d2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesImpl.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.EntitiesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityExpandResponseInner; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityGetInsightsResponseInner; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.azure.resourcemanager.securityinsights.fluent.models.GetQueriesResponseInner; +import com.azure.resourcemanager.securityinsights.models.Entities; +import com.azure.resourcemanager.securityinsights.models.Entity; +import com.azure.resourcemanager.securityinsights.models.EntityExpandParameters; +import com.azure.resourcemanager.securityinsights.models.EntityExpandResponse; +import com.azure.resourcemanager.securityinsights.models.EntityGetInsightsParameters; +import com.azure.resourcemanager.securityinsights.models.EntityGetInsightsResponse; +import com.azure.resourcemanager.securityinsights.models.EntityItemQueryKind; +import com.azure.resourcemanager.securityinsights.models.GetQueriesResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class EntitiesImpl implements Entities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntitiesImpl.class); + + private final EntitiesClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public EntitiesImpl( + EntitiesClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new EntityImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new EntityImpl(inner1, this.manager())); + } + + public Entity get(String resourceGroupName, String workspaceName, String entityId) { + EntityInner inner = this.serviceClient().get(resourceGroupName, workspaceName, entityId); + if (inner != null) { + return new EntityImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String entityId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, entityId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EntityImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EntityExpandResponse expand( + String resourceGroupName, String workspaceName, String entityId, EntityExpandParameters parameters) { + EntityExpandResponseInner inner = + this.serviceClient().expand(resourceGroupName, workspaceName, entityId, parameters); + if (inner != null) { + return new EntityExpandResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response expandWithResponse( + String resourceGroupName, + String workspaceName, + String entityId, + EntityExpandParameters parameters, + Context context) { + Response inner = + this.serviceClient().expandWithResponse(resourceGroupName, workspaceName, entityId, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EntityExpandResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GetQueriesResponse queries( + String resourceGroupName, String workspaceName, String entityId, EntityItemQueryKind kind) { + GetQueriesResponseInner inner = this.serviceClient().queries(resourceGroupName, workspaceName, entityId, kind); + if (inner != null) { + return new GetQueriesResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response queriesWithResponse( + String resourceGroupName, String workspaceName, String entityId, EntityItemQueryKind kind, Context context) { + Response inner = + this.serviceClient().queriesWithResponse(resourceGroupName, workspaceName, entityId, kind, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GetQueriesResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EntityGetInsightsResponse getInsights( + String resourceGroupName, String workspaceName, String entityId, EntityGetInsightsParameters parameters) { + EntityGetInsightsResponseInner inner = + this.serviceClient().getInsights(resourceGroupName, workspaceName, entityId, parameters); + if (inner != null) { + return new EntityGetInsightsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getInsightsWithResponse( + String resourceGroupName, + String workspaceName, + String entityId, + EntityGetInsightsParameters parameters, + Context context) { + Response inner = + this + .serviceClient() + .getInsightsWithResponse(resourceGroupName, workspaceName, entityId, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EntityGetInsightsResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private EntitiesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesRelationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesRelationsClientImpl.java new file mode 100644 index 000000000000..a48ad0d33b84 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesRelationsClientImpl.java @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.EntitiesRelationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; +import com.azure.resourcemanager.securityinsights.models.RelationList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in EntitiesRelationsClient. */ +public final class EntitiesRelationsClientImpl implements EntitiesRelationsClient { + private final ClientLogger logger = new ClientLogger(EntitiesRelationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final EntitiesRelationsService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of EntitiesRelationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EntitiesRelationsClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy.create(EntitiesRelationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsEntitiesRelations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsEnti") + private interface EntitiesRelationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/relations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("entityId") String entityId, + @QueryParam("$filter") String filter, + @QueryParam("$orderby") String orderby, + @QueryParam("$top") Integer top, + @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all relations of an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all relations of an entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String workspaceName, + String entityId, + String filter, + String orderby, + Integer top, + String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (entityId == null) { + return Mono.error(new IllegalArgumentException("Parameter entityId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + entityId, + filter, + orderby, + top, + skipToken, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all relations of an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all relations of an entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String workspaceName, + String entityId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (entityId == null) { + return Mono.error(new IllegalArgumentException("Parameter entityId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + entityId, + filter, + orderby, + top, + skipToken, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all relations of an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all relations of an entity. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String workspaceName, + String entityId, + String filter, + String orderby, + Integer top, + String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, entityId, filter, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all relations of an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all relations of an entity. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String entityId) { + final String filter = null; + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, entityId, filter, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all relations of an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all relations of an entity. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String workspaceName, + String entityId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, workspaceName, entityId, filter, orderby, top, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all relations of an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all relations of an entity. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String entityId) { + final String filter = null; + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>( + listAsync(resourceGroupName, workspaceName, entityId, filter, orderby, top, skipToken)); + } + + /** + * Gets all relations of an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all relations of an entity. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String entityId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, workspaceName, entityId, filter, orderby, top, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of relations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of relations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesRelationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesRelationsImpl.java new file mode 100644 index 000000000000..697e4ffecf48 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesRelationsImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.EntitiesRelationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; +import com.azure.resourcemanager.securityinsights.models.EntitiesRelations; +import com.azure.resourcemanager.securityinsights.models.Relation; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class EntitiesRelationsImpl implements EntitiesRelations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntitiesRelationsImpl.class); + + private final EntitiesRelationsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public EntitiesRelationsImpl( + EntitiesRelationsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String entityId) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, entityId); + return Utils.mapPage(inner, inner1 -> new RelationImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String entityId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + PagedIterable inner = + this + .serviceClient() + .list(resourceGroupName, workspaceName, entityId, filter, orderby, top, skipToken, context); + return Utils.mapPage(inner, inner1 -> new RelationImpl(inner1, this.manager())); + } + + private EntitiesRelationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityExpandResponseImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityExpandResponseImpl.java new file mode 100644 index 000000000000..bebd12d78d76 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityExpandResponseImpl.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.EntityExpandResponseInner; +import com.azure.resourcemanager.securityinsights.models.EntityExpandResponse; +import com.azure.resourcemanager.securityinsights.models.EntityExpandResponseValue; +import com.azure.resourcemanager.securityinsights.models.ExpansionResultsMetadata; + +public final class EntityExpandResponseImpl implements EntityExpandResponse { + private EntityExpandResponseInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + EntityExpandResponseImpl( + EntityExpandResponseInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ExpansionResultsMetadata metadata() { + return this.innerModel().metadata(); + } + + public EntityExpandResponseValue value() { + return this.innerModel().value(); + } + + public EntityExpandResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityGetInsightsResponseImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityGetInsightsResponseImpl.java new file mode 100644 index 000000000000..ebe0040b31fc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityGetInsightsResponseImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.EntityGetInsightsResponseInner; +import com.azure.resourcemanager.securityinsights.models.EntityGetInsightsResponse; +import com.azure.resourcemanager.securityinsights.models.EntityInsightItem; +import com.azure.resourcemanager.securityinsights.models.GetInsightsResultsMetadata; +import java.util.Collections; +import java.util.List; + +public final class EntityGetInsightsResponseImpl implements EntityGetInsightsResponse { + private EntityGetInsightsResponseInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + EntityGetInsightsResponseImpl( + EntityGetInsightsResponseInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public GetInsightsResultsMetadata metadata() { + return this.innerModel().metadata(); + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public EntityGetInsightsResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityImpl.java new file mode 100644 index 000000000000..419788334c11 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.azure.resourcemanager.securityinsights.models.Entity; + +public final class EntityImpl implements Entity { + private EntityInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + EntityImpl( + EntityInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public EntityInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueriesClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueriesClientImpl.java new file mode 100644 index 000000000000..5557838b87c8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueriesClientImpl.java @@ -0,0 +1,926 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.EntityQueriesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryInner; +import com.azure.resourcemanager.securityinsights.models.CustomEntityQuery; +import com.azure.resourcemanager.securityinsights.models.EntityQueriesKind; +import com.azure.resourcemanager.securityinsights.models.EntityQueryList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in EntityQueriesClient. */ +public final class EntityQueriesClientImpl implements EntityQueriesClient { + private final ClientLogger logger = new ClientLogger(EntityQueriesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final EntityQueriesService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of EntityQueriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EntityQueriesClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy.create(EntityQueriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsEntityQueries to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsEnti") + private interface EntityQueriesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("kind") EntityQueriesKind kind, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("entityQueryId") String entityQueryId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("entityQueryId") String entityQueryId, + @BodyParam("application/json") CustomEntityQuery entityQuery, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("entityQueryId") String entityQueryId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all entity queries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kind The entity query kind we want to fetch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entity queries. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, EntityQueriesKind kind) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + kind, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all entity queries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kind The entity query kind we want to fetch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entity queries. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, EntityQueriesKind kind, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + kind, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all entity queries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kind The entity query kind we want to fetch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entity queries. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, EntityQueriesKind kind) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, kind), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all entity queries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entity queries. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + final EntityQueriesKind kind = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, kind), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all entity queries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kind The entity query kind we want to fetch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entity queries. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, EntityQueriesKind kind, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, kind, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all entity queries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entity queries. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + final EntityQueriesKind kind = null; + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, kind)); + } + + /** + * Gets all entity queries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kind The entity query kind we want to fetch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entity queries. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, EntityQueriesKind kind, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, kind, context)); + } + + /** + * Gets an entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String entityQueryId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (entityQueryId == null) { + return Mono.error(new IllegalArgumentException("Parameter entityQueryId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + entityQueryId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String entityQueryId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (entityQueryId == null) { + return Mono.error(new IllegalArgumentException("Parameter entityQueryId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + entityQueryId, + accept, + context); + } + + /** + * Gets an entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String entityQueryId) { + return getWithResponseAsync(resourceGroupName, workspaceName, entityQueryId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EntityQueryInner get(String resourceGroupName, String workspaceName, String entityQueryId) { + return getAsync(resourceGroupName, workspaceName, entityQueryId).block(); + } + + /** + * Gets an entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String entityQueryId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, entityQueryId, context).block(); + } + + /** + * Creates or updates the entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @param entityQuery The entity query we want to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific entity query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String entityQueryId, CustomEntityQuery entityQuery) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (entityQueryId == null) { + return Mono.error(new IllegalArgumentException("Parameter entityQueryId is required and cannot be null.")); + } + if (entityQuery == null) { + return Mono.error(new IllegalArgumentException("Parameter entityQuery is required and cannot be null.")); + } else { + entityQuery.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + entityQueryId, + entityQuery, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @param entityQuery The entity query we want to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific entity query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String entityQueryId, + CustomEntityQuery entityQuery, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (entityQueryId == null) { + return Mono.error(new IllegalArgumentException("Parameter entityQueryId is required and cannot be null.")); + } + if (entityQuery == null) { + return Mono.error(new IllegalArgumentException("Parameter entityQuery is required and cannot be null.")); + } else { + entityQuery.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + entityQueryId, + entityQuery, + accept, + context); + } + + /** + * Creates or updates the entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @param entityQuery The entity query we want to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific entity query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, String entityQueryId, CustomEntityQuery entityQuery) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, entityQueryId, entityQuery) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @param entityQuery The entity query we want to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific entity query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EntityQueryInner createOrUpdate( + String resourceGroupName, String workspaceName, String entityQueryId, CustomEntityQuery entityQuery) { + return createOrUpdateAsync(resourceGroupName, workspaceName, entityQueryId, entityQuery).block(); + } + + /** + * Creates or updates the entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @param entityQuery The entity query we want to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific entity query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String entityQueryId, + CustomEntityQuery entityQuery, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, entityQueryId, entityQuery, context) + .block(); + } + + /** + * Delete the entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String entityQueryId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (entityQueryId == null) { + return Mono.error(new IllegalArgumentException("Parameter entityQueryId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + entityQueryId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String entityQueryId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (entityQueryId == null) { + return Mono.error(new IllegalArgumentException("Parameter entityQueryId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + entityQueryId, + accept, + context); + } + + /** + * Delete the entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String entityQueryId) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, entityQueryId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete the entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String entityQueryId) { + deleteAsync(resourceGroupName, workspaceName, entityQueryId).block(); + } + + /** + * Delete the entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String entityQueryId, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, entityQueryId, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the entity queries. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the entity queries. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueriesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueriesImpl.java new file mode 100644 index 000000000000..0ad79e60a736 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueriesImpl.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.EntityQueriesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryInner; +import com.azure.resourcemanager.securityinsights.models.CustomEntityQuery; +import com.azure.resourcemanager.securityinsights.models.EntityQueries; +import com.azure.resourcemanager.securityinsights.models.EntityQueriesKind; +import com.azure.resourcemanager.securityinsights.models.EntityQuery; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class EntityQueriesImpl implements EntityQueries { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityQueriesImpl.class); + + private final EntityQueriesClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public EntityQueriesImpl( + EntityQueriesClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new EntityQueryImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, EntityQueriesKind kind, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, kind, context); + return Utils.mapPage(inner, inner1 -> new EntityQueryImpl(inner1, this.manager())); + } + + public EntityQuery get(String resourceGroupName, String workspaceName, String entityQueryId) { + EntityQueryInner inner = this.serviceClient().get(resourceGroupName, workspaceName, entityQueryId); + if (inner != null) { + return new EntityQueryImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String entityQueryId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, entityQueryId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EntityQueryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EntityQuery createOrUpdate( + String resourceGroupName, String workspaceName, String entityQueryId, CustomEntityQuery entityQuery) { + EntityQueryInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, entityQueryId, entityQuery); + if (inner != null) { + return new EntityQueryImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String entityQueryId, + CustomEntityQuery entityQuery, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, entityQueryId, entityQuery, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EntityQueryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String entityQueryId) { + this.serviceClient().delete(resourceGroupName, workspaceName, entityQueryId); + } + + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String entityQueryId, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, entityQueryId, context); + } + + private EntityQueriesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryImpl.java new file mode 100644 index 000000000000..aed9918b1c34 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryInner; +import com.azure.resourcemanager.securityinsights.models.EntityQuery; + +public final class EntityQueryImpl implements EntityQuery { + private EntityQueryInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + EntityQueryImpl( + EntityQueryInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public EntityQueryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryTemplateImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryTemplateImpl.java new file mode 100644 index 000000000000..36db8654b8da --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryTemplateImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryTemplateInner; +import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplate; + +public final class EntityQueryTemplateImpl implements EntityQueryTemplate { + private EntityQueryTemplateInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + EntityQueryTemplateImpl( + EntityQueryTemplateInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public EntityQueryTemplateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryTemplatesClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryTemplatesClientImpl.java new file mode 100644 index 000000000000..2675d29e570d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryTemplatesClientImpl.java @@ -0,0 +1,550 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.EntityQueryTemplatesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryTemplateInner; +import com.azure.resourcemanager.securityinsights.models.Constant69; +import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplateList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in EntityQueryTemplatesClient. */ +public final class EntityQueryTemplatesClientImpl implements EntityQueryTemplatesClient { + private final ClientLogger logger = new ClientLogger(EntityQueryTemplatesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final EntityQueryTemplatesService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of EntityQueryTemplatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EntityQueryTemplatesClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy + .create(EntityQueryTemplatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsEntityQueryTemplates to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsEnti") + private interface EntityQueryTemplatesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueryTemplates") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("kind") Constant69 kind, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueryTemplates" + + "/{entityQueryTemplateId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("entityQueryTemplateId") String entityQueryTemplateId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all entity query templates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kind The entity template query kind we want to fetch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entity query templates. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, Constant69 kind) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + kind, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all entity query templates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kind The entity template query kind we want to fetch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entity query templates. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, Constant69 kind, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + kind, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all entity query templates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kind The entity template query kind we want to fetch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entity query templates. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, Constant69 kind) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, kind), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all entity query templates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entity query templates. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + final Constant69 kind = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, kind), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all entity query templates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kind The entity template query kind we want to fetch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entity query templates. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, Constant69 kind, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, kind, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all entity query templates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entity query templates. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + final Constant69 kind = null; + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, kind)); + } + + /** + * Gets all entity query templates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kind The entity template query kind we want to fetch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entity query templates. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, Constant69 kind, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, kind, context)); + } + + /** + * Gets an entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryTemplateId entity query template ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String entityQueryTemplateId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (entityQueryTemplateId == null) { + return Mono + .error(new IllegalArgumentException("Parameter entityQueryTemplateId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + entityQueryTemplateId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryTemplateId entity query template ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String entityQueryTemplateId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (entityQueryTemplateId == null) { + return Mono + .error(new IllegalArgumentException("Parameter entityQueryTemplateId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + entityQueryTemplateId, + accept, + context); + } + + /** + * Gets an entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryTemplateId entity query template ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String entityQueryTemplateId) { + return getWithResponseAsync(resourceGroupName, workspaceName, entityQueryTemplateId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryTemplateId entity query template ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EntityQueryTemplateInner get(String resourceGroupName, String workspaceName, String entityQueryTemplateId) { + return getAsync(resourceGroupName, workspaceName, entityQueryTemplateId).block(); + } + + /** + * Gets an entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryTemplateId entity query template ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String entityQueryTemplateId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, entityQueryTemplateId, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the entity query templates. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the entity query templates. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryTemplatesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryTemplatesImpl.java new file mode 100644 index 000000000000..46d6508ef715 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryTemplatesImpl.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.EntityQueryTemplatesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryTemplateInner; +import com.azure.resourcemanager.securityinsights.models.Constant69; +import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplate; +import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplates; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class EntityQueryTemplatesImpl implements EntityQueryTemplates { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityQueryTemplatesImpl.class); + + private final EntityQueryTemplatesClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public EntityQueryTemplatesImpl( + EntityQueryTemplatesClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new EntityQueryTemplateImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, Constant69 kind, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, kind, context); + return Utils.mapPage(inner, inner1 -> new EntityQueryTemplateImpl(inner1, this.manager())); + } + + public EntityQueryTemplate get(String resourceGroupName, String workspaceName, String entityQueryTemplateId) { + EntityQueryTemplateInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, entityQueryTemplateId); + if (inner != null) { + return new EntityQueryTemplateImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String entityQueryTemplateId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, entityQueryTemplateId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EntityQueryTemplateImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private EntityQueryTemplatesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityRelationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityRelationsClientImpl.java new file mode 100644 index 000000000000..af39dc5389c0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityRelationsClientImpl.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.EntityRelationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in EntityRelationsClient. */ +public final class EntityRelationsClientImpl implements EntityRelationsClient { + private final ClientLogger logger = new ClientLogger(EntityRelationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final EntityRelationsService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of EntityRelationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EntityRelationsClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy.create(EntityRelationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsEntityRelations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsEnti") + private interface EntityRelationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/relations" + + "/{relationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getRelation( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("entityId") String entityId, + @PathParam("relationName") String relationName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets an entity relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity relation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getRelationWithResponseAsync( + String resourceGroupName, String workspaceName, String entityId, String relationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (entityId == null) { + return Mono.error(new IllegalArgumentException("Parameter entityId is required and cannot be null.")); + } + if (relationName == null) { + return Mono.error(new IllegalArgumentException("Parameter relationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getRelation( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + entityId, + relationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an entity relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param relationName Relation Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity relation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getRelationWithResponseAsync( + String resourceGroupName, String workspaceName, String entityId, String relationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (entityId == null) { + return Mono.error(new IllegalArgumentException("Parameter entityId is required and cannot be null.")); + } + if (relationName == null) { + return Mono.error(new IllegalArgumentException("Parameter relationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getRelation( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + entityId, + relationName, + accept, + context); + } + + /** + * Gets an entity relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity relation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getRelationAsync( + String resourceGroupName, String workspaceName, String entityId, String relationName) { + return getRelationWithResponseAsync(resourceGroupName, workspaceName, entityId, relationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an entity relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity relation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RelationInner getRelation( + String resourceGroupName, String workspaceName, String entityId, String relationName) { + return getRelationAsync(resourceGroupName, workspaceName, entityId, relationName).block(); + } + + /** + * Gets an entity relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param relationName Relation Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity relation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getRelationWithResponse( + String resourceGroupName, String workspaceName, String entityId, String relationName, Context context) { + return getRelationWithResponseAsync(resourceGroupName, workspaceName, entityId, relationName, context).block(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityRelationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityRelationsImpl.java new file mode 100644 index 000000000000..29a66914ca6f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityRelationsImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.EntityRelationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; +import com.azure.resourcemanager.securityinsights.models.EntityRelations; +import com.azure.resourcemanager.securityinsights.models.Relation; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class EntityRelationsImpl implements EntityRelations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityRelationsImpl.class); + + private final EntityRelationsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public EntityRelationsImpl( + EntityRelationsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Relation getRelation(String resourceGroupName, String workspaceName, String entityId, String relationName) { + RelationInner inner = + this.serviceClient().getRelation(resourceGroupName, workspaceName, entityId, relationName); + if (inner != null) { + return new RelationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getRelationWithResponse( + String resourceGroupName, String workspaceName, String entityId, String relationName, Context context) { + Response inner = + this + .serviceClient() + .getRelationWithResponse(resourceGroupName, workspaceName, entityId, relationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RelationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private EntityRelationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityTimelineResponseImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityTimelineResponseImpl.java new file mode 100644 index 000000000000..a6c772737410 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityTimelineResponseImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.EntityTimelineResponseInner; +import com.azure.resourcemanager.securityinsights.models.EntityTimelineItem; +import com.azure.resourcemanager.securityinsights.models.EntityTimelineResponse; +import com.azure.resourcemanager.securityinsights.models.TimelineResultsMetadata; +import java.util.Collections; +import java.util.List; + +public final class EntityTimelineResponseImpl implements EntityTimelineResponse { + private EntityTimelineResponseInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + EntityTimelineResponseImpl( + EntityTimelineResponseInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public TimelineResultsMetadata metadata() { + return this.innerModel().metadata(); + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public EntityTimelineResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetQueriesResponseImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetQueriesResponseImpl.java new file mode 100644 index 000000000000..b1fdfd6e3742 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetQueriesResponseImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.GetQueriesResponseInner; +import com.azure.resourcemanager.securityinsights.models.EntityQueryItem; +import com.azure.resourcemanager.securityinsights.models.GetQueriesResponse; +import java.util.Collections; +import java.util.List; + +public final class GetQueriesResponseImpl implements GetQueriesResponse { + private GetQueriesResponseInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + GetQueriesResponseImpl( + GetQueriesResponseInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public GetQueriesResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentAlertListImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentAlertListImpl.java new file mode 100644 index 000000000000..62a7373bdd1b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentAlertListImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentAlertListInner; +import com.azure.resourcemanager.securityinsights.models.IncidentAlertList; +import com.azure.resourcemanager.securityinsights.models.SecurityAlert; +import java.util.Collections; +import java.util.List; + +public final class IncidentAlertListImpl implements IncidentAlertList { + private IncidentAlertListInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + IncidentAlertListImpl( + IncidentAlertListInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public IncidentAlertListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentBookmarkListImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentBookmarkListImpl.java new file mode 100644 index 000000000000..1b8b558e3983 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentBookmarkListImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentBookmarkListInner; +import com.azure.resourcemanager.securityinsights.models.HuntingBookmark; +import com.azure.resourcemanager.securityinsights.models.IncidentBookmarkList; +import java.util.Collections; +import java.util.List; + +public final class IncidentBookmarkListImpl implements IncidentBookmarkList { + private IncidentBookmarkListInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + IncidentBookmarkListImpl( + IncidentBookmarkListInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public IncidentBookmarkListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentCommentImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentCommentImpl.java new file mode 100644 index 000000000000..52514f3cb273 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentCommentImpl.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentCommentInner; +import com.azure.resourcemanager.securityinsights.models.ClientInfo; +import com.azure.resourcemanager.securityinsights.models.IncidentComment; +import java.time.OffsetDateTime; + +public final class IncidentCommentImpl implements IncidentComment, IncidentComment.Definition, IncidentComment.Update { + private IncidentCommentInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public OffsetDateTime createdTimeUtc() { + return this.innerModel().createdTimeUtc(); + } + + public OffsetDateTime lastModifiedTimeUtc() { + return this.innerModel().lastModifiedTimeUtc(); + } + + public String message() { + return this.innerModel().message(); + } + + public ClientInfo author() { + return this.innerModel().author(); + } + + public IncidentCommentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String incidentId; + + private String incidentCommentId; + + public IncidentCommentImpl withExistingIncident(String resourceGroupName, String workspaceName, String incidentId) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.incidentId = incidentId; + return this; + } + + public IncidentComment create() { + this.innerObject = + serviceManager + .serviceClient() + .getIncidentComments() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, incidentId, incidentCommentId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public IncidentComment create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIncidentComments() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, incidentId, incidentCommentId, this.innerModel(), context) + .getValue(); + return this; + } + + IncidentCommentImpl( + String name, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new IncidentCommentInner(); + this.serviceManager = serviceManager; + this.incidentCommentId = name; + } + + public IncidentCommentImpl update() { + return this; + } + + public IncidentComment apply() { + this.innerObject = + serviceManager + .serviceClient() + .getIncidentComments() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, incidentId, incidentCommentId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public IncidentComment apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIncidentComments() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, incidentId, incidentCommentId, this.innerModel(), context) + .getValue(); + return this; + } + + IncidentCommentImpl( + IncidentCommentInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.incidentId = Utils.getValueFromIdByName(innerObject.id(), "incidents"); + this.incidentCommentId = Utils.getValueFromIdByName(innerObject.id(), "comments"); + } + + public IncidentComment refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getIncidentComments() + .getWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, Context.NONE) + .getValue(); + return this; + } + + public IncidentComment refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIncidentComments() + .getWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, context) + .getValue(); + return this; + } + + public IncidentCommentImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public IncidentCommentImpl withMessage(String message) { + this.innerModel().withMessage(message); + return this; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentCommentsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentCommentsClientImpl.java new file mode 100644 index 000000000000..9aa904c92d78 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentCommentsClientImpl.java @@ -0,0 +1,1092 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.IncidentCommentsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentCommentInner; +import com.azure.resourcemanager.securityinsights.models.IncidentCommentList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in IncidentCommentsClient. */ +public final class IncidentCommentsClientImpl implements IncidentCommentsClient { + private final ClientLogger logger = new ClientLogger(IncidentCommentsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final IncidentCommentsService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of IncidentCommentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IncidentCommentsClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy.create(IncidentCommentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsIncidentComments to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsInci") + private interface IncidentCommentsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, + @QueryParam("$filter") String filter, + @QueryParam("$orderby") String orderby, + @QueryParam("$top") Integer top, + @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments" + + "/{incidentCommentId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, + @PathParam("incidentCommentId") String incidentCommentId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments" + + "/{incidentCommentId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, + @PathParam("incidentCommentId") String incidentCommentId, + @BodyParam("application/json") IncidentCommentInner incidentComment, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments" + + "/{incidentCommentId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, + @PathParam("incidentCommentId") String incidentCommentId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all incident comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident comments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String workspaceName, + String incidentId, + String filter, + String orderby, + Integer top, + String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + filter, + orderby, + top, + skipToken, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all incident comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident comments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String workspaceName, + String incidentId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + filter, + orderby, + top, + skipToken, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all incident comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident comments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String workspaceName, + String incidentId, + String filter, + String orderby, + Integer top, + String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all incident comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident comments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String incidentId) { + final String filter = null; + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all incident comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident comments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String workspaceName, + String incidentId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all incident comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident comments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String incidentId) { + final String filter = null; + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>( + listAsync(resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken)); + } + + /** + * Gets all incident comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident comments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String incidentId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken, context)); + } + + /** + * Gets an incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident comment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + if (incidentCommentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter incidentCommentId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + incidentCommentId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident comment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + if (incidentCommentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter incidentCommentId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + incidentCommentId, + accept, + context); + } + + /** + * Gets an incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident comment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId) { + return getWithResponseAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident comment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IncidentCommentInner get( + String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId) { + return getAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId).block(); + } + + /** + * Gets an incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident comment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId, context).block(); + } + + /** + * Creates or updates the incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @param incidentComment The incident comment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an incident comment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String incidentId, + String incidentCommentId, + IncidentCommentInner incidentComment) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + if (incidentCommentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter incidentCommentId is required and cannot be null.")); + } + if (incidentComment == null) { + return Mono + .error(new IllegalArgumentException("Parameter incidentComment is required and cannot be null.")); + } else { + incidentComment.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + incidentCommentId, + incidentComment, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @param incidentComment The incident comment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an incident comment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String incidentId, + String incidentCommentId, + IncidentCommentInner incidentComment, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + if (incidentCommentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter incidentCommentId is required and cannot be null.")); + } + if (incidentComment == null) { + return Mono + .error(new IllegalArgumentException("Parameter incidentComment is required and cannot be null.")); + } else { + incidentComment.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + incidentCommentId, + incidentComment, + accept, + context); + } + + /** + * Creates or updates the incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @param incidentComment The incident comment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an incident comment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String incidentId, + String incidentCommentId, + IncidentCommentInner incidentComment) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, incidentId, incidentCommentId, incidentComment) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @param incidentComment The incident comment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an incident comment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IncidentCommentInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String incidentId, + String incidentCommentId, + IncidentCommentInner incidentComment) { + return createOrUpdateAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId, incidentComment) + .block(); + } + + /** + * Creates or updates the incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @param incidentComment The incident comment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an incident comment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String incidentId, + String incidentCommentId, + IncidentCommentInner incidentComment, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, incidentId, incidentCommentId, incidentComment, context) + .block(); + } + + /** + * Delete the incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + if (incidentCommentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter incidentCommentId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + incidentCommentId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + if (incidentCommentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter incidentCommentId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + incidentCommentId, + accept, + context); + } + + /** + * Delete the incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete the incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId) { + deleteAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId).block(); + } + + /** + * Delete the incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of incident comments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of incident comments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentCommentsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentCommentsImpl.java new file mode 100644 index 000000000000..8e593dde84e3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentCommentsImpl.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.IncidentCommentsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentCommentInner; +import com.azure.resourcemanager.securityinsights.models.IncidentComment; +import com.azure.resourcemanager.securityinsights.models.IncidentComments; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class IncidentCommentsImpl implements IncidentComments { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IncidentCommentsImpl.class); + + private final IncidentCommentsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public IncidentCommentsImpl( + IncidentCommentsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String incidentId) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, incidentId); + return Utils.mapPage(inner, inner1 -> new IncidentCommentImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String incidentId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + PagedIterable inner = + this + .serviceClient() + .list(resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken, context); + return Utils.mapPage(inner, inner1 -> new IncidentCommentImpl(inner1, this.manager())); + } + + public IncidentComment get( + String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId) { + IncidentCommentInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, incidentId, incidentCommentId); + if (inner != null) { + return new IncidentCommentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IncidentCommentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId) { + this.serviceClient().delete(resourceGroupName, workspaceName, incidentId, incidentCommentId); + } + + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId, Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, context); + } + + public IncidentComment getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String incidentId = Utils.getValueFromIdByName(id, "incidents"); + if (incidentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'incidents'.", id))); + } + String incidentCommentId = Utils.getValueFromIdByName(id, "comments"); + if (incidentCommentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'comments'.", id))); + } + return this + .getWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String incidentId = Utils.getValueFromIdByName(id, "incidents"); + if (incidentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'incidents'.", id))); + } + String incidentCommentId = Utils.getValueFromIdByName(id, "comments"); + if (incidentCommentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'comments'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String incidentId = Utils.getValueFromIdByName(id, "incidents"); + if (incidentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'incidents'.", id))); + } + String incidentCommentId = Utils.getValueFromIdByName(id, "comments"); + if (incidentCommentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'comments'.", id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String incidentId = Utils.getValueFromIdByName(id, "incidents"); + if (incidentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'incidents'.", id))); + } + String incidentCommentId = Utils.getValueFromIdByName(id, "comments"); + if (incidentCommentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'comments'.", id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, context); + } + + private IncidentCommentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public IncidentCommentImpl define(String name) { + return new IncidentCommentImpl(name, this.manager()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentEntitiesResponseImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentEntitiesResponseImpl.java new file mode 100644 index 000000000000..317c6b5ed21f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentEntitiesResponseImpl.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentEntitiesResponseInner; +import com.azure.resourcemanager.securityinsights.models.Entity; +import com.azure.resourcemanager.securityinsights.models.IncidentEntitiesResponse; +import com.azure.resourcemanager.securityinsights.models.IncidentEntitiesResultsMetadata; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class IncidentEntitiesResponseImpl implements IncidentEntitiesResponse { + private IncidentEntitiesResponseInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + IncidentEntitiesResponseImpl( + IncidentEntitiesResponseInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List entities() { + List inner = this.innerModel().entities(); + if (inner != null) { + return Collections + .unmodifiableList( + inner.stream().map(inner1 -> new EntityImpl(inner1, this.manager())).collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List metadata() { + List inner = this.innerModel().metadata(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public IncidentEntitiesResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentImpl.java new file mode 100644 index 000000000000..48cbcdf36bc2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentImpl.java @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentInner; +import com.azure.resourcemanager.securityinsights.fluent.models.TeamInformationInner; +import com.azure.resourcemanager.securityinsights.models.Incident; +import com.azure.resourcemanager.securityinsights.models.IncidentAdditionalData; +import com.azure.resourcemanager.securityinsights.models.IncidentAlertList; +import com.azure.resourcemanager.securityinsights.models.IncidentBookmarkList; +import com.azure.resourcemanager.securityinsights.models.IncidentClassification; +import com.azure.resourcemanager.securityinsights.models.IncidentClassificationReason; +import com.azure.resourcemanager.securityinsights.models.IncidentEntitiesResponse; +import com.azure.resourcemanager.securityinsights.models.IncidentLabel; +import com.azure.resourcemanager.securityinsights.models.IncidentOwnerInfo; +import com.azure.resourcemanager.securityinsights.models.IncidentSeverity; +import com.azure.resourcemanager.securityinsights.models.IncidentStatus; +import com.azure.resourcemanager.securityinsights.models.TeamInformation; +import com.azure.resourcemanager.securityinsights.models.TeamProperties; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class IncidentImpl implements Incident, Incident.Definition, Incident.Update { + private IncidentInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public IncidentAdditionalData additionalData() { + return this.innerModel().additionalData(); + } + + public IncidentClassification classification() { + return this.innerModel().classification(); + } + + public String classificationComment() { + return this.innerModel().classificationComment(); + } + + public IncidentClassificationReason classificationReason() { + return this.innerModel().classificationReason(); + } + + public OffsetDateTime createdTimeUtc() { + return this.innerModel().createdTimeUtc(); + } + + public String description() { + return this.innerModel().description(); + } + + public OffsetDateTime firstActivityTimeUtc() { + return this.innerModel().firstActivityTimeUtc(); + } + + public String incidentUrl() { + return this.innerModel().incidentUrl(); + } + + public Integer incidentNumber() { + return this.innerModel().incidentNumber(); + } + + public List labels() { + List inner = this.innerModel().labels(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String providerName() { + return this.innerModel().providerName(); + } + + public String providerIncidentId() { + return this.innerModel().providerIncidentId(); + } + + public OffsetDateTime lastActivityTimeUtc() { + return this.innerModel().lastActivityTimeUtc(); + } + + public OffsetDateTime lastModifiedTimeUtc() { + return this.innerModel().lastModifiedTimeUtc(); + } + + public IncidentOwnerInfo owner() { + return this.innerModel().owner(); + } + + public List relatedAnalyticRuleIds() { + List inner = this.innerModel().relatedAnalyticRuleIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public IncidentSeverity severity() { + return this.innerModel().severity(); + } + + public IncidentStatus status() { + return this.innerModel().status(); + } + + public TeamInformation teamInformation() { + TeamInformationInner inner = this.innerModel().teamInformation(); + if (inner != null) { + return new TeamInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public String title() { + return this.innerModel().title(); + } + + public IncidentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String incidentId; + + public IncidentImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public Incident create() { + this.innerObject = + serviceManager + .serviceClient() + .getIncidents() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, incidentId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Incident create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIncidents() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, this.innerModel(), context) + .getValue(); + return this; + } + + IncidentImpl(String name, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new IncidentInner(); + this.serviceManager = serviceManager; + this.incidentId = name; + } + + public IncidentImpl update() { + return this; + } + + public Incident apply() { + this.innerObject = + serviceManager + .serviceClient() + .getIncidents() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, incidentId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Incident apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIncidents() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, this.innerModel(), context) + .getValue(); + return this; + } + + IncidentImpl( + IncidentInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.incidentId = Utils.getValueFromIdByName(innerObject.id(), "incidents"); + } + + public Incident refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getIncidents() + .getWithResponse(resourceGroupName, workspaceName, incidentId, Context.NONE) + .getValue(); + return this; + } + + public Incident refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIncidents() + .getWithResponse(resourceGroupName, workspaceName, incidentId, context) + .getValue(); + return this; + } + + public TeamInformation createTeam(TeamProperties teamProperties) { + return serviceManager.incidents().createTeam(resourceGroupName, workspaceName, incidentId, teamProperties); + } + + public Response createTeamWithResponse(TeamProperties teamProperties, Context context) { + return serviceManager + .incidents() + .createTeamWithResponse(resourceGroupName, workspaceName, incidentId, teamProperties, context); + } + + public IncidentAlertList listAlerts() { + return serviceManager.incidents().listAlerts(resourceGroupName, workspaceName, incidentId); + } + + public Response listAlertsWithResponse(Context context) { + return serviceManager.incidents().listAlertsWithResponse(resourceGroupName, workspaceName, incidentId, context); + } + + public IncidentBookmarkList listBookmarks() { + return serviceManager.incidents().listBookmarks(resourceGroupName, workspaceName, incidentId); + } + + public Response listBookmarksWithResponse(Context context) { + return serviceManager + .incidents() + .listBookmarksWithResponse(resourceGroupName, workspaceName, incidentId, context); + } + + public IncidentEntitiesResponse listEntities() { + return serviceManager.incidents().listEntities(resourceGroupName, workspaceName, incidentId); + } + + public Response listEntitiesWithResponse(Context context) { + return serviceManager + .incidents() + .listEntitiesWithResponse(resourceGroupName, workspaceName, incidentId, context); + } + + public IncidentImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public IncidentImpl withClassification(IncidentClassification classification) { + this.innerModel().withClassification(classification); + return this; + } + + public IncidentImpl withClassificationComment(String classificationComment) { + this.innerModel().withClassificationComment(classificationComment); + return this; + } + + public IncidentImpl withClassificationReason(IncidentClassificationReason classificationReason) { + this.innerModel().withClassificationReason(classificationReason); + return this; + } + + public IncidentImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public IncidentImpl withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc) { + this.innerModel().withFirstActivityTimeUtc(firstActivityTimeUtc); + return this; + } + + public IncidentImpl withLabels(List labels) { + this.innerModel().withLabels(labels); + return this; + } + + public IncidentImpl withProviderName(String providerName) { + this.innerModel().withProviderName(providerName); + return this; + } + + public IncidentImpl withProviderIncidentId(String providerIncidentId) { + this.innerModel().withProviderIncidentId(providerIncidentId); + return this; + } + + public IncidentImpl withLastActivityTimeUtc(OffsetDateTime lastActivityTimeUtc) { + this.innerModel().withLastActivityTimeUtc(lastActivityTimeUtc); + return this; + } + + public IncidentImpl withOwner(IncidentOwnerInfo owner) { + this.innerModel().withOwner(owner); + return this; + } + + public IncidentImpl withSeverity(IncidentSeverity severity) { + this.innerModel().withSeverity(severity); + return this; + } + + public IncidentImpl withStatus(IncidentStatus status) { + this.innerModel().withStatus(status); + return this; + } + + public IncidentImpl withTeamInformation(TeamInformationInner teamInformation) { + this.innerModel().withTeamInformation(teamInformation); + return this; + } + + public IncidentImpl withTitle(String title) { + this.innerModel().withTitle(title); + return this; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentPropertiesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentPropertiesImpl.java new file mode 100644 index 000000000000..408f9e893f0f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentPropertiesImpl.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentPropertiesInner; +import com.azure.resourcemanager.securityinsights.fluent.models.TeamInformationInner; +import com.azure.resourcemanager.securityinsights.models.IncidentAdditionalData; +import com.azure.resourcemanager.securityinsights.models.IncidentClassification; +import com.azure.resourcemanager.securityinsights.models.IncidentClassificationReason; +import com.azure.resourcemanager.securityinsights.models.IncidentLabel; +import com.azure.resourcemanager.securityinsights.models.IncidentOwnerInfo; +import com.azure.resourcemanager.securityinsights.models.IncidentProperties; +import com.azure.resourcemanager.securityinsights.models.IncidentSeverity; +import com.azure.resourcemanager.securityinsights.models.IncidentStatus; +import com.azure.resourcemanager.securityinsights.models.TeamInformation; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class IncidentPropertiesImpl implements IncidentProperties { + private IncidentPropertiesInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + IncidentPropertiesImpl( + IncidentPropertiesInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public IncidentAdditionalData additionalData() { + return this.innerModel().additionalData(); + } + + public IncidentClassification classification() { + return this.innerModel().classification(); + } + + public String classificationComment() { + return this.innerModel().classificationComment(); + } + + public IncidentClassificationReason classificationReason() { + return this.innerModel().classificationReason(); + } + + public OffsetDateTime createdTimeUtc() { + return this.innerModel().createdTimeUtc(); + } + + public String description() { + return this.innerModel().description(); + } + + public OffsetDateTime firstActivityTimeUtc() { + return this.innerModel().firstActivityTimeUtc(); + } + + public String incidentUrl() { + return this.innerModel().incidentUrl(); + } + + public Integer incidentNumber() { + return this.innerModel().incidentNumber(); + } + + public List labels() { + List inner = this.innerModel().labels(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String providerName() { + return this.innerModel().providerName(); + } + + public String providerIncidentId() { + return this.innerModel().providerIncidentId(); + } + + public OffsetDateTime lastActivityTimeUtc() { + return this.innerModel().lastActivityTimeUtc(); + } + + public OffsetDateTime lastModifiedTimeUtc() { + return this.innerModel().lastModifiedTimeUtc(); + } + + public IncidentOwnerInfo owner() { + return this.innerModel().owner(); + } + + public List relatedAnalyticRuleIds() { + List inner = this.innerModel().relatedAnalyticRuleIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public IncidentSeverity severity() { + return this.innerModel().severity(); + } + + public IncidentStatus status() { + return this.innerModel().status(); + } + + public TeamInformation teamInformation() { + TeamInformationInner inner = this.innerModel().teamInformation(); + if (inner != null) { + return new TeamInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public String title() { + return this.innerModel().title(); + } + + public IncidentPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentRelationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentRelationsClientImpl.java new file mode 100644 index 000000000000..e3104c59b90b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentRelationsClientImpl.java @@ -0,0 +1,1079 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.IncidentRelationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; +import com.azure.resourcemanager.securityinsights.models.RelationList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in IncidentRelationsClient. */ +public final class IncidentRelationsClientImpl implements IncidentRelationsClient { + private final ClientLogger logger = new ClientLogger(IncidentRelationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final IncidentRelationsService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of IncidentRelationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IncidentRelationsClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy.create(IncidentRelationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsIncidentRelations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsInci") + private interface IncidentRelationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, + @QueryParam("$filter") String filter, + @QueryParam("$orderby") String orderby, + @QueryParam("$top") Integer top, + @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations" + + "/{relationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, + @PathParam("relationName") String relationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations" + + "/{relationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, + @PathParam("relationName") String relationName, + @BodyParam("application/json") RelationInner relation, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations" + + "/{relationName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, + @PathParam("relationName") String relationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all incident relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident relations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String workspaceName, + String incidentId, + String filter, + String orderby, + Integer top, + String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + filter, + orderby, + top, + skipToken, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all incident relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident relations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String workspaceName, + String incidentId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + filter, + orderby, + top, + skipToken, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all incident relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident relations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String workspaceName, + String incidentId, + String filter, + String orderby, + Integer top, + String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all incident relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident relations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String incidentId) { + final String filter = null; + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all incident relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident relations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String workspaceName, + String incidentId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all incident relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident relations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String incidentId) { + final String filter = null; + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>( + listAsync(resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken)); + } + + /** + * Gets all incident relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident relations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String incidentId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken, context)); + } + + /** + * Gets an incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident relation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String incidentId, String relationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + if (relationName == null) { + return Mono.error(new IllegalArgumentException("Parameter relationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + relationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident relation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String incidentId, String relationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + if (relationName == null) { + return Mono.error(new IllegalArgumentException("Parameter relationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + relationName, + accept, + context); + } + + /** + * Gets an incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident relation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String incidentId, String relationName) { + return getWithResponseAsync(resourceGroupName, workspaceName, incidentId, relationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident relation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RelationInner get(String resourceGroupName, String workspaceName, String incidentId, String relationName) { + return getAsync(resourceGroupName, workspaceName, incidentId, relationName).block(); + } + + /** + * Gets an incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident relation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String incidentId, String relationName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, incidentId, relationName, context).block(); + } + + /** + * Creates or updates the incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @param relation The relation model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a relation between two resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String incidentId, + String relationName, + RelationInner relation) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + if (relationName == null) { + return Mono.error(new IllegalArgumentException("Parameter relationName is required and cannot be null.")); + } + if (relation == null) { + return Mono.error(new IllegalArgumentException("Parameter relation is required and cannot be null.")); + } else { + relation.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + relationName, + relation, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @param relation The relation model. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a relation between two resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String incidentId, + String relationName, + RelationInner relation, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + if (relationName == null) { + return Mono.error(new IllegalArgumentException("Parameter relationName is required and cannot be null.")); + } + if (relation == null) { + return Mono.error(new IllegalArgumentException("Parameter relation is required and cannot be null.")); + } else { + relation.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + relationName, + relation, + accept, + context); + } + + /** + * Creates or updates the incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @param relation The relation model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a relation between two resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String incidentId, + String relationName, + RelationInner relation) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, incidentId, relationName, relation) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @param relation The relation model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a relation between two resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RelationInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String incidentId, + String relationName, + RelationInner relation) { + return createOrUpdateAsync(resourceGroupName, workspaceName, incidentId, relationName, relation).block(); + } + + /** + * Creates or updates the incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @param relation The relation model. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a relation between two resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String incidentId, + String relationName, + RelationInner relation, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, incidentId, relationName, relation, context) + .block(); + } + + /** + * Delete the incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String incidentId, String relationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + if (relationName == null) { + return Mono.error(new IllegalArgumentException("Parameter relationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + relationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String incidentId, String relationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + if (relationName == null) { + return Mono.error(new IllegalArgumentException("Parameter relationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + relationName, + accept, + context); + } + + /** + * Delete the incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String workspaceName, String incidentId, String relationName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, incidentId, relationName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete the incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String incidentId, String relationName) { + deleteAsync(resourceGroupName, workspaceName, incidentId, relationName).block(); + } + + /** + * Delete the incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String incidentId, String relationName, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, incidentId, relationName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of relations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of relations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentRelationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentRelationsImpl.java new file mode 100644 index 000000000000..2544c3c5fa44 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentRelationsImpl.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.IncidentRelationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; +import com.azure.resourcemanager.securityinsights.models.IncidentRelations; +import com.azure.resourcemanager.securityinsights.models.Relation; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class IncidentRelationsImpl implements IncidentRelations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IncidentRelationsImpl.class); + + private final IncidentRelationsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public IncidentRelationsImpl( + IncidentRelationsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String incidentId) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, incidentId); + return Utils.mapPage(inner, inner1 -> new RelationImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String incidentId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + PagedIterable inner = + this + .serviceClient() + .list(resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken, context); + return Utils.mapPage(inner, inner1 -> new RelationImpl(inner1, this.manager())); + } + + public Relation get(String resourceGroupName, String workspaceName, String incidentId, String relationName) { + RelationInner inner = this.serviceClient().get(resourceGroupName, workspaceName, incidentId, relationName); + if (inner != null) { + return new RelationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String incidentId, String relationName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, incidentId, relationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RelationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Relation createOrUpdate( + String resourceGroupName, + String workspaceName, + String incidentId, + String relationName, + RelationInner relation) { + RelationInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, incidentId, relationName, relation); + if (inner != null) { + return new RelationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String incidentId, + String relationName, + RelationInner relation, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, incidentId, relationName, relation, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RelationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String incidentId, String relationName) { + this.serviceClient().delete(resourceGroupName, workspaceName, incidentId, relationName); + } + + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String incidentId, String relationName, Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, incidentId, relationName, context); + } + + private IncidentRelationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentsClientImpl.java new file mode 100644 index 000000000000..708d1adc9413 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentsClientImpl.java @@ -0,0 +1,1725 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.IncidentsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentAlertListInner; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentBookmarkListInner; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentEntitiesResponseInner; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentInner; +import com.azure.resourcemanager.securityinsights.fluent.models.TeamInformationInner; +import com.azure.resourcemanager.securityinsights.models.IncidentList; +import com.azure.resourcemanager.securityinsights.models.TeamProperties; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in IncidentsClient. */ +public final class IncidentsClientImpl implements IncidentsClient { + private final ClientLogger logger = new ClientLogger(IncidentsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final IncidentsService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of IncidentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IncidentsClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy.create(IncidentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsIncidents to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsInci") + private interface IncidentsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @QueryParam("$filter") String filter, + @QueryParam("$orderby") String orderby, + @QueryParam("$top") Integer top, + @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, + @BodyParam("application/json") IncidentInner incident, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/createTeam") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createTeam( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, + @BodyParam("application/json") TeamProperties teamProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/alerts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAlerts( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/bookmarks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBookmarks( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/entities") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listEntities( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all incidents. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incidents. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String filter, String orderby, Integer top, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + filter, + orderby, + top, + skipToken, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all incidents. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incidents. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String workspaceName, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + filter, + orderby, + top, + skipToken, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all incidents. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incidents. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String filter, String orderby, Integer top, String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all incidents. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incidents. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + final String filter = null; + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all incidents. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incidents. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String workspaceName, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all incidents. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incidents. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + final String filter = null; + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken)); + } + + /** + * Gets all incidents. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incidents. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken, context)); + } + + /** + * Gets an incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String incidentId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String incidentId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + accept, + context); + } + + /** + * Gets an incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String incidentId) { + return getWithResponseAsync(resourceGroupName, workspaceName, incidentId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IncidentInner get(String resourceGroupName, String workspaceName, String incidentId) { + return getAsync(resourceGroupName, workspaceName, incidentId).block(); + } + + /** + * Gets an incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String incidentId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, incidentId, context).block(); + } + + /** + * Creates or updates the incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incident The incident. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an incident in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String incidentId, IncidentInner incident) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + if (incident == null) { + return Mono.error(new IllegalArgumentException("Parameter incident is required and cannot be null.")); + } else { + incident.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + incident, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incident The incident. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an incident in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String incidentId, IncidentInner incident, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + if (incident == null) { + return Mono.error(new IllegalArgumentException("Parameter incident is required and cannot be null.")); + } else { + incident.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + incident, + accept, + context); + } + + /** + * Creates or updates the incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incident The incident. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an incident in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, String incidentId, IncidentInner incident) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, incidentId, incident) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incident The incident. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an incident in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IncidentInner createOrUpdate( + String resourceGroupName, String workspaceName, String incidentId, IncidentInner incident) { + return createOrUpdateAsync(resourceGroupName, workspaceName, incidentId, incident).block(); + } + + /** + * Creates or updates the incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incident The incident. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an incident in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String workspaceName, String incidentId, IncidentInner incident, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, incidentId, incident, context).block(); + } + + /** + * Delete the incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String incidentId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String incidentId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + accept, + context); + } + + /** + * Delete the incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String incidentId) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, incidentId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete the incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String incidentId) { + deleteAsync(resourceGroupName, workspaceName, incidentId).block(); + } + + /** + * Delete the incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String incidentId, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, incidentId, context).block(); + } + + /** + * Creates a Microsoft team to investigate the incident by sharing information and insights between participants. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param teamProperties Team properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes team information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createTeamWithResponseAsync( + String resourceGroupName, String workspaceName, String incidentId, TeamProperties teamProperties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + if (teamProperties == null) { + return Mono.error(new IllegalArgumentException("Parameter teamProperties is required and cannot be null.")); + } else { + teamProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createTeam( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + teamProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a Microsoft team to investigate the incident by sharing information and insights between participants. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param teamProperties Team properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes team information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createTeamWithResponseAsync( + String resourceGroupName, + String workspaceName, + String incidentId, + TeamProperties teamProperties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + if (teamProperties == null) { + return Mono.error(new IllegalArgumentException("Parameter teamProperties is required and cannot be null.")); + } else { + teamProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createTeam( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + teamProperties, + accept, + context); + } + + /** + * Creates a Microsoft team to investigate the incident by sharing information and insights between participants. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param teamProperties Team properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes team information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createTeamAsync( + String resourceGroupName, String workspaceName, String incidentId, TeamProperties teamProperties) { + return createTeamWithResponseAsync(resourceGroupName, workspaceName, incidentId, teamProperties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates a Microsoft team to investigate the incident by sharing information and insights between participants. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param teamProperties Team properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes team information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TeamInformationInner createTeam( + String resourceGroupName, String workspaceName, String incidentId, TeamProperties teamProperties) { + return createTeamAsync(resourceGroupName, workspaceName, incidentId, teamProperties).block(); + } + + /** + * Creates a Microsoft team to investigate the incident by sharing information and insights between participants. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param teamProperties Team properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes team information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createTeamWithResponse( + String resourceGroupName, + String workspaceName, + String incidentId, + TeamProperties teamProperties, + Context context) { + return createTeamWithResponseAsync(resourceGroupName, workspaceName, incidentId, teamProperties, context) + .block(); + } + + /** + * Gets all incident alerts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident alerts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAlertsWithResponseAsync( + String resourceGroupName, String workspaceName, String incidentId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAlerts( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all incident alerts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident alerts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAlertsWithResponseAsync( + String resourceGroupName, String workspaceName, String incidentId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAlerts( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + accept, + context); + } + + /** + * Gets all incident alerts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident alerts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAlertsAsync( + String resourceGroupName, String workspaceName, String incidentId) { + return listAlertsWithResponseAsync(resourceGroupName, workspaceName, incidentId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets all incident alerts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident alerts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IncidentAlertListInner listAlerts(String resourceGroupName, String workspaceName, String incidentId) { + return listAlertsAsync(resourceGroupName, workspaceName, incidentId).block(); + } + + /** + * Gets all incident alerts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident alerts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAlertsWithResponse( + String resourceGroupName, String workspaceName, String incidentId, Context context) { + return listAlertsWithResponseAsync(resourceGroupName, workspaceName, incidentId, context).block(); + } + + /** + * Gets all incident bookmarks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident bookmarks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBookmarksWithResponseAsync( + String resourceGroupName, String workspaceName, String incidentId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listBookmarks( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all incident bookmarks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident bookmarks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBookmarksWithResponseAsync( + String resourceGroupName, String workspaceName, String incidentId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBookmarks( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + accept, + context); + } + + /** + * Gets all incident bookmarks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident bookmarks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listBookmarksAsync( + String resourceGroupName, String workspaceName, String incidentId) { + return listBookmarksWithResponseAsync(resourceGroupName, workspaceName, incidentId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets all incident bookmarks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident bookmarks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IncidentBookmarkListInner listBookmarks(String resourceGroupName, String workspaceName, String incidentId) { + return listBookmarksAsync(resourceGroupName, workspaceName, incidentId).block(); + } + + /** + * Gets all incident bookmarks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident bookmarks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listBookmarksWithResponse( + String resourceGroupName, String workspaceName, String incidentId, Context context) { + return listBookmarksWithResponseAsync(resourceGroupName, workspaceName, incidentId, context).block(); + } + + /** + * Gets all incident related entities. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident related entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listEntitiesWithResponseAsync( + String resourceGroupName, String workspaceName, String incidentId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listEntities( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all incident related entities. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident related entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listEntitiesWithResponseAsync( + String resourceGroupName, String workspaceName, String incidentId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (incidentId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listEntities( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + incidentId, + accept, + context); + } + + /** + * Gets all incident related entities. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident related entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listEntitiesAsync( + String resourceGroupName, String workspaceName, String incidentId) { + return listEntitiesWithResponseAsync(resourceGroupName, workspaceName, incidentId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets all incident related entities. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident related entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IncidentEntitiesResponseInner listEntities( + String resourceGroupName, String workspaceName, String incidentId) { + return listEntitiesAsync(resourceGroupName, workspaceName, incidentId).block(); + } + + /** + * Gets all incident related entities. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident related entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listEntitiesWithResponse( + String resourceGroupName, String workspaceName, String incidentId, Context context) { + return listEntitiesWithResponseAsync(resourceGroupName, workspaceName, incidentId, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the incidents. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the incidents. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentsImpl.java new file mode 100644 index 000000000000..d833acc50419 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentsImpl.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.IncidentsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentAlertListInner; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentBookmarkListInner; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentEntitiesResponseInner; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentInner; +import com.azure.resourcemanager.securityinsights.fluent.models.TeamInformationInner; +import com.azure.resourcemanager.securityinsights.models.Incident; +import com.azure.resourcemanager.securityinsights.models.IncidentAlertList; +import com.azure.resourcemanager.securityinsights.models.IncidentBookmarkList; +import com.azure.resourcemanager.securityinsights.models.IncidentEntitiesResponse; +import com.azure.resourcemanager.securityinsights.models.Incidents; +import com.azure.resourcemanager.securityinsights.models.TeamInformation; +import com.azure.resourcemanager.securityinsights.models.TeamProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class IncidentsImpl implements Incidents { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IncidentsImpl.class); + + private final IncidentsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public IncidentsImpl( + IncidentsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new IncidentImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, filter, orderby, top, skipToken, context); + return Utils.mapPage(inner, inner1 -> new IncidentImpl(inner1, this.manager())); + } + + public Incident get(String resourceGroupName, String workspaceName, String incidentId) { + IncidentInner inner = this.serviceClient().get(resourceGroupName, workspaceName, incidentId); + if (inner != null) { + return new IncidentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String incidentId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, incidentId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IncidentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String incidentId) { + this.serviceClient().delete(resourceGroupName, workspaceName, incidentId); + } + + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String incidentId, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, incidentId, context); + } + + public TeamInformation createTeam( + String resourceGroupName, String workspaceName, String incidentId, TeamProperties teamProperties) { + TeamInformationInner inner = + this.serviceClient().createTeam(resourceGroupName, workspaceName, incidentId, teamProperties); + if (inner != null) { + return new TeamInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createTeamWithResponse( + String resourceGroupName, + String workspaceName, + String incidentId, + TeamProperties teamProperties, + Context context) { + Response inner = + this + .serviceClient() + .createTeamWithResponse(resourceGroupName, workspaceName, incidentId, teamProperties, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TeamInformationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public IncidentAlertList listAlerts(String resourceGroupName, String workspaceName, String incidentId) { + IncidentAlertListInner inner = this.serviceClient().listAlerts(resourceGroupName, workspaceName, incidentId); + if (inner != null) { + return new IncidentAlertListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listAlertsWithResponse( + String resourceGroupName, String workspaceName, String incidentId, Context context) { + Response inner = + this.serviceClient().listAlertsWithResponse(resourceGroupName, workspaceName, incidentId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IncidentAlertListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public IncidentBookmarkList listBookmarks(String resourceGroupName, String workspaceName, String incidentId) { + IncidentBookmarkListInner inner = + this.serviceClient().listBookmarks(resourceGroupName, workspaceName, incidentId); + if (inner != null) { + return new IncidentBookmarkListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listBookmarksWithResponse( + String resourceGroupName, String workspaceName, String incidentId, Context context) { + Response inner = + this.serviceClient().listBookmarksWithResponse(resourceGroupName, workspaceName, incidentId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IncidentBookmarkListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public IncidentEntitiesResponse listEntities(String resourceGroupName, String workspaceName, String incidentId) { + IncidentEntitiesResponseInner inner = + this.serviceClient().listEntities(resourceGroupName, workspaceName, incidentId); + if (inner != null) { + return new IncidentEntitiesResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listEntitiesWithResponse( + String resourceGroupName, String workspaceName, String incidentId, Context context) { + Response inner = + this.serviceClient().listEntitiesWithResponse(resourceGroupName, workspaceName, incidentId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IncidentEntitiesResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Incident getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String incidentId = Utils.getValueFromIdByName(id, "incidents"); + if (incidentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'incidents'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, incidentId, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String incidentId = Utils.getValueFromIdByName(id, "incidents"); + if (incidentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'incidents'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, incidentId, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String incidentId = Utils.getValueFromIdByName(id, "incidents"); + if (incidentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'incidents'.", id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, incidentId, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String incidentId = Utils.getValueFromIdByName(id, "incidents"); + if (incidentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'incidents'.", id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, incidentId, context); + } + + private IncidentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public IncidentImpl define(String name) { + return new IncidentImpl(name, this.manager()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IpGeodatasClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IpGeodatasClientImpl.java new file mode 100644 index 000000000000..961ea732496b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IpGeodatasClientImpl.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.IpGeodatasClient; +import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentIpGeodataInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in IpGeodatasClient. */ +public final class IpGeodatasClientImpl implements IpGeodatasClient { + private final ClientLogger logger = new ClientLogger(IpGeodatasClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final IpGeodatasService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of IpGeodatasClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IpGeodatasClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy.create(IpGeodatasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsIpGeodatas to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsIpGe") + private interface IpGeodatasService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecurityInsights" + + "/enrichment/ip/geodata/") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("ipAddress") String ipAddress, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get geodata for a single IP address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipAddress IP address (v4 or v6) to be enriched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return geodata for a single IP address. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String ipAddress) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ipAddress == null) { + return Mono.error(new IllegalArgumentException("Parameter ipAddress is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + ipAddress, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get geodata for a single IP address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipAddress IP address (v4 or v6) to be enriched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return geodata for a single IP address. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String ipAddress, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ipAddress == null) { + return Mono.error(new IllegalArgumentException("Parameter ipAddress is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + ipAddress, + accept, + context); + } + + /** + * Get geodata for a single IP address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipAddress IP address (v4 or v6) to be enriched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return geodata for a single IP address. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String ipAddress) { + return getWithResponseAsync(resourceGroupName, ipAddress) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get geodata for a single IP address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipAddress IP address (v4 or v6) to be enriched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return geodata for a single IP address. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EnrichmentIpGeodataInner get(String resourceGroupName, String ipAddress) { + return getAsync(resourceGroupName, ipAddress).block(); + } + + /** + * Get geodata for a single IP address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipAddress IP address (v4 or v6) to be enriched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return geodata for a single IP address. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String ipAddress, Context context) { + return getWithResponseAsync(resourceGroupName, ipAddress, context).block(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IpGeodatasImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IpGeodatasImpl.java new file mode 100644 index 000000000000..855e0c8b8b1f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IpGeodatasImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.IpGeodatasClient; +import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentIpGeodataInner; +import com.azure.resourcemanager.securityinsights.models.EnrichmentIpGeodata; +import com.azure.resourcemanager.securityinsights.models.IpGeodatas; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class IpGeodatasImpl implements IpGeodatas { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpGeodatasImpl.class); + + private final IpGeodatasClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public IpGeodatasImpl( + IpGeodatasClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public EnrichmentIpGeodata get(String resourceGroupName, String ipAddress) { + EnrichmentIpGeodataInner inner = this.serviceClient().get(resourceGroupName, ipAddress); + if (inner != null) { + return new EnrichmentIpGeodataImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String resourceGroupName, String ipAddress, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, ipAddress, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EnrichmentIpGeodataImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private IpGeodatasClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/MetadataModelImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/MetadataModelImpl.java new file mode 100644 index 000000000000..d115fb44a497 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/MetadataModelImpl.java @@ -0,0 +1,336 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.MetadataModelInner; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataAuthor; +import com.azure.resourcemanager.securityinsights.models.MetadataCategories; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencies; +import com.azure.resourcemanager.securityinsights.models.MetadataModel; +import com.azure.resourcemanager.securityinsights.models.MetadataPatch; +import com.azure.resourcemanager.securityinsights.models.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +import java.time.LocalDate; +import java.util.Collections; +import java.util.List; + +public final class MetadataModelImpl implements MetadataModel, MetadataModel.Definition, MetadataModel.Update { + private MetadataModelInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String contentId() { + return this.innerModel().contentId(); + } + + public String parentId() { + return this.innerModel().parentId(); + } + + public String version() { + return this.innerModel().version(); + } + + public Kind kind() { + return this.innerModel().kind(); + } + + public MetadataSource source() { + return this.innerModel().source(); + } + + public MetadataAuthor author() { + return this.innerModel().author(); + } + + public MetadataSupport support() { + return this.innerModel().support(); + } + + public MetadataDependencies dependencies() { + return this.innerModel().dependencies(); + } + + public MetadataCategories categories() { + return this.innerModel().categories(); + } + + public List providers() { + List inner = this.innerModel().providers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public LocalDate firstPublishDate() { + return this.innerModel().firstPublishDate(); + } + + public LocalDate lastPublishDate() { + return this.innerModel().lastPublishDate(); + } + + public MetadataModelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String metadataName; + + private MetadataPatch updateMetadataPatch; + + public MetadataModelImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public MetadataModel create() { + this.innerObject = + serviceManager + .serviceClient() + .getMetadatas() + .createWithResponse(resourceGroupName, workspaceName, metadataName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public MetadataModel create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMetadatas() + .createWithResponse(resourceGroupName, workspaceName, metadataName, this.innerModel(), context) + .getValue(); + return this; + } + + MetadataModelImpl(String name, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new MetadataModelInner(); + this.serviceManager = serviceManager; + this.metadataName = name; + } + + public MetadataModelImpl update() { + this.updateMetadataPatch = new MetadataPatch(); + return this; + } + + public MetadataModel apply() { + this.innerObject = + serviceManager + .serviceClient() + .getMetadatas() + .updateWithResponse(resourceGroupName, workspaceName, metadataName, updateMetadataPatch, Context.NONE) + .getValue(); + return this; + } + + public MetadataModel apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMetadatas() + .updateWithResponse(resourceGroupName, workspaceName, metadataName, updateMetadataPatch, context) + .getValue(); + return this; + } + + MetadataModelImpl( + MetadataModelInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.metadataName = Utils.getValueFromIdByName(innerObject.id(), "metadata"); + } + + public MetadataModel refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getMetadatas() + .getWithResponse(resourceGroupName, workspaceName, metadataName, Context.NONE) + .getValue(); + return this; + } + + public MetadataModel refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMetadatas() + .getWithResponse(resourceGroupName, workspaceName, metadataName, context) + .getValue(); + return this; + } + + public MetadataModelImpl withEtag(String etag) { + if (isInCreateMode()) { + this.innerModel().withEtag(etag); + return this; + } else { + this.updateMetadataPatch.withEtag(etag); + return this; + } + } + + public MetadataModelImpl withContentId(String contentId) { + if (isInCreateMode()) { + this.innerModel().withContentId(contentId); + return this; + } else { + this.updateMetadataPatch.withContentId(contentId); + return this; + } + } + + public MetadataModelImpl withParentId(String parentId) { + if (isInCreateMode()) { + this.innerModel().withParentId(parentId); + return this; + } else { + this.updateMetadataPatch.withParentId(parentId); + return this; + } + } + + public MetadataModelImpl withVersion(String version) { + if (isInCreateMode()) { + this.innerModel().withVersion(version); + return this; + } else { + this.updateMetadataPatch.withVersion(version); + return this; + } + } + + public MetadataModelImpl withKind(Kind kind) { + if (isInCreateMode()) { + this.innerModel().withKind(kind); + return this; + } else { + this.updateMetadataPatch.withKind(kind); + return this; + } + } + + public MetadataModelImpl withSource(MetadataSource source) { + if (isInCreateMode()) { + this.innerModel().withSource(source); + return this; + } else { + this.updateMetadataPatch.withSource(source); + return this; + } + } + + public MetadataModelImpl withAuthor(MetadataAuthor author) { + if (isInCreateMode()) { + this.innerModel().withAuthor(author); + return this; + } else { + this.updateMetadataPatch.withAuthor(author); + return this; + } + } + + public MetadataModelImpl withSupport(MetadataSupport support) { + if (isInCreateMode()) { + this.innerModel().withSupport(support); + return this; + } else { + this.updateMetadataPatch.withSupport(support); + return this; + } + } + + public MetadataModelImpl withDependencies(MetadataDependencies dependencies) { + if (isInCreateMode()) { + this.innerModel().withDependencies(dependencies); + return this; + } else { + this.updateMetadataPatch.withDependencies(dependencies); + return this; + } + } + + public MetadataModelImpl withCategories(MetadataCategories categories) { + if (isInCreateMode()) { + this.innerModel().withCategories(categories); + return this; + } else { + this.updateMetadataPatch.withCategories(categories); + return this; + } + } + + public MetadataModelImpl withProviders(List providers) { + if (isInCreateMode()) { + this.innerModel().withProviders(providers); + return this; + } else { + this.updateMetadataPatch.withProviders(providers); + return this; + } + } + + public MetadataModelImpl withFirstPublishDate(LocalDate firstPublishDate) { + if (isInCreateMode()) { + this.innerModel().withFirstPublishDate(firstPublishDate); + return this; + } else { + this.updateMetadataPatch.withFirstPublishDate(firstPublishDate); + return this; + } + } + + public MetadataModelImpl withLastPublishDate(LocalDate lastPublishDate) { + if (isInCreateMode()) { + this.innerModel().withLastPublishDate(lastPublishDate); + return this; + } else { + this.updateMetadataPatch.withLastPublishDate(lastPublishDate); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/MetadatasClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/MetadatasClientImpl.java new file mode 100644 index 000000000000..280069125936 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/MetadatasClientImpl.java @@ -0,0 +1,1184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.MetadatasClient; +import com.azure.resourcemanager.securityinsights.fluent.models.MetadataModelInner; +import com.azure.resourcemanager.securityinsights.models.MetadataList; +import com.azure.resourcemanager.securityinsights.models.MetadataPatch; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in MetadatasClient. */ +public final class MetadatasClientImpl implements MetadatasClient { + private final ClientLogger logger = new ClientLogger(MetadatasClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final MetadatasService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of MetadatasClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MetadatasClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy.create(MetadatasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsMetadatas to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsMeta") + private interface MetadatasService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @QueryParam("$filter") String filter, + @QueryParam("$orderby") String orderby, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("metadataName") String metadataName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("metadataName") String metadataName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("metadataName") String metadataName, + @BodyParam("application/json") MetadataModelInner metadata, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("metadataName") String metadataName, + @BodyParam("application/json") MetadataPatch metadataPatch, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List of all metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skip Used to skip n elements in the OData query (offset). Returns a nextLink to the next page of results + * if there are any left. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the metadata. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String filter, String orderby, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + filter, + orderby, + top, + skip, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List of all metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skip Used to skip n elements in the OData query (offset). Returns a nextLink to the next page of results + * if there are any left. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the metadata. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String workspaceName, + String filter, + String orderby, + Integer top, + Integer skip, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + filter, + orderby, + top, + skip, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List of all metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skip Used to skip n elements in the OData query (offset). Returns a nextLink to the next page of results + * if there are any left. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the metadata. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String filter, String orderby, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, top, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List of all metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the metadata. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + final String filter = null; + final String orderby = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, top, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List of all metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skip Used to skip n elements in the OData query (offset). Returns a nextLink to the next page of results + * if there are any left. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the metadata. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String workspaceName, + String filter, + String orderby, + Integer top, + Integer skip, + Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, top, skip, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List of all metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the metadata. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + final String filter = null; + final String orderby = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, filter, orderby, top, skip)); + } + + /** + * List of all metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skip Used to skip n elements in the OData query (offset). Returns a nextLink to the next page of results + * if there are any left. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the metadata. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String filter, + String orderby, + Integer top, + Integer skip, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, filter, orderby, top, skip, context)); + } + + /** + * Get a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Metadata. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String metadataName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (metadataName == null) { + return Mono.error(new IllegalArgumentException("Parameter metadataName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + metadataName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Metadata. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String metadataName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (metadataName == null) { + return Mono.error(new IllegalArgumentException("Parameter metadataName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + metadataName, + accept, + context); + } + + /** + * Get a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Metadata. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String metadataName) { + return getWithResponseAsync(resourceGroupName, workspaceName, metadataName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Metadata. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MetadataModelInner get(String resourceGroupName, String workspaceName, String metadataName) { + return getAsync(resourceGroupName, workspaceName, metadataName).block(); + } + + /** + * Get a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Metadata. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String metadataName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, metadataName, context).block(); + } + + /** + * Delete a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String metadataName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (metadataName == null) { + return Mono.error(new IllegalArgumentException("Parameter metadataName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + metadataName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String metadataName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (metadataName == null) { + return Mono.error(new IllegalArgumentException("Parameter metadataName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + metadataName, + accept, + context); + } + + /** + * Delete a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String metadataName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, metadataName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String metadataName) { + deleteAsync(resourceGroupName, workspaceName, metadataName).block(); + } + + /** + * Delete a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String metadataName, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, metadataName, context).block(); + } + + /** + * Create a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @param metadata Metadata resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return metadata resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String workspaceName, String metadataName, MetadataModelInner metadata) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (metadataName == null) { + return Mono.error(new IllegalArgumentException("Parameter metadataName is required and cannot be null.")); + } + if (metadata == null) { + return Mono.error(new IllegalArgumentException("Parameter metadata is required and cannot be null.")); + } else { + metadata.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + metadataName, + metadata, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @param metadata Metadata resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return metadata resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String workspaceName, + String metadataName, + MetadataModelInner metadata, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (metadataName == null) { + return Mono.error(new IllegalArgumentException("Parameter metadataName is required and cannot be null.")); + } + if (metadata == null) { + return Mono.error(new IllegalArgumentException("Parameter metadata is required and cannot be null.")); + } else { + metadata.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + metadataName, + metadata, + accept, + context); + } + + /** + * Create a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @param metadata Metadata resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return metadata resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String workspaceName, String metadataName, MetadataModelInner metadata) { + return createWithResponseAsync(resourceGroupName, workspaceName, metadataName, metadata) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @param metadata Metadata resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return metadata resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MetadataModelInner create( + String resourceGroupName, String workspaceName, String metadataName, MetadataModelInner metadata) { + return createAsync(resourceGroupName, workspaceName, metadataName, metadata).block(); + } + + /** + * Create a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @param metadata Metadata resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return metadata resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String workspaceName, + String metadataName, + MetadataModelInner metadata, + Context context) { + return createWithResponseAsync(resourceGroupName, workspaceName, metadataName, metadata, context).block(); + } + + /** + * Update an existing Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @param metadataPatch Partial metadata request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return metadata resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String workspaceName, String metadataName, MetadataPatch metadataPatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (metadataName == null) { + return Mono.error(new IllegalArgumentException("Parameter metadataName is required and cannot be null.")); + } + if (metadataPatch == null) { + return Mono.error(new IllegalArgumentException("Parameter metadataPatch is required and cannot be null.")); + } else { + metadataPatch.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + metadataName, + metadataPatch, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an existing Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @param metadataPatch Partial metadata request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return metadata resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String metadataName, + MetadataPatch metadataPatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (metadataName == null) { + return Mono.error(new IllegalArgumentException("Parameter metadataName is required and cannot be null.")); + } + if (metadataPatch == null) { + return Mono.error(new IllegalArgumentException("Parameter metadataPatch is required and cannot be null.")); + } else { + metadataPatch.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + metadataName, + metadataPatch, + accept, + context); + } + + /** + * Update an existing Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @param metadataPatch Partial metadata request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return metadata resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String workspaceName, String metadataName, MetadataPatch metadataPatch) { + return updateWithResponseAsync(resourceGroupName, workspaceName, metadataName, metadataPatch) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update an existing Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @param metadataPatch Partial metadata request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return metadata resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MetadataModelInner update( + String resourceGroupName, String workspaceName, String metadataName, MetadataPatch metadataPatch) { + return updateAsync(resourceGroupName, workspaceName, metadataName, metadataPatch).block(); + } + + /** + * Update an existing Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @param metadataPatch Partial metadata request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return metadata resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String workspaceName, + String metadataName, + MetadataPatch metadataPatch, + Context context) { + return updateWithResponseAsync(resourceGroupName, workspaceName, metadataName, metadataPatch, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the metadata. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the metadata. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/MetadatasImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/MetadatasImpl.java new file mode 100644 index 000000000000..c9f6d4c53182 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/MetadatasImpl.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.MetadatasClient; +import com.azure.resourcemanager.securityinsights.fluent.models.MetadataModelInner; +import com.azure.resourcemanager.securityinsights.models.MetadataModel; +import com.azure.resourcemanager.securityinsights.models.Metadatas; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class MetadatasImpl implements Metadatas { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetadatasImpl.class); + + private final MetadatasClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public MetadatasImpl( + MetadatasClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new MetadataModelImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String filter, + String orderby, + Integer top, + Integer skip, + Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, filter, orderby, top, skip, context); + return Utils.mapPage(inner, inner1 -> new MetadataModelImpl(inner1, this.manager())); + } + + public MetadataModel get(String resourceGroupName, String workspaceName, String metadataName) { + MetadataModelInner inner = this.serviceClient().get(resourceGroupName, workspaceName, metadataName); + if (inner != null) { + return new MetadataModelImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String metadataName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, metadataName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MetadataModelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String metadataName) { + this.serviceClient().delete(resourceGroupName, workspaceName, metadataName); + } + + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String metadataName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, metadataName, context); + } + + public MetadataModel getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String metadataName = Utils.getValueFromIdByName(id, "metadata"); + if (metadataName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'metadata'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, metadataName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String metadataName = Utils.getValueFromIdByName(id, "metadata"); + if (metadataName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'metadata'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, metadataName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String metadataName = Utils.getValueFromIdByName(id, "metadata"); + if (metadataName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'metadata'.", id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, metadataName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String metadataName = Utils.getValueFromIdByName(id, "metadata"); + if (metadataName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'metadata'.", id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, metadataName, context); + } + + private MetadatasClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public MetadataModelImpl define(String name) { + return new MetadataModelImpl(name, this.manager()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OfficeConsentImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OfficeConsentImpl.java new file mode 100644 index 000000000000..3ea1193ca8e6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OfficeConsentImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficeConsentInner; +import com.azure.resourcemanager.securityinsights.models.OfficeConsent; + +public final class OfficeConsentImpl implements OfficeConsent { + private OfficeConsentInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + OfficeConsentImpl( + OfficeConsentInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String tenantId() { + return this.innerModel().tenantId(); + } + + public String consentId() { + return this.innerModel().consentId(); + } + + public OfficeConsentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OfficeConsentsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OfficeConsentsClientImpl.java new file mode 100644 index 000000000000..95b998475227 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OfficeConsentsClientImpl.java @@ -0,0 +1,684 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.OfficeConsentsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficeConsentInner; +import com.azure.resourcemanager.securityinsights.models.OfficeConsentList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OfficeConsentsClient. */ +public final class OfficeConsentsClientImpl implements OfficeConsentsClient { + private final ClientLogger logger = new ClientLogger(OfficeConsentsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OfficeConsentsService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of OfficeConsentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OfficeConsentsClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy.create(OfficeConsentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsOfficeConsents to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsOffi") + private interface OfficeConsentsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents/{consentId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("consentId") String consentId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents/{consentId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("consentId") String consentId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all office365 consents. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all office365 consents. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all office365 consents. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all office365 consents. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all office365 consents. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all office365 consents. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all office365 consents. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all office365 consents. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all office365 consents. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all office365 consents. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + } + + /** + * Gets all office365 consents. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all office365 consents. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Gets an office365 consent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param consentId consent ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an office365 consent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String consentId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (consentId == null) { + return Mono.error(new IllegalArgumentException("Parameter consentId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + consentId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an office365 consent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param consentId consent ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an office365 consent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String consentId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (consentId == null) { + return Mono.error(new IllegalArgumentException("Parameter consentId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + consentId, + accept, + context); + } + + /** + * Gets an office365 consent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param consentId consent ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an office365 consent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String consentId) { + return getWithResponseAsync(resourceGroupName, workspaceName, consentId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an office365 consent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param consentId consent ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an office365 consent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OfficeConsentInner get(String resourceGroupName, String workspaceName, String consentId) { + return getAsync(resourceGroupName, workspaceName, consentId).block(); + } + + /** + * Gets an office365 consent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param consentId consent ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an office365 consent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String consentId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, consentId, context).block(); + } + + /** + * Delete the office365 consent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param consentId consent ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String consentId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (consentId == null) { + return Mono.error(new IllegalArgumentException("Parameter consentId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + consentId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the office365 consent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param consentId consent ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String consentId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (consentId == null) { + return Mono.error(new IllegalArgumentException("Parameter consentId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + consentId, + accept, + context); + } + + /** + * Delete the office365 consent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param consentId consent ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String consentId) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, consentId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete the office365 consent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param consentId consent ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String consentId) { + deleteAsync(resourceGroupName, workspaceName, consentId).block(); + } + + /** + * Delete the office365 consent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param consentId consent ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String consentId, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, consentId, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the office365 consents. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the office365 consents. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OfficeConsentsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OfficeConsentsImpl.java new file mode 100644 index 000000000000..a01aaf2cbd86 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OfficeConsentsImpl.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.OfficeConsentsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficeConsentInner; +import com.azure.resourcemanager.securityinsights.models.OfficeConsent; +import com.azure.resourcemanager.securityinsights.models.OfficeConsents; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OfficeConsentsImpl implements OfficeConsents { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OfficeConsentsImpl.class); + + private final OfficeConsentsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public OfficeConsentsImpl( + OfficeConsentsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new OfficeConsentImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new OfficeConsentImpl(inner1, this.manager())); + } + + public OfficeConsent get(String resourceGroupName, String workspaceName, String consentId) { + OfficeConsentInner inner = this.serviceClient().get(resourceGroupName, workspaceName, consentId); + if (inner != null) { + return new OfficeConsentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String consentId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, consentId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OfficeConsentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String consentId) { + this.serviceClient().delete(resourceGroupName, workspaceName, consentId); + } + + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String consentId, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, consentId, context); + } + + private OfficeConsentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OperationImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OperationImpl.java new file mode 100644 index 000000000000..ca2867a1bf43 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OperationImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.OperationInner; +import com.azure.resourcemanager.securityinsights.models.Operation; +import com.azure.resourcemanager.securityinsights.models.OperationDisplay; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public String name() { + return this.innerModel().name(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OperationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..bc573498a704 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OperationsClientImpl.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.OperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.OperationInner; +import com.azure.resourcemanager.securityinsights.models.OperationsList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsOperations to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsOper") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.SecurityInsights/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all operations available Azure Security Insights Resource Provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists the operations available in the SecurityInsights RP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all operations available Azure Security Insights Resource Provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists the operations available in the SecurityInsights RP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all operations available Azure Security Insights Resource Provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists the operations available in the SecurityInsights RP. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all operations available Azure Security Insights Resource Provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists the operations available in the SecurityInsights RP. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all operations available Azure Security Insights Resource Provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists the operations available in the SecurityInsights RP. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all operations available Azure Security Insights Resource Provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists the operations available in the SecurityInsights RP. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists the operations available in the SecurityInsights RP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists the operations available in the SecurityInsights RP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OperationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OperationsImpl.java new file mode 100644 index 000000000000..fda7a5628f95 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OperationsImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.OperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.OperationInner; +import com.azure.resourcemanager.securityinsights.models.Operation; +import com.azure.resourcemanager.securityinsights.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductSettingsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductSettingsClientImpl.java new file mode 100644 index 000000000000..ed5ac3014bc8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductSettingsClientImpl.java @@ -0,0 +1,770 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.ProductSettingsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.SettingListInner; +import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ProductSettingsClient. */ +public final class ProductSettingsClientImpl implements ProductSettingsClient { + private final ClientLogger logger = new ClientLogger(ProductSettingsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ProductSettingsService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of ProductSettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProductSettingsClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy.create(ProductSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsProductSettings to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsProd") + private interface ProductSettingsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("settingsName") String settingsName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("settingsName") String settingsName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("settingsName") String settingsName, + @BodyParam("application/json") SettingsInner settings, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List of all the settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List of all the settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context); + } + + /** + * List of all the settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String workspaceName) { + return listWithResponseAsync(resourceGroupName, workspaceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * List of all the settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SettingListInner list(String resourceGroupName, String workspaceName) { + return listAsync(resourceGroupName, workspaceName).block(); + } + + /** + * List of all the settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String workspaceName, Context context) { + return listWithResponseAsync(resourceGroupName, workspaceName, context).block(); + } + + /** + * Gets a setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a setting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String settingsName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (settingsName == null) { + return Mono.error(new IllegalArgumentException("Parameter settingsName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + settingsName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a setting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String settingsName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (settingsName == null) { + return Mono.error(new IllegalArgumentException("Parameter settingsName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + settingsName, + accept, + context); + } + + /** + * Gets a setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a setting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String settingsName) { + return getWithResponseAsync(resourceGroupName, workspaceName, settingsName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a setting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SettingsInner get(String resourceGroupName, String workspaceName, String settingsName) { + return getAsync(resourceGroupName, workspaceName, settingsName).block(); + } + + /** + * Gets a setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a setting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String settingsName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, settingsName, context).block(); + } + + /** + * Delete setting of the product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String settingsName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (settingsName == null) { + return Mono.error(new IllegalArgumentException("Parameter settingsName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + settingsName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete setting of the product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String settingsName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (settingsName == null) { + return Mono.error(new IllegalArgumentException("Parameter settingsName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + settingsName, + accept, + context); + } + + /** + * Delete setting of the product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String settingsName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, settingsName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete setting of the product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String settingsName) { + deleteAsync(resourceGroupName, workspaceName, settingsName).block(); + } + + /** + * Delete setting of the product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String settingsName, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, settingsName, context).block(); + } + + /** + * Updates setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @param settings The setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Setting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String workspaceName, String settingsName, SettingsInner settings) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (settingsName == null) { + return Mono.error(new IllegalArgumentException("Parameter settingsName is required and cannot be null.")); + } + if (settings == null) { + return Mono.error(new IllegalArgumentException("Parameter settings is required and cannot be null.")); + } else { + settings.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + settingsName, + settings, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @param settings The setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Setting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String workspaceName, String settingsName, SettingsInner settings, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (settingsName == null) { + return Mono.error(new IllegalArgumentException("Parameter settingsName is required and cannot be null.")); + } + if (settings == null) { + return Mono.error(new IllegalArgumentException("Parameter settings is required and cannot be null.")); + } else { + settings.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + settingsName, + settings, + accept, + context); + } + + /** + * Updates setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @param settings The setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Setting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String workspaceName, String settingsName, SettingsInner settings) { + return updateWithResponseAsync(resourceGroupName, workspaceName, settingsName, settings) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @param settings The setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Setting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SettingsInner update( + String resourceGroupName, String workspaceName, String settingsName, SettingsInner settings) { + return updateAsync(resourceGroupName, workspaceName, settingsName, settings).block(); + } + + /** + * Updates setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @param settings The setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Setting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String workspaceName, String settingsName, SettingsInner settings, Context context) { + return updateWithResponseAsync(resourceGroupName, workspaceName, settingsName, settings, context).block(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductSettingsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductSettingsImpl.java new file mode 100644 index 000000000000..b511cb7a90f8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductSettingsImpl.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.ProductSettingsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.SettingListInner; +import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; +import com.azure.resourcemanager.securityinsights.models.ProductSettings; +import com.azure.resourcemanager.securityinsights.models.SettingList; +import com.azure.resourcemanager.securityinsights.models.Settings; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ProductSettingsImpl implements ProductSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductSettingsImpl.class); + + private final ProductSettingsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public ProductSettingsImpl( + ProductSettingsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public SettingList list(String resourceGroupName, String workspaceName) { + SettingListInner inner = this.serviceClient().list(resourceGroupName, workspaceName); + if (inner != null) { + return new SettingListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse(String resourceGroupName, String workspaceName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, workspaceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SettingListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Settings get(String resourceGroupName, String workspaceName, String settingsName) { + SettingsInner inner = this.serviceClient().get(resourceGroupName, workspaceName, settingsName); + if (inner != null) { + return new SettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String settingsName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, settingsName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SettingsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String settingsName) { + this.serviceClient().delete(resourceGroupName, workspaceName, settingsName); + } + + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String settingsName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, settingsName, context); + } + + public Settings update( + String resourceGroupName, String workspaceName, String settingsName, SettingsInner settings) { + SettingsInner inner = this.serviceClient().update(resourceGroupName, workspaceName, settingsName, settings); + if (inner != null) { + return new SettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse( + String resourceGroupName, String workspaceName, String settingsName, SettingsInner settings, Context context) { + Response inner = + this.serviceClient().updateWithResponse(resourceGroupName, workspaceName, settingsName, settings, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SettingsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ProductSettingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/RelationImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/RelationImpl.java new file mode 100644 index 000000000000..70cc18b034df --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/RelationImpl.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; +import com.azure.resourcemanager.securityinsights.models.Relation; + +public final class RelationImpl implements Relation, Relation.Definition, Relation.Update { + private RelationInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String relatedResourceId() { + return this.innerModel().relatedResourceId(); + } + + public String relatedResourceName() { + return this.innerModel().relatedResourceName(); + } + + public String relatedResourceType() { + return this.innerModel().relatedResourceType(); + } + + public String relatedResourceKind() { + return this.innerModel().relatedResourceKind(); + } + + public RelationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String bookmarkId; + + private String relationName; + + public RelationImpl withExistingBookmark(String resourceGroupName, String workspaceName, String bookmarkId) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.bookmarkId = bookmarkId; + return this; + } + + public Relation create() { + this.innerObject = + serviceManager + .serviceClient() + .getBookmarkRelations() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, bookmarkId, relationName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Relation create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBookmarkRelations() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, bookmarkId, relationName, this.innerModel(), context) + .getValue(); + return this; + } + + RelationImpl(String name, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new RelationInner(); + this.serviceManager = serviceManager; + this.relationName = name; + } + + public RelationImpl update() { + return this; + } + + public Relation apply() { + this.innerObject = + serviceManager + .serviceClient() + .getBookmarkRelations() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, bookmarkId, relationName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Relation apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBookmarkRelations() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, bookmarkId, relationName, this.innerModel(), context) + .getValue(); + return this; + } + + RelationImpl( + RelationInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.bookmarkId = Utils.getValueFromIdByName(innerObject.id(), "bookmarks"); + this.relationName = Utils.getValueFromIdByName(innerObject.id(), "relations"); + } + + public Relation refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getBookmarkRelations() + .getWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, Context.NONE) + .getValue(); + return this; + } + + public Relation refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBookmarkRelations() + .getWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, context) + .getValue(); + return this; + } + + public RelationImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public RelationImpl withRelatedResourceId(String relatedResourceId) { + this.innerModel().withRelatedResourceId(relatedResourceId); + return this; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/RepoImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/RepoImpl.java new file mode 100644 index 000000000000..fc0358a24f1d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/RepoImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.RepoInner; +import com.azure.resourcemanager.securityinsights.models.Repo; +import java.util.Collections; +import java.util.List; + +public final class RepoImpl implements Repo { + private RepoInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + RepoImpl(RepoInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String url() { + return this.innerModel().url(); + } + + public String fullName() { + return this.innerModel().fullName(); + } + + public List branches() { + List inner = this.innerModel().branches(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public RepoInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityInsightsBuilder.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityInsightsBuilder.java new file mode 100644 index 000000000000..d35970b7c328 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityInsightsBuilder.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the SecurityInsightsImpl type. */ +@ServiceClientBuilder(serviceClients = {SecurityInsightsImpl.class}) +public final class SecurityInsightsBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the SecurityInsightsBuilder. + */ + public SecurityInsightsBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the SecurityInsightsBuilder. + */ + public SecurityInsightsBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the SecurityInsightsBuilder. + */ + public SecurityInsightsBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the SecurityInsightsBuilder. + */ + public SecurityInsightsBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the SecurityInsightsBuilder. + */ + public SecurityInsightsBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the SecurityInsightsBuilder. + */ + public SecurityInsightsBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of SecurityInsightsImpl with the provided parameters. + * + * @return an instance of SecurityInsightsImpl. + */ + public SecurityInsightsImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + SecurityInsightsImpl client = + new SecurityInsightsImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityInsightsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityInsightsImpl.java new file mode 100644 index 000000000000..3c668ed36548 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityInsightsImpl.java @@ -0,0 +1,727 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.securityinsights.fluent.ActionsClient; +import com.azure.resourcemanager.securityinsights.fluent.AlertRuleTemplatesClient; +import com.azure.resourcemanager.securityinsights.fluent.AlertRulesClient; +import com.azure.resourcemanager.securityinsights.fluent.AutomationRulesClient; +import com.azure.resourcemanager.securityinsights.fluent.BookmarkOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.BookmarkRelationsClient; +import com.azure.resourcemanager.securityinsights.fluent.BookmarksClient; +import com.azure.resourcemanager.securityinsights.fluent.DataConnectorsCheckRequirementsOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.DataConnectorsClient; +import com.azure.resourcemanager.securityinsights.fluent.DomainWhoisClient; +import com.azure.resourcemanager.securityinsights.fluent.EntitiesClient; +import com.azure.resourcemanager.securityinsights.fluent.EntitiesGetTimelinesClient; +import com.azure.resourcemanager.securityinsights.fluent.EntitiesRelationsClient; +import com.azure.resourcemanager.securityinsights.fluent.EntityQueriesClient; +import com.azure.resourcemanager.securityinsights.fluent.EntityQueryTemplatesClient; +import com.azure.resourcemanager.securityinsights.fluent.EntityRelationsClient; +import com.azure.resourcemanager.securityinsights.fluent.IncidentCommentsClient; +import com.azure.resourcemanager.securityinsights.fluent.IncidentRelationsClient; +import com.azure.resourcemanager.securityinsights.fluent.IncidentsClient; +import com.azure.resourcemanager.securityinsights.fluent.IpGeodatasClient; +import com.azure.resourcemanager.securityinsights.fluent.MetadatasClient; +import com.azure.resourcemanager.securityinsights.fluent.OfficeConsentsClient; +import com.azure.resourcemanager.securityinsights.fluent.OperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.ProductSettingsClient; +import com.azure.resourcemanager.securityinsights.fluent.SecurityInsights; +import com.azure.resourcemanager.securityinsights.fluent.SentinelOnboardingStatesClient; +import com.azure.resourcemanager.securityinsights.fluent.SourceControlsClient; +import com.azure.resourcemanager.securityinsights.fluent.SourceControlsOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorMetricsClient; +import com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsClient; +import com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.WatchlistItemsClient; +import com.azure.resourcemanager.securityinsights.fluent.WatchlistsClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the SecurityInsightsImpl type. */ +@ServiceClient(builder = SecurityInsightsBuilder.class) +public final class SecurityInsightsImpl implements SecurityInsights { + private final ClientLogger logger = new ClientLogger(SecurityInsightsImpl.class); + + /** The ID of the target subscription. */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The AlertRulesClient object to access its operations. */ + private final AlertRulesClient alertRules; + + /** + * Gets the AlertRulesClient object to access its operations. + * + * @return the AlertRulesClient object. + */ + public AlertRulesClient getAlertRules() { + return this.alertRules; + } + + /** The ActionsClient object to access its operations. */ + private final ActionsClient actions; + + /** + * Gets the ActionsClient object to access its operations. + * + * @return the ActionsClient object. + */ + public ActionsClient getActions() { + return this.actions; + } + + /** The AlertRuleTemplatesClient object to access its operations. */ + private final AlertRuleTemplatesClient alertRuleTemplates; + + /** + * Gets the AlertRuleTemplatesClient object to access its operations. + * + * @return the AlertRuleTemplatesClient object. + */ + public AlertRuleTemplatesClient getAlertRuleTemplates() { + return this.alertRuleTemplates; + } + + /** The AutomationRulesClient object to access its operations. */ + private final AutomationRulesClient automationRules; + + /** + * Gets the AutomationRulesClient object to access its operations. + * + * @return the AutomationRulesClient object. + */ + public AutomationRulesClient getAutomationRules() { + return this.automationRules; + } + + /** The BookmarksClient object to access its operations. */ + private final BookmarksClient bookmarks; + + /** + * Gets the BookmarksClient object to access its operations. + * + * @return the BookmarksClient object. + */ + public BookmarksClient getBookmarks() { + return this.bookmarks; + } + + /** The BookmarkRelationsClient object to access its operations. */ + private final BookmarkRelationsClient bookmarkRelations; + + /** + * Gets the BookmarkRelationsClient object to access its operations. + * + * @return the BookmarkRelationsClient object. + */ + public BookmarkRelationsClient getBookmarkRelations() { + return this.bookmarkRelations; + } + + /** The BookmarkOperationsClient object to access its operations. */ + private final BookmarkOperationsClient bookmarkOperations; + + /** + * Gets the BookmarkOperationsClient object to access its operations. + * + * @return the BookmarkOperationsClient object. + */ + public BookmarkOperationsClient getBookmarkOperations() { + return this.bookmarkOperations; + } + + /** The IpGeodatasClient object to access its operations. */ + private final IpGeodatasClient ipGeodatas; + + /** + * Gets the IpGeodatasClient object to access its operations. + * + * @return the IpGeodatasClient object. + */ + public IpGeodatasClient getIpGeodatas() { + return this.ipGeodatas; + } + + /** The DomainWhoisClient object to access its operations. */ + private final DomainWhoisClient domainWhois; + + /** + * Gets the DomainWhoisClient object to access its operations. + * + * @return the DomainWhoisClient object. + */ + public DomainWhoisClient getDomainWhois() { + return this.domainWhois; + } + + /** The EntityQueriesClient object to access its operations. */ + private final EntityQueriesClient entityQueries; + + /** + * Gets the EntityQueriesClient object to access its operations. + * + * @return the EntityQueriesClient object. + */ + public EntityQueriesClient getEntityQueries() { + return this.entityQueries; + } + + /** The EntitiesClient object to access its operations. */ + private final EntitiesClient entities; + + /** + * Gets the EntitiesClient object to access its operations. + * + * @return the EntitiesClient object. + */ + public EntitiesClient getEntities() { + return this.entities; + } + + /** The EntitiesGetTimelinesClient object to access its operations. */ + private final EntitiesGetTimelinesClient entitiesGetTimelines; + + /** + * Gets the EntitiesGetTimelinesClient object to access its operations. + * + * @return the EntitiesGetTimelinesClient object. + */ + public EntitiesGetTimelinesClient getEntitiesGetTimelines() { + return this.entitiesGetTimelines; + } + + /** The EntitiesRelationsClient object to access its operations. */ + private final EntitiesRelationsClient entitiesRelations; + + /** + * Gets the EntitiesRelationsClient object to access its operations. + * + * @return the EntitiesRelationsClient object. + */ + public EntitiesRelationsClient getEntitiesRelations() { + return this.entitiesRelations; + } + + /** The EntityRelationsClient object to access its operations. */ + private final EntityRelationsClient entityRelations; + + /** + * Gets the EntityRelationsClient object to access its operations. + * + * @return the EntityRelationsClient object. + */ + public EntityRelationsClient getEntityRelations() { + return this.entityRelations; + } + + /** The IncidentsClient object to access its operations. */ + private final IncidentsClient incidents; + + /** + * Gets the IncidentsClient object to access its operations. + * + * @return the IncidentsClient object. + */ + public IncidentsClient getIncidents() { + return this.incidents; + } + + /** The IncidentCommentsClient object to access its operations. */ + private final IncidentCommentsClient incidentComments; + + /** + * Gets the IncidentCommentsClient object to access its operations. + * + * @return the IncidentCommentsClient object. + */ + public IncidentCommentsClient getIncidentComments() { + return this.incidentComments; + } + + /** The IncidentRelationsClient object to access its operations. */ + private final IncidentRelationsClient incidentRelations; + + /** + * Gets the IncidentRelationsClient object to access its operations. + * + * @return the IncidentRelationsClient object. + */ + public IncidentRelationsClient getIncidentRelations() { + return this.incidentRelations; + } + + /** The MetadatasClient object to access its operations. */ + private final MetadatasClient metadatas; + + /** + * Gets the MetadatasClient object to access its operations. + * + * @return the MetadatasClient object. + */ + public MetadatasClient getMetadatas() { + return this.metadatas; + } + + /** The SentinelOnboardingStatesClient object to access its operations. */ + private final SentinelOnboardingStatesClient sentinelOnboardingStates; + + /** + * Gets the SentinelOnboardingStatesClient object to access its operations. + * + * @return the SentinelOnboardingStatesClient object. + */ + public SentinelOnboardingStatesClient getSentinelOnboardingStates() { + return this.sentinelOnboardingStates; + } + + /** The ProductSettingsClient object to access its operations. */ + private final ProductSettingsClient productSettings; + + /** + * Gets the ProductSettingsClient object to access its operations. + * + * @return the ProductSettingsClient object. + */ + public ProductSettingsClient getProductSettings() { + return this.productSettings; + } + + /** The SourceControlsClient object to access its operations. */ + private final SourceControlsClient sourceControls; + + /** + * Gets the SourceControlsClient object to access its operations. + * + * @return the SourceControlsClient object. + */ + public SourceControlsClient getSourceControls() { + return this.sourceControls; + } + + /** The SourceControlsOperationsClient object to access its operations. */ + private final SourceControlsOperationsClient sourceControlsOperations; + + /** + * Gets the SourceControlsOperationsClient object to access its operations. + * + * @return the SourceControlsOperationsClient object. + */ + public SourceControlsOperationsClient getSourceControlsOperations() { + return this.sourceControlsOperations; + } + + /** The WatchlistsClient object to access its operations. */ + private final WatchlistsClient watchlists; + + /** + * Gets the WatchlistsClient object to access its operations. + * + * @return the WatchlistsClient object. + */ + public WatchlistsClient getWatchlists() { + return this.watchlists; + } + + /** The WatchlistItemsClient object to access its operations. */ + private final WatchlistItemsClient watchlistItems; + + /** + * Gets the WatchlistItemsClient object to access its operations. + * + * @return the WatchlistItemsClient object. + */ + public WatchlistItemsClient getWatchlistItems() { + return this.watchlistItems; + } + + /** The DataConnectorsClient object to access its operations. */ + private final DataConnectorsClient dataConnectors; + + /** + * Gets the DataConnectorsClient object to access its operations. + * + * @return the DataConnectorsClient object. + */ + public DataConnectorsClient getDataConnectors() { + return this.dataConnectors; + } + + /** The DataConnectorsCheckRequirementsOperationsClient object to access its operations. */ + private final DataConnectorsCheckRequirementsOperationsClient dataConnectorsCheckRequirementsOperations; + + /** + * Gets the DataConnectorsCheckRequirementsOperationsClient object to access its operations. + * + * @return the DataConnectorsCheckRequirementsOperationsClient object. + */ + public DataConnectorsCheckRequirementsOperationsClient getDataConnectorsCheckRequirementsOperations() { + return this.dataConnectorsCheckRequirementsOperations; + } + + /** The ThreatIntelligenceIndicatorsClient object to access its operations. */ + private final ThreatIntelligenceIndicatorsClient threatIntelligenceIndicators; + + /** + * Gets the ThreatIntelligenceIndicatorsClient object to access its operations. + * + * @return the ThreatIntelligenceIndicatorsClient object. + */ + public ThreatIntelligenceIndicatorsClient getThreatIntelligenceIndicators() { + return this.threatIntelligenceIndicators; + } + + /** The ThreatIntelligenceIndicatorsOperationsClient object to access its operations. */ + private final ThreatIntelligenceIndicatorsOperationsClient threatIntelligenceIndicatorsOperations; + + /** + * Gets the ThreatIntelligenceIndicatorsOperationsClient object to access its operations. + * + * @return the ThreatIntelligenceIndicatorsOperationsClient object. + */ + public ThreatIntelligenceIndicatorsOperationsClient getThreatIntelligenceIndicatorsOperations() { + return this.threatIntelligenceIndicatorsOperations; + } + + /** The ThreatIntelligenceIndicatorMetricsClient object to access its operations. */ + private final ThreatIntelligenceIndicatorMetricsClient threatIntelligenceIndicatorMetrics; + + /** + * Gets the ThreatIntelligenceIndicatorMetricsClient object to access its operations. + * + * @return the ThreatIntelligenceIndicatorMetricsClient object. + */ + public ThreatIntelligenceIndicatorMetricsClient getThreatIntelligenceIndicatorMetrics() { + return this.threatIntelligenceIndicatorMetrics; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The OfficeConsentsClient object to access its operations. */ + private final OfficeConsentsClient officeConsents; + + /** + * Gets the OfficeConsentsClient object to access its operations. + * + * @return the OfficeConsentsClient object. + */ + public OfficeConsentsClient getOfficeConsents() { + return this.officeConsents; + } + + /** The EntityQueryTemplatesClient object to access its operations. */ + private final EntityQueryTemplatesClient entityQueryTemplates; + + /** + * Gets the EntityQueryTemplatesClient object to access its operations. + * + * @return the EntityQueryTemplatesClient object. + */ + public EntityQueryTemplatesClient getEntityQueryTemplates() { + return this.entityQueryTemplates; + } + + /** + * Initializes an instance of SecurityInsights client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. + * @param endpoint server parameter. + */ + SecurityInsightsImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2021-09-01-preview"; + this.alertRules = new AlertRulesClientImpl(this); + this.actions = new ActionsClientImpl(this); + this.alertRuleTemplates = new AlertRuleTemplatesClientImpl(this); + this.automationRules = new AutomationRulesClientImpl(this); + this.bookmarks = new BookmarksClientImpl(this); + this.bookmarkRelations = new BookmarkRelationsClientImpl(this); + this.bookmarkOperations = new BookmarkOperationsClientImpl(this); + this.ipGeodatas = new IpGeodatasClientImpl(this); + this.domainWhois = new DomainWhoisClientImpl(this); + this.entityQueries = new EntityQueriesClientImpl(this); + this.entities = new EntitiesClientImpl(this); + this.entitiesGetTimelines = new EntitiesGetTimelinesClientImpl(this); + this.entitiesRelations = new EntitiesRelationsClientImpl(this); + this.entityRelations = new EntityRelationsClientImpl(this); + this.incidents = new IncidentsClientImpl(this); + this.incidentComments = new IncidentCommentsClientImpl(this); + this.incidentRelations = new IncidentRelationsClientImpl(this); + this.metadatas = new MetadatasClientImpl(this); + this.sentinelOnboardingStates = new SentinelOnboardingStatesClientImpl(this); + this.productSettings = new ProductSettingsClientImpl(this); + this.sourceControls = new SourceControlsClientImpl(this); + this.sourceControlsOperations = new SourceControlsOperationsClientImpl(this); + this.watchlists = new WatchlistsClientImpl(this); + this.watchlistItems = new WatchlistItemsClientImpl(this); + this.dataConnectors = new DataConnectorsClientImpl(this); + this.dataConnectorsCheckRequirementsOperations = new DataConnectorsCheckRequirementsOperationsClientImpl(this); + this.threatIntelligenceIndicators = new ThreatIntelligenceIndicatorsClientImpl(this); + this.threatIntelligenceIndicatorsOperations = new ThreatIntelligenceIndicatorsOperationsClientImpl(this); + this.threatIntelligenceIndicatorMetrics = new ThreatIntelligenceIndicatorMetricsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.officeConsents = new OfficeConsentsClientImpl(this); + this.entityQueryTemplates = new EntityQueryTemplatesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SentinelOnboardingStateImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SentinelOnboardingStateImpl.java new file mode 100644 index 000000000000..ae6794185e73 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SentinelOnboardingStateImpl.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStateInner; +import com.azure.resourcemanager.securityinsights.models.SentinelOnboardingState; + +public final class SentinelOnboardingStateImpl implements SentinelOnboardingState, SentinelOnboardingState.Definition { + private SentinelOnboardingStateInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + SentinelOnboardingStateImpl( + SentinelOnboardingStateInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Boolean customerManagedKey() { + return this.innerModel().customerManagedKey(); + } + + public SentinelOnboardingStateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String sentinelOnboardingStateName; + + public SentinelOnboardingStateImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public SentinelOnboardingState create() { + this.innerObject = + serviceManager + .serviceClient() + .getSentinelOnboardingStates() + .createWithResponse( + resourceGroupName, workspaceName, sentinelOnboardingStateName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SentinelOnboardingState create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSentinelOnboardingStates() + .createWithResponse( + resourceGroupName, workspaceName, sentinelOnboardingStateName, this.innerModel(), context) + .getValue(); + return this; + } + + SentinelOnboardingStateImpl( + String name, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new SentinelOnboardingStateInner(); + this.serviceManager = serviceManager; + this.sentinelOnboardingStateName = name; + } + + public SentinelOnboardingState refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSentinelOnboardingStates() + .getWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, Context.NONE) + .getValue(); + return this; + } + + public SentinelOnboardingState refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSentinelOnboardingStates() + .getWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, context) + .getValue(); + return this; + } + + public SentinelOnboardingStateImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public SentinelOnboardingStateImpl withCustomerManagedKey(Boolean customerManagedKey) { + this.innerModel().withCustomerManagedKey(customerManagedKey); + return this; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SentinelOnboardingStatesClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SentinelOnboardingStatesClientImpl.java new file mode 100644 index 000000000000..aa95101fca29 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SentinelOnboardingStatesClientImpl.java @@ -0,0 +1,841 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.SentinelOnboardingStatesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStateInner; +import com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStatesListInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SentinelOnboardingStatesClient. */ +public final class SentinelOnboardingStatesClientImpl implements SentinelOnboardingStatesClient { + private final ClientLogger logger = new ClientLogger(SentinelOnboardingStatesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SentinelOnboardingStatesService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of SentinelOnboardingStatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SentinelOnboardingStatesClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy + .create(SentinelOnboardingStatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsSentinelOnboardingStates to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsSent") + private interface SentinelOnboardingStatesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates" + + "/{sentinelOnboardingStateName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sentinelOnboardingStateName") String sentinelOnboardingStateName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates" + + "/{sentinelOnboardingStateName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sentinelOnboardingStateName") String sentinelOnboardingStateName, + @BodyParam("application/json") SentinelOnboardingStateInner sentinelOnboardingStateParameter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates" + + "/{sentinelOnboardingStateName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sentinelOnboardingStateName") String sentinelOnboardingStateName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sentinel onboarding state. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sentinelOnboardingStateName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sentinelOnboardingStateName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter sentinelOnboardingStateName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sentinelOnboardingStateName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sentinel onboarding state. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sentinelOnboardingStateName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sentinelOnboardingStateName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter sentinelOnboardingStateName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sentinelOnboardingStateName, + accept, + context); + } + + /** + * Get Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sentinel onboarding state. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String sentinelOnboardingStateName) { + return getWithResponseAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sentinel onboarding state. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SentinelOnboardingStateInner get( + String resourceGroupName, String workspaceName, String sentinelOnboardingStateName) { + return getAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName).block(); + } + + /** + * Get Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sentinel onboarding state. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String sentinelOnboardingStateName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName, context).block(); + } + + /** + * Create Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @param sentinelOnboardingStateParameter The Sentinel onboarding state parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sentinel onboarding state. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sentinelOnboardingStateName, + SentinelOnboardingStateInner sentinelOnboardingStateParameter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sentinelOnboardingStateName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter sentinelOnboardingStateName is required and cannot be null.")); + } + if (sentinelOnboardingStateParameter != null) { + sentinelOnboardingStateParameter.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sentinelOnboardingStateName, + sentinelOnboardingStateParameter, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @param sentinelOnboardingStateParameter The Sentinel onboarding state parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sentinel onboarding state. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sentinelOnboardingStateName, + SentinelOnboardingStateInner sentinelOnboardingStateParameter, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sentinelOnboardingStateName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter sentinelOnboardingStateName is required and cannot be null.")); + } + if (sentinelOnboardingStateParameter != null) { + sentinelOnboardingStateParameter.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sentinelOnboardingStateName, + sentinelOnboardingStateParameter, + accept, + context); + } + + /** + * Create Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @param sentinelOnboardingStateParameter The Sentinel onboarding state parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sentinel onboarding state. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String workspaceName, + String sentinelOnboardingStateName, + SentinelOnboardingStateInner sentinelOnboardingStateParameter) { + return createWithResponseAsync( + resourceGroupName, workspaceName, sentinelOnboardingStateName, sentinelOnboardingStateParameter) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sentinel onboarding state. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String workspaceName, String sentinelOnboardingStateName) { + final SentinelOnboardingStateInner sentinelOnboardingStateParameter = null; + return createWithResponseAsync( + resourceGroupName, workspaceName, sentinelOnboardingStateName, sentinelOnboardingStateParameter) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sentinel onboarding state. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SentinelOnboardingStateInner create( + String resourceGroupName, String workspaceName, String sentinelOnboardingStateName) { + final SentinelOnboardingStateInner sentinelOnboardingStateParameter = null; + return createAsync( + resourceGroupName, workspaceName, sentinelOnboardingStateName, sentinelOnboardingStateParameter) + .block(); + } + + /** + * Create Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @param sentinelOnboardingStateParameter The Sentinel onboarding state parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sentinel onboarding state. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String workspaceName, + String sentinelOnboardingStateName, + SentinelOnboardingStateInner sentinelOnboardingStateParameter, + Context context) { + return createWithResponseAsync( + resourceGroupName, + workspaceName, + sentinelOnboardingStateName, + sentinelOnboardingStateParameter, + context) + .block(); + } + + /** + * Delete Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String sentinelOnboardingStateName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sentinelOnboardingStateName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter sentinelOnboardingStateName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sentinelOnboardingStateName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String sentinelOnboardingStateName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sentinelOnboardingStateName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter sentinelOnboardingStateName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sentinelOnboardingStateName, + accept, + context); + } + + /** + * Delete Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String sentinelOnboardingStateName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String sentinelOnboardingStateName) { + deleteAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName).block(); + } + + /** + * Delete Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String sentinelOnboardingStateName, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName, context).block(); + } + + /** + * Gets all Sentinel onboarding states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Sentinel onboarding states. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all Sentinel onboarding states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Sentinel onboarding states. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context); + } + + /** + * Gets all Sentinel onboarding states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Sentinel onboarding states. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String workspaceName) { + return listWithResponseAsync(resourceGroupName, workspaceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets all Sentinel onboarding states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Sentinel onboarding states. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SentinelOnboardingStatesListInner list(String resourceGroupName, String workspaceName) { + return listAsync(resourceGroupName, workspaceName).block(); + } + + /** + * Gets all Sentinel onboarding states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Sentinel onboarding states. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String workspaceName, Context context) { + return listWithResponseAsync(resourceGroupName, workspaceName, context).block(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SentinelOnboardingStatesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SentinelOnboardingStatesImpl.java new file mode 100644 index 000000000000..c05f55baa4ad --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SentinelOnboardingStatesImpl.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.SentinelOnboardingStatesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStateInner; +import com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStatesListInner; +import com.azure.resourcemanager.securityinsights.models.SentinelOnboardingState; +import com.azure.resourcemanager.securityinsights.models.SentinelOnboardingStates; +import com.azure.resourcemanager.securityinsights.models.SentinelOnboardingStatesList; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SentinelOnboardingStatesImpl implements SentinelOnboardingStates { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SentinelOnboardingStatesImpl.class); + + private final SentinelOnboardingStatesClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public SentinelOnboardingStatesImpl( + SentinelOnboardingStatesClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public SentinelOnboardingState get( + String resourceGroupName, String workspaceName, String sentinelOnboardingStateName) { + SentinelOnboardingStateInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, sentinelOnboardingStateName); + if (inner != null) { + return new SentinelOnboardingStateImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String sentinelOnboardingStateName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SentinelOnboardingStateImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String sentinelOnboardingStateName) { + this.serviceClient().delete(resourceGroupName, workspaceName, sentinelOnboardingStateName); + } + + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String sentinelOnboardingStateName, Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, context); + } + + public SentinelOnboardingStatesList list(String resourceGroupName, String workspaceName) { + SentinelOnboardingStatesListInner inner = this.serviceClient().list(resourceGroupName, workspaceName); + if (inner != null) { + return new SentinelOnboardingStatesListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String workspaceName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, workspaceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SentinelOnboardingStatesListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SentinelOnboardingState getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sentinelOnboardingStateName = Utils.getValueFromIdByName(id, "onboardingStates"); + if (sentinelOnboardingStateName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'onboardingStates'.", id))); + } + return this + .getWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sentinelOnboardingStateName = Utils.getValueFromIdByName(id, "onboardingStates"); + if (sentinelOnboardingStateName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'onboardingStates'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sentinelOnboardingStateName = Utils.getValueFromIdByName(id, "onboardingStates"); + if (sentinelOnboardingStateName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'onboardingStates'.", id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sentinelOnboardingStateName = Utils.getValueFromIdByName(id, "onboardingStates"); + if (sentinelOnboardingStateName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'onboardingStates'.", id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, context); + } + + private SentinelOnboardingStatesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public SentinelOnboardingStateImpl define(String name) { + return new SentinelOnboardingStateImpl(name, this.manager()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SentinelOnboardingStatesListImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SentinelOnboardingStatesListImpl.java new file mode 100644 index 000000000000..203b82f16d59 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SentinelOnboardingStatesListImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStateInner; +import com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStatesListInner; +import com.azure.resourcemanager.securityinsights.models.SentinelOnboardingState; +import com.azure.resourcemanager.securityinsights.models.SentinelOnboardingStatesList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class SentinelOnboardingStatesListImpl implements SentinelOnboardingStatesList { + private SentinelOnboardingStatesListInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + SentinelOnboardingStatesListImpl( + SentinelOnboardingStatesListInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new SentinelOnboardingStateImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public SentinelOnboardingStatesListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SettingListImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SettingListImpl.java new file mode 100644 index 000000000000..d42aef74defe --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SettingListImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.SettingListInner; +import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; +import com.azure.resourcemanager.securityinsights.models.SettingList; +import com.azure.resourcemanager.securityinsights.models.Settings; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class SettingListImpl implements SettingList { + private SettingListInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + SettingListImpl( + SettingListInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new SettingsImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public SettingListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SettingsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SettingsImpl.java new file mode 100644 index 000000000000..e54bfa38cc02 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SettingsImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; +import com.azure.resourcemanager.securityinsights.models.Settings; + +public final class SettingsImpl implements Settings { + private SettingsInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + SettingsImpl( + SettingsInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SettingsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlImpl.java new file mode 100644 index 000000000000..34f3f44ce222 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.SourceControlInner; +import com.azure.resourcemanager.securityinsights.models.ContentType; +import com.azure.resourcemanager.securityinsights.models.RepoType; +import com.azure.resourcemanager.securityinsights.models.Repository; +import com.azure.resourcemanager.securityinsights.models.SourceControl; +import java.util.Collections; +import java.util.List; + +public final class SourceControlImpl implements SourceControl, SourceControl.Definition { + private SourceControlInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + SourceControlImpl( + SourceControlInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String idPropertiesId() { + return this.innerModel().idPropertiesId(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String description() { + return this.innerModel().description(); + } + + public RepoType repoType() { + return this.innerModel().repoType(); + } + + public List contentTypes() { + List inner = this.innerModel().contentTypes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Repository repository() { + return this.innerModel().repository(); + } + + public SourceControlInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String sourceControlId; + + public SourceControlImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public SourceControl create() { + this.innerObject = + serviceManager + .serviceClient() + .getSourceControlsOperations() + .createWithResponse(resourceGroupName, workspaceName, sourceControlId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SourceControl create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSourceControlsOperations() + .createWithResponse(resourceGroupName, workspaceName, sourceControlId, this.innerModel(), context) + .getValue(); + return this; + } + + SourceControlImpl(String name, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new SourceControlInner(); + this.serviceManager = serviceManager; + this.sourceControlId = name; + } + + public SourceControl refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSourceControlsOperations() + .getWithResponse(resourceGroupName, workspaceName, sourceControlId, Context.NONE) + .getValue(); + return this; + } + + public SourceControl refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSourceControlsOperations() + .getWithResponse(resourceGroupName, workspaceName, sourceControlId, context) + .getValue(); + return this; + } + + public SourceControlImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public SourceControlImpl withIdPropertiesId(String idPropertiesId) { + this.innerModel().withIdPropertiesId(idPropertiesId); + return this; + } + + public SourceControlImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public SourceControlImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public SourceControlImpl withRepoType(RepoType repoType) { + this.innerModel().withRepoType(repoType); + return this; + } + + public SourceControlImpl withContentTypes(List contentTypes) { + this.innerModel().withContentTypes(contentTypes); + return this; + } + + public SourceControlImpl withRepository(Repository repository) { + this.innerModel().withRepository(repository); + return this; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsClientImpl.java new file mode 100644 index 000000000000..e23a7c654933 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsClientImpl.java @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.SourceControlsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.RepoInner; +import com.azure.resourcemanager.securityinsights.models.RepoList; +import com.azure.resourcemanager.securityinsights.models.RepoType; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SourceControlsClient. */ +public final class SourceControlsClientImpl implements SourceControlsClient { + private final ClientLogger logger = new ClientLogger(SourceControlsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SourceControlsService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of SourceControlsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SourceControlsClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy.create(SourceControlsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsSourceControls to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsSour") + private interface SourceControlsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/listRepositories") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listRepositories( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @BodyParam("application/json") RepoType repoType, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listRepositoriesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of repositories metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param repoType The repo type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of repositories metadata. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRepositoriesSinglePageAsync( + String resourceGroupName, String workspaceName, RepoType repoType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (repoType == null) { + return Mono.error(new IllegalArgumentException("Parameter repoType is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listRepositories( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + repoType, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of repositories metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param repoType The repo type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of repositories metadata. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRepositoriesSinglePageAsync( + String resourceGroupName, String workspaceName, RepoType repoType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (repoType == null) { + return Mono.error(new IllegalArgumentException("Parameter repoType is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listRepositories( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + repoType, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of repositories metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param repoType The repo type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of repositories metadata. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listRepositoriesAsync( + String resourceGroupName, String workspaceName, RepoType repoType) { + return new PagedFlux<>( + () -> listRepositoriesSinglePageAsync(resourceGroupName, workspaceName, repoType), + nextLink -> listRepositoriesNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of repositories metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param repoType The repo type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of repositories metadata. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listRepositoriesAsync( + String resourceGroupName, String workspaceName, RepoType repoType, Context context) { + return new PagedFlux<>( + () -> listRepositoriesSinglePageAsync(resourceGroupName, workspaceName, repoType, context), + nextLink -> listRepositoriesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of repositories metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param repoType The repo type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of repositories metadata. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRepositories( + String resourceGroupName, String workspaceName, RepoType repoType) { + return new PagedIterable<>(listRepositoriesAsync(resourceGroupName, workspaceName, repoType)); + } + + /** + * Gets a list of repositories metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param repoType The repo type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of repositories metadata. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRepositories( + String resourceGroupName, String workspaceName, RepoType repoType, Context context) { + return new PagedIterable<>(listRepositoriesAsync(resourceGroupName, workspaceName, repoType, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the source controls. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRepositoriesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listRepositoriesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the source controls. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRepositoriesNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listRepositoriesNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsImpl.java new file mode 100644 index 000000000000..823580c2ee83 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.SourceControlsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.RepoInner; +import com.azure.resourcemanager.securityinsights.models.Repo; +import com.azure.resourcemanager.securityinsights.models.RepoType; +import com.azure.resourcemanager.securityinsights.models.SourceControls; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SourceControlsImpl implements SourceControls { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceControlsImpl.class); + + private final SourceControlsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public SourceControlsImpl( + SourceControlsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listRepositories(String resourceGroupName, String workspaceName, RepoType repoType) { + PagedIterable inner = + this.serviceClient().listRepositories(resourceGroupName, workspaceName, repoType); + return Utils.mapPage(inner, inner1 -> new RepoImpl(inner1, this.manager())); + } + + public PagedIterable listRepositories( + String resourceGroupName, String workspaceName, RepoType repoType, Context context) { + PagedIterable inner = + this.serviceClient().listRepositories(resourceGroupName, workspaceName, repoType, context); + return Utils.mapPage(inner, inner1 -> new RepoImpl(inner1, this.manager())); + } + + private SourceControlsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsOperationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsOperationsClientImpl.java new file mode 100644 index 000000000000..daac06948b15 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsOperationsClientImpl.java @@ -0,0 +1,900 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.SourceControlsOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.SourceControlInner; +import com.azure.resourcemanager.securityinsights.models.SourceControlList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SourceControlsOperationsClient. */ +public final class SourceControlsOperationsClientImpl implements SourceControlsOperationsClient { + private final ClientLogger logger = new ClientLogger(SourceControlsOperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SourceControlsOperationsService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of SourceControlsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SourceControlsOperationsClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy + .create(SourceControlsOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsSourceControlsOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsSour") + private interface SourceControlsOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sourceControlId") String sourceControlId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sourceControlId") String sourceControlId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sourceControlId") String sourceControlId, + @BodyParam("application/json") SourceControlInner sourceControl, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all source controls, without source control items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all source controls, without source control items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all source controls, without source control items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all source controls, without source control items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all source controls, without source control items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all source controls, without source control items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all source controls, without source control items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all source controls, without source control items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all source controls, without source control items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all source controls, without source control items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + } + + /** + * Gets all source controls, without source control items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all source controls, without source control items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Gets a source control byt its identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a source control byt its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sourceControlId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sourceControlId == null) { + return Mono + .error(new IllegalArgumentException("Parameter sourceControlId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sourceControlId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a source control byt its identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a source control byt its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sourceControlId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sourceControlId == null) { + return Mono + .error(new IllegalArgumentException("Parameter sourceControlId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sourceControlId, + accept, + context); + } + + /** + * Gets a source control byt its identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a source control byt its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String sourceControlId) { + return getWithResponseAsync(resourceGroupName, workspaceName, sourceControlId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a source control byt its identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a source control byt its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SourceControlInner get(String resourceGroupName, String workspaceName, String sourceControlId) { + return getAsync(resourceGroupName, workspaceName, sourceControlId).block(); + } + + /** + * Gets a source control byt its identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a source control byt its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String sourceControlId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, sourceControlId, context).block(); + } + + /** + * Delete a source control. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String sourceControlId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sourceControlId == null) { + return Mono + .error(new IllegalArgumentException("Parameter sourceControlId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sourceControlId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a source control. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String sourceControlId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sourceControlId == null) { + return Mono + .error(new IllegalArgumentException("Parameter sourceControlId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sourceControlId, + accept, + context); + } + + /** + * Delete a source control. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String sourceControlId) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, sourceControlId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete a source control. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String sourceControlId) { + deleteAsync(resourceGroupName, workspaceName, sourceControlId).block(); + } + + /** + * Delete a source control. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String sourceControlId, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, sourceControlId, context).block(); + } + + /** + * Creates a source control. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @param sourceControl The SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SourceControl in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String workspaceName, String sourceControlId, SourceControlInner sourceControl) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sourceControlId == null) { + return Mono + .error(new IllegalArgumentException("Parameter sourceControlId is required and cannot be null.")); + } + if (sourceControl == null) { + return Mono.error(new IllegalArgumentException("Parameter sourceControl is required and cannot be null.")); + } else { + sourceControl.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sourceControlId, + sourceControl, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a source control. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @param sourceControl The SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SourceControl in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sourceControlId, + SourceControlInner sourceControl, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sourceControlId == null) { + return Mono + .error(new IllegalArgumentException("Parameter sourceControlId is required and cannot be null.")); + } + if (sourceControl == null) { + return Mono.error(new IllegalArgumentException("Parameter sourceControl is required and cannot be null.")); + } else { + sourceControl.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sourceControlId, + sourceControl, + accept, + context); + } + + /** + * Creates a source control. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @param sourceControl The SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SourceControl in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String workspaceName, String sourceControlId, SourceControlInner sourceControl) { + return createWithResponseAsync(resourceGroupName, workspaceName, sourceControlId, sourceControl) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates a source control. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @param sourceControl The SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SourceControl in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SourceControlInner create( + String resourceGroupName, String workspaceName, String sourceControlId, SourceControlInner sourceControl) { + return createAsync(resourceGroupName, workspaceName, sourceControlId, sourceControl).block(); + } + + /** + * Creates a source control. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @param sourceControl The SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SourceControl in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String workspaceName, + String sourceControlId, + SourceControlInner sourceControl, + Context context) { + return createWithResponseAsync(resourceGroupName, workspaceName, sourceControlId, sourceControl, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the source controls. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the source controls. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsOperationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsOperationsImpl.java new file mode 100644 index 000000000000..bcf11d2c1e6c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsOperationsImpl.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.SourceControlsOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.SourceControlInner; +import com.azure.resourcemanager.securityinsights.models.SourceControl; +import com.azure.resourcemanager.securityinsights.models.SourceControlsOperations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SourceControlsOperationsImpl implements SourceControlsOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceControlsOperationsImpl.class); + + private final SourceControlsOperationsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public SourceControlsOperationsImpl( + SourceControlsOperationsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new SourceControlImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new SourceControlImpl(inner1, this.manager())); + } + + public SourceControl get(String resourceGroupName, String workspaceName, String sourceControlId) { + SourceControlInner inner = this.serviceClient().get(resourceGroupName, workspaceName, sourceControlId); + if (inner != null) { + return new SourceControlImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String sourceControlId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, sourceControlId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SourceControlImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String sourceControlId) { + this.serviceClient().delete(resourceGroupName, workspaceName, sourceControlId); + } + + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String sourceControlId, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, sourceControlId, context); + } + + public SourceControl getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sourceControlId = Utils.getValueFromIdByName(id, "sourcecontrols"); + if (sourceControlId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'sourcecontrols'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, sourceControlId, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sourceControlId = Utils.getValueFromIdByName(id, "sourcecontrols"); + if (sourceControlId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'sourcecontrols'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, sourceControlId, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sourceControlId = Utils.getValueFromIdByName(id, "sourcecontrols"); + if (sourceControlId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'sourcecontrols'.", id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, sourceControlId, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sourceControlId = Utils.getValueFromIdByName(id, "sourcecontrols"); + if (sourceControlId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'sourcecontrols'.", id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, sourceControlId, context); + } + + private SourceControlsOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public SourceControlImpl define(String name) { + return new SourceControlImpl(name, this.manager()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TeamInformationImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TeamInformationImpl.java new file mode 100644 index 000000000000..4193894c5c11 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TeamInformationImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.TeamInformationInner; +import com.azure.resourcemanager.securityinsights.models.TeamInformation; +import java.time.OffsetDateTime; + +public final class TeamInformationImpl implements TeamInformation { + private TeamInformationInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + TeamInformationImpl( + TeamInformationInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String teamId() { + return this.innerModel().teamId(); + } + + public String primaryChannelUrl() { + return this.innerModel().primaryChannelUrl(); + } + + public OffsetDateTime teamCreationTimeUtc() { + return this.innerModel().teamCreationTimeUtc(); + } + + public String name() { + return this.innerModel().name(); + } + + public String description() { + return this.innerModel().description(); + } + + public TeamInformationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorMetricsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorMetricsClientImpl.java new file mode 100644 index 000000000000..d7e7ebf8e2b3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorMetricsClientImpl.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorMetricsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceMetricsListInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ThreatIntelligenceIndicatorMetricsClient. + */ +public final class ThreatIntelligenceIndicatorMetricsClientImpl implements ThreatIntelligenceIndicatorMetricsClient { + private final ClientLogger logger = new ClientLogger(ThreatIntelligenceIndicatorMetricsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ThreatIntelligenceIndicatorMetricsService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of ThreatIntelligenceIndicatorMetricsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ThreatIntelligenceIndicatorMetricsClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy + .create( + ThreatIntelligenceIndicatorMetricsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsThreatIntelligenceIndicatorMetrics to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsThre") + private interface ThreatIntelligenceIndicatorMetricsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/metrics") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context); + } + + /** + * Get threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String workspaceName) { + return listWithResponseAsync(resourceGroupName, workspaceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThreatIntelligenceMetricsListInner list(String resourceGroupName, String workspaceName) { + return listAsync(resourceGroupName, workspaceName).block(); + } + + /** + * Get threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String workspaceName, Context context) { + return listWithResponseAsync(resourceGroupName, workspaceName, context).block(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorMetricsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorMetricsImpl.java new file mode 100644 index 000000000000..4627c6d01693 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorMetricsImpl.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorMetricsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceMetricsListInner; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorMetrics; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceMetricsList; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ThreatIntelligenceIndicatorMetricsImpl implements ThreatIntelligenceIndicatorMetrics { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligenceIndicatorMetricsImpl.class); + + private final ThreatIntelligenceIndicatorMetricsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public ThreatIntelligenceIndicatorMetricsImpl( + ThreatIntelligenceIndicatorMetricsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ThreatIntelligenceMetricsList list(String resourceGroupName, String workspaceName) { + ThreatIntelligenceMetricsListInner inner = this.serviceClient().list(resourceGroupName, workspaceName); + if (inner != null) { + return new ThreatIntelligenceMetricsListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String workspaceName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, workspaceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ThreatIntelligenceMetricsListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ThreatIntelligenceIndicatorMetricsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsClientImpl.java new file mode 100644 index 000000000000..b6dca3c8bdd1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsClientImpl.java @@ -0,0 +1,1613 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceInformationInner; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAppendTags; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceFilteringCriteria; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModelForRequestBody; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceInformationList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ThreatIntelligenceIndicatorsClient. */ +public final class ThreatIntelligenceIndicatorsClientImpl implements ThreatIntelligenceIndicatorsClient { + private final ClientLogger logger = new ClientLogger(ThreatIntelligenceIndicatorsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ThreatIntelligenceIndicatorsService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of ThreatIntelligenceIndicatorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ThreatIntelligenceIndicatorsClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy + .create( + ThreatIntelligenceIndicatorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsThreatIntelligenceIndicators to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsThre") + private interface ThreatIntelligenceIndicatorsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main" + + "/createIndicator") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createIndicator( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @BodyParam("application/json") ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators" + + "/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators" + + "/{name}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, + @BodyParam("application/json") ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators" + + "/{name}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main" + + "/queryIndicators") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> queryIndicators( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @BodyParam("application/json") ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators" + + "/{name}/appendTags") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> appendTags( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, + @BodyParam("application/json") ThreatIntelligenceAppendTags threatIntelligenceAppendTags, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators" + + "/{name}/replaceTags") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> replaceTags( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, + @BodyParam("application/json") ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceReplaceTags, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> queryIndicatorsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Create a new threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createIndicatorWithResponseAsync( + String resourceGroupName, + String workspaceName, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (threatIntelligenceProperties == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter threatIntelligenceProperties is required and cannot be null.")); + } else { + threatIntelligenceProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createIndicator( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + threatIntelligenceProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a new threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createIndicatorWithResponseAsync( + String resourceGroupName, + String workspaceName, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (threatIntelligenceProperties == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter threatIntelligenceProperties is required and cannot be null.")); + } else { + threatIntelligenceProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createIndicator( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + threatIntelligenceProperties, + accept, + context); + } + + /** + * Create a new threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createIndicatorAsync( + String resourceGroupName, + String workspaceName, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties) { + return createIndicatorWithResponseAsync(resourceGroupName, workspaceName, threatIntelligenceProperties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create a new threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThreatIntelligenceInformationInner createIndicator( + String resourceGroupName, + String workspaceName, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties) { + return createIndicatorAsync(resourceGroupName, workspaceName, threatIntelligenceProperties).block(); + } + + /** + * Create a new threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createIndicatorWithResponse( + String resourceGroupName, + String workspaceName, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties, + Context context) { + return createIndicatorWithResponseAsync(resourceGroupName, workspaceName, threatIntelligenceProperties, context) + .block(); + } + + /** + * View a threat intelligence indicator by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * View a threat intelligence indicator by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + accept, + context); + } + + /** + * View a threat intelligence indicator by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String name) { + return getWithResponseAsync(resourceGroupName, workspaceName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * View a threat intelligence indicator by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThreatIntelligenceInformationInner get(String resourceGroupName, String workspaceName, String name) { + return getAsync(resourceGroupName, workspaceName, name).block(); + } + + /** + * View a threat intelligence indicator by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); + } + + /** + * Update a threat Intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (threatIntelligenceProperties == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter threatIntelligenceProperties is required and cannot be null.")); + } else { + threatIntelligenceProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + threatIntelligenceProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a threat Intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (threatIntelligenceProperties == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter threatIntelligenceProperties is required and cannot be null.")); + } else { + threatIntelligenceProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + threatIntelligenceProperties, + accept, + context); + } + + /** + * Update a threat Intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties) { + return createWithResponseAsync(resourceGroupName, workspaceName, name, threatIntelligenceProperties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update a threat Intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThreatIntelligenceInformationInner create( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties) { + return createAsync(resourceGroupName, workspaceName, name, threatIntelligenceProperties).block(); + } + + /** + * Update a threat Intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties, + Context context) { + return createWithResponseAsync(resourceGroupName, workspaceName, name, threatIntelligenceProperties, context) + .block(); + } + + /** + * Delete a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + accept, + context); + } + + /** + * Delete a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String name) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, name) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String name) { + deleteAsync(resourceGroupName, workspaceName, name).block(); + } + + /** + * Delete a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String name, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); + } + + /** + * Query threat intelligence indicators as per filtering criteria. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param threatIntelligenceFilteringCriteria Filtering criteria for querying threat intelligence indicators. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the threat intelligence information objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> queryIndicatorsSinglePageAsync( + String resourceGroupName, + String workspaceName, + ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (threatIntelligenceFilteringCriteria == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter threatIntelligenceFilteringCriteria is required and cannot be null.")); + } else { + threatIntelligenceFilteringCriteria.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .queryIndicators( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + threatIntelligenceFilteringCriteria, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Query threat intelligence indicators as per filtering criteria. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param threatIntelligenceFilteringCriteria Filtering criteria for querying threat intelligence indicators. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the threat intelligence information objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> queryIndicatorsSinglePageAsync( + String resourceGroupName, + String workspaceName, + ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (threatIntelligenceFilteringCriteria == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter threatIntelligenceFilteringCriteria is required and cannot be null.")); + } else { + threatIntelligenceFilteringCriteria.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .queryIndicators( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + threatIntelligenceFilteringCriteria, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Query threat intelligence indicators as per filtering criteria. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param threatIntelligenceFilteringCriteria Filtering criteria for querying threat intelligence indicators. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the threat intelligence information objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux queryIndicatorsAsync( + String resourceGroupName, + String workspaceName, + ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria) { + return new PagedFlux<>( + () -> queryIndicatorsSinglePageAsync(resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria), + nextLink -> queryIndicatorsNextSinglePageAsync(nextLink)); + } + + /** + * Query threat intelligence indicators as per filtering criteria. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param threatIntelligenceFilteringCriteria Filtering criteria for querying threat intelligence indicators. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the threat intelligence information objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux queryIndicatorsAsync( + String resourceGroupName, + String workspaceName, + ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, + Context context) { + return new PagedFlux<>( + () -> + queryIndicatorsSinglePageAsync( + resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria, context), + nextLink -> queryIndicatorsNextSinglePageAsync(nextLink, context)); + } + + /** + * Query threat intelligence indicators as per filtering criteria. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param threatIntelligenceFilteringCriteria Filtering criteria for querying threat intelligence indicators. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the threat intelligence information objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable queryIndicators( + String resourceGroupName, + String workspaceName, + ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria) { + return new PagedIterable<>( + queryIndicatorsAsync(resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria)); + } + + /** + * Query threat intelligence indicators as per filtering criteria. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param threatIntelligenceFilteringCriteria Filtering criteria for querying threat intelligence indicators. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the threat intelligence information objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable queryIndicators( + String resourceGroupName, + String workspaceName, + ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, + Context context) { + return new PagedIterable<>( + queryIndicatorsAsync(resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria, context)); + } + + /** + * Append tags to a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceAppendTags The threat intelligence append tags request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> appendTagsWithResponseAsync( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceAppendTags threatIntelligenceAppendTags) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (threatIntelligenceAppendTags == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter threatIntelligenceAppendTags is required and cannot be null.")); + } else { + threatIntelligenceAppendTags.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .appendTags( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + threatIntelligenceAppendTags, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Append tags to a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceAppendTags The threat intelligence append tags request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> appendTagsWithResponseAsync( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceAppendTags threatIntelligenceAppendTags, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (threatIntelligenceAppendTags == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter threatIntelligenceAppendTags is required and cannot be null.")); + } else { + threatIntelligenceAppendTags.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .appendTags( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + threatIntelligenceAppendTags, + accept, + context); + } + + /** + * Append tags to a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceAppendTags The threat intelligence append tags request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono appendTagsAsync( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceAppendTags threatIntelligenceAppendTags) { + return appendTagsWithResponseAsync(resourceGroupName, workspaceName, name, threatIntelligenceAppendTags) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Append tags to a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceAppendTags The threat intelligence append tags request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void appendTags( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceAppendTags threatIntelligenceAppendTags) { + appendTagsAsync(resourceGroupName, workspaceName, name, threatIntelligenceAppendTags).block(); + } + + /** + * Append tags to a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceAppendTags The threat intelligence append tags request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response appendTagsWithResponse( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceAppendTags threatIntelligenceAppendTags, + Context context) { + return appendTagsWithResponseAsync( + resourceGroupName, workspaceName, name, threatIntelligenceAppendTags, context) + .block(); + } + + /** + * Replace tags added to a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceReplaceTags Tags in the threat intelligence indicator to be replaced. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> replaceTagsWithResponseAsync( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceReplaceTags) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (threatIntelligenceReplaceTags == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter threatIntelligenceReplaceTags is required and cannot be null.")); + } else { + threatIntelligenceReplaceTags.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .replaceTags( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + threatIntelligenceReplaceTags, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Replace tags added to a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceReplaceTags Tags in the threat intelligence indicator to be replaced. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> replaceTagsWithResponseAsync( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceReplaceTags, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (threatIntelligenceReplaceTags == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter threatIntelligenceReplaceTags is required and cannot be null.")); + } else { + threatIntelligenceReplaceTags.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .replaceTags( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + threatIntelligenceReplaceTags, + accept, + context); + } + + /** + * Replace tags added to a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceReplaceTags Tags in the threat intelligence indicator to be replaced. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono replaceTagsAsync( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceReplaceTags) { + return replaceTagsWithResponseAsync(resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Replace tags added to a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceReplaceTags Tags in the threat intelligence indicator to be replaced. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThreatIntelligenceInformationInner replaceTags( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceReplaceTags) { + return replaceTagsAsync(resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags).block(); + } + + /** + * Replace tags added to a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceReplaceTags Tags in the threat intelligence indicator to be replaced. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response replaceTagsWithResponse( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceReplaceTags, + Context context) { + return replaceTagsWithResponseAsync( + resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the threat intelligence information objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> queryIndicatorsNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.queryIndicatorsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the threat intelligence information objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> queryIndicatorsNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .queryIndicatorsNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsImpl.java new file mode 100644 index 000000000000..5577d3c1e3d3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsImpl.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceInformationInner; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAppendTags; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceFilteringCriteria; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModelForRequestBody; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicators; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceInformation; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ThreatIntelligenceIndicatorsImpl implements ThreatIntelligenceIndicators { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligenceIndicatorsImpl.class); + + private final ThreatIntelligenceIndicatorsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public ThreatIntelligenceIndicatorsImpl( + ThreatIntelligenceIndicatorsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ThreatIntelligenceInformation createIndicator( + String resourceGroupName, + String workspaceName, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties) { + ThreatIntelligenceInformationInner inner = + this.serviceClient().createIndicator(resourceGroupName, workspaceName, threatIntelligenceProperties); + if (inner != null) { + return new ThreatIntelligenceInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createIndicatorWithResponse( + String resourceGroupName, + String workspaceName, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties, + Context context) { + Response inner = + this + .serviceClient() + .createIndicatorWithResponse(resourceGroupName, workspaceName, threatIntelligenceProperties, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ThreatIntelligenceInformationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ThreatIntelligenceInformation get(String resourceGroupName, String workspaceName, String name) { + ThreatIntelligenceInformationInner inner = this.serviceClient().get(resourceGroupName, workspaceName, name); + if (inner != null) { + return new ThreatIntelligenceInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String name, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ThreatIntelligenceInformationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ThreatIntelligenceInformation create( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties) { + ThreatIntelligenceInformationInner inner = + this.serviceClient().create(resourceGroupName, workspaceName, name, threatIntelligenceProperties); + if (inner != null) { + return new ThreatIntelligenceInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createWithResponse( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties, + Context context) { + Response inner = + this + .serviceClient() + .createWithResponse(resourceGroupName, workspaceName, name, threatIntelligenceProperties, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ThreatIntelligenceInformationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String name) { + this.serviceClient().delete(resourceGroupName, workspaceName, name); + } + + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String name, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, name, context); + } + + public PagedIterable queryIndicators( + String resourceGroupName, + String workspaceName, + ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria) { + PagedIterable inner = + this.serviceClient().queryIndicators(resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria); + return Utils.mapPage(inner, inner1 -> new ThreatIntelligenceInformationImpl(inner1, this.manager())); + } + + public PagedIterable queryIndicators( + String resourceGroupName, + String workspaceName, + ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, + Context context) { + PagedIterable inner = + this + .serviceClient() + .queryIndicators(resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria, context); + return Utils.mapPage(inner, inner1 -> new ThreatIntelligenceInformationImpl(inner1, this.manager())); + } + + public void appendTags( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceAppendTags threatIntelligenceAppendTags) { + this.serviceClient().appendTags(resourceGroupName, workspaceName, name, threatIntelligenceAppendTags); + } + + public Response appendTagsWithResponse( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceAppendTags threatIntelligenceAppendTags, + Context context) { + return this + .serviceClient() + .appendTagsWithResponse(resourceGroupName, workspaceName, name, threatIntelligenceAppendTags, context); + } + + public ThreatIntelligenceInformation replaceTags( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceReplaceTags) { + ThreatIntelligenceInformationInner inner = + this.serviceClient().replaceTags(resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags); + if (inner != null) { + return new ThreatIntelligenceInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response replaceTagsWithResponse( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceReplaceTags, + Context context) { + Response inner = + this + .serviceClient() + .replaceTagsWithResponse( + resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ThreatIntelligenceInformationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ThreatIntelligenceIndicatorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsOperationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsOperationsClientImpl.java new file mode 100644 index 000000000000..fee5c2563398 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsOperationsClientImpl.java @@ -0,0 +1,434 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceInformationInner; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceInformationList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ThreatIntelligenceIndicatorsOperationsClient. + */ +public final class ThreatIntelligenceIndicatorsOperationsClientImpl + implements ThreatIntelligenceIndicatorsOperationsClient { + private final ClientLogger logger = new ClientLogger(ThreatIntelligenceIndicatorsOperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ThreatIntelligenceIndicatorsOperationsService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of ThreatIntelligenceIndicatorsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ThreatIntelligenceIndicatorsOperationsClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy + .create( + ThreatIntelligenceIndicatorsOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsThreatIntelligenceIndicatorsOperations to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsThre") + private interface ThreatIntelligenceIndicatorsOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @QueryParam("$filter") String filter, + @QueryParam("$orderby") String orderby, + @QueryParam("$top") Integer top, + @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get all threat intelligence indicators. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all threat intelligence indicators. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String filter, String orderby, Integer top, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + filter, + orderby, + top, + skipToken, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all threat intelligence indicators. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all threat intelligence indicators. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String workspaceName, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + filter, + orderby, + top, + skipToken, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get all threat intelligence indicators. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all threat intelligence indicators. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String filter, String orderby, Integer top, String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get all threat intelligence indicators. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all threat intelligence indicators. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + final String filter = null; + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get all threat intelligence indicators. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all threat intelligence indicators. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String workspaceName, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get all threat intelligence indicators. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all threat intelligence indicators. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + final String filter = null; + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken)); + } + + /** + * Get all threat intelligence indicators. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all threat intelligence indicators. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the threat intelligence information objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the threat intelligence information objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsOperationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsOperationsImpl.java new file mode 100644 index 000000000000..fd55c414be8f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsOperationsImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceInformationInner; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorsOperations; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceInformation; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ThreatIntelligenceIndicatorsOperationsImpl implements ThreatIntelligenceIndicatorsOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligenceIndicatorsOperationsImpl.class); + + private final ThreatIntelligenceIndicatorsOperationsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public ThreatIntelligenceIndicatorsOperationsImpl( + ThreatIntelligenceIndicatorsOperationsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new ThreatIntelligenceInformationImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String filter, + String orderby, + Integer top, + String skipToken, + Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, filter, orderby, top, skipToken, context); + return Utils.mapPage(inner, inner1 -> new ThreatIntelligenceInformationImpl(inner1, this.manager())); + } + + private ThreatIntelligenceIndicatorsOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceInformationImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceInformationImpl.java new file mode 100644 index 000000000000..91112c166786 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceInformationImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceInformationInner; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceInformation; + +public final class ThreatIntelligenceInformationImpl implements ThreatIntelligenceInformation { + private ThreatIntelligenceInformationInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + ThreatIntelligenceInformationImpl( + ThreatIntelligenceInformationInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ThreatIntelligenceInformationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceMetricsListImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceMetricsListImpl.java new file mode 100644 index 000000000000..2d0154591adb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceMetricsListImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceMetricsListInner; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceMetrics; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceMetricsList; +import java.util.Collections; +import java.util.List; + +public final class ThreatIntelligenceMetricsListImpl implements ThreatIntelligenceMetricsList { + private ThreatIntelligenceMetricsListInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + ThreatIntelligenceMetricsListImpl( + ThreatIntelligenceMetricsListInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ThreatIntelligenceMetricsListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/Utils.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/Utils.java new file mode 100644 index 000000000000..cdc16e4cf245 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistImpl.java new file mode 100644 index 000000000000..5b1862258674 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistImpl.java @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.WatchlistInner; +import com.azure.resourcemanager.securityinsights.models.Source; +import com.azure.resourcemanager.securityinsights.models.UserInfo; +import com.azure.resourcemanager.securityinsights.models.Watchlist; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class WatchlistImpl implements Watchlist, Watchlist.Definition, Watchlist.Update { + private WatchlistInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String watchlistId() { + return this.innerModel().watchlistId(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String provider() { + return this.innerModel().provider(); + } + + public Source source() { + return this.innerModel().source(); + } + + public OffsetDateTime created() { + return this.innerModel().created(); + } + + public OffsetDateTime updated() { + return this.innerModel().updated(); + } + + public UserInfo createdBy() { + return this.innerModel().createdBy(); + } + + public UserInfo updatedBy() { + return this.innerModel().updatedBy(); + } + + public String description() { + return this.innerModel().description(); + } + + public String watchlistType() { + return this.innerModel().watchlistType(); + } + + public String watchlistAlias() { + return this.innerModel().watchlistAlias(); + } + + public Boolean isDeleted() { + return this.innerModel().isDeleted(); + } + + public List labels() { + List inner = this.innerModel().labels(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Duration defaultDuration() { + return this.innerModel().defaultDuration(); + } + + public String tenantId() { + return this.innerModel().tenantId(); + } + + public Integer numberOfLinesToSkip() { + return this.innerModel().numberOfLinesToSkip(); + } + + public String rawContent() { + return this.innerModel().rawContent(); + } + + public String itemsSearchKey() { + return this.innerModel().itemsSearchKey(); + } + + public String contentType() { + return this.innerModel().contentType(); + } + + public String uploadStatus() { + return this.innerModel().uploadStatus(); + } + + public Integer watchlistItemsCount() { + return this.innerModel().watchlistItemsCount(); + } + + public WatchlistInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String watchlistAlias; + + public WatchlistImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public Watchlist create() { + this.innerObject = + serviceManager + .serviceClient() + .getWatchlists() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, watchlistAlias, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Watchlist create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWatchlists() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, watchlistAlias, this.innerModel(), context) + .getValue(); + return this; + } + + WatchlistImpl(String name, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new WatchlistInner(); + this.serviceManager = serviceManager; + this.watchlistAlias = name; + } + + public WatchlistImpl update() { + return this; + } + + public Watchlist apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWatchlists() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, watchlistAlias, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Watchlist apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWatchlists() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, watchlistAlias, this.innerModel(), context) + .getValue(); + return this; + } + + WatchlistImpl( + WatchlistInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.watchlistAlias = Utils.getValueFromIdByName(innerObject.id(), "watchlists"); + } + + public Watchlist refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWatchlists() + .getWithResponse(resourceGroupName, workspaceName, watchlistAlias, Context.NONE) + .getValue(); + return this; + } + + public Watchlist refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWatchlists() + .getWithResponse(resourceGroupName, workspaceName, watchlistAlias, context) + .getValue(); + return this; + } + + public WatchlistImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public WatchlistImpl withWatchlistId(String watchlistId) { + this.innerModel().withWatchlistId(watchlistId); + return this; + } + + public WatchlistImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public WatchlistImpl withProvider(String provider) { + this.innerModel().withProvider(provider); + return this; + } + + public WatchlistImpl withSource(Source source) { + this.innerModel().withSource(source); + return this; + } + + public WatchlistImpl withCreated(OffsetDateTime created) { + this.innerModel().withCreated(created); + return this; + } + + public WatchlistImpl withUpdated(OffsetDateTime updated) { + this.innerModel().withUpdated(updated); + return this; + } + + public WatchlistImpl withCreatedBy(UserInfo createdBy) { + this.innerModel().withCreatedBy(createdBy); + return this; + } + + public WatchlistImpl withUpdatedBy(UserInfo updatedBy) { + this.innerModel().withUpdatedBy(updatedBy); + return this; + } + + public WatchlistImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public WatchlistImpl withWatchlistType(String watchlistType) { + this.innerModel().withWatchlistType(watchlistType); + return this; + } + + public WatchlistImpl withWatchlistAlias(String watchlistAlias) { + this.innerModel().withWatchlistAlias(watchlistAlias); + return this; + } + + public WatchlistImpl withIsDeleted(Boolean isDeleted) { + this.innerModel().withIsDeleted(isDeleted); + return this; + } + + public WatchlistImpl withLabels(List labels) { + this.innerModel().withLabels(labels); + return this; + } + + public WatchlistImpl withDefaultDuration(Duration defaultDuration) { + this.innerModel().withDefaultDuration(defaultDuration); + return this; + } + + public WatchlistImpl withTenantId(String tenantId) { + this.innerModel().withTenantId(tenantId); + return this; + } + + public WatchlistImpl withNumberOfLinesToSkip(Integer numberOfLinesToSkip) { + this.innerModel().withNumberOfLinesToSkip(numberOfLinesToSkip); + return this; + } + + public WatchlistImpl withRawContent(String rawContent) { + this.innerModel().withRawContent(rawContent); + return this; + } + + public WatchlistImpl withItemsSearchKey(String itemsSearchKey) { + this.innerModel().withItemsSearchKey(itemsSearchKey); + return this; + } + + public WatchlistImpl withContentType(String contentType) { + this.innerModel().withContentType(contentType); + return this; + } + + public WatchlistImpl withUploadStatus(String uploadStatus) { + this.innerModel().withUploadStatus(uploadStatus); + return this; + } + + public WatchlistImpl withWatchlistItemsCount(Integer watchlistItemsCount) { + this.innerModel().withWatchlistItemsCount(watchlistItemsCount); + return this; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistItemImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistItemImpl.java new file mode 100644 index 000000000000..1ea799f73b89 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistItemImpl.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.WatchlistItemInner; +import com.azure.resourcemanager.securityinsights.models.UserInfo; +import com.azure.resourcemanager.securityinsights.models.WatchlistItem; +import java.time.OffsetDateTime; + +public final class WatchlistItemImpl implements WatchlistItem, WatchlistItem.Definition, WatchlistItem.Update { + private WatchlistItemInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String watchlistItemType() { + return this.innerModel().watchlistItemType(); + } + + public String watchlistItemId() { + return this.innerModel().watchlistItemId(); + } + + public String tenantId() { + return this.innerModel().tenantId(); + } + + public Boolean isDeleted() { + return this.innerModel().isDeleted(); + } + + public OffsetDateTime created() { + return this.innerModel().created(); + } + + public OffsetDateTime updated() { + return this.innerModel().updated(); + } + + public UserInfo createdBy() { + return this.innerModel().createdBy(); + } + + public UserInfo updatedBy() { + return this.innerModel().updatedBy(); + } + + public Object itemsKeyValue() { + return this.innerModel().itemsKeyValue(); + } + + public Object entityMapping() { + return this.innerModel().entityMapping(); + } + + public WatchlistItemInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String watchlistAlias; + + private String watchlistItemId; + + public WatchlistItemImpl withExistingWatchlist( + String resourceGroupName, String workspaceName, String watchlistAlias) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.watchlistAlias = watchlistAlias; + return this; + } + + public WatchlistItem create() { + this.innerObject = + serviceManager + .serviceClient() + .getWatchlistItems() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public WatchlistItem create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWatchlistItems() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, this.innerModel(), context) + .getValue(); + return this; + } + + WatchlistItemImpl(String name, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new WatchlistItemInner(); + this.serviceManager = serviceManager; + this.watchlistItemId = name; + } + + public WatchlistItemImpl update() { + return this; + } + + public WatchlistItem apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWatchlistItems() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public WatchlistItem apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWatchlistItems() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, this.innerModel(), context) + .getValue(); + return this; + } + + WatchlistItemImpl( + WatchlistItemInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.watchlistAlias = Utils.getValueFromIdByName(innerObject.id(), "watchlists"); + this.watchlistItemId = Utils.getValueFromIdByName(innerObject.id(), "watchlistItems"); + } + + public WatchlistItem refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWatchlistItems() + .getWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, Context.NONE) + .getValue(); + return this; + } + + public WatchlistItem refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWatchlistItems() + .getWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, context) + .getValue(); + return this; + } + + public WatchlistItemImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public WatchlistItemImpl withWatchlistItemType(String watchlistItemType) { + this.innerModel().withWatchlistItemType(watchlistItemType); + return this; + } + + public WatchlistItemImpl withWatchlistItemId(String watchlistItemId) { + this.innerModel().withWatchlistItemId(watchlistItemId); + return this; + } + + public WatchlistItemImpl withTenantId(String tenantId) { + this.innerModel().withTenantId(tenantId); + return this; + } + + public WatchlistItemImpl withIsDeleted(Boolean isDeleted) { + this.innerModel().withIsDeleted(isDeleted); + return this; + } + + public WatchlistItemImpl withCreated(OffsetDateTime created) { + this.innerModel().withCreated(created); + return this; + } + + public WatchlistItemImpl withUpdated(OffsetDateTime updated) { + this.innerModel().withUpdated(updated); + return this; + } + + public WatchlistItemImpl withCreatedBy(UserInfo createdBy) { + this.innerModel().withCreatedBy(createdBy); + return this; + } + + public WatchlistItemImpl withUpdatedBy(UserInfo updatedBy) { + this.innerModel().withUpdatedBy(updatedBy); + return this; + } + + public WatchlistItemImpl withItemsKeyValue(Object itemsKeyValue) { + this.innerModel().withItemsKeyValue(itemsKeyValue); + return this; + } + + public WatchlistItemImpl withEntityMapping(Object entityMapping) { + this.innerModel().withEntityMapping(entityMapping); + return this; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistItemsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistItemsClientImpl.java new file mode 100644 index 000000000000..5bc3299bb255 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistItemsClientImpl.java @@ -0,0 +1,1002 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.WatchlistItemsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.WatchlistItemInner; +import com.azure.resourcemanager.securityinsights.models.WatchlistItemList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in WatchlistItemsClient. */ +public final class WatchlistItemsClientImpl implements WatchlistItemsClient { + private final ClientLogger logger = new ClientLogger(WatchlistItemsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WatchlistItemsService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of WatchlistItemsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WatchlistItemsClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy.create(WatchlistItemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsWatchlistItems to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsWatc") + private interface WatchlistItemsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}" + + "/watchlistItems") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("watchlistAlias") String watchlistAlias, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}" + + "/watchlistItems/{watchlistItemId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("watchlistAlias") String watchlistAlias, + @PathParam("watchlistItemId") String watchlistItemId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}" + + "/watchlistItems/{watchlistItemId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("watchlistAlias") String watchlistAlias, + @PathParam("watchlistItemId") String watchlistItemId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}" + + "/watchlistItems/{watchlistItemId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("watchlistAlias") String watchlistAlias, + @PathParam("watchlistItemId") String watchlistItemId, + @BodyParam("application/json") WatchlistItemInner watchlistItem, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all watchlist Items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all watchlist Items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String watchlistAlias) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (watchlistAlias == null) { + return Mono.error(new IllegalArgumentException("Parameter watchlistAlias is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + watchlistAlias, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all watchlist Items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all watchlist Items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String watchlistAlias, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (watchlistAlias == null) { + return Mono.error(new IllegalArgumentException("Parameter watchlistAlias is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + watchlistAlias, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all watchlist Items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all watchlist Items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String watchlistAlias) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, watchlistAlias), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all watchlist Items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all watchlist Items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String watchlistAlias, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, watchlistAlias, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all watchlist Items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all watchlist Items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String watchlistAlias) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, watchlistAlias)); + } + + /** + * Gets all watchlist Items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all watchlist Items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String watchlistAlias, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, watchlistAlias, context)); + } + + /** + * Gets a watchlist, without its watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a watchlist, without its watchlist items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (watchlistAlias == null) { + return Mono.error(new IllegalArgumentException("Parameter watchlistAlias is required and cannot be null.")); + } + if (watchlistItemId == null) { + return Mono + .error(new IllegalArgumentException("Parameter watchlistItemId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + watchlistAlias, + watchlistItemId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a watchlist, without its watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a watchlist, without its watchlist items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String watchlistAlias, + String watchlistItemId, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (watchlistAlias == null) { + return Mono.error(new IllegalArgumentException("Parameter watchlistAlias is required and cannot be null.")); + } + if (watchlistItemId == null) { + return Mono + .error(new IllegalArgumentException("Parameter watchlistItemId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + watchlistAlias, + watchlistItemId, + accept, + context); + } + + /** + * Gets a watchlist, without its watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a watchlist, without its watchlist items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId) { + return getWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a watchlist, without its watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a watchlist, without its watchlist items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WatchlistItemInner get( + String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId) { + return getAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId).block(); + } + + /** + * Gets a watchlist, without its watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a watchlist, without its watchlist items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String watchlistAlias, + String watchlistItemId, + Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, context).block(); + } + + /** + * Delete a watchlist item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (watchlistAlias == null) { + return Mono.error(new IllegalArgumentException("Parameter watchlistAlias is required and cannot be null.")); + } + if (watchlistItemId == null) { + return Mono + .error(new IllegalArgumentException("Parameter watchlistItemId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + watchlistAlias, + watchlistItemId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a watchlist item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, + String workspaceName, + String watchlistAlias, + String watchlistItemId, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (watchlistAlias == null) { + return Mono.error(new IllegalArgumentException("Parameter watchlistAlias is required and cannot be null.")); + } + if (watchlistItemId == null) { + return Mono + .error(new IllegalArgumentException("Parameter watchlistItemId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + watchlistAlias, + watchlistItemId, + accept, + context); + } + + /** + * Delete a watchlist item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete a watchlist item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId) { + deleteAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId).block(); + } + + /** + * Delete a watchlist item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String workspaceName, + String watchlistAlias, + String watchlistItemId, + Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, context) + .block(); + } + + /** + * Creates or updates a watchlist item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @param watchlistItem The watchlist item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Watchlist item in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String watchlistAlias, + String watchlistItemId, + WatchlistItemInner watchlistItem) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (watchlistAlias == null) { + return Mono.error(new IllegalArgumentException("Parameter watchlistAlias is required and cannot be null.")); + } + if (watchlistItemId == null) { + return Mono + .error(new IllegalArgumentException("Parameter watchlistItemId is required and cannot be null.")); + } + if (watchlistItem == null) { + return Mono.error(new IllegalArgumentException("Parameter watchlistItem is required and cannot be null.")); + } else { + watchlistItem.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + watchlistAlias, + watchlistItemId, + watchlistItem, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a watchlist item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @param watchlistItem The watchlist item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Watchlist item in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String watchlistAlias, + String watchlistItemId, + WatchlistItemInner watchlistItem, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (watchlistAlias == null) { + return Mono.error(new IllegalArgumentException("Parameter watchlistAlias is required and cannot be null.")); + } + if (watchlistItemId == null) { + return Mono + .error(new IllegalArgumentException("Parameter watchlistItemId is required and cannot be null.")); + } + if (watchlistItem == null) { + return Mono.error(new IllegalArgumentException("Parameter watchlistItem is required and cannot be null.")); + } else { + watchlistItem.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + watchlistAlias, + watchlistItemId, + watchlistItem, + accept, + context); + } + + /** + * Creates or updates a watchlist item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @param watchlistItem The watchlist item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Watchlist item in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String watchlistAlias, + String watchlistItemId, + WatchlistItemInner watchlistItem) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, watchlistItem) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a watchlist item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @param watchlistItem The watchlist item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Watchlist item in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WatchlistItemInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String watchlistAlias, + String watchlistItemId, + WatchlistItemInner watchlistItem) { + return createOrUpdateAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, watchlistItem) + .block(); + } + + /** + * Creates or updates a watchlist item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @param watchlistItem The watchlist item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Watchlist item in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String watchlistAlias, + String watchlistItemId, + WatchlistItemInner watchlistItem, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, watchlistItem, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the watchlist items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the watchlist items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistItemsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistItemsImpl.java new file mode 100644 index 000000000000..92310d61d5de --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistItemsImpl.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.WatchlistItemsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.WatchlistItemInner; +import com.azure.resourcemanager.securityinsights.models.WatchlistItem; +import com.azure.resourcemanager.securityinsights.models.WatchlistItems; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WatchlistItemsImpl implements WatchlistItems { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WatchlistItemsImpl.class); + + private final WatchlistItemsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public WatchlistItemsImpl( + WatchlistItemsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String watchlistAlias) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, watchlistAlias); + return Utils.mapPage(inner, inner1 -> new WatchlistItemImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, String watchlistAlias, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, watchlistAlias, context); + return Utils.mapPage(inner, inner1 -> new WatchlistItemImpl(inner1, this.manager())); + } + + public WatchlistItem get( + String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId) { + WatchlistItemInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId); + if (inner != null) { + return new WatchlistItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String watchlistAlias, + String watchlistItemId, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WatchlistItemImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId) { + this.serviceClient().delete(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId); + } + + public Response deleteWithResponse( + String resourceGroupName, + String workspaceName, + String watchlistAlias, + String watchlistItemId, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, context); + } + + public WatchlistItem getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String watchlistAlias = Utils.getValueFromIdByName(id, "watchlists"); + if (watchlistAlias == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'watchlists'.", id))); + } + String watchlistItemId = Utils.getValueFromIdByName(id, "watchlistItems"); + if (watchlistItemId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'watchlistItems'.", id))); + } + return this + .getWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String watchlistAlias = Utils.getValueFromIdByName(id, "watchlists"); + if (watchlistAlias == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'watchlists'.", id))); + } + String watchlistItemId = Utils.getValueFromIdByName(id, "watchlistItems"); + if (watchlistItemId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'watchlistItems'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String watchlistAlias = Utils.getValueFromIdByName(id, "watchlists"); + if (watchlistAlias == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'watchlists'.", id))); + } + String watchlistItemId = Utils.getValueFromIdByName(id, "watchlistItems"); + if (watchlistItemId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'watchlistItems'.", id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String watchlistAlias = Utils.getValueFromIdByName(id, "watchlists"); + if (watchlistAlias == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'watchlists'.", id))); + } + String watchlistItemId = Utils.getValueFromIdByName(id, "watchlistItems"); + if (watchlistItemId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'watchlistItems'.", id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, context); + } + + private WatchlistItemsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public WatchlistItemImpl define(String name) { + return new WatchlistItemImpl(name, this.manager()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistsClientImpl.java new file mode 100644 index 000000000000..6884d00e0a5c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistsClientImpl.java @@ -0,0 +1,897 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.WatchlistsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.WatchlistInner; +import com.azure.resourcemanager.securityinsights.models.WatchlistList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in WatchlistsClient. */ +public final class WatchlistsClientImpl implements WatchlistsClient { + private final ClientLogger logger = new ClientLogger(WatchlistsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WatchlistsService service; + + /** The service client containing this operation class. */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of WatchlistsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WatchlistsClientImpl(SecurityInsightsImpl client) { + this.service = + RestProxy.create(WatchlistsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsWatchlists to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsWatc") + private interface WatchlistsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("watchlistAlias") String watchlistAlias, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("watchlistAlias") String watchlistAlias, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("watchlistAlias") String watchlistAlias, + @BodyParam("application/json") WatchlistInner watchlist, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all watchlists, without watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all watchlists, without watchlist items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all watchlists, without watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all watchlists, without watchlist items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all watchlists, without watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all watchlists, without watchlist items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all watchlists, without watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all watchlists, without watchlist items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all watchlists, without watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all watchlists, without watchlist items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + } + + /** + * Gets all watchlists, without watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all watchlists, without watchlist items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Gets a watchlist, without its watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a watchlist, without its watchlist items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String watchlistAlias) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (watchlistAlias == null) { + return Mono.error(new IllegalArgumentException("Parameter watchlistAlias is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + watchlistAlias, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a watchlist, without its watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a watchlist, without its watchlist items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String watchlistAlias, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (watchlistAlias == null) { + return Mono.error(new IllegalArgumentException("Parameter watchlistAlias is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + watchlistAlias, + accept, + context); + } + + /** + * Gets a watchlist, without its watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a watchlist, without its watchlist items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String watchlistAlias) { + return getWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a watchlist, without its watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a watchlist, without its watchlist items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WatchlistInner get(String resourceGroupName, String workspaceName, String watchlistAlias) { + return getAsync(resourceGroupName, workspaceName, watchlistAlias).block(); + } + + /** + * Gets a watchlist, without its watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a watchlist, without its watchlist items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String watchlistAlias, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, context).block(); + } + + /** + * Delete a watchlist. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String watchlistAlias) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (watchlistAlias == null) { + return Mono.error(new IllegalArgumentException("Parameter watchlistAlias is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + watchlistAlias, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a watchlist. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String watchlistAlias, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (watchlistAlias == null) { + return Mono.error(new IllegalArgumentException("Parameter watchlistAlias is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + watchlistAlias, + accept, + context); + } + + /** + * Delete a watchlist. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String watchlistAlias) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete a watchlist. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String watchlistAlias) { + deleteAsync(resourceGroupName, workspaceName, watchlistAlias).block(); + } + + /** + * Delete a watchlist. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String watchlistAlias, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, context).block(); + } + + /** + * Creates or updates a watchlist and its watchlist items (bulk creation, e.g. through text/csv content type). To + * create a Watchlist and its items, we should call this endpoint with rawContent and contentType properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlist The watchlist. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Watchlist in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String watchlistAlias, WatchlistInner watchlist) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (watchlistAlias == null) { + return Mono.error(new IllegalArgumentException("Parameter watchlistAlias is required and cannot be null.")); + } + if (watchlist == null) { + return Mono.error(new IllegalArgumentException("Parameter watchlist is required and cannot be null.")); + } else { + watchlist.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + watchlistAlias, + watchlist, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a watchlist and its watchlist items (bulk creation, e.g. through text/csv content type). To + * create a Watchlist and its items, we should call this endpoint with rawContent and contentType properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlist The watchlist. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Watchlist in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String watchlistAlias, + WatchlistInner watchlist, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (watchlistAlias == null) { + return Mono.error(new IllegalArgumentException("Parameter watchlistAlias is required and cannot be null.")); + } + if (watchlist == null) { + return Mono.error(new IllegalArgumentException("Parameter watchlist is required and cannot be null.")); + } else { + watchlist.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + watchlistAlias, + watchlist, + accept, + context); + } + + /** + * Creates or updates a watchlist and its watchlist items (bulk creation, e.g. through text/csv content type). To + * create a Watchlist and its items, we should call this endpoint with rawContent and contentType properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlist The watchlist. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Watchlist in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, String watchlistAlias, WatchlistInner watchlist) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, watchlist) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a watchlist and its watchlist items (bulk creation, e.g. through text/csv content type). To + * create a Watchlist and its items, we should call this endpoint with rawContent and contentType properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlist The watchlist. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Watchlist in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WatchlistInner createOrUpdate( + String resourceGroupName, String workspaceName, String watchlistAlias, WatchlistInner watchlist) { + return createOrUpdateAsync(resourceGroupName, workspaceName, watchlistAlias, watchlist).block(); + } + + /** + * Creates or updates a watchlist and its watchlist items (bulk creation, e.g. through text/csv content type). To + * create a Watchlist and its items, we should call this endpoint with rawContent and contentType properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlist The watchlist. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Watchlist in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String watchlistAlias, + WatchlistInner watchlist, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, watchlist, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the watchlists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the watchlists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistsImpl.java new file mode 100644 index 000000000000..02594b305e8d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistsImpl.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.WatchlistsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.WatchlistInner; +import com.azure.resourcemanager.securityinsights.models.Watchlist; +import com.azure.resourcemanager.securityinsights.models.Watchlists; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WatchlistsImpl implements Watchlists { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WatchlistsImpl.class); + + private final WatchlistsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public WatchlistsImpl( + WatchlistsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new WatchlistImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new WatchlistImpl(inner1, this.manager())); + } + + public Watchlist get(String resourceGroupName, String workspaceName, String watchlistAlias) { + WatchlistInner inner = this.serviceClient().get(resourceGroupName, workspaceName, watchlistAlias); + if (inner != null) { + return new WatchlistImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String watchlistAlias, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, watchlistAlias, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WatchlistImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String watchlistAlias) { + this.serviceClient().delete(resourceGroupName, workspaceName, watchlistAlias); + } + + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String watchlistAlias, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, watchlistAlias, context); + } + + public Watchlist getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String watchlistAlias = Utils.getValueFromIdByName(id, "watchlists"); + if (watchlistAlias == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'watchlists'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, watchlistAlias, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String watchlistAlias = Utils.getValueFromIdByName(id, "watchlists"); + if (watchlistAlias == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'watchlists'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, watchlistAlias, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String watchlistAlias = Utils.getValueFromIdByName(id, "watchlists"); + if (watchlistAlias == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'watchlists'.", id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, watchlistAlias, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String watchlistAlias = Utils.getValueFromIdByName(id, "watchlists"); + if (watchlistAlias == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'watchlists'.", id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, watchlistAlias, context); + } + + private WatchlistsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public WatchlistImpl define(String name) { + return new WatchlistImpl(name, this.manager()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/package-info.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/package-info.java new file mode 100644 index 000000000000..456876fc95a3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for SecurityInsights. API spec for Microsoft.SecurityInsights (Azure Security + * Insights) resource provider. + */ +package com.azure.resourcemanager.securityinsights.implementation; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AadCheckRequirements.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AadCheckRequirements.java new file mode 100644 index 000000000000..aa548471f32e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AadCheckRequirements.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AadCheckRequirementsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents AAD (Azure Active Directory) requirements check request. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AzureActiveDirectory") +@Fluent +public final class AadCheckRequirements extends DataConnectorsCheckRequirements { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AadCheckRequirements.class); + + /* + * AAD (Azure Active Directory) requirements check properties. + */ + @JsonProperty(value = "properties") + private AadCheckRequirementsProperties innerProperties; + + /** + * Get the innerProperties property: AAD (Azure Active Directory) requirements check properties. + * + * @return the innerProperties value. + */ + private AadCheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AadDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AadDataConnector.java new file mode 100644 index 000000000000..7e57c4b281aa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AadDataConnector.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AadDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents AAD (Azure Active Directory) data connector. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AzureActiveDirectory") +@Fluent +public final class AadDataConnector extends DataConnectorInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AadDataConnector.class); + + /* + * AAD (Azure Active Directory) data connector properties. + */ + @JsonProperty(value = "properties") + private AadDataConnectorProperties innerProperties; + + /** + * Get the innerProperties property: AAD (Azure Active Directory) data connector properties. + * + * @return the innerProperties value. + */ + private AadDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public AadDataConnector withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public AlertsDataTypeOfDataConnector dataTypes() { + return this.innerProperties() == null ? null : this.innerProperties().dataTypes(); + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the AadDataConnector object itself. + */ + public AadDataConnector withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new AadDataConnectorProperties(); + } + this.innerProperties().withDataTypes(dataTypes); + return this; + } + + /** + * Get the tenantId property: The tenant id to connect to, and get the data from. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Set the tenantId property: The tenant id to connect to, and get the data from. + * + * @param tenantId the tenantId value to set. + * @return the AadDataConnector object itself. + */ + public AadDataConnector withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new AadDataConnectorProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AatpCheckRequirements.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AatpCheckRequirements.java new file mode 100644 index 000000000000..4ec8c3071e8a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AatpCheckRequirements.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AatpCheckRequirementsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents AATP (Azure Advanced Threat Protection) requirements check request. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AzureAdvancedThreatProtection") +@Fluent +public final class AatpCheckRequirements extends DataConnectorsCheckRequirements { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AatpCheckRequirements.class); + + /* + * AATP (Azure Advanced Threat Protection) requirements check properties. + */ + @JsonProperty(value = "properties") + private AatpCheckRequirementsProperties innerProperties; + + /** + * Get the innerProperties property: AATP (Azure Advanced Threat Protection) requirements check properties. + * + * @return the innerProperties value. + */ + private AatpCheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AatpDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AatpDataConnector.java new file mode 100644 index 000000000000..d8716b26271d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AatpDataConnector.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AatpDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents AATP (Azure Advanced Threat Protection) data connector. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AzureAdvancedThreatProtection") +@Fluent +public final class AatpDataConnector extends DataConnectorInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AatpDataConnector.class); + + /* + * AATP (Azure Advanced Threat Protection) data connector properties. + */ + @JsonProperty(value = "properties") + private AatpDataConnectorProperties innerProperties; + + /** + * Get the innerProperties property: AATP (Azure Advanced Threat Protection) data connector properties. + * + * @return the innerProperties value. + */ + private AatpDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public AatpDataConnector withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public AlertsDataTypeOfDataConnector dataTypes() { + return this.innerProperties() == null ? null : this.innerProperties().dataTypes(); + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the AatpDataConnector object itself. + */ + public AatpDataConnector withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new AatpDataConnectorProperties(); + } + this.innerProperties().withDataTypes(dataTypes); + return this; + } + + /** + * Get the tenantId property: The tenant id to connect to, and get the data from. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Set the tenantId property: The tenant id to connect to, and get the data from. + * + * @param tenantId the tenantId value to set. + * @return the AatpDataConnector object itself. + */ + public AatpDataConnector withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new AatpDataConnectorProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AccountEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AccountEntity.java new file mode 100644 index 000000000000..46baf97509c4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AccountEntity.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AccountEntityProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; +import java.util.UUID; + +/** Represents an account entity. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Account") +@Fluent +public final class AccountEntity extends EntityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AccountEntity.class); + + /* + * Account entity properties + */ + @JsonProperty(value = "properties") + private AccountEntityProperties innerProperties; + + /** + * Get the innerProperties property: Account entity properties. + * + * @return the innerProperties value. + */ + private AccountEntityProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the aadTenantId property: The Azure Active Directory tenant id. + * + * @return the aadTenantId value. + */ + public String aadTenantId() { + return this.innerProperties() == null ? null : this.innerProperties().aadTenantId(); + } + + /** + * Get the aadUserId property: The Azure Active Directory user id. + * + * @return the aadUserId value. + */ + public String aadUserId() { + return this.innerProperties() == null ? null : this.innerProperties().aadUserId(); + } + + /** + * Get the accountName property: The name of the account. This field should hold only the name without any domain + * added to it, i.e. administrator. + * + * @return the accountName value. + */ + public String accountName() { + return this.innerProperties() == null ? null : this.innerProperties().accountName(); + } + + /** + * Get the displayName property: The display name of the account. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Get the hostEntityId property: The Host entity id that contains the account in case it is a local account (not + * domain joined). + * + * @return the hostEntityId value. + */ + public String hostEntityId() { + return this.innerProperties() == null ? null : this.innerProperties().hostEntityId(); + } + + /** + * Get the isDomainJoined property: Determines whether this is a domain account. + * + * @return the isDomainJoined value. + */ + public Boolean isDomainJoined() { + return this.innerProperties() == null ? null : this.innerProperties().isDomainJoined(); + } + + /** + * Get the ntDomain property: The NetBIOS domain name as it appears in the alert format domain/username. Examples: + * NT AUTHORITY. + * + * @return the ntDomain value. + */ + public String ntDomain() { + return this.innerProperties() == null ? null : this.innerProperties().ntDomain(); + } + + /** + * Get the objectGuid property: The objectGUID attribute is a single-value attribute that is the unique identifier + * for the object, assigned by active directory. + * + * @return the objectGuid value. + */ + public UUID objectGuid() { + return this.innerProperties() == null ? null : this.innerProperties().objectGuid(); + } + + /** + * Get the puid property: The Azure Active Directory Passport User ID. + * + * @return the puid value. + */ + public String puid() { + return this.innerProperties() == null ? null : this.innerProperties().puid(); + } + + /** + * Get the sid property: The account security identifier, e.g. S-1-5-18. + * + * @return the sid value. + */ + public String sid() { + return this.innerProperties() == null ? null : this.innerProperties().sid(); + } + + /** + * Get the upnSuffix property: The user principal name suffix for the account, in some cases it is also the domain + * name. Examples: contoso.com. + * + * @return the upnSuffix value. + */ + public String upnSuffix() { + return this.innerProperties() == null ? null : this.innerProperties().upnSuffix(); + } + + /** + * Get the dnsDomain property: The fully qualified domain DNS name. + * + * @return the dnsDomain value. + */ + public String dnsDomain() { + return this.innerProperties() == null ? null : this.innerProperties().dnsDomain(); + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionPropertiesBase.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionPropertiesBase.java new file mode 100644 index 000000000000..536a8e46859f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionPropertiesBase.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Action property bag base. */ +@Fluent +public class ActionPropertiesBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ActionPropertiesBase.class); + + /* + * Logic App Resource Id, + * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. + */ + @JsonProperty(value = "logicAppResourceId", required = true) + private String logicAppResourceId; + + /** + * Get the logicAppResourceId property: Logic App Resource Id, + * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. + * + * @return the logicAppResourceId value. + */ + public String logicAppResourceId() { + return this.logicAppResourceId; + } + + /** + * Set the logicAppResourceId property: Logic App Resource Id, + * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. + * + * @param logicAppResourceId the logicAppResourceId value to set. + * @return the ActionPropertiesBase object itself. + */ + public ActionPropertiesBase withLogicAppResourceId(String logicAppResourceId) { + this.logicAppResourceId = logicAppResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logicAppResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property logicAppResourceId in model ActionPropertiesBase")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionRequest.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionRequest.java new file mode 100644 index 000000000000..895da6b6de43 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionRequest.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.ActionRequestProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Action for alert rule. */ +@Fluent +public final class ActionRequest extends ResourceWithEtag { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ActionRequest.class); + + /* + * Action properties for put request + */ + @JsonProperty(value = "properties") + private ActionRequestProperties innerProperties; + + /** + * Get the innerProperties property: Action properties for put request. + * + * @return the innerProperties value. + */ + private ActionRequestProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public ActionRequest withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the triggerUri property: Logic App Callback URL for this specific workflow. + * + * @return the triggerUri value. + */ + public String triggerUri() { + return this.innerProperties() == null ? null : this.innerProperties().triggerUri(); + } + + /** + * Set the triggerUri property: Logic App Callback URL for this specific workflow. + * + * @param triggerUri the triggerUri value to set. + * @return the ActionRequest object itself. + */ + public ActionRequest withTriggerUri(String triggerUri) { + if (this.innerProperties() == null) { + this.innerProperties = new ActionRequestProperties(); + } + this.innerProperties().withTriggerUri(triggerUri); + return this; + } + + /** + * Get the logicAppResourceId property: Logic App Resource Id, + * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. + * + * @return the logicAppResourceId value. + */ + public String logicAppResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().logicAppResourceId(); + } + + /** + * Set the logicAppResourceId property: Logic App Resource Id, + * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. + * + * @param logicAppResourceId the logicAppResourceId value to set. + * @return the ActionRequest object itself. + */ + public ActionRequest withLogicAppResourceId(String logicAppResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new ActionRequestProperties(); + } + this.innerProperties().withLogicAppResourceId(logicAppResourceId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionResponse.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionResponse.java new file mode 100644 index 000000000000..649ea7cb5a4d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionResponse.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.ActionResponseInner; + +/** An immutable client-side representation of ActionResponse. */ +public interface ActionResponse { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the workflowId property: The name of the logic app's workflow. + * + * @return the workflowId value. + */ + String workflowId(); + + /** + * Gets the logicAppResourceId property: Logic App Resource Id, + * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. + * + * @return the logicAppResourceId value. + */ + String logicAppResourceId(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.ActionResponseInner object. + * + * @return the inner object. + */ + ActionResponseInner innerModel(); + + /** The entirety of the ActionResponse definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ActionResponse definition stages. */ + interface DefinitionStages { + /** The first stage of the ActionResponse definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ActionResponse definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName, ruleId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @return the next definition stage. + */ + WithCreate withExistingAlertRule(String resourceGroupName, String workspaceName, String ruleId); + } + /** + * The stage of the ActionResponse definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithEtag, + DefinitionStages.WithTriggerUri, + DefinitionStages.WithLogicAppResourceId { + /** + * Executes the create request. + * + * @return the created resource. + */ + ActionResponse create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ActionResponse create(Context context); + } + /** The stage of the ActionResponse definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Etag of the azure resource. + * + * @param etag Etag of the azure resource. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the ActionResponse definition allowing to specify triggerUri. */ + interface WithTriggerUri { + /** + * Specifies the triggerUri property: Logic App Callback URL for this specific workflow.. + * + * @param triggerUri Logic App Callback URL for this specific workflow. + * @return the next definition stage. + */ + WithCreate withTriggerUri(String triggerUri); + } + /** The stage of the ActionResponse definition allowing to specify logicAppResourceId. */ + interface WithLogicAppResourceId { + /** + * Specifies the logicAppResourceId property: Logic App Resource Id, + * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}.. + * + * @param logicAppResourceId Logic App Resource Id, + * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. + * @return the next definition stage. + */ + WithCreate withLogicAppResourceId(String logicAppResourceId); + } + } + /** + * Begins update for the ActionResponse resource. + * + * @return the stage of resource update. + */ + ActionResponse.Update update(); + + /** The template for ActionResponse update. */ + interface Update extends UpdateStages.WithEtag, UpdateStages.WithTriggerUri, UpdateStages.WithLogicAppResourceId { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ActionResponse apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ActionResponse apply(Context context); + } + /** The ActionResponse update stages. */ + interface UpdateStages { + /** The stage of the ActionResponse update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Etag of the azure resource. + * + * @param etag Etag of the azure resource. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + /** The stage of the ActionResponse update allowing to specify triggerUri. */ + interface WithTriggerUri { + /** + * Specifies the triggerUri property: Logic App Callback URL for this specific workflow.. + * + * @param triggerUri Logic App Callback URL for this specific workflow. + * @return the next definition stage. + */ + Update withTriggerUri(String triggerUri); + } + /** The stage of the ActionResponse update allowing to specify logicAppResourceId. */ + interface WithLogicAppResourceId { + /** + * Specifies the logicAppResourceId property: Logic App Resource Id, + * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}.. + * + * @param logicAppResourceId Logic App Resource Id, + * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. + * @return the next definition stage. + */ + Update withLogicAppResourceId(String logicAppResourceId); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ActionResponse refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ActionResponse refresh(Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Actions.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Actions.java new file mode 100644 index 000000000000..e8d1c453b0de --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Actions.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Actions. */ +public interface Actions { + /** + * Gets all actions of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all actions of alert rule. + */ + PagedIterable listByAlertRule(String resourceGroupName, String workspaceName, String ruleId); + + /** + * Gets all actions of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all actions of alert rule. + */ + PagedIterable listByAlertRule( + String resourceGroupName, String workspaceName, String ruleId, Context context); + + /** + * Gets the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the action of alert rule. + */ + ActionResponse get(String resourceGroupName, String workspaceName, String ruleId, String actionId); + + /** + * Gets the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the action of alert rule. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String ruleId, String actionId, Context context); + + /** + * Delete the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String ruleId, String actionId); + + /** + * Delete the action of alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param actionId Action ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String ruleId, String actionId, Context context); + + /** + * Gets the action of alert rule. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the action of alert rule. + */ + ActionResponse getById(String id); + + /** + * Gets the action of alert rule. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the action of alert rule. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the action of alert rule. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the action of alert rule. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ActionResponse resource. + * + * @param name resource name. + * @return the first stage of the new ActionResponse definition. + */ + ActionResponse.DefinitionStages.Blank define(String name); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionsList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionsList.java new file mode 100644 index 000000000000..7edbb2c3f659 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionsList.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.ActionResponseInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List all the actions. */ +@Fluent +public final class ActionsList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ActionsList.class); + + /* + * URL to fetch the next set of actions. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of actions. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the nextLink property: URL to fetch the next set of actions. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of actions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of actions. + * + * @param value the value value to set. + * @return the ActionsList object itself. + */ + public ActionsList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model ActionsList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityCustomEntityQuery.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityCustomEntityQuery.java new file mode 100644 index 000000000000..acc4093b435d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityCustomEntityQuery.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.ActivityEntityQueriesProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Represents Activity entity query. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Activity") +@Fluent +public final class ActivityCustomEntityQuery extends CustomEntityQuery { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ActivityCustomEntityQuery.class); + + /* + * Activity entity query properties + */ + @JsonProperty(value = "properties") + private ActivityEntityQueriesProperties innerProperties; + + /** + * Get the innerProperties property: Activity entity query properties. + * + * @return the innerProperties value. + */ + private ActivityEntityQueriesProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public ActivityCustomEntityQuery withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the title property: The entity query title. + * + * @return the title value. + */ + public String title() { + return this.innerProperties() == null ? null : this.innerProperties().title(); + } + + /** + * Set the title property: The entity query title. + * + * @param title the title value to set. + * @return the ActivityCustomEntityQuery object itself. + */ + public ActivityCustomEntityQuery withTitle(String title) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueriesProperties(); + } + this.innerProperties().withTitle(title); + return this; + } + + /** + * Get the content property: The entity query content to display in timeline. + * + * @return the content value. + */ + public String content() { + return this.innerProperties() == null ? null : this.innerProperties().content(); + } + + /** + * Set the content property: The entity query content to display in timeline. + * + * @param content the content value to set. + * @return the ActivityCustomEntityQuery object itself. + */ + public ActivityCustomEntityQuery withContent(String content) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueriesProperties(); + } + this.innerProperties().withContent(content); + return this; + } + + /** + * Get the description property: The entity query description. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The entity query description. + * + * @param description the description value to set. + * @return the ActivityCustomEntityQuery object itself. + */ + public ActivityCustomEntityQuery withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueriesProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the queryDefinitions property: The Activity query definitions. + * + * @return the queryDefinitions value. + */ + public ActivityEntityQueriesPropertiesQueryDefinitions queryDefinitions() { + return this.innerProperties() == null ? null : this.innerProperties().queryDefinitions(); + } + + /** + * Set the queryDefinitions property: The Activity query definitions. + * + * @param queryDefinitions the queryDefinitions value to set. + * @return the ActivityCustomEntityQuery object itself. + */ + public ActivityCustomEntityQuery withQueryDefinitions( + ActivityEntityQueriesPropertiesQueryDefinitions queryDefinitions) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueriesProperties(); + } + this.innerProperties().withQueryDefinitions(queryDefinitions); + return this; + } + + /** + * Get the inputEntityType property: The type of the query's source entity. + * + * @return the inputEntityType value. + */ + public EntityType inputEntityType() { + return this.innerProperties() == null ? null : this.innerProperties().inputEntityType(); + } + + /** + * Set the inputEntityType property: The type of the query's source entity. + * + * @param inputEntityType the inputEntityType value to set. + * @return the ActivityCustomEntityQuery object itself. + */ + public ActivityCustomEntityQuery withInputEntityType(EntityType inputEntityType) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueriesProperties(); + } + this.innerProperties().withInputEntityType(inputEntityType); + return this; + } + + /** + * Get the requiredInputFieldsSets property: List of the fields of the source entity that are required to run the + * query. + * + * @return the requiredInputFieldsSets value. + */ + public List> requiredInputFieldsSets() { + return this.innerProperties() == null ? null : this.innerProperties().requiredInputFieldsSets(); + } + + /** + * Set the requiredInputFieldsSets property: List of the fields of the source entity that are required to run the + * query. + * + * @param requiredInputFieldsSets the requiredInputFieldsSets value to set. + * @return the ActivityCustomEntityQuery object itself. + */ + public ActivityCustomEntityQuery withRequiredInputFieldsSets(List> requiredInputFieldsSets) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueriesProperties(); + } + this.innerProperties().withRequiredInputFieldsSets(requiredInputFieldsSets); + return this; + } + + /** + * Get the entitiesFilter property: The query applied only to entities matching to all filters. + * + * @return the entitiesFilter value. + */ + public Map> entitiesFilter() { + return this.innerProperties() == null ? null : this.innerProperties().entitiesFilter(); + } + + /** + * Set the entitiesFilter property: The query applied only to entities matching to all filters. + * + * @param entitiesFilter the entitiesFilter value to set. + * @return the ActivityCustomEntityQuery object itself. + */ + public ActivityCustomEntityQuery withEntitiesFilter(Map> entitiesFilter) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueriesProperties(); + } + this.innerProperties().withEntitiesFilter(entitiesFilter); + return this; + } + + /** + * Get the templateName property: The template id this activity was created from. + * + * @return the templateName value. + */ + public String templateName() { + return this.innerProperties() == null ? null : this.innerProperties().templateName(); + } + + /** + * Set the templateName property: The template id this activity was created from. + * + * @param templateName the templateName value to set. + * @return the ActivityCustomEntityQuery object itself. + */ + public ActivityCustomEntityQuery withTemplateName(String templateName) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueriesProperties(); + } + this.innerProperties().withTemplateName(templateName); + return this; + } + + /** + * Get the enabled property: Determines whether this activity is enabled or disabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.innerProperties() == null ? null : this.innerProperties().enabled(); + } + + /** + * Set the enabled property: Determines whether this activity is enabled or disabled. + * + * @param enabled the enabled value to set. + * @return the ActivityCustomEntityQuery object itself. + */ + public ActivityCustomEntityQuery withEnabled(Boolean enabled) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueriesProperties(); + } + this.innerProperties().withEnabled(enabled); + return this; + } + + /** + * Get the createdTimeUtc property: The time the activity was created. + * + * @return the createdTimeUtc value. + */ + public OffsetDateTime createdTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().createdTimeUtc(); + } + + /** + * Get the lastModifiedTimeUtc property: The last time the activity was updated. + * + * @return the lastModifiedTimeUtc value. + */ + public OffsetDateTime lastModifiedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTimeUtc(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQueriesPropertiesQueryDefinitions.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQueriesPropertiesQueryDefinitions.java new file mode 100644 index 000000000000..5e6d1ae330cd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQueriesPropertiesQueryDefinitions.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Activity query definitions. */ +@Fluent +public final class ActivityEntityQueriesPropertiesQueryDefinitions { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ActivityEntityQueriesPropertiesQueryDefinitions.class); + + /* + * The Activity query to run on a given entity + */ + @JsonProperty(value = "query") + private String query; + + /** + * Get the query property: The Activity query to run on a given entity. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * Set the query property: The Activity query to run on a given entity. + * + * @param query the query value to set. + * @return the ActivityEntityQueriesPropertiesQueryDefinitions object itself. + */ + public ActivityEntityQueriesPropertiesQueryDefinitions withQuery(String query) { + this.query = query; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQuery.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQuery.java new file mode 100644 index 000000000000..33610aedf4a0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQuery.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.ActivityEntityQueriesProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Represents Activity entity query. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Activity") +@Fluent +public final class ActivityEntityQuery extends EntityQueryInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ActivityEntityQuery.class); + + /* + * Activity entity query properties + */ + @JsonProperty(value = "properties") + private ActivityEntityQueriesProperties innerProperties; + + /** + * Get the innerProperties property: Activity entity query properties. + * + * @return the innerProperties value. + */ + private ActivityEntityQueriesProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public ActivityEntityQuery withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the title property: The entity query title. + * + * @return the title value. + */ + public String title() { + return this.innerProperties() == null ? null : this.innerProperties().title(); + } + + /** + * Set the title property: The entity query title. + * + * @param title the title value to set. + * @return the ActivityEntityQuery object itself. + */ + public ActivityEntityQuery withTitle(String title) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueriesProperties(); + } + this.innerProperties().withTitle(title); + return this; + } + + /** + * Get the content property: The entity query content to display in timeline. + * + * @return the content value. + */ + public String content() { + return this.innerProperties() == null ? null : this.innerProperties().content(); + } + + /** + * Set the content property: The entity query content to display in timeline. + * + * @param content the content value to set. + * @return the ActivityEntityQuery object itself. + */ + public ActivityEntityQuery withContent(String content) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueriesProperties(); + } + this.innerProperties().withContent(content); + return this; + } + + /** + * Get the description property: The entity query description. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The entity query description. + * + * @param description the description value to set. + * @return the ActivityEntityQuery object itself. + */ + public ActivityEntityQuery withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueriesProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the queryDefinitions property: The Activity query definitions. + * + * @return the queryDefinitions value. + */ + public ActivityEntityQueriesPropertiesQueryDefinitions queryDefinitions() { + return this.innerProperties() == null ? null : this.innerProperties().queryDefinitions(); + } + + /** + * Set the queryDefinitions property: The Activity query definitions. + * + * @param queryDefinitions the queryDefinitions value to set. + * @return the ActivityEntityQuery object itself. + */ + public ActivityEntityQuery withQueryDefinitions(ActivityEntityQueriesPropertiesQueryDefinitions queryDefinitions) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueriesProperties(); + } + this.innerProperties().withQueryDefinitions(queryDefinitions); + return this; + } + + /** + * Get the inputEntityType property: The type of the query's source entity. + * + * @return the inputEntityType value. + */ + public EntityType inputEntityType() { + return this.innerProperties() == null ? null : this.innerProperties().inputEntityType(); + } + + /** + * Set the inputEntityType property: The type of the query's source entity. + * + * @param inputEntityType the inputEntityType value to set. + * @return the ActivityEntityQuery object itself. + */ + public ActivityEntityQuery withInputEntityType(EntityType inputEntityType) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueriesProperties(); + } + this.innerProperties().withInputEntityType(inputEntityType); + return this; + } + + /** + * Get the requiredInputFieldsSets property: List of the fields of the source entity that are required to run the + * query. + * + * @return the requiredInputFieldsSets value. + */ + public List> requiredInputFieldsSets() { + return this.innerProperties() == null ? null : this.innerProperties().requiredInputFieldsSets(); + } + + /** + * Set the requiredInputFieldsSets property: List of the fields of the source entity that are required to run the + * query. + * + * @param requiredInputFieldsSets the requiredInputFieldsSets value to set. + * @return the ActivityEntityQuery object itself. + */ + public ActivityEntityQuery withRequiredInputFieldsSets(List> requiredInputFieldsSets) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueriesProperties(); + } + this.innerProperties().withRequiredInputFieldsSets(requiredInputFieldsSets); + return this; + } + + /** + * Get the entitiesFilter property: The query applied only to entities matching to all filters. + * + * @return the entitiesFilter value. + */ + public Map> entitiesFilter() { + return this.innerProperties() == null ? null : this.innerProperties().entitiesFilter(); + } + + /** + * Set the entitiesFilter property: The query applied only to entities matching to all filters. + * + * @param entitiesFilter the entitiesFilter value to set. + * @return the ActivityEntityQuery object itself. + */ + public ActivityEntityQuery withEntitiesFilter(Map> entitiesFilter) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueriesProperties(); + } + this.innerProperties().withEntitiesFilter(entitiesFilter); + return this; + } + + /** + * Get the templateName property: The template id this activity was created from. + * + * @return the templateName value. + */ + public String templateName() { + return this.innerProperties() == null ? null : this.innerProperties().templateName(); + } + + /** + * Set the templateName property: The template id this activity was created from. + * + * @param templateName the templateName value to set. + * @return the ActivityEntityQuery object itself. + */ + public ActivityEntityQuery withTemplateName(String templateName) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueriesProperties(); + } + this.innerProperties().withTemplateName(templateName); + return this; + } + + /** + * Get the enabled property: Determines whether this activity is enabled or disabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.innerProperties() == null ? null : this.innerProperties().enabled(); + } + + /** + * Set the enabled property: Determines whether this activity is enabled or disabled. + * + * @param enabled the enabled value to set. + * @return the ActivityEntityQuery object itself. + */ + public ActivityEntityQuery withEnabled(Boolean enabled) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueriesProperties(); + } + this.innerProperties().withEnabled(enabled); + return this; + } + + /** + * Get the createdTimeUtc property: The time the activity was created. + * + * @return the createdTimeUtc value. + */ + public OffsetDateTime createdTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().createdTimeUtc(); + } + + /** + * Get the lastModifiedTimeUtc property: The last time the activity was updated. + * + * @return the lastModifiedTimeUtc value. + */ + public OffsetDateTime lastModifiedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTimeUtc(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQueryTemplate.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQueryTemplate.java new file mode 100644 index 000000000000..653d2b31784a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQueryTemplate.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.ActivityEntityQueryTemplateProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryTemplateInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Represents Activity entity query. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Activity") +@Fluent +public final class ActivityEntityQueryTemplate extends EntityQueryTemplateInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ActivityEntityQueryTemplate.class); + + /* + * Activity entity query properties + */ + @JsonProperty(value = "properties") + private ActivityEntityQueryTemplateProperties innerProperties; + + /** + * Get the innerProperties property: Activity entity query properties. + * + * @return the innerProperties value. + */ + private ActivityEntityQueryTemplateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the title property: The entity query title. + * + * @return the title value. + */ + public String title() { + return this.innerProperties() == null ? null : this.innerProperties().title(); + } + + /** + * Set the title property: The entity query title. + * + * @param title the title value to set. + * @return the ActivityEntityQueryTemplate object itself. + */ + public ActivityEntityQueryTemplate withTitle(String title) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueryTemplateProperties(); + } + this.innerProperties().withTitle(title); + return this; + } + + /** + * Get the content property: The entity query content to display in timeline. + * + * @return the content value. + */ + public String content() { + return this.innerProperties() == null ? null : this.innerProperties().content(); + } + + /** + * Set the content property: The entity query content to display in timeline. + * + * @param content the content value to set. + * @return the ActivityEntityQueryTemplate object itself. + */ + public ActivityEntityQueryTemplate withContent(String content) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueryTemplateProperties(); + } + this.innerProperties().withContent(content); + return this; + } + + /** + * Get the description property: The entity query description. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The entity query description. + * + * @param description the description value to set. + * @return the ActivityEntityQueryTemplate object itself. + */ + public ActivityEntityQueryTemplate withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueryTemplateProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the queryDefinitions property: The Activity query definitions. + * + * @return the queryDefinitions value. + */ + public ActivityEntityQueryTemplatePropertiesQueryDefinitions queryDefinitions() { + return this.innerProperties() == null ? null : this.innerProperties().queryDefinitions(); + } + + /** + * Set the queryDefinitions property: The Activity query definitions. + * + * @param queryDefinitions the queryDefinitions value to set. + * @return the ActivityEntityQueryTemplate object itself. + */ + public ActivityEntityQueryTemplate withQueryDefinitions( + ActivityEntityQueryTemplatePropertiesQueryDefinitions queryDefinitions) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueryTemplateProperties(); + } + this.innerProperties().withQueryDefinitions(queryDefinitions); + return this; + } + + /** + * Get the dataTypes property: List of required data types for the given entity query template. + * + * @return the dataTypes value. + */ + public List dataTypes() { + return this.innerProperties() == null ? null : this.innerProperties().dataTypes(); + } + + /** + * Set the dataTypes property: List of required data types for the given entity query template. + * + * @param dataTypes the dataTypes value to set. + * @return the ActivityEntityQueryTemplate object itself. + */ + public ActivityEntityQueryTemplate withDataTypes(List dataTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueryTemplateProperties(); + } + this.innerProperties().withDataTypes(dataTypes); + return this; + } + + /** + * Get the inputEntityType property: The type of the query's source entity. + * + * @return the inputEntityType value. + */ + public EntityType inputEntityType() { + return this.innerProperties() == null ? null : this.innerProperties().inputEntityType(); + } + + /** + * Set the inputEntityType property: The type of the query's source entity. + * + * @param inputEntityType the inputEntityType value to set. + * @return the ActivityEntityQueryTemplate object itself. + */ + public ActivityEntityQueryTemplate withInputEntityType(EntityType inputEntityType) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueryTemplateProperties(); + } + this.innerProperties().withInputEntityType(inputEntityType); + return this; + } + + /** + * Get the requiredInputFieldsSets property: List of the fields of the source entity that are required to run the + * query. + * + * @return the requiredInputFieldsSets value. + */ + public List> requiredInputFieldsSets() { + return this.innerProperties() == null ? null : this.innerProperties().requiredInputFieldsSets(); + } + + /** + * Set the requiredInputFieldsSets property: List of the fields of the source entity that are required to run the + * query. + * + * @param requiredInputFieldsSets the requiredInputFieldsSets value to set. + * @return the ActivityEntityQueryTemplate object itself. + */ + public ActivityEntityQueryTemplate withRequiredInputFieldsSets(List> requiredInputFieldsSets) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueryTemplateProperties(); + } + this.innerProperties().withRequiredInputFieldsSets(requiredInputFieldsSets); + return this; + } + + /** + * Get the entitiesFilter property: The query applied only to entities matching to all filters. + * + * @return the entitiesFilter value. + */ + public Map> entitiesFilter() { + return this.innerProperties() == null ? null : this.innerProperties().entitiesFilter(); + } + + /** + * Set the entitiesFilter property: The query applied only to entities matching to all filters. + * + * @param entitiesFilter the entitiesFilter value to set. + * @return the ActivityEntityQueryTemplate object itself. + */ + public ActivityEntityQueryTemplate withEntitiesFilter(Map> entitiesFilter) { + if (this.innerProperties() == null) { + this.innerProperties = new ActivityEntityQueryTemplateProperties(); + } + this.innerProperties().withEntitiesFilter(entitiesFilter); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQueryTemplatePropertiesQueryDefinitions.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQueryTemplatePropertiesQueryDefinitions.java new file mode 100644 index 000000000000..4b3f2e0c3736 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQueryTemplatePropertiesQueryDefinitions.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Activity query definitions. */ +@Fluent +public final class ActivityEntityQueryTemplatePropertiesQueryDefinitions { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ActivityEntityQueryTemplatePropertiesQueryDefinitions.class); + + /* + * The Activity query to run on a given entity + */ + @JsonProperty(value = "query") + private String query; + + /* + * The dimensions we want to summarize the timeline results on, this is + * comma separated list + */ + @JsonProperty(value = "summarizeBy") + private String summarizeBy; + + /** + * Get the query property: The Activity query to run on a given entity. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * Set the query property: The Activity query to run on a given entity. + * + * @param query the query value to set. + * @return the ActivityEntityQueryTemplatePropertiesQueryDefinitions object itself. + */ + public ActivityEntityQueryTemplatePropertiesQueryDefinitions withQuery(String query) { + this.query = query; + return this; + } + + /** + * Get the summarizeBy property: The dimensions we want to summarize the timeline results on, this is comma + * separated list. + * + * @return the summarizeBy value. + */ + public String summarizeBy() { + return this.summarizeBy; + } + + /** + * Set the summarizeBy property: The dimensions we want to summarize the timeline results on, this is comma + * separated list. + * + * @param summarizeBy the summarizeBy value to set. + * @return the ActivityEntityQueryTemplatePropertiesQueryDefinitions object itself. + */ + public ActivityEntityQueryTemplatePropertiesQueryDefinitions withSummarizeBy(String summarizeBy) { + this.summarizeBy = summarizeBy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityTimelineItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityTimelineItem.java new file mode 100644 index 000000000000..eaf3e78c2b27 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityTimelineItem.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** Represents Activity timeline item. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Activity") +@Fluent +public final class ActivityTimelineItem extends EntityTimelineItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ActivityTimelineItem.class); + + /* + * The activity query id. + */ + @JsonProperty(value = "queryId", required = true) + private String queryId; + + /* + * The grouping bucket start time. + */ + @JsonProperty(value = "bucketStartTimeUTC", required = true) + private OffsetDateTime bucketStartTimeUtc; + + /* + * The grouping bucket end time. + */ + @JsonProperty(value = "bucketEndTimeUTC", required = true) + private OffsetDateTime bucketEndTimeUtc; + + /* + * The time of the first activity in the grouping bucket. + */ + @JsonProperty(value = "firstActivityTimeUTC", required = true) + private OffsetDateTime firstActivityTimeUtc; + + /* + * The time of the last activity in the grouping bucket. + */ + @JsonProperty(value = "lastActivityTimeUTC", required = true) + private OffsetDateTime lastActivityTimeUtc; + + /* + * The activity timeline content. + */ + @JsonProperty(value = "content", required = true) + private String content; + + /* + * The activity timeline title. + */ + @JsonProperty(value = "title", required = true) + private String title; + + /** + * Get the queryId property: The activity query id. + * + * @return the queryId value. + */ + public String queryId() { + return this.queryId; + } + + /** + * Set the queryId property: The activity query id. + * + * @param queryId the queryId value to set. + * @return the ActivityTimelineItem object itself. + */ + public ActivityTimelineItem withQueryId(String queryId) { + this.queryId = queryId; + return this; + } + + /** + * Get the bucketStartTimeUtc property: The grouping bucket start time. + * + * @return the bucketStartTimeUtc value. + */ + public OffsetDateTime bucketStartTimeUtc() { + return this.bucketStartTimeUtc; + } + + /** + * Set the bucketStartTimeUtc property: The grouping bucket start time. + * + * @param bucketStartTimeUtc the bucketStartTimeUtc value to set. + * @return the ActivityTimelineItem object itself. + */ + public ActivityTimelineItem withBucketStartTimeUtc(OffsetDateTime bucketStartTimeUtc) { + this.bucketStartTimeUtc = bucketStartTimeUtc; + return this; + } + + /** + * Get the bucketEndTimeUtc property: The grouping bucket end time. + * + * @return the bucketEndTimeUtc value. + */ + public OffsetDateTime bucketEndTimeUtc() { + return this.bucketEndTimeUtc; + } + + /** + * Set the bucketEndTimeUtc property: The grouping bucket end time. + * + * @param bucketEndTimeUtc the bucketEndTimeUtc value to set. + * @return the ActivityTimelineItem object itself. + */ + public ActivityTimelineItem withBucketEndTimeUtc(OffsetDateTime bucketEndTimeUtc) { + this.bucketEndTimeUtc = bucketEndTimeUtc; + return this; + } + + /** + * Get the firstActivityTimeUtc property: The time of the first activity in the grouping bucket. + * + * @return the firstActivityTimeUtc value. + */ + public OffsetDateTime firstActivityTimeUtc() { + return this.firstActivityTimeUtc; + } + + /** + * Set the firstActivityTimeUtc property: The time of the first activity in the grouping bucket. + * + * @param firstActivityTimeUtc the firstActivityTimeUtc value to set. + * @return the ActivityTimelineItem object itself. + */ + public ActivityTimelineItem withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc) { + this.firstActivityTimeUtc = firstActivityTimeUtc; + return this; + } + + /** + * Get the lastActivityTimeUtc property: The time of the last activity in the grouping bucket. + * + * @return the lastActivityTimeUtc value. + */ + public OffsetDateTime lastActivityTimeUtc() { + return this.lastActivityTimeUtc; + } + + /** + * Set the lastActivityTimeUtc property: The time of the last activity in the grouping bucket. + * + * @param lastActivityTimeUtc the lastActivityTimeUtc value to set. + * @return the ActivityTimelineItem object itself. + */ + public ActivityTimelineItem withLastActivityTimeUtc(OffsetDateTime lastActivityTimeUtc) { + this.lastActivityTimeUtc = lastActivityTimeUtc; + return this; + } + + /** + * Get the content property: The activity timeline content. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: The activity timeline content. + * + * @param content the content value to set. + * @return the ActivityTimelineItem object itself. + */ + public ActivityTimelineItem withContent(String content) { + this.content = content; + return this; + } + + /** + * Get the title property: The activity timeline title. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: The activity timeline title. + * + * @param title the title value to set. + * @return the ActivityTimelineItem object itself. + */ + public ActivityTimelineItem withTitle(String title) { + this.title = title; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (queryId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property queryId in model ActivityTimelineItem")); + } + if (bucketStartTimeUtc() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property bucketStartTimeUtc in model ActivityTimelineItem")); + } + if (bucketEndTimeUtc() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property bucketEndTimeUtc in model ActivityTimelineItem")); + } + if (firstActivityTimeUtc() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property firstActivityTimeUtc in model ActivityTimelineItem")); + } + if (lastActivityTimeUtc() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property lastActivityTimeUtc in model ActivityTimelineItem")); + } + if (content() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property content in model ActivityTimelineItem")); + } + if (title() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property title in model ActivityTimelineItem")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertDetail.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertDetail.java new file mode 100644 index 000000000000..71a61e8f61a3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertDetail.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AlertDetail. */ +public final class AlertDetail extends ExpandableStringEnum { + /** Static value DisplayName for AlertDetail. */ + public static final AlertDetail DISPLAY_NAME = fromString("DisplayName"); + + /** Static value Severity for AlertDetail. */ + public static final AlertDetail SEVERITY = fromString("Severity"); + + /** + * Creates or finds a AlertDetail from its string representation. + * + * @param name a name to look for. + * @return the corresponding AlertDetail. + */ + @JsonCreator + public static AlertDetail fromString(String name) { + return fromString(name, AlertDetail.class); + } + + /** @return known AlertDetail values. */ + public static Collection values() { + return values(AlertDetail.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertDetailsOverride.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertDetailsOverride.java new file mode 100644 index 000000000000..1265dc150277 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertDetailsOverride.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Settings for how to dynamically override alert static details. */ +@Fluent +public final class AlertDetailsOverride { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertDetailsOverride.class); + + /* + * the format containing columns name(s) to override the alert name + */ + @JsonProperty(value = "alertDisplayNameFormat") + private String alertDisplayNameFormat; + + /* + * the format containing columns name(s) to override the alert description + */ + @JsonProperty(value = "alertDescriptionFormat") + private String alertDescriptionFormat; + + /* + * the column name to take the alert tactics from + */ + @JsonProperty(value = "alertTacticsColumnName") + private String alertTacticsColumnName; + + /* + * the column name to take the alert severity from + */ + @JsonProperty(value = "alertSeverityColumnName") + private String alertSeverityColumnName; + + /** + * Get the alertDisplayNameFormat property: the format containing columns name(s) to override the alert name. + * + * @return the alertDisplayNameFormat value. + */ + public String alertDisplayNameFormat() { + return this.alertDisplayNameFormat; + } + + /** + * Set the alertDisplayNameFormat property: the format containing columns name(s) to override the alert name. + * + * @param alertDisplayNameFormat the alertDisplayNameFormat value to set. + * @return the AlertDetailsOverride object itself. + */ + public AlertDetailsOverride withAlertDisplayNameFormat(String alertDisplayNameFormat) { + this.alertDisplayNameFormat = alertDisplayNameFormat; + return this; + } + + /** + * Get the alertDescriptionFormat property: the format containing columns name(s) to override the alert description. + * + * @return the alertDescriptionFormat value. + */ + public String alertDescriptionFormat() { + return this.alertDescriptionFormat; + } + + /** + * Set the alertDescriptionFormat property: the format containing columns name(s) to override the alert description. + * + * @param alertDescriptionFormat the alertDescriptionFormat value to set. + * @return the AlertDetailsOverride object itself. + */ + public AlertDetailsOverride withAlertDescriptionFormat(String alertDescriptionFormat) { + this.alertDescriptionFormat = alertDescriptionFormat; + return this; + } + + /** + * Get the alertTacticsColumnName property: the column name to take the alert tactics from. + * + * @return the alertTacticsColumnName value. + */ + public String alertTacticsColumnName() { + return this.alertTacticsColumnName; + } + + /** + * Set the alertTacticsColumnName property: the column name to take the alert tactics from. + * + * @param alertTacticsColumnName the alertTacticsColumnName value to set. + * @return the AlertDetailsOverride object itself. + */ + public AlertDetailsOverride withAlertTacticsColumnName(String alertTacticsColumnName) { + this.alertTacticsColumnName = alertTacticsColumnName; + return this; + } + + /** + * Get the alertSeverityColumnName property: the column name to take the alert severity from. + * + * @return the alertSeverityColumnName value. + */ + public String alertSeverityColumnName() { + return this.alertSeverityColumnName; + } + + /** + * Set the alertSeverityColumnName property: the column name to take the alert severity from. + * + * @param alertSeverityColumnName the alertSeverityColumnName value to set. + * @return the AlertDetailsOverride object itself. + */ + public AlertDetailsOverride withAlertSeverityColumnName(String alertSeverityColumnName) { + this.alertSeverityColumnName = alertSeverityColumnName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRule.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRule.java new file mode 100644 index 000000000000..7b9839a7561f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRule.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; + +/** An immutable client-side representation of AlertRule. */ +public interface AlertRule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner object. + * + * @return the inner object. + */ + AlertRuleInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleKind.java new file mode 100644 index 000000000000..1c50076d69af --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleKind.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AlertRuleKind. */ +public final class AlertRuleKind extends ExpandableStringEnum { + /** Static value Scheduled for AlertRuleKind. */ + public static final AlertRuleKind SCHEDULED = fromString("Scheduled"); + + /** Static value MicrosoftSecurityIncidentCreation for AlertRuleKind. */ + public static final AlertRuleKind MICROSOFT_SECURITY_INCIDENT_CREATION = + fromString("MicrosoftSecurityIncidentCreation"); + + /** Static value Fusion for AlertRuleKind. */ + public static final AlertRuleKind FUSION = fromString("Fusion"); + + /** Static value MLBehaviorAnalytics for AlertRuleKind. */ + public static final AlertRuleKind MLBEHAVIOR_ANALYTICS = fromString("MLBehaviorAnalytics"); + + /** Static value ThreatIntelligence for AlertRuleKind. */ + public static final AlertRuleKind THREAT_INTELLIGENCE = fromString("ThreatIntelligence"); + + /** Static value NRT for AlertRuleKind. */ + public static final AlertRuleKind NRT = fromString("NRT"); + + /** + * Creates or finds a AlertRuleKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding AlertRuleKind. + */ + @JsonCreator + public static AlertRuleKind fromString(String name) { + return fromString(name, AlertRuleKind.class); + } + + /** @return known AlertRuleKind values. */ + public static Collection values() { + return values(AlertRuleKind.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplate.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplate.java new file mode 100644 index 000000000000..247c2492e403 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplate.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; + +/** An immutable client-side representation of AlertRuleTemplate. */ +public interface AlertRuleTemplate { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner object. + * + * @return the inner object. + */ + AlertRuleTemplateInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplateDataSource.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplateDataSource.java new file mode 100644 index 000000000000..5d050149811a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplateDataSource.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** alert rule template data sources. */ +@Fluent +public final class AlertRuleTemplateDataSource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertRuleTemplateDataSource.class); + + /* + * The connector id that provides the following data types + */ + @JsonProperty(value = "connectorId") + private String connectorId; + + /* + * The data types used by the alert rule template + */ + @JsonProperty(value = "dataTypes") + private List dataTypes; + + /** + * Get the connectorId property: The connector id that provides the following data types. + * + * @return the connectorId value. + */ + public String connectorId() { + return this.connectorId; + } + + /** + * Set the connectorId property: The connector id that provides the following data types. + * + * @param connectorId the connectorId value to set. + * @return the AlertRuleTemplateDataSource object itself. + */ + public AlertRuleTemplateDataSource withConnectorId(String connectorId) { + this.connectorId = connectorId; + return this; + } + + /** + * Get the dataTypes property: The data types used by the alert rule template. + * + * @return the dataTypes value. + */ + public List dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: The data types used by the alert rule template. + * + * @param dataTypes the dataTypes value to set. + * @return the AlertRuleTemplateDataSource object itself. + */ + public AlertRuleTemplateDataSource withDataTypes(List dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplatePropertiesBase.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplatePropertiesBase.java new file mode 100644 index 000000000000..fae4bc272fa7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplatePropertiesBase.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Base alert rule template property bag. */ +@Fluent +public class AlertRuleTemplatePropertiesBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertRuleTemplatePropertiesBase.class); + + /* + * the number of alert rules that were created by this template + */ + @JsonProperty(value = "alertRulesCreatedByTemplateCount") + private Integer alertRulesCreatedByTemplateCount; + + /* + * The last time that this alert rule template has been updated. + */ + @JsonProperty(value = "lastUpdatedDateUTC", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastUpdatedDateUtc; + + /* + * The time that this alert rule template has been added. + */ + @JsonProperty(value = "createdDateUTC", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDateUtc; + + /* + * The description of the alert rule template. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The display name for alert rule template. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The required data sources for this template + */ + @JsonProperty(value = "requiredDataConnectors") + private List requiredDataConnectors; + + /* + * The alert rule template status. + */ + @JsonProperty(value = "status") + private TemplateStatus status; + + /** + * Get the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. + * + * @return the alertRulesCreatedByTemplateCount value. + */ + public Integer alertRulesCreatedByTemplateCount() { + return this.alertRulesCreatedByTemplateCount; + } + + /** + * Set the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. + * + * @param alertRulesCreatedByTemplateCount the alertRulesCreatedByTemplateCount value to set. + * @return the AlertRuleTemplatePropertiesBase object itself. + */ + public AlertRuleTemplatePropertiesBase withAlertRulesCreatedByTemplateCount( + Integer alertRulesCreatedByTemplateCount) { + this.alertRulesCreatedByTemplateCount = alertRulesCreatedByTemplateCount; + return this; + } + + /** + * Get the lastUpdatedDateUtc property: The last time that this alert rule template has been updated. + * + * @return the lastUpdatedDateUtc value. + */ + public OffsetDateTime lastUpdatedDateUtc() { + return this.lastUpdatedDateUtc; + } + + /** + * Get the createdDateUtc property: The time that this alert rule template has been added. + * + * @return the createdDateUtc value. + */ + public OffsetDateTime createdDateUtc() { + return this.createdDateUtc; + } + + /** + * Get the description property: The description of the alert rule template. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the alert rule template. + * + * @param description the description value to set. + * @return the AlertRuleTemplatePropertiesBase object itself. + */ + public AlertRuleTemplatePropertiesBase withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the displayName property: The display name for alert rule template. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name for alert rule template. + * + * @param displayName the displayName value to set. + * @return the AlertRuleTemplatePropertiesBase object itself. + */ + public AlertRuleTemplatePropertiesBase withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the requiredDataConnectors property: The required data sources for this template. + * + * @return the requiredDataConnectors value. + */ + public List requiredDataConnectors() { + return this.requiredDataConnectors; + } + + /** + * Set the requiredDataConnectors property: The required data sources for this template. + * + * @param requiredDataConnectors the requiredDataConnectors value to set. + * @return the AlertRuleTemplatePropertiesBase object itself. + */ + public AlertRuleTemplatePropertiesBase withRequiredDataConnectors( + List requiredDataConnectors) { + this.requiredDataConnectors = requiredDataConnectors; + return this; + } + + /** + * Get the status property: The alert rule template status. + * + * @return the status value. + */ + public TemplateStatus status() { + return this.status; + } + + /** + * Set the status property: The alert rule template status. + * + * @param status the status value to set. + * @return the AlertRuleTemplatePropertiesBase object itself. + */ + public AlertRuleTemplatePropertiesBase withStatus(TemplateStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (requiredDataConnectors() != null) { + requiredDataConnectors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplates.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplates.java new file mode 100644 index 000000000000..731ccc1808ec --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplates.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AlertRuleTemplates. */ +public interface AlertRuleTemplates { + /** + * Gets all alert rule templates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all alert rule templates. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all alert rule templates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all alert rule templates. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets the alert rule template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param alertRuleTemplateId Alert rule template ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the alert rule template. + */ + AlertRuleTemplate get(String resourceGroupName, String workspaceName, String alertRuleTemplateId); + + /** + * Gets the alert rule template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param alertRuleTemplateId Alert rule template ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the alert rule template. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String alertRuleTemplateId, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplatesList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplatesList.java new file mode 100644 index 000000000000..fbcb460383ab --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplatesList.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List all the alert rule templates. */ +@Fluent +public final class AlertRuleTemplatesList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertRuleTemplatesList.class); + + /* + * URL to fetch the next set of alert rule templates. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of alert rule templates. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the nextLink property: URL to fetch the next set of alert rule templates. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of alert rule templates. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of alert rule templates. + * + * @param value the value value to set. + * @return the AlertRuleTemplatesList object itself. + */ + public AlertRuleTemplatesList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model AlertRuleTemplatesList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRules.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRules.java new file mode 100644 index 000000000000..7e4785a3b86c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRules.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; + +/** Resource collection API of AlertRules. */ +public interface AlertRules { + /** + * Gets all alert rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all alert rules. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all alert rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all alert rules. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the alert rule. + */ + AlertRule get(String resourceGroupName, String workspaceName, String ruleId); + + /** + * Gets the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the alert rule. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String ruleId, Context context); + + /** + * Creates or updates the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param alertRule The alert rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alert rule. + */ + AlertRule createOrUpdate(String resourceGroupName, String workspaceName, String ruleId, AlertRuleInner alertRule); + + /** + * Creates or updates the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param alertRule The alert rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alert rule. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, String workspaceName, String ruleId, AlertRuleInner alertRule, Context context); + + /** + * Delete the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String ruleId); + + /** + * Delete the alert rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse(String resourceGroupName, String workspaceName, String ruleId, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRulesList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRulesList.java new file mode 100644 index 000000000000..733dc17b308b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRulesList.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List all the alert rules. */ +@Fluent +public final class AlertRulesList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertRulesList.class); + + /* + * URL to fetch the next set of alert rules. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of alert rules. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the nextLink property: URL to fetch the next set of alert rules. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of alert rules. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of alert rules. + * + * @param value the value value to set. + * @return the AlertRulesList object itself. + */ + public AlertRulesList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model AlertRulesList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertSeverity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertSeverity.java new file mode 100644 index 000000000000..faff80226065 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertSeverity.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AlertSeverity. */ +public final class AlertSeverity extends ExpandableStringEnum { + /** Static value High for AlertSeverity. */ + public static final AlertSeverity HIGH = fromString("High"); + + /** Static value Medium for AlertSeverity. */ + public static final AlertSeverity MEDIUM = fromString("Medium"); + + /** Static value Low for AlertSeverity. */ + public static final AlertSeverity LOW = fromString("Low"); + + /** Static value Informational for AlertSeverity. */ + public static final AlertSeverity INFORMATIONAL = fromString("Informational"); + + /** + * Creates or finds a AlertSeverity from its string representation. + * + * @param name a name to look for. + * @return the corresponding AlertSeverity. + */ + @JsonCreator + public static AlertSeverity fromString(String name) { + return fromString(name, AlertSeverity.class); + } + + /** @return known AlertSeverity values. */ + public static Collection values() { + return values(AlertSeverity.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertStatus.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertStatus.java new file mode 100644 index 000000000000..d1a357ad22e4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertStatus.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AlertStatus. */ +public final class AlertStatus extends ExpandableStringEnum { + /** Static value Unknown for AlertStatus. */ + public static final AlertStatus UNKNOWN = fromString("Unknown"); + + /** Static value New for AlertStatus. */ + public static final AlertStatus NEW = fromString("New"); + + /** Static value Resolved for AlertStatus. */ + public static final AlertStatus RESOLVED = fromString("Resolved"); + + /** Static value Dismissed for AlertStatus. */ + public static final AlertStatus DISMISSED = fromString("Dismissed"); + + /** Static value InProgress for AlertStatus. */ + public static final AlertStatus IN_PROGRESS = fromString("InProgress"); + + /** + * Creates or finds a AlertStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AlertStatus. + */ + @JsonCreator + public static AlertStatus fromString(String name) { + return fromString(name, AlertStatus.class); + } + + /** @return known AlertStatus values. */ + public static Collection values() { + return values(AlertStatus.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertsDataTypeOfDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertsDataTypeOfDataConnector.java new file mode 100644 index 000000000000..b30fedace230 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertsDataTypeOfDataConnector.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Alerts data type for data connectors. */ +@Fluent +public class AlertsDataTypeOfDataConnector { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertsDataTypeOfDataConnector.class); + + /* + * Alerts data type connection. + */ + @JsonProperty(value = "alerts", required = true) + private DataConnectorDataTypeCommon alerts; + + /** + * Get the alerts property: Alerts data type connection. + * + * @return the alerts value. + */ + public DataConnectorDataTypeCommon alerts() { + return this.alerts; + } + + /** + * Set the alerts property: Alerts data type connection. + * + * @param alerts the alerts value to set. + * @return the AlertsDataTypeOfDataConnector object itself. + */ + public AlertsDataTypeOfDataConnector withAlerts(DataConnectorDataTypeCommon alerts) { + this.alerts = alerts; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (alerts() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property alerts in model AlertsDataTypeOfDataConnector")); + } else { + alerts().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Anomalies.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Anomalies.java new file mode 100644 index 000000000000..95476d5b4491 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Anomalies.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AnomaliesSettingsProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Settings with single toggle. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Anomalies") +@Fluent +public final class Anomalies extends SettingsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Anomalies.class); + + /* + * Anomalies properties + */ + @JsonProperty(value = "properties") + private AnomaliesSettingsProperties innerProperties; + + /** + * Get the innerProperties property: Anomalies properties. + * + * @return the innerProperties value. + */ + private AnomaliesSettingsProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public Anomalies withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the isEnabled property: Determines whether the setting is enable or disabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isEnabled(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AntispamMailDirection.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AntispamMailDirection.java new file mode 100644 index 000000000000..f28796838a06 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AntispamMailDirection.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AntispamMailDirection. */ +public final class AntispamMailDirection extends ExpandableStringEnum { + /** Static value Unknown for AntispamMailDirection. */ + public static final AntispamMailDirection UNKNOWN = fromString("Unknown"); + + /** Static value Inbound for AntispamMailDirection. */ + public static final AntispamMailDirection INBOUND = fromString("Inbound"); + + /** Static value Outbound for AntispamMailDirection. */ + public static final AntispamMailDirection OUTBOUND = fromString("Outbound"); + + /** Static value Intraorg for AntispamMailDirection. */ + public static final AntispamMailDirection INTRAORG = fromString("Intraorg"); + + /** + * Creates or finds a AntispamMailDirection from its string representation. + * + * @param name a name to look for. + * @return the corresponding AntispamMailDirection. + */ + @JsonCreator + public static AntispamMailDirection fromString(String name) { + return fromString(name, AntispamMailDirection.class); + } + + /** @return known AntispamMailDirection values. */ + public static Collection values() { + return values(AntispamMailDirection.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AscCheckRequirements.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AscCheckRequirements.java new file mode 100644 index 000000000000..47cdd0e006a2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AscCheckRequirements.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AscCheckRequirementsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents ASC (Azure Security Center) requirements check request. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AzureSecurityCenter") +@Fluent +public final class AscCheckRequirements extends DataConnectorsCheckRequirements { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AscCheckRequirements.class); + + /* + * ASC (Azure Security Center) requirements check properties. + */ + @JsonProperty(value = "properties") + private AscCheckRequirementsProperties innerProperties; + + /** + * Get the innerProperties property: ASC (Azure Security Center) requirements check properties. + * + * @return the innerProperties value. + */ + private AscCheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the subscriptionId property: The subscription id to connect to, and get the data from. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.innerProperties() == null ? null : this.innerProperties().subscriptionId(); + } + + /** + * Set the subscriptionId property: The subscription id to connect to, and get the data from. + * + * @param subscriptionId the subscriptionId value to set. + * @return the AscCheckRequirements object itself. + */ + public AscCheckRequirements withSubscriptionId(String subscriptionId) { + if (this.innerProperties() == null) { + this.innerProperties = new AscCheckRequirementsProperties(); + } + this.innerProperties().withSubscriptionId(subscriptionId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AscDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AscDataConnector.java new file mode 100644 index 000000000000..aa5578a8a0b9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AscDataConnector.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AscDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents ASC (Azure Security Center) data connector. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AzureSecurityCenter") +@Fluent +public final class AscDataConnector extends DataConnectorInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AscDataConnector.class); + + /* + * ASC (Azure Security Center) data connector properties. + */ + @JsonProperty(value = "properties") + private AscDataConnectorProperties innerProperties; + + /** + * Get the innerProperties property: ASC (Azure Security Center) data connector properties. + * + * @return the innerProperties value. + */ + private AscDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public AscDataConnector withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the subscriptionId property: The subscription id to connect to, and get the data from. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.innerProperties() == null ? null : this.innerProperties().subscriptionId(); + } + + /** + * Set the subscriptionId property: The subscription id to connect to, and get the data from. + * + * @param subscriptionId the subscriptionId value to set. + * @return the AscDataConnector object itself. + */ + public AscDataConnector withSubscriptionId(String subscriptionId) { + if (this.innerProperties() == null) { + this.innerProperties = new AscDataConnectorProperties(); + } + this.innerProperties().withSubscriptionId(subscriptionId); + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public AlertsDataTypeOfDataConnector dataTypes() { + return this.innerProperties() == null ? null : this.innerProperties().dataTypes(); + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the AscDataConnector object itself. + */ + public AscDataConnector withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new AscDataConnectorProperties(); + } + this.innerProperties().withDataTypes(dataTypes); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AttackTactic.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AttackTactic.java new file mode 100644 index 000000000000..3c44b68e78f6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AttackTactic.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AttackTactic. */ +public final class AttackTactic extends ExpandableStringEnum { + /** Static value InitialAccess for AttackTactic. */ + public static final AttackTactic INITIAL_ACCESS = fromString("InitialAccess"); + + /** Static value Execution for AttackTactic. */ + public static final AttackTactic EXECUTION = fromString("Execution"); + + /** Static value Persistence for AttackTactic. */ + public static final AttackTactic PERSISTENCE = fromString("Persistence"); + + /** Static value PrivilegeEscalation for AttackTactic. */ + public static final AttackTactic PRIVILEGE_ESCALATION = fromString("PrivilegeEscalation"); + + /** Static value DefenseEvasion for AttackTactic. */ + public static final AttackTactic DEFENSE_EVASION = fromString("DefenseEvasion"); + + /** Static value CredentialAccess for AttackTactic. */ + public static final AttackTactic CREDENTIAL_ACCESS = fromString("CredentialAccess"); + + /** Static value Discovery for AttackTactic. */ + public static final AttackTactic DISCOVERY = fromString("Discovery"); + + /** Static value LateralMovement for AttackTactic. */ + public static final AttackTactic LATERAL_MOVEMENT = fromString("LateralMovement"); + + /** Static value Collection for AttackTactic. */ + public static final AttackTactic COLLECTION = fromString("Collection"); + + /** Static value Exfiltration for AttackTactic. */ + public static final AttackTactic EXFILTRATION = fromString("Exfiltration"); + + /** Static value CommandAndControl for AttackTactic. */ + public static final AttackTactic COMMAND_AND_CONTROL = fromString("CommandAndControl"); + + /** Static value Impact for AttackTactic. */ + public static final AttackTactic IMPACT = fromString("Impact"); + + /** Static value PreAttack for AttackTactic. */ + public static final AttackTactic PRE_ATTACK = fromString("PreAttack"); + + /** + * Creates or finds a AttackTactic from its string representation. + * + * @param name a name to look for. + * @return the corresponding AttackTactic. + */ + @JsonCreator + public static AttackTactic fromString(String name) { + return fromString(name, AttackTactic.class); + } + + /** @return known AttackTactic values. */ + public static Collection values() { + return values(AttackTactic.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRule.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRule.java new file mode 100644 index 000000000000..b4c4a35c7712 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRule.java @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.AutomationRuleInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of AutomationRule. */ +public interface AutomationRule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the displayName property: The display name of the automation rule. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the order property: The order of execution of the automation rule. + * + * @return the order value. + */ + int order(); + + /** + * Gets the triggeringLogic property: The triggering logic of the automation rule. + * + * @return the triggeringLogic value. + */ + AutomationRuleTriggeringLogic triggeringLogic(); + + /** + * Gets the actions property: The actions to execute when the automation rule is triggered. + * + * @return the actions value. + */ + List actions(); + + /** + * Gets the createdTimeUtc property: The time the automation rule was created. + * + * @return the createdTimeUtc value. + */ + OffsetDateTime createdTimeUtc(); + + /** + * Gets the lastModifiedTimeUtc property: The last time the automation rule was updated. + * + * @return the lastModifiedTimeUtc value. + */ + OffsetDateTime lastModifiedTimeUtc(); + + /** + * Gets the createdBy property: Describes the client that created the automation rule. + * + * @return the createdBy value. + */ + ClientInfo createdBy(); + + /** + * Gets the lastModifiedBy property: Describes the client that last updated the automation rule. + * + * @return the lastModifiedBy value. + */ + ClientInfo lastModifiedBy(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.AutomationRuleInner object. + * + * @return the inner object. + */ + AutomationRuleInner innerModel(); + + /** The entirety of the AutomationRule definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The AutomationRule definition stages. */ + interface DefinitionStages { + /** The first stage of the AutomationRule definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the AutomationRule definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @return the next definition stage. + */ + WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); + } + /** + * The stage of the AutomationRule definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithEtag, + DefinitionStages.WithDisplayName, + DefinitionStages.WithOrder, + DefinitionStages.WithTriggeringLogic, + DefinitionStages.WithActions { + /** + * Executes the create request. + * + * @return the created resource. + */ + AutomationRule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AutomationRule create(Context context); + } + /** The stage of the AutomationRule definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Etag of the azure resource. + * + * @param etag Etag of the azure resource. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the AutomationRule definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: The display name of the automation rule. + * + * @param displayName The display name of the automation rule. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the AutomationRule definition allowing to specify order. */ + interface WithOrder { + /** + * Specifies the order property: The order of execution of the automation rule. + * + * @param order The order of execution of the automation rule. + * @return the next definition stage. + */ + WithCreate withOrder(int order); + } + /** The stage of the AutomationRule definition allowing to specify triggeringLogic. */ + interface WithTriggeringLogic { + /** + * Specifies the triggeringLogic property: The triggering logic of the automation rule. + * + * @param triggeringLogic The triggering logic of the automation rule. + * @return the next definition stage. + */ + WithCreate withTriggeringLogic(AutomationRuleTriggeringLogic triggeringLogic); + } + /** The stage of the AutomationRule definition allowing to specify actions. */ + interface WithActions { + /** + * Specifies the actions property: The actions to execute when the automation rule is triggered. + * + * @param actions The actions to execute when the automation rule is triggered. + * @return the next definition stage. + */ + WithCreate withActions(List actions); + } + } + /** + * Begins update for the AutomationRule resource. + * + * @return the stage of resource update. + */ + AutomationRule.Update update(); + + /** The template for AutomationRule update. */ + interface Update + extends UpdateStages.WithEtag, + UpdateStages.WithDisplayName, + UpdateStages.WithOrder, + UpdateStages.WithTriggeringLogic, + UpdateStages.WithActions { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AutomationRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AutomationRule apply(Context context); + } + /** The AutomationRule update stages. */ + interface UpdateStages { + /** The stage of the AutomationRule update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Etag of the azure resource. + * + * @param etag Etag of the azure resource. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + /** The stage of the AutomationRule update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: The display name of the automation rule. + * + * @param displayName The display name of the automation rule. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the AutomationRule update allowing to specify order. */ + interface WithOrder { + /** + * Specifies the order property: The order of execution of the automation rule. + * + * @param order The order of execution of the automation rule. + * @return the next definition stage. + */ + Update withOrder(int order); + } + /** The stage of the AutomationRule update allowing to specify triggeringLogic. */ + interface WithTriggeringLogic { + /** + * Specifies the triggeringLogic property: The triggering logic of the automation rule. + * + * @param triggeringLogic The triggering logic of the automation rule. + * @return the next definition stage. + */ + Update withTriggeringLogic(AutomationRuleTriggeringLogic triggeringLogic); + } + /** The stage of the AutomationRule update allowing to specify actions. */ + interface WithActions { + /** + * Specifies the actions property: The actions to execute when the automation rule is triggered. + * + * @param actions The actions to execute when the automation rule is triggered. + * @return the next definition stage. + */ + Update withActions(List actions); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AutomationRule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AutomationRule refresh(Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleAction.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleAction.java new file mode 100644 index 000000000000..aa2f770d00b3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleAction.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Describes an automation rule action. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "actionType", + defaultImpl = AutomationRuleAction.class) +@JsonTypeName("AutomationRuleAction") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "RunPlaybook", value = AutomationRuleRunPlaybookAction.class), + @JsonSubTypes.Type(name = "ModifyProperties", value = AutomationRuleModifyPropertiesAction.class) +}) +@Fluent +public class AutomationRuleAction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutomationRuleAction.class); + + /* + * The order of execution of the automation rule action + */ + @JsonProperty(value = "order", required = true) + private int order; + + /** + * Get the order property: The order of execution of the automation rule action. + * + * @return the order value. + */ + public int order() { + return this.order; + } + + /** + * Set the order property: The order of execution of the automation rule action. + * + * @param order the order value to set. + * @return the AutomationRuleAction object itself. + */ + public AutomationRuleAction withOrder(int order) { + this.order = order; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleActionType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleActionType.java new file mode 100644 index 000000000000..547b7c53a00b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleActionType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AutomationRuleActionType. */ +public final class AutomationRuleActionType extends ExpandableStringEnum { + /** Static value ModifyProperties for AutomationRuleActionType. */ + public static final AutomationRuleActionType MODIFY_PROPERTIES = fromString("ModifyProperties"); + + /** Static value RunPlaybook for AutomationRuleActionType. */ + public static final AutomationRuleActionType RUN_PLAYBOOK = fromString("RunPlaybook"); + + /** + * Creates or finds a AutomationRuleActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutomationRuleActionType. + */ + @JsonCreator + public static AutomationRuleActionType fromString(String name) { + return fromString(name, AutomationRuleActionType.class); + } + + /** @return known AutomationRuleActionType values. */ + public static Collection values() { + return values(AutomationRuleActionType.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleCondition.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleCondition.java new file mode 100644 index 000000000000..ed9426bdab97 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleCondition.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Describes an automation rule condition. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "conditionType", + defaultImpl = AutomationRuleCondition.class) +@JsonTypeName("AutomationRuleCondition") +@JsonSubTypes({@JsonSubTypes.Type(name = "Property", value = AutomationRulePropertyValuesCondition.class)}) +@Immutable +public class AutomationRuleCondition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutomationRuleCondition.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleConditionType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleConditionType.java new file mode 100644 index 000000000000..4d7c437eafed --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleConditionType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AutomationRuleConditionType. */ +public final class AutomationRuleConditionType extends ExpandableStringEnum { + /** Static value Property for AutomationRuleConditionType. */ + public static final AutomationRuleConditionType PROPERTY = fromString("Property"); + + /** + * Creates or finds a AutomationRuleConditionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutomationRuleConditionType. + */ + @JsonCreator + public static AutomationRuleConditionType fromString(String name) { + return fromString(name, AutomationRuleConditionType.class); + } + + /** @return known AutomationRuleConditionType values. */ + public static Collection values() { + return values(AutomationRuleConditionType.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleModifyPropertiesAction.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleModifyPropertiesAction.java new file mode 100644 index 000000000000..1560e1ebf27f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleModifyPropertiesAction.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Describes an automation rule action to modify an object's properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "actionType") +@JsonTypeName("ModifyProperties") +@Fluent +public final class AutomationRuleModifyPropertiesAction extends AutomationRuleAction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutomationRuleModifyPropertiesAction.class); + + /* + * The configuration of the modify properties automation rule action + */ + @JsonProperty(value = "actionConfiguration", required = true) + private AutomationRuleModifyPropertiesActionConfiguration actionConfiguration; + + /** + * Get the actionConfiguration property: The configuration of the modify properties automation rule action. + * + * @return the actionConfiguration value. + */ + public AutomationRuleModifyPropertiesActionConfiguration actionConfiguration() { + return this.actionConfiguration; + } + + /** + * Set the actionConfiguration property: The configuration of the modify properties automation rule action. + * + * @param actionConfiguration the actionConfiguration value to set. + * @return the AutomationRuleModifyPropertiesAction object itself. + */ + public AutomationRuleModifyPropertiesAction withActionConfiguration( + AutomationRuleModifyPropertiesActionConfiguration actionConfiguration) { + this.actionConfiguration = actionConfiguration; + return this; + } + + /** {@inheritDoc} */ + @Override + public AutomationRuleModifyPropertiesAction withOrder(int order) { + super.withOrder(order); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (actionConfiguration() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property actionConfiguration in model AutomationRuleModifyPropertiesAction")); + } else { + actionConfiguration().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleModifyPropertiesActionConfiguration.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleModifyPropertiesActionConfiguration.java new file mode 100644 index 000000000000..2098daddb153 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleModifyPropertiesActionConfiguration.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The configuration of the modify properties automation rule action. */ +@Fluent +public final class AutomationRuleModifyPropertiesActionConfiguration { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(AutomationRuleModifyPropertiesActionConfiguration.class); + + /* + * The reason the incident was closed + */ + @JsonProperty(value = "classification") + private IncidentClassification classification; + + /* + * Describes the reason the incident was closed + */ + @JsonProperty(value = "classificationComment") + private String classificationComment; + + /* + * The classification reason the incident was closed with + */ + @JsonProperty(value = "classificationReason") + private IncidentClassificationReason classificationReason; + + /* + * List of labels to add to the incident + */ + @JsonProperty(value = "labels") + private List labels; + + /* + * Describes a user that the incident is assigned to + */ + @JsonProperty(value = "owner") + private IncidentOwnerInfo owner; + + /* + * The severity of the incident + */ + @JsonProperty(value = "severity") + private IncidentSeverity severity; + + /* + * The status of the incident + */ + @JsonProperty(value = "status") + private IncidentStatus status; + + /** + * Get the classification property: The reason the incident was closed. + * + * @return the classification value. + */ + public IncidentClassification classification() { + return this.classification; + } + + /** + * Set the classification property: The reason the incident was closed. + * + * @param classification the classification value to set. + * @return the AutomationRuleModifyPropertiesActionConfiguration object itself. + */ + public AutomationRuleModifyPropertiesActionConfiguration withClassification(IncidentClassification classification) { + this.classification = classification; + return this; + } + + /** + * Get the classificationComment property: Describes the reason the incident was closed. + * + * @return the classificationComment value. + */ + public String classificationComment() { + return this.classificationComment; + } + + /** + * Set the classificationComment property: Describes the reason the incident was closed. + * + * @param classificationComment the classificationComment value to set. + * @return the AutomationRuleModifyPropertiesActionConfiguration object itself. + */ + public AutomationRuleModifyPropertiesActionConfiguration withClassificationComment(String classificationComment) { + this.classificationComment = classificationComment; + return this; + } + + /** + * Get the classificationReason property: The classification reason the incident was closed with. + * + * @return the classificationReason value. + */ + public IncidentClassificationReason classificationReason() { + return this.classificationReason; + } + + /** + * Set the classificationReason property: The classification reason the incident was closed with. + * + * @param classificationReason the classificationReason value to set. + * @return the AutomationRuleModifyPropertiesActionConfiguration object itself. + */ + public AutomationRuleModifyPropertiesActionConfiguration withClassificationReason( + IncidentClassificationReason classificationReason) { + this.classificationReason = classificationReason; + return this; + } + + /** + * Get the labels property: List of labels to add to the incident. + * + * @return the labels value. + */ + public List labels() { + return this.labels; + } + + /** + * Set the labels property: List of labels to add to the incident. + * + * @param labels the labels value to set. + * @return the AutomationRuleModifyPropertiesActionConfiguration object itself. + */ + public AutomationRuleModifyPropertiesActionConfiguration withLabels(List labels) { + this.labels = labels; + return this; + } + + /** + * Get the owner property: Describes a user that the incident is assigned to. + * + * @return the owner value. + */ + public IncidentOwnerInfo owner() { + return this.owner; + } + + /** + * Set the owner property: Describes a user that the incident is assigned to. + * + * @param owner the owner value to set. + * @return the AutomationRuleModifyPropertiesActionConfiguration object itself. + */ + public AutomationRuleModifyPropertiesActionConfiguration withOwner(IncidentOwnerInfo owner) { + this.owner = owner; + return this; + } + + /** + * Get the severity property: The severity of the incident. + * + * @return the severity value. + */ + public IncidentSeverity severity() { + return this.severity; + } + + /** + * Set the severity property: The severity of the incident. + * + * @param severity the severity value to set. + * @return the AutomationRuleModifyPropertiesActionConfiguration object itself. + */ + public AutomationRuleModifyPropertiesActionConfiguration withSeverity(IncidentSeverity severity) { + this.severity = severity; + return this; + } + + /** + * Get the status property: The status of the incident. + * + * @return the status value. + */ + public IncidentStatus status() { + return this.status; + } + + /** + * Set the status property: The status of the incident. + * + * @param status the status value to set. + * @return the AutomationRuleModifyPropertiesActionConfiguration object itself. + */ + public AutomationRuleModifyPropertiesActionConfiguration withStatus(IncidentStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (labels() != null) { + labels().forEach(e -> e.validate()); + } + if (owner() != null) { + owner().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyConditionSupportedOperator.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyConditionSupportedOperator.java new file mode 100644 index 000000000000..d13ac18634da --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyConditionSupportedOperator.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AutomationRulePropertyConditionSupportedOperator. */ +public final class AutomationRulePropertyConditionSupportedOperator + extends ExpandableStringEnum { + /** Static value Equals for AutomationRulePropertyConditionSupportedOperator. */ + public static final AutomationRulePropertyConditionSupportedOperator EQUALS = fromString("Equals"); + + /** Static value NotEquals for AutomationRulePropertyConditionSupportedOperator. */ + public static final AutomationRulePropertyConditionSupportedOperator NOT_EQUALS = fromString("NotEquals"); + + /** Static value Contains for AutomationRulePropertyConditionSupportedOperator. */ + public static final AutomationRulePropertyConditionSupportedOperator CONTAINS = fromString("Contains"); + + /** Static value NotContains for AutomationRulePropertyConditionSupportedOperator. */ + public static final AutomationRulePropertyConditionSupportedOperator NOT_CONTAINS = fromString("NotContains"); + + /** Static value StartsWith for AutomationRulePropertyConditionSupportedOperator. */ + public static final AutomationRulePropertyConditionSupportedOperator STARTS_WITH = fromString("StartsWith"); + + /** Static value NotStartsWith for AutomationRulePropertyConditionSupportedOperator. */ + public static final AutomationRulePropertyConditionSupportedOperator NOT_STARTS_WITH = fromString("NotStartsWith"); + + /** Static value EndsWith for AutomationRulePropertyConditionSupportedOperator. */ + public static final AutomationRulePropertyConditionSupportedOperator ENDS_WITH = fromString("EndsWith"); + + /** Static value NotEndsWith for AutomationRulePropertyConditionSupportedOperator. */ + public static final AutomationRulePropertyConditionSupportedOperator NOT_ENDS_WITH = fromString("NotEndsWith"); + + /** + * Creates or finds a AutomationRulePropertyConditionSupportedOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutomationRulePropertyConditionSupportedOperator. + */ + @JsonCreator + public static AutomationRulePropertyConditionSupportedOperator fromString(String name) { + return fromString(name, AutomationRulePropertyConditionSupportedOperator.class); + } + + /** @return known AutomationRulePropertyConditionSupportedOperator values. */ + public static Collection values() { + return values(AutomationRulePropertyConditionSupportedOperator.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyConditionSupportedProperty.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyConditionSupportedProperty.java new file mode 100644 index 000000000000..0b7ef101a6e7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyConditionSupportedProperty.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AutomationRulePropertyConditionSupportedProperty. */ +public final class AutomationRulePropertyConditionSupportedProperty + extends ExpandableStringEnum { + /** Static value IncidentTitle for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_TITLE = fromString("IncidentTitle"); + + /** Static value IncidentDescription for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_DESCRIPTION = + fromString("IncidentDescription"); + + /** Static value IncidentSeverity for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_SEVERITY = + fromString("IncidentSeverity"); + + /** Static value IncidentStatus for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_STATUS = fromString("IncidentStatus"); + + /** Static value IncidentTactics for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_TACTICS = + fromString("IncidentTactics"); + + /** Static value IncidentRelatedAnalyticRuleIds for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_RELATED_ANALYTIC_RULE_IDS = + fromString("IncidentRelatedAnalyticRuleIds"); + + /** Static value IncidentProviderName for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_PROVIDER_NAME = + fromString("IncidentProviderName"); + + /** Static value AccountAadTenantId for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_AAD_TENANT_ID = + fromString("AccountAadTenantId"); + + /** Static value AccountAadUserId for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_AAD_USER_ID = + fromString("AccountAadUserId"); + + /** Static value AccountName for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_NAME = fromString("AccountName"); + + /** Static value AccountNTDomain for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_NTDOMAIN = + fromString("AccountNTDomain"); + + /** Static value AccountPUID for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_PUID = fromString("AccountPUID"); + + /** Static value AccountSid for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_SID = fromString("AccountSid"); + + /** Static value AccountObjectGuid for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_OBJECT_GUID = + fromString("AccountObjectGuid"); + + /** Static value AccountUPNSuffix for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_UPNSUFFIX = + fromString("AccountUPNSuffix"); + + /** Static value AzureResourceResourceId for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty AZURE_RESOURCE_RESOURCE_ID = + fromString("AzureResourceResourceId"); + + /** Static value AzureResourceSubscriptionId for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty AZURE_RESOURCE_SUBSCRIPTION_ID = + fromString("AzureResourceSubscriptionId"); + + /** Static value CloudApplicationAppId for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty CLOUD_APPLICATION_APP_ID = + fromString("CloudApplicationAppId"); + + /** Static value CloudApplicationAppName for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty CLOUD_APPLICATION_APP_NAME = + fromString("CloudApplicationAppName"); + + /** Static value DNSDomainName for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty DNSDOMAIN_NAME = fromString("DNSDomainName"); + + /** Static value FileDirectory for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty FILE_DIRECTORY = fromString("FileDirectory"); + + /** Static value FileName for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty FILE_NAME = fromString("FileName"); + + /** Static value FileHashValue for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty FILE_HASH_VALUE = fromString("FileHashValue"); + + /** Static value HostAzureID for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty HOST_AZURE_ID = fromString("HostAzureID"); + + /** Static value HostName for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty HOST_NAME = fromString("HostName"); + + /** Static value HostNetBiosName for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty HOST_NET_BIOS_NAME = + fromString("HostNetBiosName"); + + /** Static value HostNTDomain for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty HOST_NTDOMAIN = fromString("HostNTDomain"); + + /** Static value HostOSVersion for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty HOST_OSVERSION = fromString("HostOSVersion"); + + /** Static value IoTDeviceId for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty IO_TDEVICE_ID = fromString("IoTDeviceId"); + + /** Static value IoTDeviceName for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty IO_TDEVICE_NAME = fromString("IoTDeviceName"); + + /** Static value IoTDeviceType for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty IO_TDEVICE_TYPE = fromString("IoTDeviceType"); + + /** Static value IoTDeviceVendor for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty IO_TDEVICE_VENDOR = + fromString("IoTDeviceVendor"); + + /** Static value IoTDeviceModel for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty IO_TDEVICE_MODEL = + fromString("IoTDeviceModel"); + + /** Static value IoTDeviceOperatingSystem for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty IO_TDEVICE_OPERATING_SYSTEM = + fromString("IoTDeviceOperatingSystem"); + + /** Static value IPAddress for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty IPADDRESS = fromString("IPAddress"); + + /** Static value MailboxDisplayName for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty MAILBOX_DISPLAY_NAME = + fromString("MailboxDisplayName"); + + /** Static value MailboxPrimaryAddress for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty MAILBOX_PRIMARY_ADDRESS = + fromString("MailboxPrimaryAddress"); + + /** Static value MailboxUPN for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty MAILBOX_UPN = fromString("MailboxUPN"); + + /** Static value MailMessageDeliveryAction for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_DELIVERY_ACTION = + fromString("MailMessageDeliveryAction"); + + /** Static value MailMessageDeliveryLocation for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_DELIVERY_LOCATION = + fromString("MailMessageDeliveryLocation"); + + /** Static value MailMessageRecipient for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_RECIPIENT = + fromString("MailMessageRecipient"); + + /** Static value MailMessageSenderIP for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_SENDER_IP = + fromString("MailMessageSenderIP"); + + /** Static value MailMessageSubject for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_SUBJECT = + fromString("MailMessageSubject"); + + /** Static value MailMessageP1Sender for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_P1SENDER = + fromString("MailMessageP1Sender"); + + /** Static value MailMessageP2Sender for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_P2SENDER = + fromString("MailMessageP2Sender"); + + /** Static value MalwareCategory for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty MALWARE_CATEGORY = + fromString("MalwareCategory"); + + /** Static value MalwareName for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty MALWARE_NAME = fromString("MalwareName"); + + /** Static value ProcessCommandLine for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty PROCESS_COMMAND_LINE = + fromString("ProcessCommandLine"); + + /** Static value ProcessId for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty PROCESS_ID = fromString("ProcessId"); + + /** Static value RegistryKey for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty REGISTRY_KEY = fromString("RegistryKey"); + + /** Static value RegistryValueData for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty REGISTRY_VALUE_DATA = + fromString("RegistryValueData"); + + /** Static value Url for AutomationRulePropertyConditionSupportedProperty. */ + public static final AutomationRulePropertyConditionSupportedProperty URL = fromString("Url"); + + /** + * Creates or finds a AutomationRulePropertyConditionSupportedProperty from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutomationRulePropertyConditionSupportedProperty. + */ + @JsonCreator + public static AutomationRulePropertyConditionSupportedProperty fromString(String name) { + return fromString(name, AutomationRulePropertyConditionSupportedProperty.class); + } + + /** @return known AutomationRulePropertyConditionSupportedProperty values. */ + public static Collection values() { + return values(AutomationRulePropertyConditionSupportedProperty.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyValuesCondition.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyValuesCondition.java new file mode 100644 index 000000000000..008987e3f74d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyValuesCondition.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Describes an automation rule condition that evaluates a property's value. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "conditionType") +@JsonTypeName("Property") +@Fluent +public final class AutomationRulePropertyValuesCondition extends AutomationRuleCondition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutomationRulePropertyValuesCondition.class); + + /* + * The configuration of the automation rule condition + */ + @JsonProperty(value = "conditionProperties", required = true) + private AutomationRulePropertyValuesConditionProperties conditionProperties; + + /** + * Get the conditionProperties property: The configuration of the automation rule condition. + * + * @return the conditionProperties value. + */ + public AutomationRulePropertyValuesConditionProperties conditionProperties() { + return this.conditionProperties; + } + + /** + * Set the conditionProperties property: The configuration of the automation rule condition. + * + * @param conditionProperties the conditionProperties value to set. + * @return the AutomationRulePropertyValuesCondition object itself. + */ + public AutomationRulePropertyValuesCondition withConditionProperties( + AutomationRulePropertyValuesConditionProperties conditionProperties) { + this.conditionProperties = conditionProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (conditionProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property conditionProperties in model" + + " AutomationRulePropertyValuesCondition")); + } else { + conditionProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyValuesConditionProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyValuesConditionProperties.java new file mode 100644 index 000000000000..b6875a560ebb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyValuesConditionProperties.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The configuration of the automation rule condition. */ +@Fluent +public final class AutomationRulePropertyValuesConditionProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(AutomationRulePropertyValuesConditionProperties.class); + + /* + * The property to evaluate + */ + @JsonProperty(value = "propertyName") + private AutomationRulePropertyConditionSupportedProperty propertyName; + + /* + * The operator to use for evaluation the condition + */ + @JsonProperty(value = "operator") + private AutomationRulePropertyConditionSupportedOperator operator; + + /* + * The values to use for evaluating the condition + */ + @JsonProperty(value = "propertyValues") + private List propertyValues; + + /** + * Get the propertyName property: The property to evaluate. + * + * @return the propertyName value. + */ + public AutomationRulePropertyConditionSupportedProperty propertyName() { + return this.propertyName; + } + + /** + * Set the propertyName property: The property to evaluate. + * + * @param propertyName the propertyName value to set. + * @return the AutomationRulePropertyValuesConditionProperties object itself. + */ + public AutomationRulePropertyValuesConditionProperties withPropertyName( + AutomationRulePropertyConditionSupportedProperty propertyName) { + this.propertyName = propertyName; + return this; + } + + /** + * Get the operator property: The operator to use for evaluation the condition. + * + * @return the operator value. + */ + public AutomationRulePropertyConditionSupportedOperator operator() { + return this.operator; + } + + /** + * Set the operator property: The operator to use for evaluation the condition. + * + * @param operator the operator value to set. + * @return the AutomationRulePropertyValuesConditionProperties object itself. + */ + public AutomationRulePropertyValuesConditionProperties withOperator( + AutomationRulePropertyConditionSupportedOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the propertyValues property: The values to use for evaluating the condition. + * + * @return the propertyValues value. + */ + public List propertyValues() { + return this.propertyValues; + } + + /** + * Set the propertyValues property: The values to use for evaluating the condition. + * + * @param propertyValues the propertyValues value to set. + * @return the AutomationRulePropertyValuesConditionProperties object itself. + */ + public AutomationRulePropertyValuesConditionProperties withPropertyValues(List propertyValues) { + this.propertyValues = propertyValues; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleRunPlaybookAction.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleRunPlaybookAction.java new file mode 100644 index 000000000000..c9601a8f9693 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleRunPlaybookAction.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Describes an automation rule action to run a playbook. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "actionType") +@JsonTypeName("RunPlaybook") +@Fluent +public final class AutomationRuleRunPlaybookAction extends AutomationRuleAction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutomationRuleRunPlaybookAction.class); + + /* + * The configuration of the run playbook automation rule action + */ + @JsonProperty(value = "actionConfiguration", required = true) + private AutomationRuleRunPlaybookActionConfiguration actionConfiguration; + + /** + * Get the actionConfiguration property: The configuration of the run playbook automation rule action. + * + * @return the actionConfiguration value. + */ + public AutomationRuleRunPlaybookActionConfiguration actionConfiguration() { + return this.actionConfiguration; + } + + /** + * Set the actionConfiguration property: The configuration of the run playbook automation rule action. + * + * @param actionConfiguration the actionConfiguration value to set. + * @return the AutomationRuleRunPlaybookAction object itself. + */ + public AutomationRuleRunPlaybookAction withActionConfiguration( + AutomationRuleRunPlaybookActionConfiguration actionConfiguration) { + this.actionConfiguration = actionConfiguration; + return this; + } + + /** {@inheritDoc} */ + @Override + public AutomationRuleRunPlaybookAction withOrder(int order) { + super.withOrder(order); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (actionConfiguration() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property actionConfiguration in model AutomationRuleRunPlaybookAction")); + } else { + actionConfiguration().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleRunPlaybookActionConfiguration.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleRunPlaybookActionConfiguration.java new file mode 100644 index 000000000000..7a708979a769 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleRunPlaybookActionConfiguration.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration of the run playbook automation rule action. */ +@Fluent +public final class AutomationRuleRunPlaybookActionConfiguration { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(AutomationRuleRunPlaybookActionConfiguration.class); + + /* + * The resource id of the playbook resource + */ + @JsonProperty(value = "logicAppResourceId") + private String logicAppResourceId; + + /* + * The tenant id of the playbook resource + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /** + * Get the logicAppResourceId property: The resource id of the playbook resource. + * + * @return the logicAppResourceId value. + */ + public String logicAppResourceId() { + return this.logicAppResourceId; + } + + /** + * Set the logicAppResourceId property: The resource id of the playbook resource. + * + * @param logicAppResourceId the logicAppResourceId value to set. + * @return the AutomationRuleRunPlaybookActionConfiguration object itself. + */ + public AutomationRuleRunPlaybookActionConfiguration withLogicAppResourceId(String logicAppResourceId) { + this.logicAppResourceId = logicAppResourceId; + return this; + } + + /** + * Get the tenantId property: The tenant id of the playbook resource. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenant id of the playbook resource. + * + * @param tenantId the tenantId value to set. + * @return the AutomationRuleRunPlaybookActionConfiguration object itself. + */ + public AutomationRuleRunPlaybookActionConfiguration withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleTriggeringLogic.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleTriggeringLogic.java new file mode 100644 index 000000000000..94162fd712ac --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleTriggeringLogic.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Describes automation rule triggering logic. */ +@Fluent +public final class AutomationRuleTriggeringLogic { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutomationRuleTriggeringLogic.class); + + /* + * Determines whether the automation rule is enabled or disabled. + */ + @JsonProperty(value = "isEnabled", required = true) + private boolean isEnabled; + + /* + * Determines when the automation rule should automatically expire and be + * disabled. + */ + @JsonProperty(value = "expirationTimeUtc") + private OffsetDateTime expirationTimeUtc; + + /* + * The type of object the automation rule triggers on + */ + @JsonProperty(value = "triggersOn", required = true) + private TriggersOn triggersOn; + + /* + * The type of event the automation rule triggers on + */ + @JsonProperty(value = "triggersWhen", required = true) + private TriggersWhen triggersWhen; + + /* + * The conditions to evaluate to determine if the automation rule should be + * triggered on a given object + */ + @JsonProperty(value = "conditions") + private List conditions; + + /** + * Get the isEnabled property: Determines whether the automation rule is enabled or disabled. + * + * @return the isEnabled value. + */ + public boolean isEnabled() { + return this.isEnabled; + } + + /** + * Set the isEnabled property: Determines whether the automation rule is enabled or disabled. + * + * @param isEnabled the isEnabled value to set. + * @return the AutomationRuleTriggeringLogic object itself. + */ + public AutomationRuleTriggeringLogic withIsEnabled(boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get the expirationTimeUtc property: Determines when the automation rule should automatically expire and be + * disabled. + * + * @return the expirationTimeUtc value. + */ + public OffsetDateTime expirationTimeUtc() { + return this.expirationTimeUtc; + } + + /** + * Set the expirationTimeUtc property: Determines when the automation rule should automatically expire and be + * disabled. + * + * @param expirationTimeUtc the expirationTimeUtc value to set. + * @return the AutomationRuleTriggeringLogic object itself. + */ + public AutomationRuleTriggeringLogic withExpirationTimeUtc(OffsetDateTime expirationTimeUtc) { + this.expirationTimeUtc = expirationTimeUtc; + return this; + } + + /** + * Get the triggersOn property: The type of object the automation rule triggers on. + * + * @return the triggersOn value. + */ + public TriggersOn triggersOn() { + return this.triggersOn; + } + + /** + * Set the triggersOn property: The type of object the automation rule triggers on. + * + * @param triggersOn the triggersOn value to set. + * @return the AutomationRuleTriggeringLogic object itself. + */ + public AutomationRuleTriggeringLogic withTriggersOn(TriggersOn triggersOn) { + this.triggersOn = triggersOn; + return this; + } + + /** + * Get the triggersWhen property: The type of event the automation rule triggers on. + * + * @return the triggersWhen value. + */ + public TriggersWhen triggersWhen() { + return this.triggersWhen; + } + + /** + * Set the triggersWhen property: The type of event the automation rule triggers on. + * + * @param triggersWhen the triggersWhen value to set. + * @return the AutomationRuleTriggeringLogic object itself. + */ + public AutomationRuleTriggeringLogic withTriggersWhen(TriggersWhen triggersWhen) { + this.triggersWhen = triggersWhen; + return this; + } + + /** + * Get the conditions property: The conditions to evaluate to determine if the automation rule should be triggered + * on a given object. + * + * @return the conditions value. + */ + public List conditions() { + return this.conditions; + } + + /** + * Set the conditions property: The conditions to evaluate to determine if the automation rule should be triggered + * on a given object. + * + * @param conditions the conditions value to set. + * @return the AutomationRuleTriggeringLogic object itself. + */ + public AutomationRuleTriggeringLogic withConditions(List conditions) { + this.conditions = conditions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (triggersOn() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property triggersOn in model AutomationRuleTriggeringLogic")); + } + if (triggersWhen() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property triggersWhen in model AutomationRuleTriggeringLogic")); + } + if (conditions() != null) { + conditions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRules.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRules.java new file mode 100644 index 000000000000..cd8be00e8c26 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRules.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AutomationRules. */ +public interface AutomationRules { + /** + * Gets all automation rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all automation rules. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all automation rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all automation rules. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the automation rule. + */ + AutomationRule get(String resourceGroupName, String workspaceName, String automationRuleId); + + /** + * Gets the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the automation rule. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String automationRuleId, Context context); + + /** + * Delete the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String automationRuleId); + + /** + * Delete the automation rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param automationRuleId Automation rule ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String automationRuleId, Context context); + + /** + * Gets the automation rule. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the automation rule. + */ + AutomationRule getById(String id); + + /** + * Gets the automation rule. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the automation rule. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the automation rule. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the automation rule. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AutomationRule resource. + * + * @param name resource name. + * @return the first stage of the new AutomationRule definition. + */ + AutomationRule.DefinitionStages.Blank define(String name); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulesList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulesList.java new file mode 100644 index 000000000000..6baa6f31448a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulesList.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AutomationRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List all the automation rules. */ +@Fluent +public final class AutomationRulesList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutomationRulesList.class); + + /* + * URL to fetch the next set of automation rules. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of automation rules. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the nextLink property: URL to fetch the next set of automation rules. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of automation rules. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of automation rules. + * + * @param value the value value to set. + * @return the AutomationRulesList object itself. + */ + public AutomationRulesList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model AutomationRulesList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Availability.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Availability.java new file mode 100644 index 000000000000..8ba720f8a9ef --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Availability.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Connector Availability Status. */ +@Fluent +public final class Availability { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Availability.class); + + /* + * The connector Availability Status + */ + @JsonProperty(value = "status") + private AvailabilityStatus status; + + /* + * Set connector as preview + */ + @JsonProperty(value = "isPreview") + private Boolean isPreview; + + /** + * Get the status property: The connector Availability Status. + * + * @return the status value. + */ + public AvailabilityStatus status() { + return this.status; + } + + /** + * Set the status property: The connector Availability Status. + * + * @param status the status value to set. + * @return the Availability object itself. + */ + public Availability withStatus(AvailabilityStatus status) { + this.status = status; + return this; + } + + /** + * Get the isPreview property: Set connector as preview. + * + * @return the isPreview value. + */ + public Boolean isPreview() { + return this.isPreview; + } + + /** + * Set the isPreview property: Set connector as preview. + * + * @param isPreview the isPreview value to set. + * @return the Availability object itself. + */ + public Availability withIsPreview(Boolean isPreview) { + this.isPreview = isPreview; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AvailabilityStatus.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AvailabilityStatus.java new file mode 100644 index 000000000000..05cd6877c747 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AvailabilityStatus.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for AvailabilityStatus. */ +public enum AvailabilityStatus { + /** Enum value 1. */ + ONE(1); + + /** The actual serialized value for a AvailabilityStatus instance. */ + private final int value; + + AvailabilityStatus(int value) { + this.value = value; + } + + /** + * Parses a serialized value to a AvailabilityStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed AvailabilityStatus object, or null if unable to parse. + */ + @JsonCreator + public static AvailabilityStatus fromInt(int value) { + AvailabilityStatus[] items = AvailabilityStatus.values(); + for (AvailabilityStatus item : items) { + if (item.toInt() == value) { + return item; + } + } + return null; + } + + /** + * De-serializes the instance to int value. + * + * @return the int value. + */ + @JsonValue + public int toInt() { + return this.value; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsCloudTrailCheckRequirements.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsCloudTrailCheckRequirements.java new file mode 100644 index 000000000000..8d51c007318f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsCloudTrailCheckRequirements.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Amazon Web Services CloudTrail requirements check request. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AmazonWebServicesCloudTrail") +@Immutable +public final class AwsCloudTrailCheckRequirements extends DataConnectorsCheckRequirements { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AwsCloudTrailCheckRequirements.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsCloudTrailDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsCloudTrailDataConnector.java new file mode 100644 index 000000000000..657bf58d8b0a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsCloudTrailDataConnector.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AwsCloudTrailDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents Amazon Web Services CloudTrail data connector. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AmazonWebServicesCloudTrail") +@Fluent +public final class AwsCloudTrailDataConnector extends DataConnectorInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AwsCloudTrailDataConnector.class); + + /* + * Amazon Web Services CloudTrail data connector properties. + */ + @JsonProperty(value = "properties") + private AwsCloudTrailDataConnectorProperties innerProperties; + + /** + * Get the innerProperties property: Amazon Web Services CloudTrail data connector properties. + * + * @return the innerProperties value. + */ + private AwsCloudTrailDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public AwsCloudTrailDataConnector withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the awsRoleArn property: The Aws Role Arn (with CloudTrailReadOnly policy) that is used to access the Aws + * account. + * + * @return the awsRoleArn value. + */ + public String awsRoleArn() { + return this.innerProperties() == null ? null : this.innerProperties().awsRoleArn(); + } + + /** + * Set the awsRoleArn property: The Aws Role Arn (with CloudTrailReadOnly policy) that is used to access the Aws + * account. + * + * @param awsRoleArn the awsRoleArn value to set. + * @return the AwsCloudTrailDataConnector object itself. + */ + public AwsCloudTrailDataConnector withAwsRoleArn(String awsRoleArn) { + if (this.innerProperties() == null) { + this.innerProperties = new AwsCloudTrailDataConnectorProperties(); + } + this.innerProperties().withAwsRoleArn(awsRoleArn); + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public AwsCloudTrailDataConnectorDataTypes dataTypes() { + return this.innerProperties() == null ? null : this.innerProperties().dataTypes(); + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the AwsCloudTrailDataConnector object itself. + */ + public AwsCloudTrailDataConnector withDataTypes(AwsCloudTrailDataConnectorDataTypes dataTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new AwsCloudTrailDataConnectorProperties(); + } + this.innerProperties().withDataTypes(dataTypes); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsCloudTrailDataConnectorDataTypes.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsCloudTrailDataConnectorDataTypes.java new file mode 100644 index 000000000000..b06e4313e891 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsCloudTrailDataConnectorDataTypes.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The available data types for Amazon Web Services CloudTrail data connector. */ +@Fluent +public final class AwsCloudTrailDataConnectorDataTypes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AwsCloudTrailDataConnectorDataTypes.class); + + /* + * Logs data type. + */ + @JsonProperty(value = "logs", required = true) + private AwsCloudTrailDataConnectorDataTypesLogs logs; + + /** + * Get the logs property: Logs data type. + * + * @return the logs value. + */ + public AwsCloudTrailDataConnectorDataTypesLogs logs() { + return this.logs; + } + + /** + * Set the logs property: Logs data type. + * + * @param logs the logs value to set. + * @return the AwsCloudTrailDataConnectorDataTypes object itself. + */ + public AwsCloudTrailDataConnectorDataTypes withLogs(AwsCloudTrailDataConnectorDataTypesLogs logs) { + this.logs = logs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logs() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property logs in model AwsCloudTrailDataConnectorDataTypes")); + } else { + logs().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsCloudTrailDataConnectorDataTypesLogs.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsCloudTrailDataConnectorDataTypesLogs.java new file mode 100644 index 000000000000..981c716f9566 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsCloudTrailDataConnectorDataTypesLogs.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Logs data type. */ +@Fluent +public final class AwsCloudTrailDataConnectorDataTypesLogs extends DataConnectorDataTypeCommon { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AwsCloudTrailDataConnectorDataTypesLogs.class); + + /** {@inheritDoc} */ + @Override + public AwsCloudTrailDataConnectorDataTypesLogs withState(DataTypeState state) { + super.withState(state); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3CheckRequirements.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3CheckRequirements.java new file mode 100644 index 000000000000..d9ef1517907e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3CheckRequirements.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Amazon Web Services S3 requirements check request. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AmazonWebServicesS3") +@Immutable +public final class AwsS3CheckRequirements extends DataConnectorsCheckRequirements { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AwsS3CheckRequirements.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3DataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3DataConnector.java new file mode 100644 index 000000000000..90e7adf43915 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3DataConnector.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AwsS3DataConnectorProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Represents Amazon Web Services S3 data connector. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AmazonWebServicesS3") +@Fluent +public final class AwsS3DataConnector extends DataConnectorInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AwsS3DataConnector.class); + + /* + * Amazon Web Services S3 data connector properties. + */ + @JsonProperty(value = "properties") + private AwsS3DataConnectorProperties innerProperties; + + /** + * Get the innerProperties property: Amazon Web Services S3 data connector properties. + * + * @return the innerProperties value. + */ + private AwsS3DataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public AwsS3DataConnector withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the destinationTable property: The logs destination table name in LogAnalytics. + * + * @return the destinationTable value. + */ + public String destinationTable() { + return this.innerProperties() == null ? null : this.innerProperties().destinationTable(); + } + + /** + * Set the destinationTable property: The logs destination table name in LogAnalytics. + * + * @param destinationTable the destinationTable value to set. + * @return the AwsS3DataConnector object itself. + */ + public AwsS3DataConnector withDestinationTable(String destinationTable) { + if (this.innerProperties() == null) { + this.innerProperties = new AwsS3DataConnectorProperties(); + } + this.innerProperties().withDestinationTable(destinationTable); + return this; + } + + /** + * Get the sqsUrls property: The AWS sqs urls for the connector. + * + * @return the sqsUrls value. + */ + public List sqsUrls() { + return this.innerProperties() == null ? null : this.innerProperties().sqsUrls(); + } + + /** + * Set the sqsUrls property: The AWS sqs urls for the connector. + * + * @param sqsUrls the sqsUrls value to set. + * @return the AwsS3DataConnector object itself. + */ + public AwsS3DataConnector withSqsUrls(List sqsUrls) { + if (this.innerProperties() == null) { + this.innerProperties = new AwsS3DataConnectorProperties(); + } + this.innerProperties().withSqsUrls(sqsUrls); + return this; + } + + /** + * Get the roleArn property: The Aws Role Arn that is used to access the Aws account. + * + * @return the roleArn value. + */ + public String roleArn() { + return this.innerProperties() == null ? null : this.innerProperties().roleArn(); + } + + /** + * Set the roleArn property: The Aws Role Arn that is used to access the Aws account. + * + * @param roleArn the roleArn value to set. + * @return the AwsS3DataConnector object itself. + */ + public AwsS3DataConnector withRoleArn(String roleArn) { + if (this.innerProperties() == null) { + this.innerProperties = new AwsS3DataConnectorProperties(); + } + this.innerProperties().withRoleArn(roleArn); + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public AwsS3DataConnectorDataTypes dataTypes() { + return this.innerProperties() == null ? null : this.innerProperties().dataTypes(); + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the AwsS3DataConnector object itself. + */ + public AwsS3DataConnector withDataTypes(AwsS3DataConnectorDataTypes dataTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new AwsS3DataConnectorProperties(); + } + this.innerProperties().withDataTypes(dataTypes); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3DataConnectorDataTypes.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3DataConnectorDataTypes.java new file mode 100644 index 000000000000..8f8cd6f91d1b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3DataConnectorDataTypes.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The available data types for Amazon Web Services S3 data connector. */ +@Fluent +public final class AwsS3DataConnectorDataTypes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AwsS3DataConnectorDataTypes.class); + + /* + * Logs data type. + */ + @JsonProperty(value = "logs", required = true) + private AwsS3DataConnectorDataTypesLogs logs; + + /** + * Get the logs property: Logs data type. + * + * @return the logs value. + */ + public AwsS3DataConnectorDataTypesLogs logs() { + return this.logs; + } + + /** + * Set the logs property: Logs data type. + * + * @param logs the logs value to set. + * @return the AwsS3DataConnectorDataTypes object itself. + */ + public AwsS3DataConnectorDataTypes withLogs(AwsS3DataConnectorDataTypesLogs logs) { + this.logs = logs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logs() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property logs in model AwsS3DataConnectorDataTypes")); + } else { + logs().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3DataConnectorDataTypesLogs.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3DataConnectorDataTypesLogs.java new file mode 100644 index 000000000000..fd2c160e5e00 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3DataConnectorDataTypesLogs.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Logs data type. */ +@Fluent +public final class AwsS3DataConnectorDataTypesLogs extends DataConnectorDataTypeCommon { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AwsS3DataConnectorDataTypesLogs.class); + + /** {@inheritDoc} */ + @Override + public AwsS3DataConnectorDataTypesLogs withState(DataTypeState state) { + super.withState(state); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AzureResourceEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AzureResourceEntity.java new file mode 100644 index 000000000000..c59fa3574e21 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AzureResourceEntity.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AzureResourceEntityProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** Represents an azure resource entity. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AzureResource") +@Fluent +public final class AzureResourceEntity extends EntityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureResourceEntity.class); + + /* + * AzureResource entity properties + */ + @JsonProperty(value = "properties") + private AzureResourceEntityProperties innerProperties; + + /** + * Get the innerProperties property: AzureResource entity properties. + * + * @return the innerProperties value. + */ + private AzureResourceEntityProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the resourceId property: The azure resource id of the resource. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.innerProperties() == null ? null : this.innerProperties().resourceId(); + } + + /** + * Get the subscriptionId property: The subscription id of the resource. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.innerProperties() == null ? null : this.innerProperties().subscriptionId(); + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Bookmark.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Bookmark.java new file mode 100644 index 000000000000..a007b44cfe36 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Bookmark.java @@ -0,0 +1,538 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.BookmarkInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of Bookmark. */ +public interface Bookmark { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the created property: The time the bookmark was created. + * + * @return the created value. + */ + OffsetDateTime created(); + + /** + * Gets the createdBy property: Describes a user that created the bookmark. + * + * @return the createdBy value. + */ + UserInfo createdBy(); + + /** + * Gets the displayName property: The display name of the bookmark. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the labels property: List of labels relevant to this bookmark. + * + * @return the labels value. + */ + List labels(); + + /** + * Gets the notes property: The notes of the bookmark. + * + * @return the notes value. + */ + String notes(); + + /** + * Gets the query property: The query of the bookmark. + * + * @return the query value. + */ + String query(); + + /** + * Gets the queryResult property: The query result of the bookmark. + * + * @return the queryResult value. + */ + String queryResult(); + + /** + * Gets the updated property: The last time the bookmark was updated. + * + * @return the updated value. + */ + OffsetDateTime updated(); + + /** + * Gets the updatedBy property: Describes a user that updated the bookmark. + * + * @return the updatedBy value. + */ + UserInfo updatedBy(); + + /** + * Gets the eventTime property: The bookmark event time. + * + * @return the eventTime value. + */ + OffsetDateTime eventTime(); + + /** + * Gets the queryStartTime property: The start time for the query. + * + * @return the queryStartTime value. + */ + OffsetDateTime queryStartTime(); + + /** + * Gets the queryEndTime property: The end time for the query. + * + * @return the queryEndTime value. + */ + OffsetDateTime queryEndTime(); + + /** + * Gets the incidentInfo property: Describes an incident that relates to bookmark. + * + * @return the incidentInfo value. + */ + IncidentInfo incidentInfo(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.BookmarkInner object. + * + * @return the inner object. + */ + BookmarkInner innerModel(); + + /** The entirety of the Bookmark definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Bookmark definition stages. */ + interface DefinitionStages { + /** The first stage of the Bookmark definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Bookmark definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @return the next definition stage. + */ + WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); + } + /** + * The stage of the Bookmark definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithEtag, + DefinitionStages.WithCreated, + DefinitionStages.WithCreatedBy, + DefinitionStages.WithDisplayName, + DefinitionStages.WithLabels, + DefinitionStages.WithNotes, + DefinitionStages.WithQuery, + DefinitionStages.WithQueryResult, + DefinitionStages.WithUpdated, + DefinitionStages.WithUpdatedBy, + DefinitionStages.WithEventTime, + DefinitionStages.WithQueryStartTime, + DefinitionStages.WithQueryEndTime, + DefinitionStages.WithIncidentInfo { + /** + * Executes the create request. + * + * @return the created resource. + */ + Bookmark create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Bookmark create(Context context); + } + /** The stage of the Bookmark definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Etag of the azure resource. + * + * @param etag Etag of the azure resource. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the Bookmark definition allowing to specify created. */ + interface WithCreated { + /** + * Specifies the created property: The time the bookmark was created. + * + * @param created The time the bookmark was created. + * @return the next definition stage. + */ + WithCreate withCreated(OffsetDateTime created); + } + /** The stage of the Bookmark definition allowing to specify createdBy. */ + interface WithCreatedBy { + /** + * Specifies the createdBy property: Describes a user that created the bookmark. + * + * @param createdBy Describes a user that created the bookmark. + * @return the next definition stage. + */ + WithCreate withCreatedBy(UserInfo createdBy); + } + /** The stage of the Bookmark definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: The display name of the bookmark. + * + * @param displayName The display name of the bookmark. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the Bookmark definition allowing to specify labels. */ + interface WithLabels { + /** + * Specifies the labels property: List of labels relevant to this bookmark. + * + * @param labels List of labels relevant to this bookmark. + * @return the next definition stage. + */ + WithCreate withLabels(List labels); + } + /** The stage of the Bookmark definition allowing to specify notes. */ + interface WithNotes { + /** + * Specifies the notes property: The notes of the bookmark. + * + * @param notes The notes of the bookmark. + * @return the next definition stage. + */ + WithCreate withNotes(String notes); + } + /** The stage of the Bookmark definition allowing to specify query. */ + interface WithQuery { + /** + * Specifies the query property: The query of the bookmark.. + * + * @param query The query of the bookmark. + * @return the next definition stage. + */ + WithCreate withQuery(String query); + } + /** The stage of the Bookmark definition allowing to specify queryResult. */ + interface WithQueryResult { + /** + * Specifies the queryResult property: The query result of the bookmark.. + * + * @param queryResult The query result of the bookmark. + * @return the next definition stage. + */ + WithCreate withQueryResult(String queryResult); + } + /** The stage of the Bookmark definition allowing to specify updated. */ + interface WithUpdated { + /** + * Specifies the updated property: The last time the bookmark was updated. + * + * @param updated The last time the bookmark was updated. + * @return the next definition stage. + */ + WithCreate withUpdated(OffsetDateTime updated); + } + /** The stage of the Bookmark definition allowing to specify updatedBy. */ + interface WithUpdatedBy { + /** + * Specifies the updatedBy property: Describes a user that updated the bookmark. + * + * @param updatedBy Describes a user that updated the bookmark. + * @return the next definition stage. + */ + WithCreate withUpdatedBy(UserInfo updatedBy); + } + /** The stage of the Bookmark definition allowing to specify eventTime. */ + interface WithEventTime { + /** + * Specifies the eventTime property: The bookmark event time. + * + * @param eventTime The bookmark event time. + * @return the next definition stage. + */ + WithCreate withEventTime(OffsetDateTime eventTime); + } + /** The stage of the Bookmark definition allowing to specify queryStartTime. */ + interface WithQueryStartTime { + /** + * Specifies the queryStartTime property: The start time for the query. + * + * @param queryStartTime The start time for the query. + * @return the next definition stage. + */ + WithCreate withQueryStartTime(OffsetDateTime queryStartTime); + } + /** The stage of the Bookmark definition allowing to specify queryEndTime. */ + interface WithQueryEndTime { + /** + * Specifies the queryEndTime property: The end time for the query. + * + * @param queryEndTime The end time for the query. + * @return the next definition stage. + */ + WithCreate withQueryEndTime(OffsetDateTime queryEndTime); + } + /** The stage of the Bookmark definition allowing to specify incidentInfo. */ + interface WithIncidentInfo { + /** + * Specifies the incidentInfo property: Describes an incident that relates to bookmark. + * + * @param incidentInfo Describes an incident that relates to bookmark. + * @return the next definition stage. + */ + WithCreate withIncidentInfo(IncidentInfo incidentInfo); + } + } + /** + * Begins update for the Bookmark resource. + * + * @return the stage of resource update. + */ + Bookmark.Update update(); + + /** The template for Bookmark update. */ + interface Update + extends UpdateStages.WithEtag, + UpdateStages.WithCreated, + UpdateStages.WithCreatedBy, + UpdateStages.WithDisplayName, + UpdateStages.WithLabels, + UpdateStages.WithNotes, + UpdateStages.WithQuery, + UpdateStages.WithQueryResult, + UpdateStages.WithUpdated, + UpdateStages.WithUpdatedBy, + UpdateStages.WithEventTime, + UpdateStages.WithQueryStartTime, + UpdateStages.WithQueryEndTime, + UpdateStages.WithIncidentInfo { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Bookmark apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Bookmark apply(Context context); + } + /** The Bookmark update stages. */ + interface UpdateStages { + /** The stage of the Bookmark update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Etag of the azure resource. + * + * @param etag Etag of the azure resource. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + /** The stage of the Bookmark update allowing to specify created. */ + interface WithCreated { + /** + * Specifies the created property: The time the bookmark was created. + * + * @param created The time the bookmark was created. + * @return the next definition stage. + */ + Update withCreated(OffsetDateTime created); + } + /** The stage of the Bookmark update allowing to specify createdBy. */ + interface WithCreatedBy { + /** + * Specifies the createdBy property: Describes a user that created the bookmark. + * + * @param createdBy Describes a user that created the bookmark. + * @return the next definition stage. + */ + Update withCreatedBy(UserInfo createdBy); + } + /** The stage of the Bookmark update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: The display name of the bookmark. + * + * @param displayName The display name of the bookmark. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the Bookmark update allowing to specify labels. */ + interface WithLabels { + /** + * Specifies the labels property: List of labels relevant to this bookmark. + * + * @param labels List of labels relevant to this bookmark. + * @return the next definition stage. + */ + Update withLabels(List labels); + } + /** The stage of the Bookmark update allowing to specify notes. */ + interface WithNotes { + /** + * Specifies the notes property: The notes of the bookmark. + * + * @param notes The notes of the bookmark. + * @return the next definition stage. + */ + Update withNotes(String notes); + } + /** The stage of the Bookmark update allowing to specify query. */ + interface WithQuery { + /** + * Specifies the query property: The query of the bookmark.. + * + * @param query The query of the bookmark. + * @return the next definition stage. + */ + Update withQuery(String query); + } + /** The stage of the Bookmark update allowing to specify queryResult. */ + interface WithQueryResult { + /** + * Specifies the queryResult property: The query result of the bookmark.. + * + * @param queryResult The query result of the bookmark. + * @return the next definition stage. + */ + Update withQueryResult(String queryResult); + } + /** The stage of the Bookmark update allowing to specify updated. */ + interface WithUpdated { + /** + * Specifies the updated property: The last time the bookmark was updated. + * + * @param updated The last time the bookmark was updated. + * @return the next definition stage. + */ + Update withUpdated(OffsetDateTime updated); + } + /** The stage of the Bookmark update allowing to specify updatedBy. */ + interface WithUpdatedBy { + /** + * Specifies the updatedBy property: Describes a user that updated the bookmark. + * + * @param updatedBy Describes a user that updated the bookmark. + * @return the next definition stage. + */ + Update withUpdatedBy(UserInfo updatedBy); + } + /** The stage of the Bookmark update allowing to specify eventTime. */ + interface WithEventTime { + /** + * Specifies the eventTime property: The bookmark event time. + * + * @param eventTime The bookmark event time. + * @return the next definition stage. + */ + Update withEventTime(OffsetDateTime eventTime); + } + /** The stage of the Bookmark update allowing to specify queryStartTime. */ + interface WithQueryStartTime { + /** + * Specifies the queryStartTime property: The start time for the query. + * + * @param queryStartTime The start time for the query. + * @return the next definition stage. + */ + Update withQueryStartTime(OffsetDateTime queryStartTime); + } + /** The stage of the Bookmark update allowing to specify queryEndTime. */ + interface WithQueryEndTime { + /** + * Specifies the queryEndTime property: The end time for the query. + * + * @param queryEndTime The end time for the query. + * @return the next definition stage. + */ + Update withQueryEndTime(OffsetDateTime queryEndTime); + } + /** The stage of the Bookmark update allowing to specify incidentInfo. */ + interface WithIncidentInfo { + /** + * Specifies the incidentInfo property: Describes an incident that relates to bookmark. + * + * @param incidentInfo Describes an incident that relates to bookmark. + * @return the next definition stage. + */ + Update withIncidentInfo(IncidentInfo incidentInfo); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Bookmark refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Bookmark refresh(Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkExpandParameters.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkExpandParameters.java new file mode 100644 index 000000000000..6394e9a4b192 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkExpandParameters.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.UUID; + +/** The parameters required to execute an expand operation on the given bookmark. */ +@Fluent +public final class BookmarkExpandParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BookmarkExpandParameters.class); + + /* + * The end date filter, so the only expansion results returned are before + * this date. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * The Id of the expansion to perform. + */ + @JsonProperty(value = "expansionId") + private UUID expansionId; + + /* + * The start date filter, so the only expansion results returned are after + * this date. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /** + * Get the endTime property: The end date filter, so the only expansion results returned are before this date. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end date filter, so the only expansion results returned are before this date. + * + * @param endTime the endTime value to set. + * @return the BookmarkExpandParameters object itself. + */ + public BookmarkExpandParameters withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the expansionId property: The Id of the expansion to perform. + * + * @return the expansionId value. + */ + public UUID expansionId() { + return this.expansionId; + } + + /** + * Set the expansionId property: The Id of the expansion to perform. + * + * @param expansionId the expansionId value to set. + * @return the BookmarkExpandParameters object itself. + */ + public BookmarkExpandParameters withExpansionId(UUID expansionId) { + this.expansionId = expansionId; + return this; + } + + /** + * Get the startTime property: The start date filter, so the only expansion results returned are after this date. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start date filter, so the only expansion results returned are after this date. + * + * @param startTime the startTime value to set. + * @return the BookmarkExpandParameters object itself. + */ + public BookmarkExpandParameters withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkExpandResponse.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkExpandResponse.java new file mode 100644 index 000000000000..0df634388d5e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkExpandResponse.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.BookmarkExpandResponseInner; + +/** An immutable client-side representation of BookmarkExpandResponse. */ +public interface BookmarkExpandResponse { + /** + * Gets the metadata property: The metadata from the expansion operation results. + * + * @return the metadata value. + */ + ExpansionResultsMetadata metadata(); + + /** + * Gets the value property: The expansion result values. + * + * @return the value value. + */ + BookmarkExpandResponseValue value(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.BookmarkExpandResponseInner object. + * + * @return the inner object. + */ + BookmarkExpandResponseInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkExpandResponseValue.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkExpandResponseValue.java new file mode 100644 index 000000000000..cc4026d97464 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkExpandResponseValue.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The expansion result values. */ +@Fluent +public final class BookmarkExpandResponseValue { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BookmarkExpandResponseValue.class); + + /* + * Array of the expansion result entities. + */ + @JsonProperty(value = "entities") + private List entities; + + /* + * Array of expansion result connected entities + */ + @JsonProperty(value = "edges") + private List edges; + + /** + * Get the entities property: Array of the expansion result entities. + * + * @return the entities value. + */ + public List entities() { + return this.entities; + } + + /** + * Set the entities property: Array of the expansion result entities. + * + * @param entities the entities value to set. + * @return the BookmarkExpandResponseValue object itself. + */ + public BookmarkExpandResponseValue withEntities(List entities) { + this.entities = entities; + return this; + } + + /** + * Get the edges property: Array of expansion result connected entities. + * + * @return the edges value. + */ + public List edges() { + return this.edges; + } + + /** + * Set the edges property: Array of expansion result connected entities. + * + * @param edges the edges value to set. + * @return the BookmarkExpandResponseValue object itself. + */ + public BookmarkExpandResponseValue withEdges(List edges) { + this.edges = edges; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (entities() != null) { + entities().forEach(e -> e.validate()); + } + if (edges() != null) { + edges().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkList.java new file mode 100644 index 000000000000..1c935bdd4dcc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkList.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.BookmarkInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List all the bookmarks. */ +@Fluent +public final class BookmarkList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BookmarkList.class); + + /* + * URL to fetch the next set of cases. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of bookmarks. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the nextLink property: URL to fetch the next set of cases. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of bookmarks. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of bookmarks. + * + * @param value the value value to set. + * @return the BookmarkList object itself. + */ + public BookmarkList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model BookmarkList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkOperations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkOperations.java new file mode 100644 index 000000000000..24a42754bf58 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkOperations.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of BookmarkOperations. */ +public interface BookmarkOperations { + /** + * Expand an bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param parameters The parameters required to execute an expand operation on the given bookmark. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity expansion result operation response. + */ + BookmarkExpandResponse expand( + String resourceGroupName, String workspaceName, String bookmarkId, BookmarkExpandParameters parameters); + + /** + * Expand an bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param parameters The parameters required to execute an expand operation on the given bookmark. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity expansion result operation response. + */ + Response expandWithResponse( + String resourceGroupName, + String workspaceName, + String bookmarkId, + BookmarkExpandParameters parameters, + Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkRelations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkRelations.java new file mode 100644 index 000000000000..3690975375db --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkRelations.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of BookmarkRelations. */ +public interface BookmarkRelations { + /** + * Gets all bookmark relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all bookmark relations. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String bookmarkId); + + /** + * Gets all bookmark relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all bookmark relations. + */ + PagedIterable list( + String resourceGroupName, + String workspaceName, + String bookmarkId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context); + + /** + * Gets a bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a bookmark relation. + */ + Relation get(String resourceGroupName, String workspaceName, String bookmarkId, String relationName); + + /** + * Gets a bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a bookmark relation. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String bookmarkId, String relationName, Context context); + + /** + * Delete the bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String bookmarkId, String relationName); + + /** + * Delete the bookmark relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param relationName Relation Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String bookmarkId, String relationName, Context context); + + /** + * Gets a bookmark relation. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a bookmark relation. + */ + Relation getById(String id); + + /** + * Gets a bookmark relation. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a bookmark relation. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the bookmark relation. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the bookmark relation. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Relation resource. + * + * @param name resource name. + * @return the first stage of the new Relation definition. + */ + Relation.DefinitionStages.Blank define(String name); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkTimelineItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkTimelineItem.java new file mode 100644 index 000000000000..c41519f7c33f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkTimelineItem.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** Represents bookmark timeline item. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Bookmark") +@Fluent +public final class BookmarkTimelineItem extends EntityTimelineItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BookmarkTimelineItem.class); + + /* + * The bookmark azure resource id. + */ + @JsonProperty(value = "azureResourceId", required = true) + private String azureResourceId; + + /* + * The bookmark display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The notes of the bookmark + */ + @JsonProperty(value = "notes") + private String notes; + + /* + * The bookmark end time. + */ + @JsonProperty(value = "endTimeUtc") + private OffsetDateTime endTimeUtc; + + /* + * The bookmark start time. + */ + @JsonProperty(value = "startTimeUtc") + private OffsetDateTime startTimeUtc; + + /* + * The bookmark event time. + */ + @JsonProperty(value = "eventTime") + private OffsetDateTime eventTime; + + /* + * Describes a user that created the bookmark + */ + @JsonProperty(value = "createdBy") + private UserInfo createdBy; + + /* + * List of labels relevant to this bookmark + */ + @JsonProperty(value = "labels") + private List labels; + + /** + * Get the azureResourceId property: The bookmark azure resource id. + * + * @return the azureResourceId value. + */ + public String azureResourceId() { + return this.azureResourceId; + } + + /** + * Set the azureResourceId property: The bookmark azure resource id. + * + * @param azureResourceId the azureResourceId value to set. + * @return the BookmarkTimelineItem object itself. + */ + public BookmarkTimelineItem withAzureResourceId(String azureResourceId) { + this.azureResourceId = azureResourceId; + return this; + } + + /** + * Get the displayName property: The bookmark display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The bookmark display name. + * + * @param displayName the displayName value to set. + * @return the BookmarkTimelineItem object itself. + */ + public BookmarkTimelineItem withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the notes property: The notes of the bookmark. + * + * @return the notes value. + */ + public String notes() { + return this.notes; + } + + /** + * Set the notes property: The notes of the bookmark. + * + * @param notes the notes value to set. + * @return the BookmarkTimelineItem object itself. + */ + public BookmarkTimelineItem withNotes(String notes) { + this.notes = notes; + return this; + } + + /** + * Get the endTimeUtc property: The bookmark end time. + * + * @return the endTimeUtc value. + */ + public OffsetDateTime endTimeUtc() { + return this.endTimeUtc; + } + + /** + * Set the endTimeUtc property: The bookmark end time. + * + * @param endTimeUtc the endTimeUtc value to set. + * @return the BookmarkTimelineItem object itself. + */ + public BookmarkTimelineItem withEndTimeUtc(OffsetDateTime endTimeUtc) { + this.endTimeUtc = endTimeUtc; + return this; + } + + /** + * Get the startTimeUtc property: The bookmark start time. + * + * @return the startTimeUtc value. + */ + public OffsetDateTime startTimeUtc() { + return this.startTimeUtc; + } + + /** + * Set the startTimeUtc property: The bookmark start time. + * + * @param startTimeUtc the startTimeUtc value to set. + * @return the BookmarkTimelineItem object itself. + */ + public BookmarkTimelineItem withStartTimeUtc(OffsetDateTime startTimeUtc) { + this.startTimeUtc = startTimeUtc; + return this; + } + + /** + * Get the eventTime property: The bookmark event time. + * + * @return the eventTime value. + */ + public OffsetDateTime eventTime() { + return this.eventTime; + } + + /** + * Set the eventTime property: The bookmark event time. + * + * @param eventTime the eventTime value to set. + * @return the BookmarkTimelineItem object itself. + */ + public BookmarkTimelineItem withEventTime(OffsetDateTime eventTime) { + this.eventTime = eventTime; + return this; + } + + /** + * Get the createdBy property: Describes a user that created the bookmark. + * + * @return the createdBy value. + */ + public UserInfo createdBy() { + return this.createdBy; + } + + /** + * Set the createdBy property: Describes a user that created the bookmark. + * + * @param createdBy the createdBy value to set. + * @return the BookmarkTimelineItem object itself. + */ + public BookmarkTimelineItem withCreatedBy(UserInfo createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Get the labels property: List of labels relevant to this bookmark. + * + * @return the labels value. + */ + public List labels() { + return this.labels; + } + + /** + * Set the labels property: List of labels relevant to this bookmark. + * + * @param labels the labels value to set. + * @return the BookmarkTimelineItem object itself. + */ + public BookmarkTimelineItem withLabels(List labels) { + this.labels = labels; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (azureResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property azureResourceId in model BookmarkTimelineItem")); + } + if (createdBy() != null) { + createdBy().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Bookmarks.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Bookmarks.java new file mode 100644 index 000000000000..402edb2a6905 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Bookmarks.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Bookmarks. */ +public interface Bookmarks { + /** + * Gets all bookmarks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all bookmarks. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all bookmarks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all bookmarks. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets a bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a bookmark. + */ + Bookmark get(String resourceGroupName, String workspaceName, String bookmarkId); + + /** + * Gets a bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a bookmark. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String bookmarkId, Context context); + + /** + * Delete the bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String bookmarkId); + + /** + * Delete the bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String bookmarkId, Context context); + + /** + * Gets a bookmark. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a bookmark. + */ + Bookmark getById(String id); + + /** + * Gets a bookmark. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a bookmark. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the bookmark. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the bookmark. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Bookmark resource. + * + * @param name resource name. + * @return the first stage of the new Bookmark definition. + */ + Bookmark.DefinitionStages.Blank define(String name); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ClientInfo.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ClientInfo.java new file mode 100644 index 000000000000..7c4ef8aa342b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ClientInfo.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** Information on the client (user or application) that made some action. */ +@Fluent +public final class ClientInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientInfo.class); + + /* + * The email of the client. + */ + @JsonProperty(value = "email") + private String email; + + /* + * The name of the client. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The object id of the client. + */ + @JsonProperty(value = "objectId") + private UUID objectId; + + /* + * The user principal name of the client. + */ + @JsonProperty(value = "userPrincipalName") + private String userPrincipalName; + + /** + * Get the email property: The email of the client. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: The email of the client. + * + * @param email the email value to set. + * @return the ClientInfo object itself. + */ + public ClientInfo withEmail(String email) { + this.email = email; + return this; + } + + /** + * Get the name property: The name of the client. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the client. + * + * @param name the name value to set. + * @return the ClientInfo object itself. + */ + public ClientInfo withName(String name) { + this.name = name; + return this; + } + + /** + * Get the objectId property: The object id of the client. + * + * @return the objectId value. + */ + public UUID objectId() { + return this.objectId; + } + + /** + * Set the objectId property: The object id of the client. + * + * @param objectId the objectId value to set. + * @return the ClientInfo object itself. + */ + public ClientInfo withObjectId(UUID objectId) { + this.objectId = objectId; + return this; + } + + /** + * Get the userPrincipalName property: The user principal name of the client. + * + * @return the userPrincipalName value. + */ + public String userPrincipalName() { + return this.userPrincipalName; + } + + /** + * Set the userPrincipalName property: The user principal name of the client. + * + * @param userPrincipalName the userPrincipalName value to set. + * @return the ClientInfo object itself. + */ + public ClientInfo withUserPrincipalName(String userPrincipalName) { + this.userPrincipalName = userPrincipalName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CloudApplicationEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CloudApplicationEntity.java new file mode 100644 index 000000000000..06ed9fbfcf2e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CloudApplicationEntity.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.CloudApplicationEntityProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** Represents a cloud application entity. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("CloudApplication") +@Fluent +public final class CloudApplicationEntity extends EntityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudApplicationEntity.class); + + /* + * CloudApplication entity properties + */ + @JsonProperty(value = "properties") + private CloudApplicationEntityProperties innerProperties; + + /** + * Get the innerProperties property: CloudApplication entity properties. + * + * @return the innerProperties value. + */ + private CloudApplicationEntityProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the appId property: The technical identifier of the application. + * + * @return the appId value. + */ + public Integer appId() { + return this.innerProperties() == null ? null : this.innerProperties().appId(); + } + + /** + * Get the appName property: The name of the related cloud application. + * + * @return the appName value. + */ + public String appName() { + return this.innerProperties() == null ? null : this.innerProperties().appName(); + } + + /** + * Get the instanceName property: The user defined instance name of the cloud application. It is often used to + * distinguish between several applications of the same type that a customer has. + * + * @return the instanceName value. + */ + public String instanceName() { + return this.innerProperties() == null ? null : this.innerProperties().instanceName(); + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessApiPollingDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessApiPollingDataConnector.java new file mode 100644 index 000000000000..ac48b50e2400 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessApiPollingDataConnector.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.ApiPollingParameters; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents Codeless API Polling data connector. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("APIPolling") +@Fluent +public final class CodelessApiPollingDataConnector extends DataConnectorInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CodelessApiPollingDataConnector.class); + + /* + * Codeless poling data connector properties + */ + @JsonProperty(value = "properties") + private ApiPollingParameters innerProperties; + + /** + * Get the innerProperties property: Codeless poling data connector properties. + * + * @return the innerProperties value. + */ + private ApiPollingParameters innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public CodelessApiPollingDataConnector withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the connectorUiConfig property: Config to describe the instructions blade. + * + * @return the connectorUiConfig value. + */ + public CodelessUiConnectorConfigProperties connectorUiConfig() { + return this.innerProperties() == null ? null : this.innerProperties().connectorUiConfig(); + } + + /** + * Set the connectorUiConfig property: Config to describe the instructions blade. + * + * @param connectorUiConfig the connectorUiConfig value to set. + * @return the CodelessApiPollingDataConnector object itself. + */ + public CodelessApiPollingDataConnector withConnectorUiConfig( + CodelessUiConnectorConfigProperties connectorUiConfig) { + if (this.innerProperties() == null) { + this.innerProperties = new ApiPollingParameters(); + } + this.innerProperties().withConnectorUiConfig(connectorUiConfig); + return this; + } + + /** + * Get the pollingConfig property: Config to describe the polling instructions. + * + * @return the pollingConfig value. + */ + public CodelessConnectorPollingConfigProperties pollingConfig() { + return this.innerProperties() == null ? null : this.innerProperties().pollingConfig(); + } + + /** + * Set the pollingConfig property: Config to describe the polling instructions. + * + * @param pollingConfig the pollingConfig value to set. + * @return the CodelessApiPollingDataConnector object itself. + */ + public CodelessApiPollingDataConnector withPollingConfig(CodelessConnectorPollingConfigProperties pollingConfig) { + if (this.innerProperties() == null) { + this.innerProperties = new ApiPollingParameters(); + } + this.innerProperties().withPollingConfig(pollingConfig); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingAuthProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingAuthProperties.java new file mode 100644 index 000000000000..bb0169d8621b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingAuthProperties.java @@ -0,0 +1,381 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describe the authentication properties needed to successfully authenticate with the server. */ +@Fluent +public final class CodelessConnectorPollingAuthProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CodelessConnectorPollingAuthProperties.class); + + /* + * The authentication type + */ + @JsonProperty(value = "authType", required = true) + private String authType; + + /* + * The header name which the token is sent with + */ + @JsonProperty(value = "apiKeyName") + private String apiKeyName; + + /* + * A prefix send in the header before the actual token + */ + @JsonProperty(value = "apiKeyIdentifier") + private String apiKeyIdentifier; + + /* + * Marks if the key should sent in header + */ + @JsonProperty(value = "isApiKeyInPostPayload") + private String isApiKeyInPostPayload; + + /* + * Describes the flow name, for example 'AuthCode' for Oauth 2.0 + */ + @JsonProperty(value = "flowName") + private String flowName; + + /* + * The endpoint used to issue a token, used in Oauth 2.0 flow + */ + @JsonProperty(value = "tokenEndpoint") + private String tokenEndpoint; + + /* + * The endpoint used to authorize the user, used in Oauth 2.0 flow + */ + @JsonProperty(value = "authorizationEndpoint") + private String authorizationEndpoint; + + /* + * The query parameters used in authorization request, used in Oauth 2.0 + * flow + */ + @JsonProperty(value = "authorizationEndpointQueryParameters") + private Object authorizationEndpointQueryParameters; + + /* + * The redirect endpoint where we will get the authorization code, used in + * Oauth 2.0 flow + */ + @JsonProperty(value = "redirectionEndpoint") + private String redirectionEndpoint; + + /* + * The query headers used in token request, used in Oauth 2.0 flow + */ + @JsonProperty(value = "tokenEndpointHeaders") + private Object tokenEndpointHeaders; + + /* + * The query parameters used in token request, used in Oauth 2.0 flow + */ + @JsonProperty(value = "tokenEndpointQueryParameters") + private Object tokenEndpointQueryParameters; + + /* + * Marks if we should send the client secret in header or payload, used in + * Oauth 2.0 flow + */ + @JsonProperty(value = "isClientSecretInHeader") + private Boolean isClientSecretInHeader; + + /* + * The OAuth token scope + */ + @JsonProperty(value = "scope") + private String scope; + + /** + * Get the authType property: The authentication type. + * + * @return the authType value. + */ + public String authType() { + return this.authType; + } + + /** + * Set the authType property: The authentication type. + * + * @param authType the authType value to set. + * @return the CodelessConnectorPollingAuthProperties object itself. + */ + public CodelessConnectorPollingAuthProperties withAuthType(String authType) { + this.authType = authType; + return this; + } + + /** + * Get the apiKeyName property: The header name which the token is sent with. + * + * @return the apiKeyName value. + */ + public String apiKeyName() { + return this.apiKeyName; + } + + /** + * Set the apiKeyName property: The header name which the token is sent with. + * + * @param apiKeyName the apiKeyName value to set. + * @return the CodelessConnectorPollingAuthProperties object itself. + */ + public CodelessConnectorPollingAuthProperties withApiKeyName(String apiKeyName) { + this.apiKeyName = apiKeyName; + return this; + } + + /** + * Get the apiKeyIdentifier property: A prefix send in the header before the actual token. + * + * @return the apiKeyIdentifier value. + */ + public String apiKeyIdentifier() { + return this.apiKeyIdentifier; + } + + /** + * Set the apiKeyIdentifier property: A prefix send in the header before the actual token. + * + * @param apiKeyIdentifier the apiKeyIdentifier value to set. + * @return the CodelessConnectorPollingAuthProperties object itself. + */ + public CodelessConnectorPollingAuthProperties withApiKeyIdentifier(String apiKeyIdentifier) { + this.apiKeyIdentifier = apiKeyIdentifier; + return this; + } + + /** + * Get the isApiKeyInPostPayload property: Marks if the key should sent in header. + * + * @return the isApiKeyInPostPayload value. + */ + public String isApiKeyInPostPayload() { + return this.isApiKeyInPostPayload; + } + + /** + * Set the isApiKeyInPostPayload property: Marks if the key should sent in header. + * + * @param isApiKeyInPostPayload the isApiKeyInPostPayload value to set. + * @return the CodelessConnectorPollingAuthProperties object itself. + */ + public CodelessConnectorPollingAuthProperties withIsApiKeyInPostPayload(String isApiKeyInPostPayload) { + this.isApiKeyInPostPayload = isApiKeyInPostPayload; + return this; + } + + /** + * Get the flowName property: Describes the flow name, for example 'AuthCode' for Oauth 2.0. + * + * @return the flowName value. + */ + public String flowName() { + return this.flowName; + } + + /** + * Set the flowName property: Describes the flow name, for example 'AuthCode' for Oauth 2.0. + * + * @param flowName the flowName value to set. + * @return the CodelessConnectorPollingAuthProperties object itself. + */ + public CodelessConnectorPollingAuthProperties withFlowName(String flowName) { + this.flowName = flowName; + return this; + } + + /** + * Get the tokenEndpoint property: The endpoint used to issue a token, used in Oauth 2.0 flow. + * + * @return the tokenEndpoint value. + */ + public String tokenEndpoint() { + return this.tokenEndpoint; + } + + /** + * Set the tokenEndpoint property: The endpoint used to issue a token, used in Oauth 2.0 flow. + * + * @param tokenEndpoint the tokenEndpoint value to set. + * @return the CodelessConnectorPollingAuthProperties object itself. + */ + public CodelessConnectorPollingAuthProperties withTokenEndpoint(String tokenEndpoint) { + this.tokenEndpoint = tokenEndpoint; + return this; + } + + /** + * Get the authorizationEndpoint property: The endpoint used to authorize the user, used in Oauth 2.0 flow. + * + * @return the authorizationEndpoint value. + */ + public String authorizationEndpoint() { + return this.authorizationEndpoint; + } + + /** + * Set the authorizationEndpoint property: The endpoint used to authorize the user, used in Oauth 2.0 flow. + * + * @param authorizationEndpoint the authorizationEndpoint value to set. + * @return the CodelessConnectorPollingAuthProperties object itself. + */ + public CodelessConnectorPollingAuthProperties withAuthorizationEndpoint(String authorizationEndpoint) { + this.authorizationEndpoint = authorizationEndpoint; + return this; + } + + /** + * Get the authorizationEndpointQueryParameters property: The query parameters used in authorization request, used + * in Oauth 2.0 flow. + * + * @return the authorizationEndpointQueryParameters value. + */ + public Object authorizationEndpointQueryParameters() { + return this.authorizationEndpointQueryParameters; + } + + /** + * Set the authorizationEndpointQueryParameters property: The query parameters used in authorization request, used + * in Oauth 2.0 flow. + * + * @param authorizationEndpointQueryParameters the authorizationEndpointQueryParameters value to set. + * @return the CodelessConnectorPollingAuthProperties object itself. + */ + public CodelessConnectorPollingAuthProperties withAuthorizationEndpointQueryParameters( + Object authorizationEndpointQueryParameters) { + this.authorizationEndpointQueryParameters = authorizationEndpointQueryParameters; + return this; + } + + /** + * Get the redirectionEndpoint property: The redirect endpoint where we will get the authorization code, used in + * Oauth 2.0 flow. + * + * @return the redirectionEndpoint value. + */ + public String redirectionEndpoint() { + return this.redirectionEndpoint; + } + + /** + * Set the redirectionEndpoint property: The redirect endpoint where we will get the authorization code, used in + * Oauth 2.0 flow. + * + * @param redirectionEndpoint the redirectionEndpoint value to set. + * @return the CodelessConnectorPollingAuthProperties object itself. + */ + public CodelessConnectorPollingAuthProperties withRedirectionEndpoint(String redirectionEndpoint) { + this.redirectionEndpoint = redirectionEndpoint; + return this; + } + + /** + * Get the tokenEndpointHeaders property: The query headers used in token request, used in Oauth 2.0 flow. + * + * @return the tokenEndpointHeaders value. + */ + public Object tokenEndpointHeaders() { + return this.tokenEndpointHeaders; + } + + /** + * Set the tokenEndpointHeaders property: The query headers used in token request, used in Oauth 2.0 flow. + * + * @param tokenEndpointHeaders the tokenEndpointHeaders value to set. + * @return the CodelessConnectorPollingAuthProperties object itself. + */ + public CodelessConnectorPollingAuthProperties withTokenEndpointHeaders(Object tokenEndpointHeaders) { + this.tokenEndpointHeaders = tokenEndpointHeaders; + return this; + } + + /** + * Get the tokenEndpointQueryParameters property: The query parameters used in token request, used in Oauth 2.0 + * flow. + * + * @return the tokenEndpointQueryParameters value. + */ + public Object tokenEndpointQueryParameters() { + return this.tokenEndpointQueryParameters; + } + + /** + * Set the tokenEndpointQueryParameters property: The query parameters used in token request, used in Oauth 2.0 + * flow. + * + * @param tokenEndpointQueryParameters the tokenEndpointQueryParameters value to set. + * @return the CodelessConnectorPollingAuthProperties object itself. + */ + public CodelessConnectorPollingAuthProperties withTokenEndpointQueryParameters( + Object tokenEndpointQueryParameters) { + this.tokenEndpointQueryParameters = tokenEndpointQueryParameters; + return this; + } + + /** + * Get the isClientSecretInHeader property: Marks if we should send the client secret in header or payload, used in + * Oauth 2.0 flow. + * + * @return the isClientSecretInHeader value. + */ + public Boolean isClientSecretInHeader() { + return this.isClientSecretInHeader; + } + + /** + * Set the isClientSecretInHeader property: Marks if we should send the client secret in header or payload, used in + * Oauth 2.0 flow. + * + * @param isClientSecretInHeader the isClientSecretInHeader value to set. + * @return the CodelessConnectorPollingAuthProperties object itself. + */ + public CodelessConnectorPollingAuthProperties withIsClientSecretInHeader(Boolean isClientSecretInHeader) { + this.isClientSecretInHeader = isClientSecretInHeader; + return this; + } + + /** + * Get the scope property: The OAuth token scope. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The OAuth token scope. + * + * @param scope the scope value to set. + * @return the CodelessConnectorPollingAuthProperties object itself. + */ + public CodelessConnectorPollingAuthProperties withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property authType in model CodelessConnectorPollingAuthProperties")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingConfigProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingConfigProperties.java new file mode 100644 index 000000000000..8e73a80125b9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingConfigProperties.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Config to describe the polling config for API poller connector. */ +@Fluent +public final class CodelessConnectorPollingConfigProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CodelessConnectorPollingConfigProperties.class); + + /* + * The poller active status + */ + @JsonProperty(value = "isActive") + private Boolean isActive; + + /* + * Describe the authentication type of the poller + */ + @JsonProperty(value = "auth", required = true) + private CodelessConnectorPollingAuthProperties auth; + + /* + * Describe the poll request config parameters of the poller + */ + @JsonProperty(value = "request", required = true) + private CodelessConnectorPollingRequestProperties request; + + /* + * Describe the poll request paging config of the poller + */ + @JsonProperty(value = "paging") + private CodelessConnectorPollingPagingProperties paging; + + /* + * Describe the response config parameters of the poller + */ + @JsonProperty(value = "response") + private CodelessConnectorPollingResponseProperties response; + + /** + * Get the isActive property: The poller active status. + * + * @return the isActive value. + */ + public Boolean isActive() { + return this.isActive; + } + + /** + * Set the isActive property: The poller active status. + * + * @param isActive the isActive value to set. + * @return the CodelessConnectorPollingConfigProperties object itself. + */ + public CodelessConnectorPollingConfigProperties withIsActive(Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Get the auth property: Describe the authentication type of the poller. + * + * @return the auth value. + */ + public CodelessConnectorPollingAuthProperties auth() { + return this.auth; + } + + /** + * Set the auth property: Describe the authentication type of the poller. + * + * @param auth the auth value to set. + * @return the CodelessConnectorPollingConfigProperties object itself. + */ + public CodelessConnectorPollingConfigProperties withAuth(CodelessConnectorPollingAuthProperties auth) { + this.auth = auth; + return this; + } + + /** + * Get the request property: Describe the poll request config parameters of the poller. + * + * @return the request value. + */ + public CodelessConnectorPollingRequestProperties request() { + return this.request; + } + + /** + * Set the request property: Describe the poll request config parameters of the poller. + * + * @param request the request value to set. + * @return the CodelessConnectorPollingConfigProperties object itself. + */ + public CodelessConnectorPollingConfigProperties withRequest(CodelessConnectorPollingRequestProperties request) { + this.request = request; + return this; + } + + /** + * Get the paging property: Describe the poll request paging config of the poller. + * + * @return the paging value. + */ + public CodelessConnectorPollingPagingProperties paging() { + return this.paging; + } + + /** + * Set the paging property: Describe the poll request paging config of the poller. + * + * @param paging the paging value to set. + * @return the CodelessConnectorPollingConfigProperties object itself. + */ + public CodelessConnectorPollingConfigProperties withPaging(CodelessConnectorPollingPagingProperties paging) { + this.paging = paging; + return this; + } + + /** + * Get the response property: Describe the response config parameters of the poller. + * + * @return the response value. + */ + public CodelessConnectorPollingResponseProperties response() { + return this.response; + } + + /** + * Set the response property: Describe the response config parameters of the poller. + * + * @param response the response value to set. + * @return the CodelessConnectorPollingConfigProperties object itself. + */ + public CodelessConnectorPollingConfigProperties withResponse(CodelessConnectorPollingResponseProperties response) { + this.response = response; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (auth() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property auth in model CodelessConnectorPollingConfigProperties")); + } else { + auth().validate(); + } + if (request() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property request in model CodelessConnectorPollingConfigProperties")); + } else { + request().validate(); + } + if (paging() != null) { + paging().validate(); + } + if (response() != null) { + response().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingPagingProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingPagingProperties.java new file mode 100644 index 000000000000..541021643968 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingPagingProperties.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describe the properties needed to make a pagination call. */ +@Fluent +public final class CodelessConnectorPollingPagingProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CodelessConnectorPollingPagingProperties.class); + + /* + * Describes the type. could be 'None', 'PageToken', 'PageCount', + * 'TimeStamp' + */ + @JsonProperty(value = "pagingType", required = true) + private String pagingType; + + /* + * Defines the name of a next page attribute + */ + @JsonProperty(value = "nextPageParaName") + private String nextPageParaName; + + /* + * Defines the path to a next page token JSON + */ + @JsonProperty(value = "nextPageTokenJsonPath") + private String nextPageTokenJsonPath; + + /* + * Defines the path to a page count attribute + */ + @JsonProperty(value = "pageCountAttributePath") + private String pageCountAttributePath; + + /* + * Defines the path to a page total count attribute + */ + @JsonProperty(value = "pageTotalCountAttributePath") + private String pageTotalCountAttributePath; + + /* + * Defines the path to a paging time stamp attribute + */ + @JsonProperty(value = "pageTimeStampAttributePath") + private String pageTimestampAttributePath; + + /* + * Determines whether to search for the latest time stamp in the events + * list + */ + @JsonProperty(value = "searchTheLatestTimeStampFromEventsList") + private String searchTheLatestTimestampFromEventsList; + + /* + * Defines the name of the page size parameter + */ + @JsonProperty(value = "pageSizeParaName") + private String pageSizeParaName; + + /* + * Defines the paging size + */ + @JsonProperty(value = "pageSize") + private Integer pageSize; + + /** + * Get the pagingType property: Describes the type. could be 'None', 'PageToken', 'PageCount', 'TimeStamp'. + * + * @return the pagingType value. + */ + public String pagingType() { + return this.pagingType; + } + + /** + * Set the pagingType property: Describes the type. could be 'None', 'PageToken', 'PageCount', 'TimeStamp'. + * + * @param pagingType the pagingType value to set. + * @return the CodelessConnectorPollingPagingProperties object itself. + */ + public CodelessConnectorPollingPagingProperties withPagingType(String pagingType) { + this.pagingType = pagingType; + return this; + } + + /** + * Get the nextPageParaName property: Defines the name of a next page attribute. + * + * @return the nextPageParaName value. + */ + public String nextPageParaName() { + return this.nextPageParaName; + } + + /** + * Set the nextPageParaName property: Defines the name of a next page attribute. + * + * @param nextPageParaName the nextPageParaName value to set. + * @return the CodelessConnectorPollingPagingProperties object itself. + */ + public CodelessConnectorPollingPagingProperties withNextPageParaName(String nextPageParaName) { + this.nextPageParaName = nextPageParaName; + return this; + } + + /** + * Get the nextPageTokenJsonPath property: Defines the path to a next page token JSON. + * + * @return the nextPageTokenJsonPath value. + */ + public String nextPageTokenJsonPath() { + return this.nextPageTokenJsonPath; + } + + /** + * Set the nextPageTokenJsonPath property: Defines the path to a next page token JSON. + * + * @param nextPageTokenJsonPath the nextPageTokenJsonPath value to set. + * @return the CodelessConnectorPollingPagingProperties object itself. + */ + public CodelessConnectorPollingPagingProperties withNextPageTokenJsonPath(String nextPageTokenJsonPath) { + this.nextPageTokenJsonPath = nextPageTokenJsonPath; + return this; + } + + /** + * Get the pageCountAttributePath property: Defines the path to a page count attribute. + * + * @return the pageCountAttributePath value. + */ + public String pageCountAttributePath() { + return this.pageCountAttributePath; + } + + /** + * Set the pageCountAttributePath property: Defines the path to a page count attribute. + * + * @param pageCountAttributePath the pageCountAttributePath value to set. + * @return the CodelessConnectorPollingPagingProperties object itself. + */ + public CodelessConnectorPollingPagingProperties withPageCountAttributePath(String pageCountAttributePath) { + this.pageCountAttributePath = pageCountAttributePath; + return this; + } + + /** + * Get the pageTotalCountAttributePath property: Defines the path to a page total count attribute. + * + * @return the pageTotalCountAttributePath value. + */ + public String pageTotalCountAttributePath() { + return this.pageTotalCountAttributePath; + } + + /** + * Set the pageTotalCountAttributePath property: Defines the path to a page total count attribute. + * + * @param pageTotalCountAttributePath the pageTotalCountAttributePath value to set. + * @return the CodelessConnectorPollingPagingProperties object itself. + */ + public CodelessConnectorPollingPagingProperties withPageTotalCountAttributePath( + String pageTotalCountAttributePath) { + this.pageTotalCountAttributePath = pageTotalCountAttributePath; + return this; + } + + /** + * Get the pageTimestampAttributePath property: Defines the path to a paging time stamp attribute. + * + * @return the pageTimestampAttributePath value. + */ + public String pageTimestampAttributePath() { + return this.pageTimestampAttributePath; + } + + /** + * Set the pageTimestampAttributePath property: Defines the path to a paging time stamp attribute. + * + * @param pageTimestampAttributePath the pageTimestampAttributePath value to set. + * @return the CodelessConnectorPollingPagingProperties object itself. + */ + public CodelessConnectorPollingPagingProperties withPageTimestampAttributePath(String pageTimestampAttributePath) { + this.pageTimestampAttributePath = pageTimestampAttributePath; + return this; + } + + /** + * Get the searchTheLatestTimestampFromEventsList property: Determines whether to search for the latest time stamp + * in the events list. + * + * @return the searchTheLatestTimestampFromEventsList value. + */ + public String searchTheLatestTimestampFromEventsList() { + return this.searchTheLatestTimestampFromEventsList; + } + + /** + * Set the searchTheLatestTimestampFromEventsList property: Determines whether to search for the latest time stamp + * in the events list. + * + * @param searchTheLatestTimestampFromEventsList the searchTheLatestTimestampFromEventsList value to set. + * @return the CodelessConnectorPollingPagingProperties object itself. + */ + public CodelessConnectorPollingPagingProperties withSearchTheLatestTimestampFromEventsList( + String searchTheLatestTimestampFromEventsList) { + this.searchTheLatestTimestampFromEventsList = searchTheLatestTimestampFromEventsList; + return this; + } + + /** + * Get the pageSizeParaName property: Defines the name of the page size parameter. + * + * @return the pageSizeParaName value. + */ + public String pageSizeParaName() { + return this.pageSizeParaName; + } + + /** + * Set the pageSizeParaName property: Defines the name of the page size parameter. + * + * @param pageSizeParaName the pageSizeParaName value to set. + * @return the CodelessConnectorPollingPagingProperties object itself. + */ + public CodelessConnectorPollingPagingProperties withPageSizeParaName(String pageSizeParaName) { + this.pageSizeParaName = pageSizeParaName; + return this; + } + + /** + * Get the pageSize property: Defines the paging size. + * + * @return the pageSize value. + */ + public Integer pageSize() { + return this.pageSize; + } + + /** + * Set the pageSize property: Defines the paging size. + * + * @param pageSize the pageSize value to set. + * @return the CodelessConnectorPollingPagingProperties object itself. + */ + public CodelessConnectorPollingPagingProperties withPageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (pagingType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property pagingType in model CodelessConnectorPollingPagingProperties")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingRequestProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingRequestProperties.java new file mode 100644 index 000000000000..a9c77c56c090 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingRequestProperties.java @@ -0,0 +1,359 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describe the request properties needed to successfully pull from the server. */ +@Fluent +public final class CodelessConnectorPollingRequestProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CodelessConnectorPollingRequestProperties.class); + + /* + * Describe the endpoint we should pull the data from + */ + @JsonProperty(value = "apiEndpoint", required = true) + private String apiEndpoint; + + /* + * Defines the rate limit QPS + */ + @JsonProperty(value = "rateLimitQps") + private Integer rateLimitQps; + + /* + * The window interval we will use the pull the data + */ + @JsonProperty(value = "queryWindowInMin", required = true) + private int queryWindowInMin; + + /* + * The http method type we will use in the poll request, GET or POST + */ + @JsonProperty(value = "httpMethod", required = true) + private String httpMethod; + + /* + * The time format will be used the query events in a specific window + */ + @JsonProperty(value = "queryTimeFormat", required = true) + private String queryTimeFormat; + + /* + * Describe the amount of time we should try and poll the data in case of + * failure + */ + @JsonProperty(value = "retryCount") + private Integer retryCount; + + /* + * The number of seconds we will consider as a request timeout + */ + @JsonProperty(value = "timeoutInSeconds") + private Integer timeoutInSeconds; + + /* + * Describe the headers sent in the poll request + */ + @JsonProperty(value = "headers") + private Object headers; + + /* + * Describe the query parameters sent in the poll request + */ + @JsonProperty(value = "queryParameters") + private Object queryParameters; + + /* + * For advanced scenarios for example user name/password embedded in nested + * JSON payload + */ + @JsonProperty(value = "queryParametersTemplate") + private String queryParametersTemplate; + + /* + * This will be used the query events from a start of the time window + */ + @JsonProperty(value = "startTimeAttributeName") + private String startTimeAttributeName; + + /* + * This will be used the query events from the end of the time window + */ + @JsonProperty(value = "endTimeAttributeName") + private String endTimeAttributeName; + + /** + * Get the apiEndpoint property: Describe the endpoint we should pull the data from. + * + * @return the apiEndpoint value. + */ + public String apiEndpoint() { + return this.apiEndpoint; + } + + /** + * Set the apiEndpoint property: Describe the endpoint we should pull the data from. + * + * @param apiEndpoint the apiEndpoint value to set. + * @return the CodelessConnectorPollingRequestProperties object itself. + */ + public CodelessConnectorPollingRequestProperties withApiEndpoint(String apiEndpoint) { + this.apiEndpoint = apiEndpoint; + return this; + } + + /** + * Get the rateLimitQps property: Defines the rate limit QPS. + * + * @return the rateLimitQps value. + */ + public Integer rateLimitQps() { + return this.rateLimitQps; + } + + /** + * Set the rateLimitQps property: Defines the rate limit QPS. + * + * @param rateLimitQps the rateLimitQps value to set. + * @return the CodelessConnectorPollingRequestProperties object itself. + */ + public CodelessConnectorPollingRequestProperties withRateLimitQps(Integer rateLimitQps) { + this.rateLimitQps = rateLimitQps; + return this; + } + + /** + * Get the queryWindowInMin property: The window interval we will use the pull the data. + * + * @return the queryWindowInMin value. + */ + public int queryWindowInMin() { + return this.queryWindowInMin; + } + + /** + * Set the queryWindowInMin property: The window interval we will use the pull the data. + * + * @param queryWindowInMin the queryWindowInMin value to set. + * @return the CodelessConnectorPollingRequestProperties object itself. + */ + public CodelessConnectorPollingRequestProperties withQueryWindowInMin(int queryWindowInMin) { + this.queryWindowInMin = queryWindowInMin; + return this; + } + + /** + * Get the httpMethod property: The http method type we will use in the poll request, GET or POST. + * + * @return the httpMethod value. + */ + public String httpMethod() { + return this.httpMethod; + } + + /** + * Set the httpMethod property: The http method type we will use in the poll request, GET or POST. + * + * @param httpMethod the httpMethod value to set. + * @return the CodelessConnectorPollingRequestProperties object itself. + */ + public CodelessConnectorPollingRequestProperties withHttpMethod(String httpMethod) { + this.httpMethod = httpMethod; + return this; + } + + /** + * Get the queryTimeFormat property: The time format will be used the query events in a specific window. + * + * @return the queryTimeFormat value. + */ + public String queryTimeFormat() { + return this.queryTimeFormat; + } + + /** + * Set the queryTimeFormat property: The time format will be used the query events in a specific window. + * + * @param queryTimeFormat the queryTimeFormat value to set. + * @return the CodelessConnectorPollingRequestProperties object itself. + */ + public CodelessConnectorPollingRequestProperties withQueryTimeFormat(String queryTimeFormat) { + this.queryTimeFormat = queryTimeFormat; + return this; + } + + /** + * Get the retryCount property: Describe the amount of time we should try and poll the data in case of failure. + * + * @return the retryCount value. + */ + public Integer retryCount() { + return this.retryCount; + } + + /** + * Set the retryCount property: Describe the amount of time we should try and poll the data in case of failure. + * + * @param retryCount the retryCount value to set. + * @return the CodelessConnectorPollingRequestProperties object itself. + */ + public CodelessConnectorPollingRequestProperties withRetryCount(Integer retryCount) { + this.retryCount = retryCount; + return this; + } + + /** + * Get the timeoutInSeconds property: The number of seconds we will consider as a request timeout. + * + * @return the timeoutInSeconds value. + */ + public Integer timeoutInSeconds() { + return this.timeoutInSeconds; + } + + /** + * Set the timeoutInSeconds property: The number of seconds we will consider as a request timeout. + * + * @param timeoutInSeconds the timeoutInSeconds value to set. + * @return the CodelessConnectorPollingRequestProperties object itself. + */ + public CodelessConnectorPollingRequestProperties withTimeoutInSeconds(Integer timeoutInSeconds) { + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * Get the headers property: Describe the headers sent in the poll request. + * + * @return the headers value. + */ + public Object headers() { + return this.headers; + } + + /** + * Set the headers property: Describe the headers sent in the poll request. + * + * @param headers the headers value to set. + * @return the CodelessConnectorPollingRequestProperties object itself. + */ + public CodelessConnectorPollingRequestProperties withHeaders(Object headers) { + this.headers = headers; + return this; + } + + /** + * Get the queryParameters property: Describe the query parameters sent in the poll request. + * + * @return the queryParameters value. + */ + public Object queryParameters() { + return this.queryParameters; + } + + /** + * Set the queryParameters property: Describe the query parameters sent in the poll request. + * + * @param queryParameters the queryParameters value to set. + * @return the CodelessConnectorPollingRequestProperties object itself. + */ + public CodelessConnectorPollingRequestProperties withQueryParameters(Object queryParameters) { + this.queryParameters = queryParameters; + return this; + } + + /** + * Get the queryParametersTemplate property: For advanced scenarios for example user name/password embedded in + * nested JSON payload. + * + * @return the queryParametersTemplate value. + */ + public String queryParametersTemplate() { + return this.queryParametersTemplate; + } + + /** + * Set the queryParametersTemplate property: For advanced scenarios for example user name/password embedded in + * nested JSON payload. + * + * @param queryParametersTemplate the queryParametersTemplate value to set. + * @return the CodelessConnectorPollingRequestProperties object itself. + */ + public CodelessConnectorPollingRequestProperties withQueryParametersTemplate(String queryParametersTemplate) { + this.queryParametersTemplate = queryParametersTemplate; + return this; + } + + /** + * Get the startTimeAttributeName property: This will be used the query events from a start of the time window. + * + * @return the startTimeAttributeName value. + */ + public String startTimeAttributeName() { + return this.startTimeAttributeName; + } + + /** + * Set the startTimeAttributeName property: This will be used the query events from a start of the time window. + * + * @param startTimeAttributeName the startTimeAttributeName value to set. + * @return the CodelessConnectorPollingRequestProperties object itself. + */ + public CodelessConnectorPollingRequestProperties withStartTimeAttributeName(String startTimeAttributeName) { + this.startTimeAttributeName = startTimeAttributeName; + return this; + } + + /** + * Get the endTimeAttributeName property: This will be used the query events from the end of the time window. + * + * @return the endTimeAttributeName value. + */ + public String endTimeAttributeName() { + return this.endTimeAttributeName; + } + + /** + * Set the endTimeAttributeName property: This will be used the query events from the end of the time window. + * + * @param endTimeAttributeName the endTimeAttributeName value to set. + * @return the CodelessConnectorPollingRequestProperties object itself. + */ + public CodelessConnectorPollingRequestProperties withEndTimeAttributeName(String endTimeAttributeName) { + this.endTimeAttributeName = endTimeAttributeName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (apiEndpoint() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property apiEndpoint in model CodelessConnectorPollingRequestProperties")); + } + if (httpMethod() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property httpMethod in model CodelessConnectorPollingRequestProperties")); + } + if (queryTimeFormat() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property queryTimeFormat in model" + + " CodelessConnectorPollingRequestProperties")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingResponseProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingResponseProperties.java new file mode 100644 index 000000000000..8234ebca97f0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingResponseProperties.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the response from the external server. */ +@Fluent +public final class CodelessConnectorPollingResponseProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CodelessConnectorPollingResponseProperties.class); + + /* + * Describes the path we should extract the data in the response + */ + @JsonProperty(value = "eventsJsonPaths", required = true) + private List eventsJsonPaths; + + /* + * Describes the path we should extract the status code in the response + */ + @JsonProperty(value = "successStatusJsonPath") + private String successStatusJsonPath; + + /* + * Describes the path we should extract the status value in the response + */ + @JsonProperty(value = "successStatusValue") + private String successStatusValue; + + /* + * Describes if the data in the response is Gzip + */ + @JsonProperty(value = "isGzipCompressed") + private Boolean isGzipCompressed; + + /** + * Get the eventsJsonPaths property: Describes the path we should extract the data in the response. + * + * @return the eventsJsonPaths value. + */ + public List eventsJsonPaths() { + return this.eventsJsonPaths; + } + + /** + * Set the eventsJsonPaths property: Describes the path we should extract the data in the response. + * + * @param eventsJsonPaths the eventsJsonPaths value to set. + * @return the CodelessConnectorPollingResponseProperties object itself. + */ + public CodelessConnectorPollingResponseProperties withEventsJsonPaths(List eventsJsonPaths) { + this.eventsJsonPaths = eventsJsonPaths; + return this; + } + + /** + * Get the successStatusJsonPath property: Describes the path we should extract the status code in the response. + * + * @return the successStatusJsonPath value. + */ + public String successStatusJsonPath() { + return this.successStatusJsonPath; + } + + /** + * Set the successStatusJsonPath property: Describes the path we should extract the status code in the response. + * + * @param successStatusJsonPath the successStatusJsonPath value to set. + * @return the CodelessConnectorPollingResponseProperties object itself. + */ + public CodelessConnectorPollingResponseProperties withSuccessStatusJsonPath(String successStatusJsonPath) { + this.successStatusJsonPath = successStatusJsonPath; + return this; + } + + /** + * Get the successStatusValue property: Describes the path we should extract the status value in the response. + * + * @return the successStatusValue value. + */ + public String successStatusValue() { + return this.successStatusValue; + } + + /** + * Set the successStatusValue property: Describes the path we should extract the status value in the response. + * + * @param successStatusValue the successStatusValue value to set. + * @return the CodelessConnectorPollingResponseProperties object itself. + */ + public CodelessConnectorPollingResponseProperties withSuccessStatusValue(String successStatusValue) { + this.successStatusValue = successStatusValue; + return this; + } + + /** + * Get the isGzipCompressed property: Describes if the data in the response is Gzip. + * + * @return the isGzipCompressed value. + */ + public Boolean isGzipCompressed() { + return this.isGzipCompressed; + } + + /** + * Set the isGzipCompressed property: Describes if the data in the response is Gzip. + * + * @param isGzipCompressed the isGzipCompressed value to set. + * @return the CodelessConnectorPollingResponseProperties object itself. + */ + public CodelessConnectorPollingResponseProperties withIsGzipCompressed(Boolean isGzipCompressed) { + this.isGzipCompressed = isGzipCompressed; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (eventsJsonPaths() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property eventsJsonPaths in model" + + " CodelessConnectorPollingResponseProperties")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigProperties.java new file mode 100644 index 000000000000..1acd5395f87f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigProperties.java @@ -0,0 +1,426 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Config to describe the instructions blade. */ +@Fluent +public final class CodelessUiConnectorConfigProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CodelessUiConnectorConfigProperties.class); + + /* + * Connector blade title + */ + @JsonProperty(value = "title", required = true) + private String title; + + /* + * Connector publisher name + */ + @JsonProperty(value = "publisher", required = true) + private String publisher; + + /* + * Connector description + */ + @JsonProperty(value = "descriptionMarkdown", required = true) + private String descriptionMarkdown; + + /* + * An optional custom image to be used when displaying the connector within + * Azure Sentinel's connector's gallery + */ + @JsonProperty(value = "customImage") + private String customImage; + + /* + * Name of the table the connector will insert the data to + */ + @JsonProperty(value = "graphQueriesTableName", required = true) + private String graphQueriesTableName; + + /* + * The graph query to show the current data status + */ + @JsonProperty(value = "graphQueries", required = true) + private List graphQueries; + + /* + * The sample queries for the connector + */ + @JsonProperty(value = "sampleQueries", required = true) + private List sampleQueries; + + /* + * Data types to check for last data received + */ + @JsonProperty(value = "dataTypes", required = true) + private List dataTypes; + + /* + * Define the way the connector check connectivity + */ + @JsonProperty(value = "connectivityCriteria", required = true) + private List connectivityCriteria; + + /* + * Connector Availability Status + */ + @JsonProperty(value = "availability", required = true) + private Availability availability; + + /* + * Permissions required for the connector + */ + @JsonProperty(value = "permissions", required = true) + private Permissions permissions; + + /* + * Instruction steps to enable the connector + */ + @JsonProperty(value = "instructionSteps", required = true) + private List instructionSteps; + + /** + * Get the title property: Connector blade title. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: Connector blade title. + * + * @param title the title value to set. + * @return the CodelessUiConnectorConfigProperties object itself. + */ + public CodelessUiConnectorConfigProperties withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the publisher property: Connector publisher name. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: Connector publisher name. + * + * @param publisher the publisher value to set. + * @return the CodelessUiConnectorConfigProperties object itself. + */ + public CodelessUiConnectorConfigProperties withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the descriptionMarkdown property: Connector description. + * + * @return the descriptionMarkdown value. + */ + public String descriptionMarkdown() { + return this.descriptionMarkdown; + } + + /** + * Set the descriptionMarkdown property: Connector description. + * + * @param descriptionMarkdown the descriptionMarkdown value to set. + * @return the CodelessUiConnectorConfigProperties object itself. + */ + public CodelessUiConnectorConfigProperties withDescriptionMarkdown(String descriptionMarkdown) { + this.descriptionMarkdown = descriptionMarkdown; + return this; + } + + /** + * Get the customImage property: An optional custom image to be used when displaying the connector within Azure + * Sentinel's connector's gallery. + * + * @return the customImage value. + */ + public String customImage() { + return this.customImage; + } + + /** + * Set the customImage property: An optional custom image to be used when displaying the connector within Azure + * Sentinel's connector's gallery. + * + * @param customImage the customImage value to set. + * @return the CodelessUiConnectorConfigProperties object itself. + */ + public CodelessUiConnectorConfigProperties withCustomImage(String customImage) { + this.customImage = customImage; + return this; + } + + /** + * Get the graphQueriesTableName property: Name of the table the connector will insert the data to. + * + * @return the graphQueriesTableName value. + */ + public String graphQueriesTableName() { + return this.graphQueriesTableName; + } + + /** + * Set the graphQueriesTableName property: Name of the table the connector will insert the data to. + * + * @param graphQueriesTableName the graphQueriesTableName value to set. + * @return the CodelessUiConnectorConfigProperties object itself. + */ + public CodelessUiConnectorConfigProperties withGraphQueriesTableName(String graphQueriesTableName) { + this.graphQueriesTableName = graphQueriesTableName; + return this; + } + + /** + * Get the graphQueries property: The graph query to show the current data status. + * + * @return the graphQueries value. + */ + public List graphQueries() { + return this.graphQueries; + } + + /** + * Set the graphQueries property: The graph query to show the current data status. + * + * @param graphQueries the graphQueries value to set. + * @return the CodelessUiConnectorConfigProperties object itself. + */ + public CodelessUiConnectorConfigProperties withGraphQueries( + List graphQueries) { + this.graphQueries = graphQueries; + return this; + } + + /** + * Get the sampleQueries property: The sample queries for the connector. + * + * @return the sampleQueries value. + */ + public List sampleQueries() { + return this.sampleQueries; + } + + /** + * Set the sampleQueries property: The sample queries for the connector. + * + * @param sampleQueries the sampleQueries value to set. + * @return the CodelessUiConnectorConfigProperties object itself. + */ + public CodelessUiConnectorConfigProperties withSampleQueries( + List sampleQueries) { + this.sampleQueries = sampleQueries; + return this; + } + + /** + * Get the dataTypes property: Data types to check for last data received. + * + * @return the dataTypes value. + */ + public List dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: Data types to check for last data received. + * + * @param dataTypes the dataTypes value to set. + * @return the CodelessUiConnectorConfigProperties object itself. + */ + public CodelessUiConnectorConfigProperties withDataTypes( + List dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** + * Get the connectivityCriteria property: Define the way the connector check connectivity. + * + * @return the connectivityCriteria value. + */ + public List connectivityCriteria() { + return this.connectivityCriteria; + } + + /** + * Set the connectivityCriteria property: Define the way the connector check connectivity. + * + * @param connectivityCriteria the connectivityCriteria value to set. + * @return the CodelessUiConnectorConfigProperties object itself. + */ + public CodelessUiConnectorConfigProperties withConnectivityCriteria( + List connectivityCriteria) { + this.connectivityCriteria = connectivityCriteria; + return this; + } + + /** + * Get the availability property: Connector Availability Status. + * + * @return the availability value. + */ + public Availability availability() { + return this.availability; + } + + /** + * Set the availability property: Connector Availability Status. + * + * @param availability the availability value to set. + * @return the CodelessUiConnectorConfigProperties object itself. + */ + public CodelessUiConnectorConfigProperties withAvailability(Availability availability) { + this.availability = availability; + return this; + } + + /** + * Get the permissions property: Permissions required for the connector. + * + * @return the permissions value. + */ + public Permissions permissions() { + return this.permissions; + } + + /** + * Set the permissions property: Permissions required for the connector. + * + * @param permissions the permissions value to set. + * @return the CodelessUiConnectorConfigProperties object itself. + */ + public CodelessUiConnectorConfigProperties withPermissions(Permissions permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get the instructionSteps property: Instruction steps to enable the connector. + * + * @return the instructionSteps value. + */ + public List instructionSteps() { + return this.instructionSteps; + } + + /** + * Set the instructionSteps property: Instruction steps to enable the connector. + * + * @param instructionSteps the instructionSteps value to set. + * @return the CodelessUiConnectorConfigProperties object itself. + */ + public CodelessUiConnectorConfigProperties withInstructionSteps( + List instructionSteps) { + this.instructionSteps = instructionSteps; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (title() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property title in model CodelessUiConnectorConfigProperties")); + } + if (publisher() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property publisher in model CodelessUiConnectorConfigProperties")); + } + if (descriptionMarkdown() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property descriptionMarkdown in model CodelessUiConnectorConfigProperties")); + } + if (graphQueriesTableName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property graphQueriesTableName in model" + + " CodelessUiConnectorConfigProperties")); + } + if (graphQueries() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property graphQueries in model CodelessUiConnectorConfigProperties")); + } else { + graphQueries().forEach(e -> e.validate()); + } + if (sampleQueries() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sampleQueries in model CodelessUiConnectorConfigProperties")); + } else { + sampleQueries().forEach(e -> e.validate()); + } + if (dataTypes() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dataTypes in model CodelessUiConnectorConfigProperties")); + } else { + dataTypes().forEach(e -> e.validate()); + } + if (connectivityCriteria() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property connectivityCriteria in model CodelessUiConnectorConfigProperties")); + } else { + connectivityCriteria().forEach(e -> e.validate()); + } + if (availability() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property availability in model CodelessUiConnectorConfigProperties")); + } else { + availability().validate(); + } + if (permissions() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property permissions in model CodelessUiConnectorConfigProperties")); + } else { + permissions().validate(); + } + if (instructionSteps() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property instructionSteps in model CodelessUiConnectorConfigProperties")); + } else { + instructionSteps().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem.java new file mode 100644 index 000000000000..91d181434244 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem model. */ +@Fluent +public final class CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem extends ConnectivityCriteria { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem.class); + + /** {@inheritDoc} */ + @Override + public CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem withType(ConnectivityType type) { + super.withType(type); + return this; + } + + /** {@inheritDoc} */ + @Override + public CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem withValue(List value) { + super.withValue(value); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesDataTypesItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesDataTypesItem.java new file mode 100644 index 000000000000..3319c584d824 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesDataTypesItem.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The CodelessUiConnectorConfigPropertiesDataTypesItem model. */ +@Fluent +public final class CodelessUiConnectorConfigPropertiesDataTypesItem extends LastDataReceivedDataType { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(CodelessUiConnectorConfigPropertiesDataTypesItem.class); + + /** {@inheritDoc} */ + @Override + public CodelessUiConnectorConfigPropertiesDataTypesItem withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public CodelessUiConnectorConfigPropertiesDataTypesItem withLastDataReceivedQuery(String lastDataReceivedQuery) { + super.withLastDataReceivedQuery(lastDataReceivedQuery); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesGraphQueriesItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesGraphQueriesItem.java new file mode 100644 index 000000000000..525c0ddbe198 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesGraphQueriesItem.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The CodelessUiConnectorConfigPropertiesGraphQueriesItem model. */ +@Fluent +public final class CodelessUiConnectorConfigPropertiesGraphQueriesItem extends GraphQueries { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(CodelessUiConnectorConfigPropertiesGraphQueriesItem.class); + + /** {@inheritDoc} */ + @Override + public CodelessUiConnectorConfigPropertiesGraphQueriesItem withMetricName(String metricName) { + super.withMetricName(metricName); + return this; + } + + /** {@inheritDoc} */ + @Override + public CodelessUiConnectorConfigPropertiesGraphQueriesItem withLegend(String legend) { + super.withLegend(legend); + return this; + } + + /** {@inheritDoc} */ + @Override + public CodelessUiConnectorConfigPropertiesGraphQueriesItem withBaseQuery(String baseQuery) { + super.withBaseQuery(baseQuery); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesInstructionStepsItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesInstructionStepsItem.java new file mode 100644 index 000000000000..32db5a96ec89 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesInstructionStepsItem.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The CodelessUiConnectorConfigPropertiesInstructionStepsItem model. */ +@Fluent +public final class CodelessUiConnectorConfigPropertiesInstructionStepsItem extends InstructionSteps { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(CodelessUiConnectorConfigPropertiesInstructionStepsItem.class); + + /** {@inheritDoc} */ + @Override + public CodelessUiConnectorConfigPropertiesInstructionStepsItem withTitle(String title) { + super.withTitle(title); + return this; + } + + /** {@inheritDoc} */ + @Override + public CodelessUiConnectorConfigPropertiesInstructionStepsItem withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public CodelessUiConnectorConfigPropertiesInstructionStepsItem withInstructions( + List instructions) { + super.withInstructions(instructions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesSampleQueriesItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesSampleQueriesItem.java new file mode 100644 index 000000000000..1703a5ced55c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesSampleQueriesItem.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The CodelessUiConnectorConfigPropertiesSampleQueriesItem model. */ +@Fluent +public final class CodelessUiConnectorConfigPropertiesSampleQueriesItem extends SampleQueries { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(CodelessUiConnectorConfigPropertiesSampleQueriesItem.class); + + /** {@inheritDoc} */ + @Override + public CodelessUiConnectorConfigPropertiesSampleQueriesItem withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public CodelessUiConnectorConfigPropertiesSampleQueriesItem withQuery(String query) { + super.withQuery(query); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiDataConnector.java new file mode 100644 index 000000000000..b09c9063abbd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiDataConnector.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.CodelessParameters; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents Codeless UI data connector. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("GenericUI") +@Fluent +public final class CodelessUiDataConnector extends DataConnectorInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CodelessUiDataConnector.class); + + /* + * Codeless UI data connector properties + */ + @JsonProperty(value = "properties") + private CodelessParameters innerProperties; + + /** + * Get the innerProperties property: Codeless UI data connector properties. + * + * @return the innerProperties value. + */ + private CodelessParameters innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public CodelessUiDataConnector withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the connectorUiConfig property: Config to describe the instructions blade. + * + * @return the connectorUiConfig value. + */ + public CodelessUiConnectorConfigProperties connectorUiConfig() { + return this.innerProperties() == null ? null : this.innerProperties().connectorUiConfig(); + } + + /** + * Set the connectorUiConfig property: Config to describe the instructions blade. + * + * @param connectorUiConfig the connectorUiConfig value to set. + * @return the CodelessUiDataConnector object itself. + */ + public CodelessUiDataConnector withConnectorUiConfig(CodelessUiConnectorConfigProperties connectorUiConfig) { + if (this.innerProperties() == null) { + this.innerProperties = new CodelessParameters(); + } + this.innerProperties().withConnectorUiConfig(connectorUiConfig); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConfidenceLevel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConfidenceLevel.java new file mode 100644 index 000000000000..0d13b9b64734 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConfidenceLevel.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConfidenceLevel. */ +public final class ConfidenceLevel extends ExpandableStringEnum { + /** Static value Unknown for ConfidenceLevel. */ + public static final ConfidenceLevel UNKNOWN = fromString("Unknown"); + + /** Static value Low for ConfidenceLevel. */ + public static final ConfidenceLevel LOW = fromString("Low"); + + /** Static value High for ConfidenceLevel. */ + public static final ConfidenceLevel HIGH = fromString("High"); + + /** + * Creates or finds a ConfidenceLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConfidenceLevel. + */ + @JsonCreator + public static ConfidenceLevel fromString(String name) { + return fromString(name, ConfidenceLevel.class); + } + + /** @return known ConfidenceLevel values. */ + public static Collection values() { + return values(ConfidenceLevel.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConfidenceScoreStatus.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConfidenceScoreStatus.java new file mode 100644 index 000000000000..34afc4e0d105 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConfidenceScoreStatus.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConfidenceScoreStatus. */ +public final class ConfidenceScoreStatus extends ExpandableStringEnum { + /** Static value NotApplicable for ConfidenceScoreStatus. */ + public static final ConfidenceScoreStatus NOT_APPLICABLE = fromString("NotApplicable"); + + /** Static value InProcess for ConfidenceScoreStatus. */ + public static final ConfidenceScoreStatus IN_PROCESS = fromString("InProcess"); + + /** Static value NotFinal for ConfidenceScoreStatus. */ + public static final ConfidenceScoreStatus NOT_FINAL = fromString("NotFinal"); + + /** Static value Final for ConfidenceScoreStatus. */ + public static final ConfidenceScoreStatus FINAL = fromString("Final"); + + /** + * Creates or finds a ConfidenceScoreStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConfidenceScoreStatus. + */ + @JsonCreator + public static ConfidenceScoreStatus fromString(String name) { + return fromString(name, ConfidenceScoreStatus.class); + } + + /** @return known ConfidenceScoreStatus values. */ + public static Collection values() { + return values(ConfidenceScoreStatus.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectAuthKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectAuthKind.java new file mode 100644 index 000000000000..24e6f982def1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectAuthKind.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectAuthKind. */ +public final class ConnectAuthKind extends ExpandableStringEnum { + /** Static value Basic for ConnectAuthKind. */ + public static final ConnectAuthKind BASIC = fromString("Basic"); + + /** Static value OAuth2 for ConnectAuthKind. */ + public static final ConnectAuthKind OAUTH2 = fromString("OAuth2"); + + /** Static value APIKey for ConnectAuthKind. */ + public static final ConnectAuthKind APIKEY = fromString("APIKey"); + + /** + * Creates or finds a ConnectAuthKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectAuthKind. + */ + @JsonCreator + public static ConnectAuthKind fromString(String name) { + return fromString(name, ConnectAuthKind.class); + } + + /** @return known ConnectAuthKind values. */ + public static Collection values() { + return values(ConnectAuthKind.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectedEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectedEntity.java new file mode 100644 index 000000000000..e1b132581129 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectedEntity.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Expansion result connected entities. */ +@Fluent +public final class ConnectedEntity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectedEntity.class); + + /* + * Entity Id of the connected entity + */ + @JsonProperty(value = "targetEntityId") + private String targetEntityId; + + /* + * key-value pairs for a connected entity mapping + */ + @JsonProperty(value = "additionalData") + private Object additionalData; + + /** + * Get the targetEntityId property: Entity Id of the connected entity. + * + * @return the targetEntityId value. + */ + public String targetEntityId() { + return this.targetEntityId; + } + + /** + * Set the targetEntityId property: Entity Id of the connected entity. + * + * @param targetEntityId the targetEntityId value to set. + * @return the ConnectedEntity object itself. + */ + public ConnectedEntity withTargetEntityId(String targetEntityId) { + this.targetEntityId = targetEntityId; + return this; + } + + /** + * Get the additionalData property: key-value pairs for a connected entity mapping. + * + * @return the additionalData value. + */ + public Object additionalData() { + return this.additionalData; + } + + /** + * Set the additionalData property: key-value pairs for a connected entity mapping. + * + * @param additionalData the additionalData value to set. + * @return the ConnectedEntity object itself. + */ + public ConnectedEntity withAdditionalData(Object additionalData) { + this.additionalData = additionalData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectivityCriteria.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectivityCriteria.java new file mode 100644 index 000000000000..54db68763e91 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectivityCriteria.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Setting for the connector check connectivity. */ +@Fluent +public class ConnectivityCriteria { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectivityCriteria.class); + + /* + * type of connectivity + */ + @JsonProperty(value = "type") + private ConnectivityType type; + + /* + * Queries for checking connectivity + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the type property: type of connectivity. + * + * @return the type value. + */ + public ConnectivityType type() { + return this.type; + } + + /** + * Set the type property: type of connectivity. + * + * @param type the type value to set. + * @return the ConnectivityCriteria object itself. + */ + public ConnectivityCriteria withType(ConnectivityType type) { + this.type = type; + return this; + } + + /** + * Get the value property: Queries for checking connectivity. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Queries for checking connectivity. + * + * @param value the value value to set. + * @return the ConnectivityCriteria object itself. + */ + public ConnectivityCriteria withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectivityType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectivityType.java new file mode 100644 index 000000000000..3e0f98cbb2a8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectivityType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectivityType. */ +public final class ConnectivityType extends ExpandableStringEnum { + /** Static value IsConnectedQuery for ConnectivityType. */ + public static final ConnectivityType IS_CONNECTED_QUERY = fromString("IsConnectedQuery"); + + /** + * Creates or finds a ConnectivityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectivityType. + */ + @JsonCreator + public static ConnectivityType fromString(String name) { + return fromString(name, ConnectivityType.class); + } + + /** @return known ConnectivityType values. */ + public static Collection values() { + return values(ConnectivityType.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorInstructionModelBase.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorInstructionModelBase.java new file mode 100644 index 000000000000..bc3fe32b297d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorInstructionModelBase.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Instruction step details. */ +@Fluent +public class ConnectorInstructionModelBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectorInstructionModelBase.class); + + /* + * The parameters for the setting + */ + @JsonProperty(value = "parameters") + private Object parameters; + + /* + * The kind of the setting + */ + @JsonProperty(value = "type", required = true) + private SettingType type; + + /** + * Get the parameters property: The parameters for the setting. + * + * @return the parameters value. + */ + public Object parameters() { + return this.parameters; + } + + /** + * Set the parameters property: The parameters for the setting. + * + * @param parameters the parameters value to set. + * @return the ConnectorInstructionModelBase object itself. + */ + public ConnectorInstructionModelBase withParameters(Object parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the type property: The kind of the setting. + * + * @return the type value. + */ + public SettingType type() { + return this.type; + } + + /** + * Set the type property: The kind of the setting. + * + * @param type the type value to set. + * @return the ConnectorInstructionModelBase object itself. + */ + public ConnectorInstructionModelBase withType(SettingType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property type in model ConnectorInstructionModelBase")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Constant69.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Constant69.java new file mode 100644 index 000000000000..11021b609e3f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Constant69.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for Constant69. */ +public enum Constant69 { + /** Enum value Activity. */ + ACTIVITY("Activity"); + + /** The actual serialized value for a Constant69 instance. */ + private final String value; + + Constant69(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Constant69 instance. + * + * @param value the serialized value to parse. + * @return the parsed Constant69 object, or null if unable to parse. + */ + @JsonCreator + public static Constant69 fromString(String value) { + Constant69[] items = Constant69.values(); + for (Constant69 item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentPathMap.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentPathMap.java new file mode 100644 index 000000000000..db0d69707c9f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentPathMap.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The mapping of content type to a repo path. */ +@Fluent +public final class ContentPathMap { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentPathMap.class); + + /* + * Content type. + */ + @JsonProperty(value = "contentType") + private ContentType contentType; + + /* + * The path to the content. + */ + @JsonProperty(value = "path") + private String path; + + /** + * Get the contentType property: Content type. + * + * @return the contentType value. + */ + public ContentType contentType() { + return this.contentType; + } + + /** + * Set the contentType property: Content type. + * + * @param contentType the contentType value to set. + * @return the ContentPathMap object itself. + */ + public ContentPathMap withContentType(ContentType contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the path property: The path to the content. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The path to the content. + * + * @param path the path value to set. + * @return the ContentPathMap object itself. + */ + public ContentPathMap withPath(String path) { + this.path = path; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentType.java new file mode 100644 index 000000000000..ceec98d6566a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ContentType. */ +public final class ContentType extends ExpandableStringEnum { + /** Static value AnalyticRule for ContentType. */ + public static final ContentType ANALYTIC_RULE = fromString("AnalyticRule"); + + /** Static value Workbook for ContentType. */ + public static final ContentType WORKBOOK = fromString("Workbook"); + + /** + * Creates or finds a ContentType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContentType. + */ + @JsonCreator + public static ContentType fromString(String name) { + return fromString(name, ContentType.class); + } + + /** @return known ContentType values. */ + public static Collection values() { + return values(ContentType.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomEntityQuery.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomEntityQuery.java new file mode 100644 index 000000000000..94aa5c93e748 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomEntityQuery.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Specific entity query that supports put requests. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = CustomEntityQuery.class) +@JsonTypeName("CustomEntityQuery") +@JsonSubTypes({@JsonSubTypes.Type(name = "Activity", value = ActivityCustomEntityQuery.class)}) +@Fluent +public class CustomEntityQuery extends ResourceWithEtag { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomEntityQuery.class); + + /** {@inheritDoc} */ + @Override + public CustomEntityQuery withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomEntityQueryKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomEntityQueryKind.java new file mode 100644 index 000000000000..09d3b314eaf6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomEntityQueryKind.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CustomEntityQueryKind. */ +public final class CustomEntityQueryKind extends ExpandableStringEnum { + /** Static value Activity for CustomEntityQueryKind. */ + public static final CustomEntityQueryKind ACTIVITY = fromString("Activity"); + + /** + * Creates or finds a CustomEntityQueryKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding CustomEntityQueryKind. + */ + @JsonCreator + public static CustomEntityQueryKind fromString(String name) { + return fromString(name, CustomEntityQueryKind.class); + } + + /** @return known CustomEntityQueryKind values. */ + public static Collection values() { + return values(CustomEntityQueryKind.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Customs.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Customs.java new file mode 100644 index 000000000000..067060e61288 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Customs.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Customs permissions required for the connector. */ +@Fluent +public class Customs extends CustomsPermission { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Customs.class); + + /** {@inheritDoc} */ + @Override + public Customs withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public Customs withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomsPermission.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomsPermission.java new file mode 100644 index 000000000000..2a56d0f96d38 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomsPermission.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Customs permissions required for the connector. */ +@Fluent +public class CustomsPermission { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomsPermission.class); + + /* + * Customs permissions name + */ + @JsonProperty(value = "name") + private String name; + + /* + * Customs permissions description + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the name property: Customs permissions name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Customs permissions name. + * + * @param name the name value to set. + * @return the CustomsPermission object itself. + */ + public CustomsPermission withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Customs permissions description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Customs permissions description. + * + * @param description the description value to set. + * @return the CustomsPermission object itself. + */ + public CustomsPermission withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnector.java new file mode 100644 index 000000000000..2a1b02e65c82 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnector.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; + +/** An immutable client-side representation of DataConnector. */ +public interface DataConnector { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner object. + * + * @return the inner object. + */ + DataConnectorInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorAuthorizationState.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorAuthorizationState.java new file mode 100644 index 000000000000..cc3d131c96d6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorAuthorizationState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DataConnectorAuthorizationState. */ +public final class DataConnectorAuthorizationState extends ExpandableStringEnum { + /** Static value Valid for DataConnectorAuthorizationState. */ + public static final DataConnectorAuthorizationState VALID = fromString("Valid"); + + /** Static value Invalid for DataConnectorAuthorizationState. */ + public static final DataConnectorAuthorizationState INVALID = fromString("Invalid"); + + /** + * Creates or finds a DataConnectorAuthorizationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataConnectorAuthorizationState. + */ + @JsonCreator + public static DataConnectorAuthorizationState fromString(String name) { + return fromString(name, DataConnectorAuthorizationState.class); + } + + /** @return known DataConnectorAuthorizationState values. */ + public static Collection values() { + return values(DataConnectorAuthorizationState.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorConnectBody.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorConnectBody.java new file mode 100644 index 000000000000..fc595f40cca9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorConnectBody.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents Codeless API Polling data connector. */ +@Fluent +public final class DataConnectorConnectBody { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataConnectorConnectBody.class); + + /* + * The authentication kind used to poll the data + */ + @JsonProperty(value = "kind") + private ConnectAuthKind kind; + + /* + * The API key of the audit server. + */ + @JsonProperty(value = "apiKey") + private String apiKey; + + /* + * The client secret of the OAuth 2.0 application. + */ + @JsonProperty(value = "clientSecret") + private String clientSecret; + + /* + * The client id of the OAuth 2.0 application. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /* + * The authorization code used in OAuth 2.0 code flow to issue a token. + */ + @JsonProperty(value = "authorizationCode") + private String authorizationCode; + + /* + * The user name in the audit log server. + */ + @JsonProperty(value = "userName") + private String username; + + /* + * The user password in the audit log server. + */ + @JsonProperty(value = "password") + private String password; + + /* + * The requestConfigUserInputValues property. + */ + @JsonProperty(value = "requestConfigUserInputValues") + private List requestConfigUserInputValues; + + /** + * Get the kind property: The authentication kind used to poll the data. + * + * @return the kind value. + */ + public ConnectAuthKind kind() { + return this.kind; + } + + /** + * Set the kind property: The authentication kind used to poll the data. + * + * @param kind the kind value to set. + * @return the DataConnectorConnectBody object itself. + */ + public DataConnectorConnectBody withKind(ConnectAuthKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the apiKey property: The API key of the audit server. + * + * @return the apiKey value. + */ + public String apiKey() { + return this.apiKey; + } + + /** + * Set the apiKey property: The API key of the audit server. + * + * @param apiKey the apiKey value to set. + * @return the DataConnectorConnectBody object itself. + */ + public DataConnectorConnectBody withApiKey(String apiKey) { + this.apiKey = apiKey; + return this; + } + + /** + * Get the clientSecret property: The client secret of the OAuth 2.0 application. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: The client secret of the OAuth 2.0 application. + * + * @param clientSecret the clientSecret value to set. + * @return the DataConnectorConnectBody object itself. + */ + public DataConnectorConnectBody withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get the clientId property: The client id of the OAuth 2.0 application. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The client id of the OAuth 2.0 application. + * + * @param clientId the clientId value to set. + * @return the DataConnectorConnectBody object itself. + */ + public DataConnectorConnectBody withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the authorizationCode property: The authorization code used in OAuth 2.0 code flow to issue a token. + * + * @return the authorizationCode value. + */ + public String authorizationCode() { + return this.authorizationCode; + } + + /** + * Set the authorizationCode property: The authorization code used in OAuth 2.0 code flow to issue a token. + * + * @param authorizationCode the authorizationCode value to set. + * @return the DataConnectorConnectBody object itself. + */ + public DataConnectorConnectBody withAuthorizationCode(String authorizationCode) { + this.authorizationCode = authorizationCode; + return this; + } + + /** + * Get the username property: The user name in the audit log server. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The user name in the audit log server. + * + * @param username the username value to set. + * @return the DataConnectorConnectBody object itself. + */ + public DataConnectorConnectBody withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: The user password in the audit log server. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The user password in the audit log server. + * + * @param password the password value to set. + * @return the DataConnectorConnectBody object itself. + */ + public DataConnectorConnectBody withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the requestConfigUserInputValues property: The requestConfigUserInputValues property. + * + * @return the requestConfigUserInputValues value. + */ + public List requestConfigUserInputValues() { + return this.requestConfigUserInputValues; + } + + /** + * Set the requestConfigUserInputValues property: The requestConfigUserInputValues property. + * + * @param requestConfigUserInputValues the requestConfigUserInputValues value to set. + * @return the DataConnectorConnectBody object itself. + */ + public DataConnectorConnectBody withRequestConfigUserInputValues(List requestConfigUserInputValues) { + this.requestConfigUserInputValues = requestConfigUserInputValues; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDataTypeCommon.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDataTypeCommon.java new file mode 100644 index 000000000000..504fb007d290 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDataTypeCommon.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Common field for data type in data connectors. */ +@Fluent +public class DataConnectorDataTypeCommon { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataConnectorDataTypeCommon.class); + + /* + * Describe whether this data type connection is enabled or not. + */ + @JsonProperty(value = "state", required = true) + private DataTypeState state; + + /** + * Get the state property: Describe whether this data type connection is enabled or not. + * + * @return the state value. + */ + public DataTypeState state() { + return this.state; + } + + /** + * Set the state property: Describe whether this data type connection is enabled or not. + * + * @param state the state value to set. + * @return the DataConnectorDataTypeCommon object itself. + */ + public DataConnectorDataTypeCommon withState(DataTypeState state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (state() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property state in model DataConnectorDataTypeCommon")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorKind.java new file mode 100644 index 000000000000..fc0fac4fb2e0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorKind.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DataConnectorKind. */ +public final class DataConnectorKind extends ExpandableStringEnum { + /** Static value AzureActiveDirectory for DataConnectorKind. */ + public static final DataConnectorKind AZURE_ACTIVE_DIRECTORY = fromString("AzureActiveDirectory"); + + /** Static value AzureSecurityCenter for DataConnectorKind. */ + public static final DataConnectorKind AZURE_SECURITY_CENTER = fromString("AzureSecurityCenter"); + + /** Static value MicrosoftCloudAppSecurity for DataConnectorKind. */ + public static final DataConnectorKind MICROSOFT_CLOUD_APP_SECURITY = fromString("MicrosoftCloudAppSecurity"); + + /** Static value ThreatIntelligence for DataConnectorKind. */ + public static final DataConnectorKind THREAT_INTELLIGENCE = fromString("ThreatIntelligence"); + + /** Static value ThreatIntelligenceTaxii for DataConnectorKind. */ + public static final DataConnectorKind THREAT_INTELLIGENCE_TAXII = fromString("ThreatIntelligenceTaxii"); + + /** Static value Office365 for DataConnectorKind. */ + public static final DataConnectorKind OFFICE365 = fromString("Office365"); + + /** Static value OfficeATP for DataConnectorKind. */ + public static final DataConnectorKind OFFICE_ATP = fromString("OfficeATP"); + + /** Static value OfficeIRM for DataConnectorKind. */ + public static final DataConnectorKind OFFICE_IRM = fromString("OfficeIRM"); + + /** Static value AmazonWebServicesCloudTrail for DataConnectorKind. */ + public static final DataConnectorKind AMAZON_WEB_SERVICES_CLOUD_TRAIL = fromString("AmazonWebServicesCloudTrail"); + + /** Static value AmazonWebServicesS3 for DataConnectorKind. */ + public static final DataConnectorKind AMAZON_WEB_SERVICES_S3 = fromString("AmazonWebServicesS3"); + + /** Static value AzureAdvancedThreatProtection for DataConnectorKind. */ + public static final DataConnectorKind AZURE_ADVANCED_THREAT_PROTECTION = + fromString("AzureAdvancedThreatProtection"); + + /** Static value MicrosoftDefenderAdvancedThreatProtection for DataConnectorKind. */ + public static final DataConnectorKind MICROSOFT_DEFENDER_ADVANCED_THREAT_PROTECTION = + fromString("MicrosoftDefenderAdvancedThreatProtection"); + + /** Static value Dynamics365 for DataConnectorKind. */ + public static final DataConnectorKind DYNAMICS365 = fromString("Dynamics365"); + + /** Static value MicrosoftThreatProtection for DataConnectorKind. */ + public static final DataConnectorKind MICROSOFT_THREAT_PROTECTION = fromString("MicrosoftThreatProtection"); + + /** Static value MicrosoftThreatIntelligence for DataConnectorKind. */ + public static final DataConnectorKind MICROSOFT_THREAT_INTELLIGENCE = fromString("MicrosoftThreatIntelligence"); + + /** Static value GenericUI for DataConnectorKind. */ + public static final DataConnectorKind GENERIC_UI = fromString("GenericUI"); + + /** Static value APIPolling for DataConnectorKind. */ + public static final DataConnectorKind APIPOLLING = fromString("APIPolling"); + + /** + * Creates or finds a DataConnectorKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataConnectorKind. + */ + @JsonCreator + public static DataConnectorKind fromString(String name) { + return fromString(name, DataConnectorKind.class); + } + + /** @return known DataConnectorKind values. */ + public static Collection values() { + return values(DataConnectorKind.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorLicenseState.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorLicenseState.java new file mode 100644 index 000000000000..160c5f660cc2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorLicenseState.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DataConnectorLicenseState. */ +public final class DataConnectorLicenseState extends ExpandableStringEnum { + /** Static value Valid for DataConnectorLicenseState. */ + public static final DataConnectorLicenseState VALID = fromString("Valid"); + + /** Static value Invalid for DataConnectorLicenseState. */ + public static final DataConnectorLicenseState INVALID = fromString("Invalid"); + + /** Static value Unknown for DataConnectorLicenseState. */ + public static final DataConnectorLicenseState UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a DataConnectorLicenseState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataConnectorLicenseState. + */ + @JsonCreator + public static DataConnectorLicenseState fromString(String name) { + return fromString(name, DataConnectorLicenseState.class); + } + + /** @return known DataConnectorLicenseState values. */ + public static Collection values() { + return values(DataConnectorLicenseState.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorList.java new file mode 100644 index 000000000000..c59f900c9a3a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorList.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List all the data connectors. */ +@Fluent +public final class DataConnectorList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataConnectorList.class); + + /* + * URL to fetch the next set of data connectors. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of data connectors. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the nextLink property: URL to fetch the next set of data connectors. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of data connectors. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of data connectors. + * + * @param value the value value to set. + * @return the DataConnectorList object itself. + */ + public DataConnectorList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model DataConnectorList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorRequirementsState.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorRequirementsState.java new file mode 100644 index 000000000000..96aa7a63791f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorRequirementsState.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorRequirementsStateInner; + +/** An immutable client-side representation of DataConnectorRequirementsState. */ +public interface DataConnectorRequirementsState { + /** + * Gets the authorizationState property: Authorization state for this connector. + * + * @return the authorizationState value. + */ + DataConnectorAuthorizationState authorizationState(); + + /** + * Gets the licenseState property: License state for this connector. + * + * @return the licenseState value. + */ + DataConnectorLicenseState licenseState(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorRequirementsStateInner + * object. + * + * @return the inner object. + */ + DataConnectorRequirementsStateInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorTenantId.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorTenantId.java new file mode 100644 index 000000000000..d9cee5747ccd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorTenantId.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties data connector on tenant level. */ +@Fluent +public class DataConnectorTenantId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataConnectorTenantId.class); + + /* + * The tenant id to connect to, and get the data from. + */ + @JsonProperty(value = "tenantId", required = true) + private String tenantId; + + /** + * Get the tenantId property: The tenant id to connect to, and get the data from. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenant id to connect to, and get the data from. + * + * @param tenantId the tenantId value to set. + * @return the DataConnectorTenantId object itself. + */ + public DataConnectorTenantId withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tenantId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property tenantId in model DataConnectorTenantId")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorWithAlertsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorWithAlertsProperties.java new file mode 100644 index 000000000000..9bce8ed56d5a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorWithAlertsProperties.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Data connector properties. */ +@Fluent +public class DataConnectorWithAlertsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataConnectorWithAlertsProperties.class); + + /* + * The available data types for the connector. + */ + @JsonProperty(value = "dataTypes") + private AlertsDataTypeOfDataConnector dataTypes; + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public AlertsDataTypeOfDataConnector dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the DataConnectorWithAlertsProperties object itself. + */ + public DataConnectorWithAlertsProperties withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataTypes() != null) { + dataTypes().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectors.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectors.java new file mode 100644 index 000000000000..25f787e28d5c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectors.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; + +/** Resource collection API of DataConnectors. */ +public interface DataConnectors { + /** + * Gets all data connectors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all data connectors. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all data connectors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all data connectors. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a data connector. + */ + DataConnector get(String resourceGroupName, String workspaceName, String dataConnectorId); + + /** + * Gets a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a data connector. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String dataConnectorId, Context context); + + /** + * Creates or updates the data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param dataConnector The data connector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data connector. + */ + DataConnector createOrUpdate( + String resourceGroupName, String workspaceName, String dataConnectorId, DataConnectorInner dataConnector); + + /** + * Creates or updates the data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param dataConnector The data connector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data connector. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String dataConnectorId, + DataConnectorInner dataConnector, + Context context); + + /** + * Delete the data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String dataConnectorId); + + /** + * Delete the data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String dataConnectorId, Context context); + + /** + * Connects a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param connectBody The data connector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void connect( + String resourceGroupName, String workspaceName, String dataConnectorId, DataConnectorConnectBody connectBody); + + /** + * Connects a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param connectBody The data connector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response connectWithResponse( + String resourceGroupName, + String workspaceName, + String dataConnectorId, + DataConnectorConnectBody connectBody, + Context context); + + /** + * Disconnect a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void disconnect(String resourceGroupName, String workspaceName, String dataConnectorId); + + /** + * Disconnect a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response disconnectWithResponse( + String resourceGroupName, String workspaceName, String dataConnectorId, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorsCheckRequirements.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorsCheckRequirements.java new file mode 100644 index 000000000000..781543f16485 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorsCheckRequirements.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Data connector requirements properties. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = DataConnectorsCheckRequirements.class) +@JsonTypeName("DataConnectorsCheckRequirements") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureActiveDirectory", value = AadCheckRequirements.class), + @JsonSubTypes.Type(name = "AzureAdvancedThreatProtection", value = AatpCheckRequirements.class), + @JsonSubTypes.Type(name = "AzureSecurityCenter", value = AscCheckRequirements.class), + @JsonSubTypes.Type(name = "AmazonWebServicesCloudTrail", value = AwsCloudTrailCheckRequirements.class), + @JsonSubTypes.Type(name = "AmazonWebServicesS3", value = AwsS3CheckRequirements.class), + @JsonSubTypes.Type(name = "Dynamics365", value = Dynamics365CheckRequirements.class), + @JsonSubTypes.Type(name = "MicrosoftCloudAppSecurity", value = McasCheckRequirements.class), + @JsonSubTypes.Type(name = "MicrosoftDefenderAdvancedThreatProtection", value = MdatpCheckRequirements.class), + @JsonSubTypes.Type(name = "MicrosoftThreatIntelligence", value = MstiCheckRequirements.class), + @JsonSubTypes.Type(name = "MicrosoftThreatProtection", value = MtpCheckRequirements.class), + @JsonSubTypes.Type(name = "OfficeATP", value = OfficeAtpCheckRequirements.class), + @JsonSubTypes.Type(name = "OfficeIRM", value = OfficeIrmCheckRequirements.class), + @JsonSubTypes.Type(name = "ThreatIntelligence", value = TICheckRequirements.class), + @JsonSubTypes.Type(name = "ThreatIntelligenceTaxii", value = TiTaxiiCheckRequirements.class) +}) +@Immutable +public class DataConnectorsCheckRequirements { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataConnectorsCheckRequirements.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorsCheckRequirementsOperations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorsCheckRequirementsOperations.java new file mode 100644 index 000000000000..0af3f3aabdf9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorsCheckRequirementsOperations.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DataConnectorsCheckRequirementsOperations. */ +public interface DataConnectorsCheckRequirementsOperations { + /** + * Get requirements state for a data connector type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorsCheckRequirements The parameters for requirements check message. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return requirements state for a data connector type. + */ + DataConnectorRequirementsState post( + String resourceGroupName, + String workspaceName, + DataConnectorsCheckRequirements dataConnectorsCheckRequirements); + + /** + * Get requirements state for a data connector type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataConnectorsCheckRequirements The parameters for requirements check message. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return requirements state for a data connector type. + */ + Response postWithResponse( + String resourceGroupName, + String workspaceName, + DataConnectorsCheckRequirements dataConnectorsCheckRequirements, + Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataTypeDefinitions.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataTypeDefinitions.java new file mode 100644 index 000000000000..e1dca2075efc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataTypeDefinitions.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The data type definition. */ +@Fluent +public final class DataTypeDefinitions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataTypeDefinitions.class); + + /* + * The data type name + */ + @JsonProperty(value = "dataType") + private String dataType; + + /** + * Get the dataType property: The data type name. + * + * @return the dataType value. + */ + public String dataType() { + return this.dataType; + } + + /** + * Set the dataType property: The data type name. + * + * @param dataType the dataType value to set. + * @return the DataTypeDefinitions object itself. + */ + public DataTypeDefinitions withDataType(String dataType) { + this.dataType = dataType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataTypeState.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataTypeState.java new file mode 100644 index 000000000000..194cb322083c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataTypeState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DataTypeState. */ +public final class DataTypeState extends ExpandableStringEnum { + /** Static value Enabled for DataTypeState. */ + public static final DataTypeState ENABLED = fromString("Enabled"); + + /** Static value Disabled for DataTypeState. */ + public static final DataTypeState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a DataTypeState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataTypeState. + */ + @JsonCreator + public static DataTypeState fromString(String name) { + return fromString(name, DataTypeState.class); + } + + /** @return known DataTypeState values. */ + public static Collection values() { + return values(DataTypeState.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeliveryAction.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeliveryAction.java new file mode 100644 index 000000000000..936f6efe2e69 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeliveryAction.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for DeliveryAction. */ +public enum DeliveryAction { + /** Enum value Unknown. */ + UNKNOWN("Unknown"), + + /** Enum value DeliveredAsSpam. */ + DELIVERED_AS_SPAM("DeliveredAsSpam"), + + /** Enum value Delivered. */ + DELIVERED("Delivered"), + + /** Enum value Blocked. */ + BLOCKED("Blocked"), + + /** Enum value Replaced. */ + REPLACED("Replaced"); + + /** The actual serialized value for a DeliveryAction instance. */ + private final String value; + + DeliveryAction(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DeliveryAction instance. + * + * @param value the serialized value to parse. + * @return the parsed DeliveryAction object, or null if unable to parse. + */ + @JsonCreator + public static DeliveryAction fromString(String value) { + DeliveryAction[] items = DeliveryAction.values(); + for (DeliveryAction item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeliveryLocation.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeliveryLocation.java new file mode 100644 index 000000000000..aaaf669741ae --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeliveryLocation.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for DeliveryLocation. */ +public enum DeliveryLocation { + /** Enum value Unknown. */ + UNKNOWN("Unknown"), + + /** Enum value Inbox. */ + INBOX("Inbox"), + + /** Enum value JunkFolder. */ + JUNK_FOLDER("JunkFolder"), + + /** Enum value DeletedFolder. */ + DELETED_FOLDER("DeletedFolder"), + + /** Enum value Quarantine. */ + QUARANTINE("Quarantine"), + + /** Enum value External. */ + EXTERNAL("External"), + + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Dropped. */ + DROPPED("Dropped"), + + /** Enum value Forwarded. */ + FORWARDED("Forwarded"); + + /** The actual serialized value for a DeliveryLocation instance. */ + private final String value; + + DeliveryLocation(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DeliveryLocation instance. + * + * @param value the serialized value to parse. + * @return the parsed DeliveryLocation object, or null if unable to parse. + */ + @JsonCreator + public static DeliveryLocation fromString(String value) { + DeliveryLocation[] items = DeliveryLocation.values(); + for (DeliveryLocation item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DnsEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DnsEntity.java new file mode 100644 index 000000000000..97c8006170ed --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DnsEntity.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.DnsEntityProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Represents a dns entity. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("DnsResolution") +@Fluent +public final class DnsEntity extends EntityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DnsEntity.class); + + /* + * Dns entity properties + */ + @JsonProperty(value = "properties") + private DnsEntityProperties innerProperties; + + /** + * Get the innerProperties property: Dns entity properties. + * + * @return the innerProperties value. + */ + private DnsEntityProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the dnsServerIpEntityId property: An ip entity id for the dns server resolving the request. + * + * @return the dnsServerIpEntityId value. + */ + public String dnsServerIpEntityId() { + return this.innerProperties() == null ? null : this.innerProperties().dnsServerIpEntityId(); + } + + /** + * Get the domainName property: The name of the dns record associated with the alert. + * + * @return the domainName value. + */ + public String domainName() { + return this.innerProperties() == null ? null : this.innerProperties().domainName(); + } + + /** + * Get the hostIpAddressEntityId property: An ip entity id for the dns request client. + * + * @return the hostIpAddressEntityId value. + */ + public String hostIpAddressEntityId() { + return this.innerProperties() == null ? null : this.innerProperties().hostIpAddressEntityId(); + } + + /** + * Get the ipAddressEntityIds property: Ip entity identifiers for the resolved ip address. + * + * @return the ipAddressEntityIds value. + */ + public List ipAddressEntityIds() { + return this.innerProperties() == null ? null : this.innerProperties().ipAddressEntityIds(); + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DomainWhois.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DomainWhois.java new file mode 100644 index 000000000000..cdf28e940bfe --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DomainWhois.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DomainWhois. */ +public interface DomainWhois { + /** + * Get whois information for a single domain name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param domain Domain name to be enriched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whois information for a single domain name. + */ + EnrichmentDomainWhois get(String resourceGroupName, String domain); + + /** + * Get whois information for a single domain name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param domain Domain name to be enriched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whois information for a single domain name. + */ + Response getWithResponse(String resourceGroupName, String domain, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365CheckRequirements.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365CheckRequirements.java new file mode 100644 index 000000000000..72b533edc489 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365CheckRequirements.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.Dynamics365CheckRequirementsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents Dynamics365 requirements check request. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Dynamics365") +@Fluent +public final class Dynamics365CheckRequirements extends DataConnectorsCheckRequirements { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Dynamics365CheckRequirements.class); + + /* + * Dynamics365 requirements check properties. + */ + @JsonProperty(value = "properties") + private Dynamics365CheckRequirementsProperties innerProperties; + + /** + * Get the innerProperties property: Dynamics365 requirements check properties. + * + * @return the innerProperties value. + */ + private Dynamics365CheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365DataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365DataConnector.java new file mode 100644 index 000000000000..804f35d5ce4f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365DataConnector.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.Dynamics365DataConnectorProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents Dynamics365 data connector. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Dynamics365") +@Fluent +public final class Dynamics365DataConnector extends DataConnectorInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Dynamics365DataConnector.class); + + /* + * Dynamics365 data connector properties. + */ + @JsonProperty(value = "properties") + private Dynamics365DataConnectorProperties innerProperties; + + /** + * Get the innerProperties property: Dynamics365 data connector properties. + * + * @return the innerProperties value. + */ + private Dynamics365DataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public Dynamics365DataConnector withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public Dynamics365DataConnectorDataTypes dataTypes() { + return this.innerProperties() == null ? null : this.innerProperties().dataTypes(); + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the Dynamics365DataConnector object itself. + */ + public Dynamics365DataConnector withDataTypes(Dynamics365DataConnectorDataTypes dataTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new Dynamics365DataConnectorProperties(); + } + this.innerProperties().withDataTypes(dataTypes); + return this; + } + + /** + * Get the tenantId property: The tenant id to connect to, and get the data from. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Set the tenantId property: The tenant id to connect to, and get the data from. + * + * @param tenantId the tenantId value to set. + * @return the Dynamics365DataConnector object itself. + */ + public Dynamics365DataConnector withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new Dynamics365DataConnectorProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365DataConnectorDataTypes.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365DataConnectorDataTypes.java new file mode 100644 index 000000000000..1b935488d321 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365DataConnectorDataTypes.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The available data types for Dynamics365 data connector. */ +@Fluent +public final class Dynamics365DataConnectorDataTypes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Dynamics365DataConnectorDataTypes.class); + + /* + * Common Data Service data type connection. + */ + @JsonProperty(value = "dynamics365CdsActivities", required = true) + private Dynamics365DataConnectorDataTypesDynamics365CdsActivities dynamics365CdsActivities; + + /** + * Get the dynamics365CdsActivities property: Common Data Service data type connection. + * + * @return the dynamics365CdsActivities value. + */ + public Dynamics365DataConnectorDataTypesDynamics365CdsActivities dynamics365CdsActivities() { + return this.dynamics365CdsActivities; + } + + /** + * Set the dynamics365CdsActivities property: Common Data Service data type connection. + * + * @param dynamics365CdsActivities the dynamics365CdsActivities value to set. + * @return the Dynamics365DataConnectorDataTypes object itself. + */ + public Dynamics365DataConnectorDataTypes withDynamics365CdsActivities( + Dynamics365DataConnectorDataTypesDynamics365CdsActivities dynamics365CdsActivities) { + this.dynamics365CdsActivities = dynamics365CdsActivities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dynamics365CdsActivities() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dynamics365CdsActivities in model" + + " Dynamics365DataConnectorDataTypes")); + } else { + dynamics365CdsActivities().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365DataConnectorDataTypesDynamics365CdsActivities.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365DataConnectorDataTypesDynamics365CdsActivities.java new file mode 100644 index 000000000000..09a23cddd4e3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365DataConnectorDataTypesDynamics365CdsActivities.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Common Data Service data type connection. */ +@Fluent +public final class Dynamics365DataConnectorDataTypesDynamics365CdsActivities extends DataConnectorDataTypeCommon { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(Dynamics365DataConnectorDataTypesDynamics365CdsActivities.class); + + /** {@inheritDoc} */ + @Override + public Dynamics365DataConnectorDataTypesDynamics365CdsActivities withState(DataTypeState state) { + super.withState(state); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ElevationToken.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ElevationToken.java new file mode 100644 index 000000000000..25ae71d1a2ff --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ElevationToken.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ElevationToken. */ +public enum ElevationToken { + /** Enum value Default. */ + DEFAULT("Default"), + + /** Enum value Full. */ + FULL("Full"), + + /** Enum value Limited. */ + LIMITED("Limited"); + + /** The actual serialized value for a ElevationToken instance. */ + private final String value; + + ElevationToken(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ElevationToken instance. + * + * @param value the serialized value to parse. + * @return the parsed ElevationToken object, or null if unable to parse. + */ + @JsonCreator + public static ElevationToken fromString(String value) { + ElevationToken[] items = ElevationToken.values(); + for (ElevationToken item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhois.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhois.java new file mode 100644 index 000000000000..5b903538b5db --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhois.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentDomainWhoisInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of EnrichmentDomainWhois. */ +public interface EnrichmentDomainWhois { + /** + * Gets the domain property: The domain for this whois record. + * + * @return the domain value. + */ + String domain(); + + /** + * Gets the server property: The hostname of this registrar's whois server. + * + * @return the server value. + */ + String server(); + + /** + * Gets the created property: The timestamp at which this record was created. + * + * @return the created value. + */ + OffsetDateTime created(); + + /** + * Gets the updated property: The timestamp at which this record was last updated. + * + * @return the updated value. + */ + OffsetDateTime updated(); + + /** + * Gets the expires property: The timestamp at which this record will expire. + * + * @return the expires value. + */ + OffsetDateTime expires(); + + /** + * Gets the parsedWhois property: The whois record for a given domain. + * + * @return the parsedWhois value. + */ + EnrichmentDomainWhoisDetails parsedWhois(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentDomainWhoisInner object. + * + * @return the inner object. + */ + EnrichmentDomainWhoisInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisContact.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisContact.java new file mode 100644 index 000000000000..732134bf3e9a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisContact.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An individual contact associated with this domain. */ +@Fluent +public final class EnrichmentDomainWhoisContact { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EnrichmentDomainWhoisContact.class); + + /* + * The name of this contact + */ + @JsonProperty(value = "name") + private String name; + + /* + * The organization for this contact + */ + @JsonProperty(value = "org") + private String org; + + /* + * A list describing the street address for this contact + */ + @JsonProperty(value = "street") + private List street; + + /* + * The city for this contact + */ + @JsonProperty(value = "city") + private String city; + + /* + * The state for this contact + */ + @JsonProperty(value = "state") + private String state; + + /* + * The postal code for this contact + */ + @JsonProperty(value = "postal") + private String postal; + + /* + * The country for this contact + */ + @JsonProperty(value = "country") + private String country; + + /* + * The phone number for this contact + */ + @JsonProperty(value = "phone") + private String phone; + + /* + * The fax number for this contact + */ + @JsonProperty(value = "fax") + private String fax; + + /* + * The email address for this contact + */ + @JsonProperty(value = "email") + private String email; + + /** + * Get the name property: The name of this contact. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of this contact. + * + * @param name the name value to set. + * @return the EnrichmentDomainWhoisContact object itself. + */ + public EnrichmentDomainWhoisContact withName(String name) { + this.name = name; + return this; + } + + /** + * Get the org property: The organization for this contact. + * + * @return the org value. + */ + public String org() { + return this.org; + } + + /** + * Set the org property: The organization for this contact. + * + * @param org the org value to set. + * @return the EnrichmentDomainWhoisContact object itself. + */ + public EnrichmentDomainWhoisContact withOrg(String org) { + this.org = org; + return this; + } + + /** + * Get the street property: A list describing the street address for this contact. + * + * @return the street value. + */ + public List street() { + return this.street; + } + + /** + * Set the street property: A list describing the street address for this contact. + * + * @param street the street value to set. + * @return the EnrichmentDomainWhoisContact object itself. + */ + public EnrichmentDomainWhoisContact withStreet(List street) { + this.street = street; + return this; + } + + /** + * Get the city property: The city for this contact. + * + * @return the city value. + */ + public String city() { + return this.city; + } + + /** + * Set the city property: The city for this contact. + * + * @param city the city value to set. + * @return the EnrichmentDomainWhoisContact object itself. + */ + public EnrichmentDomainWhoisContact withCity(String city) { + this.city = city; + return this; + } + + /** + * Get the state property: The state for this contact. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Set the state property: The state for this contact. + * + * @param state the state value to set. + * @return the EnrichmentDomainWhoisContact object itself. + */ + public EnrichmentDomainWhoisContact withState(String state) { + this.state = state; + return this; + } + + /** + * Get the postal property: The postal code for this contact. + * + * @return the postal value. + */ + public String postal() { + return this.postal; + } + + /** + * Set the postal property: The postal code for this contact. + * + * @param postal the postal value to set. + * @return the EnrichmentDomainWhoisContact object itself. + */ + public EnrichmentDomainWhoisContact withPostal(String postal) { + this.postal = postal; + return this; + } + + /** + * Get the country property: The country for this contact. + * + * @return the country value. + */ + public String country() { + return this.country; + } + + /** + * Set the country property: The country for this contact. + * + * @param country the country value to set. + * @return the EnrichmentDomainWhoisContact object itself. + */ + public EnrichmentDomainWhoisContact withCountry(String country) { + this.country = country; + return this; + } + + /** + * Get the phone property: The phone number for this contact. + * + * @return the phone value. + */ + public String phone() { + return this.phone; + } + + /** + * Set the phone property: The phone number for this contact. + * + * @param phone the phone value to set. + * @return the EnrichmentDomainWhoisContact object itself. + */ + public EnrichmentDomainWhoisContact withPhone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get the fax property: The fax number for this contact. + * + * @return the fax value. + */ + public String fax() { + return this.fax; + } + + /** + * Set the fax property: The fax number for this contact. + * + * @param fax the fax value to set. + * @return the EnrichmentDomainWhoisContact object itself. + */ + public EnrichmentDomainWhoisContact withFax(String fax) { + this.fax = fax; + return this; + } + + /** + * Get the email property: The email address for this contact. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: The email address for this contact. + * + * @param email the email value to set. + * @return the EnrichmentDomainWhoisContact object itself. + */ + public EnrichmentDomainWhoisContact withEmail(String email) { + this.email = email; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisContacts.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisContacts.java new file mode 100644 index 000000000000..1ed53add22a1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisContacts.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The set of contacts associated with this domain. */ +@Fluent +public final class EnrichmentDomainWhoisContacts { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EnrichmentDomainWhoisContacts.class); + + /* + * The admin contact for this whois record + */ + @JsonProperty(value = "admin") + private EnrichmentDomainWhoisContact admin; + + /* + * The billing contact for this whois record + */ + @JsonProperty(value = "billing") + private EnrichmentDomainWhoisContact billing; + + /* + * The registrant contact for this whois record + */ + @JsonProperty(value = "registrant") + private EnrichmentDomainWhoisContact registrant; + + /* + * The technical contact for this whois record + */ + @JsonProperty(value = "tech") + private EnrichmentDomainWhoisContact tech; + + /** + * Get the admin property: The admin contact for this whois record. + * + * @return the admin value. + */ + public EnrichmentDomainWhoisContact admin() { + return this.admin; + } + + /** + * Set the admin property: The admin contact for this whois record. + * + * @param admin the admin value to set. + * @return the EnrichmentDomainWhoisContacts object itself. + */ + public EnrichmentDomainWhoisContacts withAdmin(EnrichmentDomainWhoisContact admin) { + this.admin = admin; + return this; + } + + /** + * Get the billing property: The billing contact for this whois record. + * + * @return the billing value. + */ + public EnrichmentDomainWhoisContact billing() { + return this.billing; + } + + /** + * Set the billing property: The billing contact for this whois record. + * + * @param billing the billing value to set. + * @return the EnrichmentDomainWhoisContacts object itself. + */ + public EnrichmentDomainWhoisContacts withBilling(EnrichmentDomainWhoisContact billing) { + this.billing = billing; + return this; + } + + /** + * Get the registrant property: The registrant contact for this whois record. + * + * @return the registrant value. + */ + public EnrichmentDomainWhoisContact registrant() { + return this.registrant; + } + + /** + * Set the registrant property: The registrant contact for this whois record. + * + * @param registrant the registrant value to set. + * @return the EnrichmentDomainWhoisContacts object itself. + */ + public EnrichmentDomainWhoisContacts withRegistrant(EnrichmentDomainWhoisContact registrant) { + this.registrant = registrant; + return this; + } + + /** + * Get the tech property: The technical contact for this whois record. + * + * @return the tech value. + */ + public EnrichmentDomainWhoisContact tech() { + return this.tech; + } + + /** + * Set the tech property: The technical contact for this whois record. + * + * @param tech the tech value to set. + * @return the EnrichmentDomainWhoisContacts object itself. + */ + public EnrichmentDomainWhoisContacts withTech(EnrichmentDomainWhoisContact tech) { + this.tech = tech; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (admin() != null) { + admin().validate(); + } + if (billing() != null) { + billing().validate(); + } + if (registrant() != null) { + registrant().validate(); + } + if (tech() != null) { + tech().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisDetails.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisDetails.java new file mode 100644 index 000000000000..2a942c945800 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisDetails.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The whois record for a given domain. */ +@Fluent +public final class EnrichmentDomainWhoisDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EnrichmentDomainWhoisDetails.class); + + /* + * The registrar associated with this domain + */ + @JsonProperty(value = "registrar") + private EnrichmentDomainWhoisRegistrarDetails registrar; + + /* + * The set of contacts associated with this domain + */ + @JsonProperty(value = "contacts") + private EnrichmentDomainWhoisContacts contacts; + + /* + * A list of name servers associated with this domain + */ + @JsonProperty(value = "nameServers") + private List nameServers; + + /* + * The set of status flags for this whois record + */ + @JsonProperty(value = "statuses") + private List statuses; + + /** + * Get the registrar property: The registrar associated with this domain. + * + * @return the registrar value. + */ + public EnrichmentDomainWhoisRegistrarDetails registrar() { + return this.registrar; + } + + /** + * Set the registrar property: The registrar associated with this domain. + * + * @param registrar the registrar value to set. + * @return the EnrichmentDomainWhoisDetails object itself. + */ + public EnrichmentDomainWhoisDetails withRegistrar(EnrichmentDomainWhoisRegistrarDetails registrar) { + this.registrar = registrar; + return this; + } + + /** + * Get the contacts property: The set of contacts associated with this domain. + * + * @return the contacts value. + */ + public EnrichmentDomainWhoisContacts contacts() { + return this.contacts; + } + + /** + * Set the contacts property: The set of contacts associated with this domain. + * + * @param contacts the contacts value to set. + * @return the EnrichmentDomainWhoisDetails object itself. + */ + public EnrichmentDomainWhoisDetails withContacts(EnrichmentDomainWhoisContacts contacts) { + this.contacts = contacts; + return this; + } + + /** + * Get the nameServers property: A list of name servers associated with this domain. + * + * @return the nameServers value. + */ + public List nameServers() { + return this.nameServers; + } + + /** + * Set the nameServers property: A list of name servers associated with this domain. + * + * @param nameServers the nameServers value to set. + * @return the EnrichmentDomainWhoisDetails object itself. + */ + public EnrichmentDomainWhoisDetails withNameServers(List nameServers) { + this.nameServers = nameServers; + return this; + } + + /** + * Get the statuses property: The set of status flags for this whois record. + * + * @return the statuses value. + */ + public List statuses() { + return this.statuses; + } + + /** + * Set the statuses property: The set of status flags for this whois record. + * + * @param statuses the statuses value to set. + * @return the EnrichmentDomainWhoisDetails object itself. + */ + public EnrichmentDomainWhoisDetails withStatuses(List statuses) { + this.statuses = statuses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (registrar() != null) { + registrar().validate(); + } + if (contacts() != null) { + contacts().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisRegistrarDetails.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisRegistrarDetails.java new file mode 100644 index 000000000000..24ac38d4d0cf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisRegistrarDetails.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The registrar associated with this domain. */ +@Fluent +public final class EnrichmentDomainWhoisRegistrarDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EnrichmentDomainWhoisRegistrarDetails.class); + + /* + * The name of this registrar + */ + @JsonProperty(value = "name") + private String name; + + /* + * This registrar's abuse contact email + */ + @JsonProperty(value = "abuseContactEmail") + private String abuseContactEmail; + + /* + * This registrar's abuse contact phone number + */ + @JsonProperty(value = "abuseContactPhone") + private String abuseContactPhone; + + /* + * This registrar's Internet Assigned Numbers Authority id + */ + @JsonProperty(value = "ianaId") + private String ianaId; + + /* + * This registrar's URL + */ + @JsonProperty(value = "url") + private String url; + + /* + * The hostname of this registrar's whois server + */ + @JsonProperty(value = "whoisServer") + private String whoisServer; + + /** + * Get the name property: The name of this registrar. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of this registrar. + * + * @param name the name value to set. + * @return the EnrichmentDomainWhoisRegistrarDetails object itself. + */ + public EnrichmentDomainWhoisRegistrarDetails withName(String name) { + this.name = name; + return this; + } + + /** + * Get the abuseContactEmail property: This registrar's abuse contact email. + * + * @return the abuseContactEmail value. + */ + public String abuseContactEmail() { + return this.abuseContactEmail; + } + + /** + * Set the abuseContactEmail property: This registrar's abuse contact email. + * + * @param abuseContactEmail the abuseContactEmail value to set. + * @return the EnrichmentDomainWhoisRegistrarDetails object itself. + */ + public EnrichmentDomainWhoisRegistrarDetails withAbuseContactEmail(String abuseContactEmail) { + this.abuseContactEmail = abuseContactEmail; + return this; + } + + /** + * Get the abuseContactPhone property: This registrar's abuse contact phone number. + * + * @return the abuseContactPhone value. + */ + public String abuseContactPhone() { + return this.abuseContactPhone; + } + + /** + * Set the abuseContactPhone property: This registrar's abuse contact phone number. + * + * @param abuseContactPhone the abuseContactPhone value to set. + * @return the EnrichmentDomainWhoisRegistrarDetails object itself. + */ + public EnrichmentDomainWhoisRegistrarDetails withAbuseContactPhone(String abuseContactPhone) { + this.abuseContactPhone = abuseContactPhone; + return this; + } + + /** + * Get the ianaId property: This registrar's Internet Assigned Numbers Authority id. + * + * @return the ianaId value. + */ + public String ianaId() { + return this.ianaId; + } + + /** + * Set the ianaId property: This registrar's Internet Assigned Numbers Authority id. + * + * @param ianaId the ianaId value to set. + * @return the EnrichmentDomainWhoisRegistrarDetails object itself. + */ + public EnrichmentDomainWhoisRegistrarDetails withIanaId(String ianaId) { + this.ianaId = ianaId; + return this; + } + + /** + * Get the url property: This registrar's URL. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: This registrar's URL. + * + * @param url the url value to set. + * @return the EnrichmentDomainWhoisRegistrarDetails object itself. + */ + public EnrichmentDomainWhoisRegistrarDetails withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the whoisServer property: The hostname of this registrar's whois server. + * + * @return the whoisServer value. + */ + public String whoisServer() { + return this.whoisServer; + } + + /** + * Set the whoisServer property: The hostname of this registrar's whois server. + * + * @param whoisServer the whoisServer value to set. + * @return the EnrichmentDomainWhoisRegistrarDetails object itself. + */ + public EnrichmentDomainWhoisRegistrarDetails withWhoisServer(String whoisServer) { + this.whoisServer = whoisServer; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentIpGeodata.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentIpGeodata.java new file mode 100644 index 000000000000..d8b2e8ec5925 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentIpGeodata.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentIpGeodataInner; + +/** An immutable client-side representation of EnrichmentIpGeodata. */ +public interface EnrichmentIpGeodata { + /** + * Gets the asn property: The autonomous system number associated with this IP address. + * + * @return the asn value. + */ + String asn(); + + /** + * Gets the carrier property: The name of the carrier for this IP address. + * + * @return the carrier value. + */ + String carrier(); + + /** + * Gets the city property: The city this IP address is located in. + * + * @return the city value. + */ + String city(); + + /** + * Gets the cityCf property: A numeric rating of confidence that the value in the 'city' field is correct, on a + * scale of 0-100. + * + * @return the cityCf value. + */ + Integer cityCf(); + + /** + * Gets the continent property: The continent this IP address is located on. + * + * @return the continent value. + */ + String continent(); + + /** + * Gets the country property: The county this IP address is located in. + * + * @return the country value. + */ + String country(); + + /** + * Gets the countryCf property: A numeric rating of confidence that the value in the 'country' field is correct on a + * scale of 0-100. + * + * @return the countryCf value. + */ + Integer countryCf(); + + /** + * Gets the ipAddr property: The dotted-decimal or colon-separated string representation of the IP address. + * + * @return the ipAddr value. + */ + String ipAddr(); + + /** + * Gets the ipRoutingType property: A description of the connection type of this IP address. + * + * @return the ipRoutingType value. + */ + String ipRoutingType(); + + /** + * Gets the latitude property: The latitude of this IP address. + * + * @return the latitude value. + */ + String latitude(); + + /** + * Gets the longitude property: The longitude of this IP address. + * + * @return the longitude value. + */ + String longitude(); + + /** + * Gets the organization property: The name of the organization for this IP address. + * + * @return the organization value. + */ + String organization(); + + /** + * Gets the organizationType property: The type of the organization for this IP address. + * + * @return the organizationType value. + */ + String organizationType(); + + /** + * Gets the region property: The geographic region this IP address is located in. + * + * @return the region value. + */ + String region(); + + /** + * Gets the state property: The state this IP address is located in. + * + * @return the state value. + */ + String state(); + + /** + * Gets the stateCf property: A numeric rating of confidence that the value in the 'state' field is correct on a + * scale of 0-100. + * + * @return the stateCf value. + */ + Integer stateCf(); + + /** + * Gets the stateCode property: The abbreviated name for the state this IP address is located in. + * + * @return the stateCode value. + */ + String stateCode(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentIpGeodataInner object. + * + * @return the inner object. + */ + EnrichmentIpGeodataInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Entities.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Entities.java new file mode 100644 index 000000000000..3f5e89c0c881 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Entities.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Entities. */ +public interface Entities { + /** + * Gets all entities. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entities. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all entities. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entities. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity. + */ + Entity get(String resourceGroupName, String workspaceName, String entityId); + + /** + * Gets an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String entityId, Context context); + + /** + * Expands an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute an expand operation on the given entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity expansion result operation response. + */ + EntityExpandResponse expand( + String resourceGroupName, String workspaceName, String entityId, EntityExpandParameters parameters); + + /** + * Expands an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute an expand operation on the given entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity expansion result operation response. + */ + Response expandWithResponse( + String resourceGroupName, + String workspaceName, + String entityId, + EntityExpandParameters parameters, + Context context); + + /** + * Get Insights and Activities for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param kind The Kind parameter for queries. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return insights and Activities for an entity. + */ + GetQueriesResponse queries( + String resourceGroupName, String workspaceName, String entityId, EntityItemQueryKind kind); + + /** + * Get Insights and Activities for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param kind The Kind parameter for queries. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return insights and Activities for an entity. + */ + Response queriesWithResponse( + String resourceGroupName, String workspaceName, String entityId, EntityItemQueryKind kind, Context context); + + /** + * Execute Insights for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute insights on the given entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Get Insights result operation response. + */ + EntityGetInsightsResponse getInsights( + String resourceGroupName, String workspaceName, String entityId, EntityGetInsightsParameters parameters); + + /** + * Execute Insights for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute insights on the given entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Get Insights result operation response. + */ + Response getInsightsWithResponse( + String resourceGroupName, + String workspaceName, + String entityId, + EntityGetInsightsParameters parameters, + Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntitiesGetTimelines.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntitiesGetTimelines.java new file mode 100644 index 000000000000..5bb7e98673d2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntitiesGetTimelines.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of EntitiesGetTimelines. */ +public interface EntitiesGetTimelines { + /** + * Timeline for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute an timeline operation on the given entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity timeline result operation response. + */ + EntityTimelineResponse list( + String resourceGroupName, String workspaceName, String entityId, EntityTimelineParameters parameters); + + /** + * Timeline for an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param parameters The parameters required to execute an timeline operation on the given entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity timeline result operation response. + */ + Response listWithResponse( + String resourceGroupName, + String workspaceName, + String entityId, + EntityTimelineParameters parameters, + Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntitiesRelations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntitiesRelations.java new file mode 100644 index 000000000000..8cee4f709b9d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntitiesRelations.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of EntitiesRelations. */ +public interface EntitiesRelations { + /** + * Gets all relations of an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all relations of an entity. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String entityId); + + /** + * Gets all relations of an entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all relations of an entity. + */ + PagedIterable list( + String resourceGroupName, + String workspaceName, + String entityId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Entity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Entity.java new file mode 100644 index 000000000000..664d22e8eae5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Entity.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; + +/** An immutable client-side representation of Entity. */ +public interface Entity { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.EntityInner object. + * + * @return the inner object. + */ + EntityInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityAnalytics.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityAnalytics.java new file mode 100644 index 000000000000..6246284ebcb0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityAnalytics.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityAnalyticsProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Settings with single toggle. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("EntityAnalytics") +@Fluent +public final class EntityAnalytics extends SettingsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityAnalytics.class); + + /* + * EntityAnalytics properties + */ + @JsonProperty(value = "properties") + private EntityAnalyticsProperties innerProperties; + + /** + * Get the innerProperties property: EntityAnalytics properties. + * + * @return the innerProperties value. + */ + private EntityAnalyticsProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public EntityAnalytics withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the isEnabled property: Determines whether the setting is enable or disabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isEnabled(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityCommonProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityCommonProperties.java new file mode 100644 index 000000000000..518293c9886e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityCommonProperties.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Entity common property bag. */ +@Immutable +public class EntityCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityCommonProperties.class); + + /* + * A bag of custom fields that should be part of the entity and will be + * presented to the user. + */ + @JsonProperty(value = "additionalData", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map additionalData; + + /* + * The graph item display name which is a short humanly readable + * description of the graph item instance. This property is optional and + * might be system generated. + */ + @JsonProperty(value = "friendlyName", access = JsonProperty.Access.WRITE_ONLY) + private String friendlyName; + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.additionalData; + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityEdges.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityEdges.java new file mode 100644 index 000000000000..f517e0fa2432 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityEdges.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The edge that connects the entity to the other entity. */ +@Fluent +public final class EntityEdges { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityEdges.class); + + /* + * The target entity Id. + */ + @JsonProperty(value = "targetEntityId") + private String targetEntityId; + + /* + * A bag of custom fields that should be part of the entity and will be + * presented to the user. + */ + @JsonProperty(value = "additionalData") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map additionalData; + + /** + * Get the targetEntityId property: The target entity Id. + * + * @return the targetEntityId value. + */ + public String targetEntityId() { + return this.targetEntityId; + } + + /** + * Set the targetEntityId property: The target entity Id. + * + * @param targetEntityId the targetEntityId value to set. + * @return the EntityEdges object itself. + */ + public EntityEdges withTargetEntityId(String targetEntityId) { + this.targetEntityId = targetEntityId; + return this; + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.additionalData; + } + + /** + * Set the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @param additionalData the additionalData value to set. + * @return the EntityEdges object itself. + */ + public EntityEdges withAdditionalData(Map additionalData) { + this.additionalData = additionalData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityExpandParameters.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityExpandParameters.java new file mode 100644 index 000000000000..2de4c811db32 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityExpandParameters.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.UUID; + +/** The parameters required to execute an expand operation on the given entity. */ +@Fluent +public final class EntityExpandParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityExpandParameters.class); + + /* + * The end date filter, so the only expansion results returned are before + * this date. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * The Id of the expansion to perform. + */ + @JsonProperty(value = "expansionId") + private UUID expansionId; + + /* + * The start date filter, so the only expansion results returned are after + * this date. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /** + * Get the endTime property: The end date filter, so the only expansion results returned are before this date. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end date filter, so the only expansion results returned are before this date. + * + * @param endTime the endTime value to set. + * @return the EntityExpandParameters object itself. + */ + public EntityExpandParameters withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the expansionId property: The Id of the expansion to perform. + * + * @return the expansionId value. + */ + public UUID expansionId() { + return this.expansionId; + } + + /** + * Set the expansionId property: The Id of the expansion to perform. + * + * @param expansionId the expansionId value to set. + * @return the EntityExpandParameters object itself. + */ + public EntityExpandParameters withExpansionId(UUID expansionId) { + this.expansionId = expansionId; + return this; + } + + /** + * Get the startTime property: The start date filter, so the only expansion results returned are after this date. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start date filter, so the only expansion results returned are after this date. + * + * @param startTime the startTime value to set. + * @return the EntityExpandParameters object itself. + */ + public EntityExpandParameters withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityExpandResponse.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityExpandResponse.java new file mode 100644 index 000000000000..fb8e3981d534 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityExpandResponse.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.EntityExpandResponseInner; + +/** An immutable client-side representation of EntityExpandResponse. */ +public interface EntityExpandResponse { + /** + * Gets the metadata property: The metadata from the expansion operation results. + * + * @return the metadata value. + */ + ExpansionResultsMetadata metadata(); + + /** + * Gets the value property: The expansion result values. + * + * @return the value value. + */ + EntityExpandResponseValue value(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.EntityExpandResponseInner object. + * + * @return the inner object. + */ + EntityExpandResponseInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityExpandResponseValue.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityExpandResponseValue.java new file mode 100644 index 000000000000..b843e7bb156f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityExpandResponseValue.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The expansion result values. */ +@Fluent +public final class EntityExpandResponseValue { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityExpandResponseValue.class); + + /* + * Array of the expansion result entities. + */ + @JsonProperty(value = "entities") + private List entities; + + /* + * Array of edges that connects the entity to the list of entities. + */ + @JsonProperty(value = "edges") + private List edges; + + /** + * Get the entities property: Array of the expansion result entities. + * + * @return the entities value. + */ + public List entities() { + return this.entities; + } + + /** + * Set the entities property: Array of the expansion result entities. + * + * @param entities the entities value to set. + * @return the EntityExpandResponseValue object itself. + */ + public EntityExpandResponseValue withEntities(List entities) { + this.entities = entities; + return this; + } + + /** + * Get the edges property: Array of edges that connects the entity to the list of entities. + * + * @return the edges value. + */ + public List edges() { + return this.edges; + } + + /** + * Set the edges property: Array of edges that connects the entity to the list of entities. + * + * @param edges the edges value to set. + * @return the EntityExpandResponseValue object itself. + */ + public EntityExpandResponseValue withEdges(List edges) { + this.edges = edges; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (entities() != null) { + entities().forEach(e -> e.validate()); + } + if (edges() != null) { + edges().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityGetInsightsParameters.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityGetInsightsParameters.java new file mode 100644 index 000000000000..9f8a1b3bf66a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityGetInsightsParameters.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.UUID; + +/** The parameters required to execute insights operation on the given entity. */ +@Fluent +public final class EntityGetInsightsParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityGetInsightsParameters.class); + + /* + * The start timeline date, so the results returned are after this date. + */ + @JsonProperty(value = "startTime", required = true) + private OffsetDateTime startTime; + + /* + * The end timeline date, so the results returned are before this date. + */ + @JsonProperty(value = "endTime", required = true) + private OffsetDateTime endTime; + + /* + * Indicates if query time range should be extended with default time range + * of the query. Default value is false + */ + @JsonProperty(value = "addDefaultExtendedTimeRange") + private Boolean addDefaultExtendedTimeRange; + + /* + * List of Insights Query Id. If empty, default value is all insights of + * this entity + */ + @JsonProperty(value = "insightQueryIds") + private List insightQueryIds; + + /** + * Get the startTime property: The start timeline date, so the results returned are after this date. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start timeline date, so the results returned are after this date. + * + * @param startTime the startTime value to set. + * @return the EntityGetInsightsParameters object itself. + */ + public EntityGetInsightsParameters withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end timeline date, so the results returned are before this date. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end timeline date, so the results returned are before this date. + * + * @param endTime the endTime value to set. + * @return the EntityGetInsightsParameters object itself. + */ + public EntityGetInsightsParameters withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the addDefaultExtendedTimeRange property: Indicates if query time range should be extended with default time + * range of the query. Default value is false. + * + * @return the addDefaultExtendedTimeRange value. + */ + public Boolean addDefaultExtendedTimeRange() { + return this.addDefaultExtendedTimeRange; + } + + /** + * Set the addDefaultExtendedTimeRange property: Indicates if query time range should be extended with default time + * range of the query. Default value is false. + * + * @param addDefaultExtendedTimeRange the addDefaultExtendedTimeRange value to set. + * @return the EntityGetInsightsParameters object itself. + */ + public EntityGetInsightsParameters withAddDefaultExtendedTimeRange(Boolean addDefaultExtendedTimeRange) { + this.addDefaultExtendedTimeRange = addDefaultExtendedTimeRange; + return this; + } + + /** + * Get the insightQueryIds property: List of Insights Query Id. If empty, default value is all insights of this + * entity. + * + * @return the insightQueryIds value. + */ + public List insightQueryIds() { + return this.insightQueryIds; + } + + /** + * Set the insightQueryIds property: List of Insights Query Id. If empty, default value is all insights of this + * entity. + * + * @param insightQueryIds the insightQueryIds value to set. + * @return the EntityGetInsightsParameters object itself. + */ + public EntityGetInsightsParameters withInsightQueryIds(List insightQueryIds) { + this.insightQueryIds = insightQueryIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (startTime() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property startTime in model EntityGetInsightsParameters")); + } + if (endTime() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property endTime in model EntityGetInsightsParameters")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityGetInsightsResponse.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityGetInsightsResponse.java new file mode 100644 index 000000000000..dbb22861ff01 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityGetInsightsResponse.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.EntityGetInsightsResponseInner; +import java.util.List; + +/** An immutable client-side representation of EntityGetInsightsResponse. */ +public interface EntityGetInsightsResponse { + /** + * Gets the metadata property: The metadata from the get insights operation results. + * + * @return the metadata value. + */ + GetInsightsResultsMetadata metadata(); + + /** + * Gets the value property: The insights result values. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.EntityGetInsightsResponseInner object. + * + * @return the inner object. + */ + EntityGetInsightsResponseInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityInsightItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityInsightItem.java new file mode 100644 index 000000000000..098117d63751 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityInsightItem.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Entity insight Item. */ +@Fluent +public final class EntityInsightItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityInsightItem.class); + + /* + * The query id of the insight + */ + @JsonProperty(value = "queryId") + private String queryId; + + /* + * The Time interval that the query actually executed on. + */ + @JsonProperty(value = "queryTimeInterval") + private EntityInsightItemQueryTimeInterval queryTimeInterval; + + /* + * Query results for table insights query. + */ + @JsonProperty(value = "tableQueryResults") + private InsightsTableResult tableQueryResults; + + /* + * Query results for table insights query. + */ + @JsonProperty(value = "chartQueryResults") + private List chartQueryResults; + + /** + * Get the queryId property: The query id of the insight. + * + * @return the queryId value. + */ + public String queryId() { + return this.queryId; + } + + /** + * Set the queryId property: The query id of the insight. + * + * @param queryId the queryId value to set. + * @return the EntityInsightItem object itself. + */ + public EntityInsightItem withQueryId(String queryId) { + this.queryId = queryId; + return this; + } + + /** + * Get the queryTimeInterval property: The Time interval that the query actually executed on. + * + * @return the queryTimeInterval value. + */ + public EntityInsightItemQueryTimeInterval queryTimeInterval() { + return this.queryTimeInterval; + } + + /** + * Set the queryTimeInterval property: The Time interval that the query actually executed on. + * + * @param queryTimeInterval the queryTimeInterval value to set. + * @return the EntityInsightItem object itself. + */ + public EntityInsightItem withQueryTimeInterval(EntityInsightItemQueryTimeInterval queryTimeInterval) { + this.queryTimeInterval = queryTimeInterval; + return this; + } + + /** + * Get the tableQueryResults property: Query results for table insights query. + * + * @return the tableQueryResults value. + */ + public InsightsTableResult tableQueryResults() { + return this.tableQueryResults; + } + + /** + * Set the tableQueryResults property: Query results for table insights query. + * + * @param tableQueryResults the tableQueryResults value to set. + * @return the EntityInsightItem object itself. + */ + public EntityInsightItem withTableQueryResults(InsightsTableResult tableQueryResults) { + this.tableQueryResults = tableQueryResults; + return this; + } + + /** + * Get the chartQueryResults property: Query results for table insights query. + * + * @return the chartQueryResults value. + */ + public List chartQueryResults() { + return this.chartQueryResults; + } + + /** + * Set the chartQueryResults property: Query results for table insights query. + * + * @param chartQueryResults the chartQueryResults value to set. + * @return the EntityInsightItem object itself. + */ + public EntityInsightItem withChartQueryResults(List chartQueryResults) { + this.chartQueryResults = chartQueryResults; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (queryTimeInterval() != null) { + queryTimeInterval().validate(); + } + if (tableQueryResults() != null) { + tableQueryResults().validate(); + } + if (chartQueryResults() != null) { + chartQueryResults().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityInsightItemQueryTimeInterval.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityInsightItemQueryTimeInterval.java new file mode 100644 index 000000000000..ec72cadb22ae --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityInsightItemQueryTimeInterval.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The Time interval that the query actually executed on. */ +@Fluent +public final class EntityInsightItemQueryTimeInterval { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityInsightItemQueryTimeInterval.class); + + /* + * Insight query start time + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * Insight query end time + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /** + * Get the startTime property: Insight query start time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Insight query start time. + * + * @param startTime the startTime value to set. + * @return the EntityInsightItemQueryTimeInterval object itself. + */ + public EntityInsightItemQueryTimeInterval withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: Insight query end time. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: Insight query end time. + * + * @param endTime the endTime value to set. + * @return the EntityInsightItemQueryTimeInterval object itself. + */ + public EntityInsightItemQueryTimeInterval withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityItemQueryKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityItemQueryKind.java new file mode 100644 index 000000000000..36b6a8c25fba --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityItemQueryKind.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EntityItemQueryKind. */ +public final class EntityItemQueryKind extends ExpandableStringEnum { + /** Static value Insight for EntityItemQueryKind. */ + public static final EntityItemQueryKind INSIGHT = fromString("Insight"); + + /** + * Creates or finds a EntityItemQueryKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding EntityItemQueryKind. + */ + @JsonCreator + public static EntityItemQueryKind fromString(String name) { + return fromString(name, EntityItemQueryKind.class); + } + + /** @return known EntityItemQueryKind values. */ + public static Collection values() { + return values(EntityItemQueryKind.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityKind.java new file mode 100644 index 000000000000..4d847ebf53fd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityKind.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EntityKind. */ +public final class EntityKind extends ExpandableStringEnum { + /** Static value Account for EntityKind. */ + public static final EntityKind ACCOUNT = fromString("Account"); + + /** Static value Host for EntityKind. */ + public static final EntityKind HOST = fromString("Host"); + + /** Static value File for EntityKind. */ + public static final EntityKind FILE = fromString("File"); + + /** Static value AzureResource for EntityKind. */ + public static final EntityKind AZURE_RESOURCE = fromString("AzureResource"); + + /** Static value CloudApplication for EntityKind. */ + public static final EntityKind CLOUD_APPLICATION = fromString("CloudApplication"); + + /** Static value DnsResolution for EntityKind. */ + public static final EntityKind DNS_RESOLUTION = fromString("DnsResolution"); + + /** Static value FileHash for EntityKind. */ + public static final EntityKind FILE_HASH = fromString("FileHash"); + + /** Static value Ip for EntityKind. */ + public static final EntityKind IP = fromString("Ip"); + + /** Static value Malware for EntityKind. */ + public static final EntityKind MALWARE = fromString("Malware"); + + /** Static value Process for EntityKind. */ + public static final EntityKind PROCESS = fromString("Process"); + + /** Static value RegistryKey for EntityKind. */ + public static final EntityKind REGISTRY_KEY = fromString("RegistryKey"); + + /** Static value RegistryValue for EntityKind. */ + public static final EntityKind REGISTRY_VALUE = fromString("RegistryValue"); + + /** Static value SecurityGroup for EntityKind. */ + public static final EntityKind SECURITY_GROUP = fromString("SecurityGroup"); + + /** Static value Url for EntityKind. */ + public static final EntityKind URL = fromString("Url"); + + /** Static value IoTDevice for EntityKind. */ + public static final EntityKind IO_TDEVICE = fromString("IoTDevice"); + + /** Static value SecurityAlert for EntityKind. */ + public static final EntityKind SECURITY_ALERT = fromString("SecurityAlert"); + + /** Static value Bookmark for EntityKind. */ + public static final EntityKind BOOKMARK = fromString("Bookmark"); + + /** Static value MailCluster for EntityKind. */ + public static final EntityKind MAIL_CLUSTER = fromString("MailCluster"); + + /** Static value MailMessage for EntityKind. */ + public static final EntityKind MAIL_MESSAGE = fromString("MailMessage"); + + /** Static value Mailbox for EntityKind. */ + public static final EntityKind MAILBOX = fromString("Mailbox"); + + /** Static value SubmissionMail for EntityKind. */ + public static final EntityKind SUBMISSION_MAIL = fromString("SubmissionMail"); + + /** + * Creates or finds a EntityKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding EntityKind. + */ + @JsonCreator + public static EntityKind fromString(String name) { + return fromString(name, EntityKind.class); + } + + /** @return known EntityKind values. */ + public static Collection values() { + return values(EntityKind.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityList.java new file mode 100644 index 000000000000..70dc8eb442f3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityList.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of all the entities. */ +@Fluent +public final class EntityList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityList.class); + + /* + * URL to fetch the next set of entities. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of entities. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the nextLink property: URL to fetch the next set of entities. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of entities. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of entities. + * + * @param value the value value to set. + * @return the EntityList object itself. + */ + public EntityList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model EntityList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityMapping.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityMapping.java new file mode 100644 index 000000000000..077f53e9b35e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityMapping.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Single entity mapping for the alert rule. */ +@Fluent +public final class EntityMapping { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityMapping.class); + + /* + * The V3 type of the mapped entity + */ + @JsonProperty(value = "entityType") + private EntityMappingType entityType; + + /* + * array of field mappings for the given entity mapping + */ + @JsonProperty(value = "fieldMappings") + private List fieldMappings; + + /** + * Get the entityType property: The V3 type of the mapped entity. + * + * @return the entityType value. + */ + public EntityMappingType entityType() { + return this.entityType; + } + + /** + * Set the entityType property: The V3 type of the mapped entity. + * + * @param entityType the entityType value to set. + * @return the EntityMapping object itself. + */ + public EntityMapping withEntityType(EntityMappingType entityType) { + this.entityType = entityType; + return this; + } + + /** + * Get the fieldMappings property: array of field mappings for the given entity mapping. + * + * @return the fieldMappings value. + */ + public List fieldMappings() { + return this.fieldMappings; + } + + /** + * Set the fieldMappings property: array of field mappings for the given entity mapping. + * + * @param fieldMappings the fieldMappings value to set. + * @return the EntityMapping object itself. + */ + public EntityMapping withFieldMappings(List fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (fieldMappings() != null) { + fieldMappings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityMappingType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityMappingType.java new file mode 100644 index 000000000000..bf0919aa828b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityMappingType.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EntityMappingType. */ +public final class EntityMappingType extends ExpandableStringEnum { + /** Static value Account for EntityMappingType. */ + public static final EntityMappingType ACCOUNT = fromString("Account"); + + /** Static value Host for EntityMappingType. */ + public static final EntityMappingType HOST = fromString("Host"); + + /** Static value IP for EntityMappingType. */ + public static final EntityMappingType IP = fromString("IP"); + + /** Static value Malware for EntityMappingType. */ + public static final EntityMappingType MALWARE = fromString("Malware"); + + /** Static value File for EntityMappingType. */ + public static final EntityMappingType FILE = fromString("File"); + + /** Static value Process for EntityMappingType. */ + public static final EntityMappingType PROCESS = fromString("Process"); + + /** Static value CloudApplication for EntityMappingType. */ + public static final EntityMappingType CLOUD_APPLICATION = fromString("CloudApplication"); + + /** Static value DNS for EntityMappingType. */ + public static final EntityMappingType DNS = fromString("DNS"); + + /** Static value AzureResource for EntityMappingType. */ + public static final EntityMappingType AZURE_RESOURCE = fromString("AzureResource"); + + /** Static value FileHash for EntityMappingType. */ + public static final EntityMappingType FILE_HASH = fromString("FileHash"); + + /** Static value RegistryKey for EntityMappingType. */ + public static final EntityMappingType REGISTRY_KEY = fromString("RegistryKey"); + + /** Static value RegistryValue for EntityMappingType. */ + public static final EntityMappingType REGISTRY_VALUE = fromString("RegistryValue"); + + /** Static value SecurityGroup for EntityMappingType. */ + public static final EntityMappingType SECURITY_GROUP = fromString("SecurityGroup"); + + /** Static value URL for EntityMappingType. */ + public static final EntityMappingType URL = fromString("URL"); + + /** Static value Mailbox for EntityMappingType. */ + public static final EntityMappingType MAILBOX = fromString("Mailbox"); + + /** Static value MailCluster for EntityMappingType. */ + public static final EntityMappingType MAIL_CLUSTER = fromString("MailCluster"); + + /** Static value MailMessage for EntityMappingType. */ + public static final EntityMappingType MAIL_MESSAGE = fromString("MailMessage"); + + /** Static value SubmissionMail for EntityMappingType. */ + public static final EntityMappingType SUBMISSION_MAIL = fromString("SubmissionMail"); + + /** + * Creates or finds a EntityMappingType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EntityMappingType. + */ + @JsonCreator + public static EntityMappingType fromString(String name) { + return fromString(name, EntityMappingType.class); + } + + /** @return known EntityMappingType values. */ + public static Collection values() { + return values(EntityMappingType.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueries.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueries.java new file mode 100644 index 000000000000..f102acc95b5b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueries.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of EntityQueries. */ +public interface EntityQueries { + /** + * Gets all entity queries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entity queries. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all entity queries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kind The entity query kind we want to fetch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entity queries. + */ + PagedIterable list( + String resourceGroupName, String workspaceName, EntityQueriesKind kind, Context context); + + /** + * Gets an entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity query. + */ + EntityQuery get(String resourceGroupName, String workspaceName, String entityQueryId); + + /** + * Gets an entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity query. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String entityQueryId, Context context); + + /** + * Creates or updates the entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @param entityQuery The entity query we want to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific entity query. + */ + EntityQuery createOrUpdate( + String resourceGroupName, String workspaceName, String entityQueryId, CustomEntityQuery entityQuery); + + /** + * Creates or updates the entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @param entityQuery The entity query we want to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific entity query. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String entityQueryId, + CustomEntityQuery entityQuery, + Context context); + + /** + * Delete the entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String entityQueryId); + + /** + * Delete the entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryId entity query ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String entityQueryId, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueriesKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueriesKind.java new file mode 100644 index 000000000000..14c9354db575 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueriesKind.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EntityQueriesKind. */ +public final class EntityQueriesKind extends ExpandableStringEnum { + /** Static value Expansion for EntityQueriesKind. */ + public static final EntityQueriesKind EXPANSION = fromString("Expansion"); + + /** Static value Activity for EntityQueriesKind. */ + public static final EntityQueriesKind ACTIVITY = fromString("Activity"); + + /** + * Creates or finds a EntityQueriesKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding EntityQueriesKind. + */ + @JsonCreator + public static EntityQueriesKind fromString(String name) { + return fromString(name, EntityQueriesKind.class); + } + + /** @return known EntityQueriesKind values. */ + public static Collection values() { + return values(EntityQueriesKind.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQuery.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQuery.java new file mode 100644 index 000000000000..3b7459c1f213 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQuery.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryInner; + +/** An immutable client-side representation of EntityQuery. */ +public interface EntityQuery { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryInner object. + * + * @return the inner object. + */ + EntityQueryInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryItem.java new file mode 100644 index 000000000000..f8c323c276c4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryItem.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** An abstract Query item for entity. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = EntityQueryItem.class) +@JsonTypeName("EntityQueryItem") +@JsonSubTypes({@JsonSubTypes.Type(name = "Insight", value = InsightQueryItem.class)}) +@Fluent +public class EntityQueryItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityQueryItem.class); + + /* + * Query Template ARM ID + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Query Template ARM Name + */ + @JsonProperty(value = "name") + private String name; + + /* + * ARM Type + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the id property: Query Template ARM ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Query Template ARM Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Query Template ARM Name. + * + * @param name the name value to set. + * @return the EntityQueryItem object itself. + */ + public EntityQueryItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: ARM Type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: ARM Type. + * + * @param type the type value to set. + * @return the EntityQueryItem object itself. + */ + public EntityQueryItem withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryItemProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryItemProperties.java new file mode 100644 index 000000000000..069a9d1884e4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryItemProperties.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An properties abstract Query item for entity. */ +@Fluent +public class EntityQueryItemProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityQueryItemProperties.class); + + /* + * Data types for template + */ + @JsonProperty(value = "dataTypes") + private List dataTypes; + + /* + * The type of the entity + */ + @JsonProperty(value = "inputEntityType") + private EntityType inputEntityType; + + /* + * Data types for template + */ + @JsonProperty(value = "requiredInputFieldsSets") + private List> requiredInputFieldsSets; + + /* + * The query applied only to entities matching to all filters + */ + @JsonProperty(value = "entitiesFilter") + private Object entitiesFilter; + + /** + * Get the dataTypes property: Data types for template. + * + * @return the dataTypes value. + */ + public List dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: Data types for template. + * + * @param dataTypes the dataTypes value to set. + * @return the EntityQueryItemProperties object itself. + */ + public EntityQueryItemProperties withDataTypes(List dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** + * Get the inputEntityType property: The type of the entity. + * + * @return the inputEntityType value. + */ + public EntityType inputEntityType() { + return this.inputEntityType; + } + + /** + * Set the inputEntityType property: The type of the entity. + * + * @param inputEntityType the inputEntityType value to set. + * @return the EntityQueryItemProperties object itself. + */ + public EntityQueryItemProperties withInputEntityType(EntityType inputEntityType) { + this.inputEntityType = inputEntityType; + return this; + } + + /** + * Get the requiredInputFieldsSets property: Data types for template. + * + * @return the requiredInputFieldsSets value. + */ + public List> requiredInputFieldsSets() { + return this.requiredInputFieldsSets; + } + + /** + * Set the requiredInputFieldsSets property: Data types for template. + * + * @param requiredInputFieldsSets the requiredInputFieldsSets value to set. + * @return the EntityQueryItemProperties object itself. + */ + public EntityQueryItemProperties withRequiredInputFieldsSets(List> requiredInputFieldsSets) { + this.requiredInputFieldsSets = requiredInputFieldsSets; + return this; + } + + /** + * Get the entitiesFilter property: The query applied only to entities matching to all filters. + * + * @return the entitiesFilter value. + */ + public Object entitiesFilter() { + return this.entitiesFilter; + } + + /** + * Set the entitiesFilter property: The query applied only to entities matching to all filters. + * + * @param entitiesFilter the entitiesFilter value to set. + * @return the EntityQueryItemProperties object itself. + */ + public EntityQueryItemProperties withEntitiesFilter(Object entitiesFilter) { + this.entitiesFilter = entitiesFilter; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataTypes() != null) { + dataTypes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryItemPropertiesDataTypesItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryItemPropertiesDataTypesItem.java new file mode 100644 index 000000000000..6a78ec9aba67 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryItemPropertiesDataTypesItem.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The EntityQueryItemPropertiesDataTypesItem model. */ +@Fluent +public final class EntityQueryItemPropertiesDataTypesItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityQueryItemPropertiesDataTypesItem.class); + + /* + * Data type name + */ + @JsonProperty(value = "dataType") + private String dataType; + + /** + * Get the dataType property: Data type name. + * + * @return the dataType value. + */ + public String dataType() { + return this.dataType; + } + + /** + * Set the dataType property: Data type name. + * + * @param dataType the dataType value to set. + * @return the EntityQueryItemPropertiesDataTypesItem object itself. + */ + public EntityQueryItemPropertiesDataTypesItem withDataType(String dataType) { + this.dataType = dataType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryKind.java new file mode 100644 index 000000000000..038e9f11ecb0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryKind.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EntityQueryKind. */ +public final class EntityQueryKind extends ExpandableStringEnum { + /** Static value Expansion for EntityQueryKind. */ + public static final EntityQueryKind EXPANSION = fromString("Expansion"); + + /** Static value Insight for EntityQueryKind. */ + public static final EntityQueryKind INSIGHT = fromString("Insight"); + + /** Static value Activity for EntityQueryKind. */ + public static final EntityQueryKind ACTIVITY = fromString("Activity"); + + /** + * Creates or finds a EntityQueryKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding EntityQueryKind. + */ + @JsonCreator + public static EntityQueryKind fromString(String name) { + return fromString(name, EntityQueryKind.class); + } + + /** @return known EntityQueryKind values. */ + public static Collection values() { + return values(EntityQueryKind.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryList.java new file mode 100644 index 000000000000..32d4eb730848 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryList.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of all the entity queries. */ +@Fluent +public final class EntityQueryList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityQueryList.class); + + /* + * URL to fetch the next set of entity queries. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of entity queries. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the nextLink property: URL to fetch the next set of entity queries. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of entity queries. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of entity queries. + * + * @param value the value value to set. + * @return the EntityQueryList object itself. + */ + public EntityQueryList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model EntityQueryList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplate.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplate.java new file mode 100644 index 000000000000..cb8a8e6b155e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplate.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryTemplateInner; + +/** An immutable client-side representation of EntityQueryTemplate. */ +public interface EntityQueryTemplate { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryTemplateInner object. + * + * @return the inner object. + */ + EntityQueryTemplateInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplateKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplateKind.java new file mode 100644 index 000000000000..c51329e309a7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplateKind.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EntityQueryTemplateKind. */ +public final class EntityQueryTemplateKind extends ExpandableStringEnum { + /** Static value Activity for EntityQueryTemplateKind. */ + public static final EntityQueryTemplateKind ACTIVITY = fromString("Activity"); + + /** + * Creates or finds a EntityQueryTemplateKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding EntityQueryTemplateKind. + */ + @JsonCreator + public static EntityQueryTemplateKind fromString(String name) { + return fromString(name, EntityQueryTemplateKind.class); + } + + /** @return known EntityQueryTemplateKind values. */ + public static Collection values() { + return values(EntityQueryTemplateKind.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplateList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplateList.java new file mode 100644 index 000000000000..e82c1b7044a1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplateList.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryTemplateInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of all the entity query templates. */ +@Fluent +public final class EntityQueryTemplateList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityQueryTemplateList.class); + + /* + * URL to fetch the next set of entity query templates. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of entity query templates. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the nextLink property: URL to fetch the next set of entity query templates. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of entity query templates. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of entity query templates. + * + * @param value the value value to set. + * @return the EntityQueryTemplateList object itself. + */ + public EntityQueryTemplateList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model EntityQueryTemplateList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplates.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplates.java new file mode 100644 index 000000000000..d3fb9e9e9610 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplates.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of EntityQueryTemplates. */ +public interface EntityQueryTemplates { + /** + * Gets all entity query templates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entity query templates. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all entity query templates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kind The entity template query kind we want to fetch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all entity query templates. + */ + PagedIterable list( + String resourceGroupName, String workspaceName, Constant69 kind, Context context); + + /** + * Gets an entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryTemplateId entity query template ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity query. + */ + EntityQueryTemplate get(String resourceGroupName, String workspaceName, String entityQueryTemplateId); + + /** + * Gets an entity query. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityQueryTemplateId entity query template ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity query. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String entityQueryTemplateId, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityRelations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityRelations.java new file mode 100644 index 000000000000..f8f10bcb29eb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityRelations.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of EntityRelations. */ +public interface EntityRelations { + /** + * Gets an entity relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity relation. + */ + Relation getRelation(String resourceGroupName, String workspaceName, String entityId, String relationName); + + /** + * Gets an entity relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityId entity ID. + * @param relationName Relation Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an entity relation. + */ + Response getRelationWithResponse( + String resourceGroupName, String workspaceName, String entityId, String relationName, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineItem.java new file mode 100644 index 000000000000..1c1d7a1e0633 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineItem.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Entity timeline Item. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = EntityTimelineItem.class) +@JsonTypeName("EntityTimelineItem") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Activity", value = ActivityTimelineItem.class), + @JsonSubTypes.Type(name = "Bookmark", value = BookmarkTimelineItem.class), + @JsonSubTypes.Type(name = "SecurityAlert", value = SecurityAlertTimelineItem.class) +}) +@Immutable +public class EntityTimelineItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityTimelineItem.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineKind.java new file mode 100644 index 000000000000..ac67e9c5a620 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineKind.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EntityTimelineKind. */ +public final class EntityTimelineKind extends ExpandableStringEnum { + /** Static value Activity for EntityTimelineKind. */ + public static final EntityTimelineKind ACTIVITY = fromString("Activity"); + + /** Static value Bookmark for EntityTimelineKind. */ + public static final EntityTimelineKind BOOKMARK = fromString("Bookmark"); + + /** Static value SecurityAlert for EntityTimelineKind. */ + public static final EntityTimelineKind SECURITY_ALERT = fromString("SecurityAlert"); + + /** + * Creates or finds a EntityTimelineKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding EntityTimelineKind. + */ + @JsonCreator + public static EntityTimelineKind fromString(String name) { + return fromString(name, EntityTimelineKind.class); + } + + /** @return known EntityTimelineKind values. */ + public static Collection values() { + return values(EntityTimelineKind.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineParameters.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineParameters.java new file mode 100644 index 000000000000..034984cf6be8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineParameters.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The parameters required to execute s timeline operation on the given entity. */ +@Fluent +public final class EntityTimelineParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityTimelineParameters.class); + + /* + * Array of timeline Item kinds. + */ + @JsonProperty(value = "kinds") + private List kinds; + + /* + * The start timeline date, so the results returned are after this date. + */ + @JsonProperty(value = "startTime", required = true) + private OffsetDateTime startTime; + + /* + * The end timeline date, so the results returned are before this date. + */ + @JsonProperty(value = "endTime", required = true) + private OffsetDateTime endTime; + + /* + * The number of bucket for timeline queries aggregation. + */ + @JsonProperty(value = "numberOfBucket") + private Integer numberOfBucket; + + /** + * Get the kinds property: Array of timeline Item kinds. + * + * @return the kinds value. + */ + public List kinds() { + return this.kinds; + } + + /** + * Set the kinds property: Array of timeline Item kinds. + * + * @param kinds the kinds value to set. + * @return the EntityTimelineParameters object itself. + */ + public EntityTimelineParameters withKinds(List kinds) { + this.kinds = kinds; + return this; + } + + /** + * Get the startTime property: The start timeline date, so the results returned are after this date. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start timeline date, so the results returned are after this date. + * + * @param startTime the startTime value to set. + * @return the EntityTimelineParameters object itself. + */ + public EntityTimelineParameters withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end timeline date, so the results returned are before this date. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end timeline date, so the results returned are before this date. + * + * @param endTime the endTime value to set. + * @return the EntityTimelineParameters object itself. + */ + public EntityTimelineParameters withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the numberOfBucket property: The number of bucket for timeline queries aggregation. + * + * @return the numberOfBucket value. + */ + public Integer numberOfBucket() { + return this.numberOfBucket; + } + + /** + * Set the numberOfBucket property: The number of bucket for timeline queries aggregation. + * + * @param numberOfBucket the numberOfBucket value to set. + * @return the EntityTimelineParameters object itself. + */ + public EntityTimelineParameters withNumberOfBucket(Integer numberOfBucket) { + this.numberOfBucket = numberOfBucket; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (startTime() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property startTime in model EntityTimelineParameters")); + } + if (endTime() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property endTime in model EntityTimelineParameters")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineResponse.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineResponse.java new file mode 100644 index 000000000000..f06f9e561d6b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineResponse.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.EntityTimelineResponseInner; +import java.util.List; + +/** An immutable client-side representation of EntityTimelineResponse. */ +public interface EntityTimelineResponse { + /** + * Gets the metadata property: The metadata from the timeline operation results. + * + * @return the metadata value. + */ + TimelineResultsMetadata metadata(); + + /** + * Gets the value property: The timeline result values. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.EntityTimelineResponseInner object. + * + * @return the inner object. + */ + EntityTimelineResponseInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityType.java new file mode 100644 index 000000000000..42337e79a751 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityType.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EntityType. */ +public final class EntityType extends ExpandableStringEnum { + /** Static value Account for EntityType. */ + public static final EntityType ACCOUNT = fromString("Account"); + + /** Static value Host for EntityType. */ + public static final EntityType HOST = fromString("Host"); + + /** Static value File for EntityType. */ + public static final EntityType FILE = fromString("File"); + + /** Static value AzureResource for EntityType. */ + public static final EntityType AZURE_RESOURCE = fromString("AzureResource"); + + /** Static value CloudApplication for EntityType. */ + public static final EntityType CLOUD_APPLICATION = fromString("CloudApplication"); + + /** Static value DNS for EntityType. */ + public static final EntityType DNS = fromString("DNS"); + + /** Static value FileHash for EntityType. */ + public static final EntityType FILE_HASH = fromString("FileHash"); + + /** Static value IP for EntityType. */ + public static final EntityType IP = fromString("IP"); + + /** Static value Malware for EntityType. */ + public static final EntityType MALWARE = fromString("Malware"); + + /** Static value Process for EntityType. */ + public static final EntityType PROCESS = fromString("Process"); + + /** Static value RegistryKey for EntityType. */ + public static final EntityType REGISTRY_KEY = fromString("RegistryKey"); + + /** Static value RegistryValue for EntityType. */ + public static final EntityType REGISTRY_VALUE = fromString("RegistryValue"); + + /** Static value SecurityGroup for EntityType. */ + public static final EntityType SECURITY_GROUP = fromString("SecurityGroup"); + + /** Static value URL for EntityType. */ + public static final EntityType URL = fromString("URL"); + + /** Static value IoTDevice for EntityType. */ + public static final EntityType IO_TDEVICE = fromString("IoTDevice"); + + /** Static value SecurityAlert for EntityType. */ + public static final EntityType SECURITY_ALERT = fromString("SecurityAlert"); + + /** Static value HuntingBookmark for EntityType. */ + public static final EntityType HUNTING_BOOKMARK = fromString("HuntingBookmark"); + + /** Static value MailCluster for EntityType. */ + public static final EntityType MAIL_CLUSTER = fromString("MailCluster"); + + /** Static value MailMessage for EntityType. */ + public static final EntityType MAIL_MESSAGE = fromString("MailMessage"); + + /** Static value Mailbox for EntityType. */ + public static final EntityType MAILBOX = fromString("Mailbox"); + + /** Static value SubmissionMail for EntityType. */ + public static final EntityType SUBMISSION_MAIL = fromString("SubmissionMail"); + + /** + * Creates or finds a EntityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EntityType. + */ + @JsonCreator + public static EntityType fromString(String name) { + return fromString(name, EntityType.class); + } + + /** @return known EntityType values. */ + public static Collection values() { + return values(EntityType.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EventGroupingAggregationKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EventGroupingAggregationKind.java new file mode 100644 index 000000000000..9c8fa56eb6e6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EventGroupingAggregationKind.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EventGroupingAggregationKind. */ +public final class EventGroupingAggregationKind extends ExpandableStringEnum { + /** Static value SingleAlert for EventGroupingAggregationKind. */ + public static final EventGroupingAggregationKind SINGLE_ALERT = fromString("SingleAlert"); + + /** Static value AlertPerResult for EventGroupingAggregationKind. */ + public static final EventGroupingAggregationKind ALERT_PER_RESULT = fromString("AlertPerResult"); + + /** + * Creates or finds a EventGroupingAggregationKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding EventGroupingAggregationKind. + */ + @JsonCreator + public static EventGroupingAggregationKind fromString(String name) { + return fromString(name, EventGroupingAggregationKind.class); + } + + /** @return known EventGroupingAggregationKind values. */ + public static Collection values() { + return values(EventGroupingAggregationKind.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EventGroupingSettings.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EventGroupingSettings.java new file mode 100644 index 000000000000..ff9cb25ed525 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EventGroupingSettings.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Event grouping settings property bag. */ +@Fluent +public final class EventGroupingSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventGroupingSettings.class); + + /* + * The event grouping aggregation kinds + */ + @JsonProperty(value = "aggregationKind") + private EventGroupingAggregationKind aggregationKind; + + /** + * Get the aggregationKind property: The event grouping aggregation kinds. + * + * @return the aggregationKind value. + */ + public EventGroupingAggregationKind aggregationKind() { + return this.aggregationKind; + } + + /** + * Set the aggregationKind property: The event grouping aggregation kinds. + * + * @param aggregationKind the aggregationKind value to set. + * @return the EventGroupingSettings object itself. + */ + public EventGroupingSettings withAggregationKind(EventGroupingAggregationKind aggregationKind) { + this.aggregationKind = aggregationKind; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ExpansionEntityQuery.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ExpansionEntityQuery.java new file mode 100644 index 000000000000..c974f4f3b2a4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ExpansionEntityQuery.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryInner; +import com.azure.resourcemanager.securityinsights.fluent.models.ExpansionEntityQueriesProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Represents Expansion entity query. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Expansion") +@Fluent +public final class ExpansionEntityQuery extends EntityQueryInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpansionEntityQuery.class); + + /* + * Expansion entity query properties + */ + @JsonProperty(value = "properties") + private ExpansionEntityQueriesProperties innerProperties; + + /** + * Get the innerProperties property: Expansion entity query properties. + * + * @return the innerProperties value. + */ + private ExpansionEntityQueriesProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public ExpansionEntityQuery withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the dataSources property: List of the data sources that are required to run the query. + * + * @return the dataSources value. + */ + public List dataSources() { + return this.innerProperties() == null ? null : this.innerProperties().dataSources(); + } + + /** + * Set the dataSources property: List of the data sources that are required to run the query. + * + * @param dataSources the dataSources value to set. + * @return the ExpansionEntityQuery object itself. + */ + public ExpansionEntityQuery withDataSources(List dataSources) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpansionEntityQueriesProperties(); + } + this.innerProperties().withDataSources(dataSources); + return this; + } + + /** + * Get the displayName property: The query display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The query display name. + * + * @param displayName the displayName value to set. + * @return the ExpansionEntityQuery object itself. + */ + public ExpansionEntityQuery withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpansionEntityQueriesProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the inputEntityType property: The type of the query's source entity. + * + * @return the inputEntityType value. + */ + public EntityType inputEntityType() { + return this.innerProperties() == null ? null : this.innerProperties().inputEntityType(); + } + + /** + * Set the inputEntityType property: The type of the query's source entity. + * + * @param inputEntityType the inputEntityType value to set. + * @return the ExpansionEntityQuery object itself. + */ + public ExpansionEntityQuery withInputEntityType(EntityType inputEntityType) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpansionEntityQueriesProperties(); + } + this.innerProperties().withInputEntityType(inputEntityType); + return this; + } + + /** + * Get the inputFields property: List of the fields of the source entity that are required to run the query. + * + * @return the inputFields value. + */ + public List inputFields() { + return this.innerProperties() == null ? null : this.innerProperties().inputFields(); + } + + /** + * Set the inputFields property: List of the fields of the source entity that are required to run the query. + * + * @param inputFields the inputFields value to set. + * @return the ExpansionEntityQuery object itself. + */ + public ExpansionEntityQuery withInputFields(List inputFields) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpansionEntityQueriesProperties(); + } + this.innerProperties().withInputFields(inputFields); + return this; + } + + /** + * Get the outputEntityTypes property: List of the desired output types to be constructed from the result. + * + * @return the outputEntityTypes value. + */ + public List outputEntityTypes() { + return this.innerProperties() == null ? null : this.innerProperties().outputEntityTypes(); + } + + /** + * Set the outputEntityTypes property: List of the desired output types to be constructed from the result. + * + * @param outputEntityTypes the outputEntityTypes value to set. + * @return the ExpansionEntityQuery object itself. + */ + public ExpansionEntityQuery withOutputEntityTypes(List outputEntityTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpansionEntityQueriesProperties(); + } + this.innerProperties().withOutputEntityTypes(outputEntityTypes); + return this; + } + + /** + * Get the queryTemplate property: The template query string to be parsed and formatted. + * + * @return the queryTemplate value. + */ + public String queryTemplate() { + return this.innerProperties() == null ? null : this.innerProperties().queryTemplate(); + } + + /** + * Set the queryTemplate property: The template query string to be parsed and formatted. + * + * @param queryTemplate the queryTemplate value to set. + * @return the ExpansionEntityQuery object itself. + */ + public ExpansionEntityQuery withQueryTemplate(String queryTemplate) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpansionEntityQueriesProperties(); + } + this.innerProperties().withQueryTemplate(queryTemplate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ExpansionResultAggregation.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ExpansionResultAggregation.java new file mode 100644 index 000000000000..48d48953572a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ExpansionResultAggregation.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Information of a specific aggregation in the expansion result. */ +@Fluent +public final class ExpansionResultAggregation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpansionResultAggregation.class); + + /* + * The common type of the aggregation. (for e.g. entity field name) + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /* + * Total number of aggregations of the given kind (and aggregationType if + * given) in the expansion result. + */ + @JsonProperty(value = "count", required = true) + private int count; + + /* + * The display name of the aggregation by type. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The kind of the aggregated entity. + */ + @JsonProperty(value = "entityKind", required = true) + private EntityKind entityKind; + + /** + * Get the aggregationType property: The common type of the aggregation. (for e.g. entity field name). + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregationType property: The common type of the aggregation. (for e.g. entity field name). + * + * @param aggregationType the aggregationType value to set. + * @return the ExpansionResultAggregation object itself. + */ + public ExpansionResultAggregation withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the count property: Total number of aggregations of the given kind (and aggregationType if given) in the + * expansion result. + * + * @return the count value. + */ + public int count() { + return this.count; + } + + /** + * Set the count property: Total number of aggregations of the given kind (and aggregationType if given) in the + * expansion result. + * + * @param count the count value to set. + * @return the ExpansionResultAggregation object itself. + */ + public ExpansionResultAggregation withCount(int count) { + this.count = count; + return this; + } + + /** + * Get the displayName property: The display name of the aggregation by type. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the aggregation by type. + * + * @param displayName the displayName value to set. + * @return the ExpansionResultAggregation object itself. + */ + public ExpansionResultAggregation withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the entityKind property: The kind of the aggregated entity. + * + * @return the entityKind value. + */ + public EntityKind entityKind() { + return this.entityKind; + } + + /** + * Set the entityKind property: The kind of the aggregated entity. + * + * @param entityKind the entityKind value to set. + * @return the ExpansionResultAggregation object itself. + */ + public ExpansionResultAggregation withEntityKind(EntityKind entityKind) { + this.entityKind = entityKind; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (entityKind() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property entityKind in model ExpansionResultAggregation")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ExpansionResultsMetadata.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ExpansionResultsMetadata.java new file mode 100644 index 000000000000..eb231730e4c2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ExpansionResultsMetadata.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Expansion result metadata. */ +@Fluent +public final class ExpansionResultsMetadata { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpansionResultsMetadata.class); + + /* + * Information of the aggregated nodes in the expansion result. + */ + @JsonProperty(value = "aggregations") + private List aggregations; + + /** + * Get the aggregations property: Information of the aggregated nodes in the expansion result. + * + * @return the aggregations value. + */ + public List aggregations() { + return this.aggregations; + } + + /** + * Set the aggregations property: Information of the aggregated nodes in the expansion result. + * + * @param aggregations the aggregations value to set. + * @return the ExpansionResultsMetadata object itself. + */ + public ExpansionResultsMetadata withAggregations(List aggregations) { + this.aggregations = aggregations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (aggregations() != null) { + aggregations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EyesOn.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EyesOn.java new file mode 100644 index 000000000000..68abbd7d0edf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EyesOn.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EyesOnSettingsProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Settings with single toggle. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("EyesOn") +@Fluent +public final class EyesOn extends SettingsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EyesOn.class); + + /* + * EyesOn properties + */ + @JsonProperty(value = "properties") + private EyesOnSettingsProperties innerProperties; + + /** + * Get the innerProperties property: EyesOn properties. + * + * @return the innerProperties value. + */ + private EyesOnSettingsProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public EyesOn withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the isEnabled property: Determines whether the setting is enable or disabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isEnabled(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FieldMapping.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FieldMapping.java new file mode 100644 index 000000000000..a241c73b4275 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FieldMapping.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A single field mapping of the mapped entity. */ +@Fluent +public final class FieldMapping { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FieldMapping.class); + + /* + * the V3 identifier of the entity + */ + @JsonProperty(value = "identifier") + private String identifier; + + /* + * the column name to be mapped to the identifier + */ + @JsonProperty(value = "columnName") + private String columnName; + + /** + * Get the identifier property: the V3 identifier of the entity. + * + * @return the identifier value. + */ + public String identifier() { + return this.identifier; + } + + /** + * Set the identifier property: the V3 identifier of the entity. + * + * @param identifier the identifier value to set. + * @return the FieldMapping object itself. + */ + public FieldMapping withIdentifier(String identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get the columnName property: the column name to be mapped to the identifier. + * + * @return the columnName value. + */ + public String columnName() { + return this.columnName; + } + + /** + * Set the columnName property: the column name to be mapped to the identifier. + * + * @param columnName the columnName value to set. + * @return the FieldMapping object itself. + */ + public FieldMapping withColumnName(String columnName) { + this.columnName = columnName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileEntity.java new file mode 100644 index 000000000000..22d7de5bc119 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileEntity.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.azure.resourcemanager.securityinsights.fluent.models.FileEntityProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Represents a file entity. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("File") +@Fluent +public final class FileEntity extends EntityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FileEntity.class); + + /* + * File entity properties + */ + @JsonProperty(value = "properties") + private FileEntityProperties innerProperties; + + /** + * Get the innerProperties property: File entity properties. + * + * @return the innerProperties value. + */ + private FileEntityProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the directory property: The full path to the file. + * + * @return the directory value. + */ + public String directory() { + return this.innerProperties() == null ? null : this.innerProperties().directory(); + } + + /** + * Get the fileHashEntityIds property: The file hash entity identifiers associated with this file. + * + * @return the fileHashEntityIds value. + */ + public List fileHashEntityIds() { + return this.innerProperties() == null ? null : this.innerProperties().fileHashEntityIds(); + } + + /** + * Get the fileName property: The file name without path (some alerts might not include path). + * + * @return the fileName value. + */ + public String fileName() { + return this.innerProperties() == null ? null : this.innerProperties().fileName(); + } + + /** + * Get the hostEntityId property: The Host entity id which the file belongs to. + * + * @return the hostEntityId value. + */ + public String hostEntityId() { + return this.innerProperties() == null ? null : this.innerProperties().hostEntityId(); + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileHashAlgorithm.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileHashAlgorithm.java new file mode 100644 index 000000000000..3ea302a75bbc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileHashAlgorithm.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FileHashAlgorithm. */ +public final class FileHashAlgorithm extends ExpandableStringEnum { + /** Static value Unknown for FileHashAlgorithm. */ + public static final FileHashAlgorithm UNKNOWN = fromString("Unknown"); + + /** Static value MD5 for FileHashAlgorithm. */ + public static final FileHashAlgorithm MD5 = fromString("MD5"); + + /** Static value SHA1 for FileHashAlgorithm. */ + public static final FileHashAlgorithm SHA1 = fromString("SHA1"); + + /** Static value SHA256 for FileHashAlgorithm. */ + public static final FileHashAlgorithm SHA256 = fromString("SHA256"); + + /** Static value SHA256AC for FileHashAlgorithm. */ + public static final FileHashAlgorithm SHA256AC = fromString("SHA256AC"); + + /** + * Creates or finds a FileHashAlgorithm from its string representation. + * + * @param name a name to look for. + * @return the corresponding FileHashAlgorithm. + */ + @JsonCreator + public static FileHashAlgorithm fromString(String name) { + return fromString(name, FileHashAlgorithm.class); + } + + /** @return known FileHashAlgorithm values. */ + public static Collection values() { + return values(FileHashAlgorithm.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileHashEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileHashEntity.java new file mode 100644 index 000000000000..5f6cb69abbad --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileHashEntity.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.azure.resourcemanager.securityinsights.fluent.models.FileHashEntityProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** Represents a file hash entity. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("FileHash") +@Fluent +public final class FileHashEntity extends EntityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FileHashEntity.class); + + /* + * FileHash entity properties + */ + @JsonProperty(value = "properties") + private FileHashEntityProperties innerProperties; + + /** + * Get the innerProperties property: FileHash entity properties. + * + * @return the innerProperties value. + */ + private FileHashEntityProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the algorithm property: The hash algorithm type. + * + * @return the algorithm value. + */ + public FileHashAlgorithm algorithm() { + return this.innerProperties() == null ? null : this.innerProperties().algorithm(); + } + + /** + * Get the hashValue property: The file hash value. + * + * @return the hashValue value. + */ + public String hashValue() { + return this.innerProperties() == null ? null : this.innerProperties().hashValue(); + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionAlertRule.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionAlertRule.java new file mode 100644 index 000000000000..fb5a2c11ea87 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionAlertRule.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; +import com.azure.resourcemanager.securityinsights.fluent.models.FusionAlertRuleProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** Represents Fusion alert rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Fusion") +@Fluent +public final class FusionAlertRule extends AlertRuleInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FusionAlertRule.class); + + /* + * Fusion alert rule properties + */ + @JsonProperty(value = "properties") + private FusionAlertRuleProperties innerProperties; + + /** + * Get the innerProperties property: Fusion alert rule properties. + * + * @return the innerProperties value. + */ + private FusionAlertRuleProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public FusionAlertRule withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. + * + * @return the alertRuleTemplateName value. + */ + public String alertRuleTemplateName() { + return this.innerProperties() == null ? null : this.innerProperties().alertRuleTemplateName(); + } + + /** + * Set the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. + * + * @param alertRuleTemplateName the alertRuleTemplateName value to set. + * @return the FusionAlertRule object itself. + */ + public FusionAlertRule withAlertRuleTemplateName(String alertRuleTemplateName) { + if (this.innerProperties() == null) { + this.innerProperties = new FusionAlertRuleProperties(); + } + this.innerProperties().withAlertRuleTemplateName(alertRuleTemplateName); + return this; + } + + /** + * Get the description property: The description of the alert rule. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Get the displayName property: The display name for alerts created by this alert rule. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Get the enabled property: Determines whether this alert rule is enabled or disabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.innerProperties() == null ? null : this.innerProperties().enabled(); + } + + /** + * Set the enabled property: Determines whether this alert rule is enabled or disabled. + * + * @param enabled the enabled value to set. + * @return the FusionAlertRule object itself. + */ + public FusionAlertRule withEnabled(Boolean enabled) { + if (this.innerProperties() == null) { + this.innerProperties = new FusionAlertRuleProperties(); + } + this.innerProperties().withEnabled(enabled); + return this; + } + + /** + * Get the lastModifiedUtc property: The last time that this alert has been modified. + * + * @return the lastModifiedUtc value. + */ + public OffsetDateTime lastModifiedUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedUtc(); + } + + /** + * Get the severity property: The severity for alerts created by this alert rule. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.innerProperties() == null ? null : this.innerProperties().severity(); + } + + /** + * Get the tactics property: The tactics of the alert rule. + * + * @return the tactics value. + */ + public List tactics() { + return this.innerProperties() == null ? null : this.innerProperties().tactics(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionAlertRuleTemplate.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionAlertRuleTemplate.java new file mode 100644 index 000000000000..77ae4505b164 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionAlertRuleTemplate.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; +import com.azure.resourcemanager.securityinsights.fluent.models.FusionAlertRuleTemplateProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** Represents Fusion alert rule template. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Fusion") +@Fluent +public final class FusionAlertRuleTemplate extends AlertRuleTemplateInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FusionAlertRuleTemplate.class); + + /* + * Fusion alert rule template properties + */ + @JsonProperty(value = "properties") + private FusionAlertRuleTemplateProperties innerProperties; + + /** + * Get the innerProperties property: Fusion alert rule template properties. + * + * @return the innerProperties value. + */ + private FusionAlertRuleTemplateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the severity property: The severity for alerts created by this alert rule. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.innerProperties() == null ? null : this.innerProperties().severity(); + } + + /** + * Set the severity property: The severity for alerts created by this alert rule. + * + * @param severity the severity value to set. + * @return the FusionAlertRuleTemplate object itself. + */ + public FusionAlertRuleTemplate withSeverity(AlertSeverity severity) { + if (this.innerProperties() == null) { + this.innerProperties = new FusionAlertRuleTemplateProperties(); + } + this.innerProperties().withSeverity(severity); + return this; + } + + /** + * Get the tactics property: The tactics of the alert rule template. + * + * @return the tactics value. + */ + public List tactics() { + return this.innerProperties() == null ? null : this.innerProperties().tactics(); + } + + /** + * Set the tactics property: The tactics of the alert rule template. + * + * @param tactics the tactics value to set. + * @return the FusionAlertRuleTemplate object itself. + */ + public FusionAlertRuleTemplate withTactics(List tactics) { + if (this.innerProperties() == null) { + this.innerProperties = new FusionAlertRuleTemplateProperties(); + } + this.innerProperties().withTactics(tactics); + return this; + } + + /** + * Get the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. + * + * @return the alertRulesCreatedByTemplateCount value. + */ + public Integer alertRulesCreatedByTemplateCount() { + return this.innerProperties() == null ? null : this.innerProperties().alertRulesCreatedByTemplateCount(); + } + + /** + * Set the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. + * + * @param alertRulesCreatedByTemplateCount the alertRulesCreatedByTemplateCount value to set. + * @return the FusionAlertRuleTemplate object itself. + */ + public FusionAlertRuleTemplate withAlertRulesCreatedByTemplateCount(Integer alertRulesCreatedByTemplateCount) { + if (this.innerProperties() == null) { + this.innerProperties = new FusionAlertRuleTemplateProperties(); + } + this.innerProperties().withAlertRulesCreatedByTemplateCount(alertRulesCreatedByTemplateCount); + return this; + } + + /** + * Get the lastUpdatedDateUtc property: The last time that this alert rule template has been updated. + * + * @return the lastUpdatedDateUtc value. + */ + public OffsetDateTime lastUpdatedDateUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedDateUtc(); + } + + /** + * Get the createdDateUtc property: The time that this alert rule template has been added. + * + * @return the createdDateUtc value. + */ + public OffsetDateTime createdDateUtc() { + return this.innerProperties() == null ? null : this.innerProperties().createdDateUtc(); + } + + /** + * Get the description property: The description of the alert rule template. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of the alert rule template. + * + * @param description the description value to set. + * @return the FusionAlertRuleTemplate object itself. + */ + public FusionAlertRuleTemplate withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new FusionAlertRuleTemplateProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the displayName property: The display name for alert rule template. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name for alert rule template. + * + * @param displayName the displayName value to set. + * @return the FusionAlertRuleTemplate object itself. + */ + public FusionAlertRuleTemplate withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new FusionAlertRuleTemplateProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the requiredDataConnectors property: The required data sources for this template. + * + * @return the requiredDataConnectors value. + */ + public List requiredDataConnectors() { + return this.innerProperties() == null ? null : this.innerProperties().requiredDataConnectors(); + } + + /** + * Set the requiredDataConnectors property: The required data sources for this template. + * + * @param requiredDataConnectors the requiredDataConnectors value to set. + * @return the FusionAlertRuleTemplate object itself. + */ + public FusionAlertRuleTemplate withRequiredDataConnectors( + List requiredDataConnectors) { + if (this.innerProperties() == null) { + this.innerProperties = new FusionAlertRuleTemplateProperties(); + } + this.innerProperties().withRequiredDataConnectors(requiredDataConnectors); + return this; + } + + /** + * Get the status property: The alert rule template status. + * + * @return the status value. + */ + public TemplateStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The alert rule template status. + * + * @param status the status value to set. + * @return the FusionAlertRuleTemplate object itself. + */ + public FusionAlertRuleTemplate withStatus(TemplateStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new FusionAlertRuleTemplateProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GeoLocation.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GeoLocation.java new file mode 100644 index 000000000000..ae9b9f03c933 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GeoLocation.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The geo-location context attached to the ip entity. */ +@Immutable +public final class GeoLocation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GeoLocation.class); + + /* + * Autonomous System Number + */ + @JsonProperty(value = "asn", access = JsonProperty.Access.WRITE_ONLY) + private Integer asn; + + /* + * City name + */ + @JsonProperty(value = "city", access = JsonProperty.Access.WRITE_ONLY) + private String city; + + /* + * The country code according to ISO 3166 format + */ + @JsonProperty(value = "countryCode", access = JsonProperty.Access.WRITE_ONLY) + private String countryCode; + + /* + * Country name according to ISO 3166 Alpha 2: the lowercase of the English + * Short Name + */ + @JsonProperty(value = "countryName", access = JsonProperty.Access.WRITE_ONLY) + private String countryName; + + /* + * The longitude of the identified location, expressed as a floating point + * number with range of -180 to 180, with positive numbers representing + * East and negative numbers representing West. Latitude and longitude are + * derived from the city or postal code. + */ + @JsonProperty(value = "latitude", access = JsonProperty.Access.WRITE_ONLY) + private Double latitude; + + /* + * The latitude of the identified location, expressed as a floating point + * number with range of - 90 to 90, with positive numbers representing + * North and negative numbers representing South. Latitude and longitude + * are derived from the city or postal code. + */ + @JsonProperty(value = "longitude", access = JsonProperty.Access.WRITE_ONLY) + private Double longitude; + + /* + * State name + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /** + * Get the asn property: Autonomous System Number. + * + * @return the asn value. + */ + public Integer asn() { + return this.asn; + } + + /** + * Get the city property: City name. + * + * @return the city value. + */ + public String city() { + return this.city; + } + + /** + * Get the countryCode property: The country code according to ISO 3166 format. + * + * @return the countryCode value. + */ + public String countryCode() { + return this.countryCode; + } + + /** + * Get the countryName property: Country name according to ISO 3166 Alpha 2: the lowercase of the English Short + * Name. + * + * @return the countryName value. + */ + public String countryName() { + return this.countryName; + } + + /** + * Get the latitude property: The longitude of the identified location, expressed as a floating point number with + * range of -180 to 180, with positive numbers representing East and negative numbers representing West. Latitude + * and longitude are derived from the city or postal code. + * + * @return the latitude value. + */ + public Double latitude() { + return this.latitude; + } + + /** + * Get the longitude property: The latitude of the identified location, expressed as a floating point number with + * range of - 90 to 90, with positive numbers representing North and negative numbers representing South. Latitude + * and longitude are derived from the city or postal code. + * + * @return the longitude value. + */ + public Double longitude() { + return this.longitude; + } + + /** + * Get the state property: State name. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetInsightsError.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetInsightsError.java new file mode 100644 index 000000000000..dceb5de6b44f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetInsightsError.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** GetInsights Query Errors. */ +@Fluent +public final class GetInsightsError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetInsightsError.class); + + /* + * the query kind + */ + @JsonProperty(value = "kind", required = true) + private String kind = "Insight"; + + /* + * the query id + */ + @JsonProperty(value = "queryId") + private String queryId; + + /* + * the error message + */ + @JsonProperty(value = "errorMessage", required = true) + private String errorMessage; + + /** Creates an instance of GetInsightsError class. */ + public GetInsightsError() { + kind = "Insight"; + } + + /** + * Get the kind property: the query kind. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: the query kind. + * + * @param kind the kind value to set. + * @return the GetInsightsError object itself. + */ + public GetInsightsError withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the queryId property: the query id. + * + * @return the queryId value. + */ + public String queryId() { + return this.queryId; + } + + /** + * Set the queryId property: the query id. + * + * @param queryId the queryId value to set. + * @return the GetInsightsError object itself. + */ + public GetInsightsError withQueryId(String queryId) { + this.queryId = queryId; + return this; + } + + /** + * Get the errorMessage property: the error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: the error message. + * + * @param errorMessage the errorMessage value to set. + * @return the GetInsightsError object itself. + */ + public GetInsightsError withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (errorMessage() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property errorMessage in model GetInsightsError")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetInsightsResultsMetadata.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetInsightsResultsMetadata.java new file mode 100644 index 000000000000..3aa3bdad333c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetInsightsResultsMetadata.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Get Insights result metadata. */ +@Fluent +public final class GetInsightsResultsMetadata { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetInsightsResultsMetadata.class); + + /* + * the total items found for the insights request + */ + @JsonProperty(value = "totalCount", required = true) + private int totalCount; + + /* + * information about the failed queries + */ + @JsonProperty(value = "errors") + private List errors; + + /** + * Get the totalCount property: the total items found for the insights request. + * + * @return the totalCount value. + */ + public int totalCount() { + return this.totalCount; + } + + /** + * Set the totalCount property: the total items found for the insights request. + * + * @param totalCount the totalCount value to set. + * @return the GetInsightsResultsMetadata object itself. + */ + public GetInsightsResultsMetadata withTotalCount(int totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Get the errors property: information about the failed queries. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Set the errors property: information about the failed queries. + * + * @param errors the errors value to set. + * @return the GetInsightsResultsMetadata object itself. + */ + public GetInsightsResultsMetadata withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (errors() != null) { + errors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetQueriesResponse.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetQueriesResponse.java new file mode 100644 index 000000000000..bb0a74c7e027 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetQueriesResponse.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.GetQueriesResponseInner; +import java.util.List; + +/** An immutable client-side representation of GetQueriesResponse. */ +public interface GetQueriesResponse { + /** + * Gets the value property: The query result values. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.GetQueriesResponseInner object. + * + * @return the inner object. + */ + GetQueriesResponseInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GraphQueries.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GraphQueries.java new file mode 100644 index 000000000000..5eec14465c7c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GraphQueries.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The graph query to show the current data status. */ +@Fluent +public class GraphQueries { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GraphQueries.class); + + /* + * the metric that the query is checking + */ + @JsonProperty(value = "metricName") + private String metricName; + + /* + * The legend for the graph + */ + @JsonProperty(value = "legend") + private String legend; + + /* + * The base query for the graph + */ + @JsonProperty(value = "baseQuery") + private String baseQuery; + + /** + * Get the metricName property: the metric that the query is checking. + * + * @return the metricName value. + */ + public String metricName() { + return this.metricName; + } + + /** + * Set the metricName property: the metric that the query is checking. + * + * @param metricName the metricName value to set. + * @return the GraphQueries object itself. + */ + public GraphQueries withMetricName(String metricName) { + this.metricName = metricName; + return this; + } + + /** + * Get the legend property: The legend for the graph. + * + * @return the legend value. + */ + public String legend() { + return this.legend; + } + + /** + * Set the legend property: The legend for the graph. + * + * @param legend the legend value to set. + * @return the GraphQueries object itself. + */ + public GraphQueries withLegend(String legend) { + this.legend = legend; + return this; + } + + /** + * Get the baseQuery property: The base query for the graph. + * + * @return the baseQuery value. + */ + public String baseQuery() { + return this.baseQuery; + } + + /** + * Set the baseQuery property: The base query for the graph. + * + * @param baseQuery the baseQuery value to set. + * @return the GraphQueries object itself. + */ + public GraphQueries withBaseQuery(String baseQuery) { + this.baseQuery = baseQuery; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GroupingConfiguration.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GroupingConfiguration.java new file mode 100644 index 000000000000..7b64a876157b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GroupingConfiguration.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.util.List; + +/** Grouping configuration property bag. */ +@Fluent +public final class GroupingConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GroupingConfiguration.class); + + /* + * Grouping enabled + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * Re-open closed matching incidents + */ + @JsonProperty(value = "reopenClosedIncident", required = true) + private boolean reopenClosedIncident; + + /* + * Limit the group to alerts created within the lookback duration (in ISO + * 8601 duration format) + */ + @JsonProperty(value = "lookbackDuration", required = true) + private Duration lookbackDuration; + + /* + * Grouping matching method. When method is Selected at least one of + * groupByEntities, groupByAlertDetails, groupByCustomDetails must be + * provided and not empty. + */ + @JsonProperty(value = "matchingMethod", required = true) + private MatchingMethod matchingMethod; + + /* + * A list of entity types to group by (when matchingMethod is Selected). + * Only entities defined in the current alert rule may be used. + */ + @JsonProperty(value = "groupByEntities") + private List groupByEntities; + + /* + * A list of alert details to group by (when matchingMethod is Selected) + */ + @JsonProperty(value = "groupByAlertDetails") + private List groupByAlertDetails; + + /* + * A list of custom details keys to group by (when matchingMethod is + * Selected). Only keys defined in the current alert rule may be used. + */ + @JsonProperty(value = "groupByCustomDetails") + private List groupByCustomDetails; + + /** + * Get the enabled property: Grouping enabled. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Grouping enabled. + * + * @param enabled the enabled value to set. + * @return the GroupingConfiguration object itself. + */ + public GroupingConfiguration withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the reopenClosedIncident property: Re-open closed matching incidents. + * + * @return the reopenClosedIncident value. + */ + public boolean reopenClosedIncident() { + return this.reopenClosedIncident; + } + + /** + * Set the reopenClosedIncident property: Re-open closed matching incidents. + * + * @param reopenClosedIncident the reopenClosedIncident value to set. + * @return the GroupingConfiguration object itself. + */ + public GroupingConfiguration withReopenClosedIncident(boolean reopenClosedIncident) { + this.reopenClosedIncident = reopenClosedIncident; + return this; + } + + /** + * Get the lookbackDuration property: Limit the group to alerts created within the lookback duration (in ISO 8601 + * duration format). + * + * @return the lookbackDuration value. + */ + public Duration lookbackDuration() { + return this.lookbackDuration; + } + + /** + * Set the lookbackDuration property: Limit the group to alerts created within the lookback duration (in ISO 8601 + * duration format). + * + * @param lookbackDuration the lookbackDuration value to set. + * @return the GroupingConfiguration object itself. + */ + public GroupingConfiguration withLookbackDuration(Duration lookbackDuration) { + this.lookbackDuration = lookbackDuration; + return this; + } + + /** + * Get the matchingMethod property: Grouping matching method. When method is Selected at least one of + * groupByEntities, groupByAlertDetails, groupByCustomDetails must be provided and not empty. + * + * @return the matchingMethod value. + */ + public MatchingMethod matchingMethod() { + return this.matchingMethod; + } + + /** + * Set the matchingMethod property: Grouping matching method. When method is Selected at least one of + * groupByEntities, groupByAlertDetails, groupByCustomDetails must be provided and not empty. + * + * @param matchingMethod the matchingMethod value to set. + * @return the GroupingConfiguration object itself. + */ + public GroupingConfiguration withMatchingMethod(MatchingMethod matchingMethod) { + this.matchingMethod = matchingMethod; + return this; + } + + /** + * Get the groupByEntities property: A list of entity types to group by (when matchingMethod is Selected). Only + * entities defined in the current alert rule may be used. + * + * @return the groupByEntities value. + */ + public List groupByEntities() { + return this.groupByEntities; + } + + /** + * Set the groupByEntities property: A list of entity types to group by (when matchingMethod is Selected). Only + * entities defined in the current alert rule may be used. + * + * @param groupByEntities the groupByEntities value to set. + * @return the GroupingConfiguration object itself. + */ + public GroupingConfiguration withGroupByEntities(List groupByEntities) { + this.groupByEntities = groupByEntities; + return this; + } + + /** + * Get the groupByAlertDetails property: A list of alert details to group by (when matchingMethod is Selected). + * + * @return the groupByAlertDetails value. + */ + public List groupByAlertDetails() { + return this.groupByAlertDetails; + } + + /** + * Set the groupByAlertDetails property: A list of alert details to group by (when matchingMethod is Selected). + * + * @param groupByAlertDetails the groupByAlertDetails value to set. + * @return the GroupingConfiguration object itself. + */ + public GroupingConfiguration withGroupByAlertDetails(List groupByAlertDetails) { + this.groupByAlertDetails = groupByAlertDetails; + return this; + } + + /** + * Get the groupByCustomDetails property: A list of custom details keys to group by (when matchingMethod is + * Selected). Only keys defined in the current alert rule may be used. + * + * @return the groupByCustomDetails value. + */ + public List groupByCustomDetails() { + return this.groupByCustomDetails; + } + + /** + * Set the groupByCustomDetails property: A list of custom details keys to group by (when matchingMethod is + * Selected). Only keys defined in the current alert rule may be used. + * + * @param groupByCustomDetails the groupByCustomDetails value to set. + * @return the GroupingConfiguration object itself. + */ + public GroupingConfiguration withGroupByCustomDetails(List groupByCustomDetails) { + this.groupByCustomDetails = groupByCustomDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (lookbackDuration() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property lookbackDuration in model GroupingConfiguration")); + } + if (matchingMethod() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property matchingMethod in model GroupingConfiguration")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HostEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HostEntity.java new file mode 100644 index 000000000000..7a8616936923 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HostEntity.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.azure.resourcemanager.securityinsights.fluent.models.HostEntityProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** Represents a host entity. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Host") +@Fluent +public final class HostEntity extends EntityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HostEntity.class); + + /* + * Host entity properties + */ + @JsonProperty(value = "properties") + private HostEntityProperties innerProperties; + + /** + * Get the innerProperties property: Host entity properties. + * + * @return the innerProperties value. + */ + private HostEntityProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the azureId property: The azure resource id of the VM. + * + * @return the azureId value. + */ + public String azureId() { + return this.innerProperties() == null ? null : this.innerProperties().azureId(); + } + + /** + * Get the dnsDomain property: The DNS domain that this host belongs to. Should contain the compete DNS suffix for + * the domain. + * + * @return the dnsDomain value. + */ + public String dnsDomain() { + return this.innerProperties() == null ? null : this.innerProperties().dnsDomain(); + } + + /** + * Get the hostname property: The hostname without the domain suffix. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Get the isDomainJoined property: Determines whether this host belongs to a domain. + * + * @return the isDomainJoined value. + */ + public Boolean isDomainJoined() { + return this.innerProperties() == null ? null : this.innerProperties().isDomainJoined(); + } + + /** + * Get the netBiosName property: The host name (pre-windows2000). + * + * @return the netBiosName value. + */ + public String netBiosName() { + return this.innerProperties() == null ? null : this.innerProperties().netBiosName(); + } + + /** + * Get the ntDomain property: The NT domain that this host belongs to. + * + * @return the ntDomain value. + */ + public String ntDomain() { + return this.innerProperties() == null ? null : this.innerProperties().ntDomain(); + } + + /** + * Get the omsAgentId property: The OMS agent id, if the host has OMS agent installed. + * + * @return the omsAgentId value. + */ + public String omsAgentId() { + return this.innerProperties() == null ? null : this.innerProperties().omsAgentId(); + } + + /** + * Get the osFamily property: The operating system type. + * + * @return the osFamily value. + */ + public OSFamily osFamily() { + return this.innerProperties() == null ? null : this.innerProperties().osFamily(); + } + + /** + * Set the osFamily property: The operating system type. + * + * @param osFamily the osFamily value to set. + * @return the HostEntity object itself. + */ + public HostEntity withOsFamily(OSFamily osFamily) { + if (this.innerProperties() == null) { + this.innerProperties = new HostEntityProperties(); + } + this.innerProperties().withOsFamily(osFamily); + return this; + } + + /** + * Get the osVersion property: A free text representation of the operating system. This field is meant to hold + * specific versions the are more fine grained than OSFamily or future values not supported by OSFamily enumeration. + * + * @return the osVersion value. + */ + public String osVersion() { + return this.innerProperties() == null ? null : this.innerProperties().osVersion(); + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntingBookmark.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntingBookmark.java new file mode 100644 index 000000000000..e043b1c3ce00 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntingBookmark.java @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntingBookmarkProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Represents a Hunting bookmark entity. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Bookmark") +@Fluent +public final class HuntingBookmark extends EntityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HuntingBookmark.class); + + /* + * HuntingBookmark entity properties + */ + @JsonProperty(value = "properties") + private HuntingBookmarkProperties innerProperties; + + /** + * Get the innerProperties property: HuntingBookmark entity properties. + * + * @return the innerProperties value. + */ + private HuntingBookmarkProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the created property: The time the bookmark was created. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.innerProperties() == null ? null : this.innerProperties().created(); + } + + /** + * Set the created property: The time the bookmark was created. + * + * @param created the created value to set. + * @return the HuntingBookmark object itself. + */ + public HuntingBookmark withCreated(OffsetDateTime created) { + if (this.innerProperties() == null) { + this.innerProperties = new HuntingBookmarkProperties(); + } + this.innerProperties().withCreated(created); + return this; + } + + /** + * Get the createdBy property: Describes a user that created the bookmark. + * + * @return the createdBy value. + */ + public UserInfo createdBy() { + return this.innerProperties() == null ? null : this.innerProperties().createdBy(); + } + + /** + * Set the createdBy property: Describes a user that created the bookmark. + * + * @param createdBy the createdBy value to set. + * @return the HuntingBookmark object itself. + */ + public HuntingBookmark withCreatedBy(UserInfo createdBy) { + if (this.innerProperties() == null) { + this.innerProperties = new HuntingBookmarkProperties(); + } + this.innerProperties().withCreatedBy(createdBy); + return this; + } + + /** + * Get the displayName property: The display name of the bookmark. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name of the bookmark. + * + * @param displayName the displayName value to set. + * @return the HuntingBookmark object itself. + */ + public HuntingBookmark withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new HuntingBookmarkProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the eventTime property: The time of the event. + * + * @return the eventTime value. + */ + public OffsetDateTime eventTime() { + return this.innerProperties() == null ? null : this.innerProperties().eventTime(); + } + + /** + * Set the eventTime property: The time of the event. + * + * @param eventTime the eventTime value to set. + * @return the HuntingBookmark object itself. + */ + public HuntingBookmark withEventTime(OffsetDateTime eventTime) { + if (this.innerProperties() == null) { + this.innerProperties = new HuntingBookmarkProperties(); + } + this.innerProperties().withEventTime(eventTime); + return this; + } + + /** + * Get the labels property: List of labels relevant to this bookmark. + * + * @return the labels value. + */ + public List labels() { + return this.innerProperties() == null ? null : this.innerProperties().labels(); + } + + /** + * Set the labels property: List of labels relevant to this bookmark. + * + * @param labels the labels value to set. + * @return the HuntingBookmark object itself. + */ + public HuntingBookmark withLabels(List labels) { + if (this.innerProperties() == null) { + this.innerProperties = new HuntingBookmarkProperties(); + } + this.innerProperties().withLabels(labels); + return this; + } + + /** + * Get the notes property: The notes of the bookmark. + * + * @return the notes value. + */ + public String notes() { + return this.innerProperties() == null ? null : this.innerProperties().notes(); + } + + /** + * Set the notes property: The notes of the bookmark. + * + * @param notes the notes value to set. + * @return the HuntingBookmark object itself. + */ + public HuntingBookmark withNotes(String notes) { + if (this.innerProperties() == null) { + this.innerProperties = new HuntingBookmarkProperties(); + } + this.innerProperties().withNotes(notes); + return this; + } + + /** + * Get the query property: The query of the bookmark. + * + * @return the query value. + */ + public String query() { + return this.innerProperties() == null ? null : this.innerProperties().query(); + } + + /** + * Set the query property: The query of the bookmark. + * + * @param query the query value to set. + * @return the HuntingBookmark object itself. + */ + public HuntingBookmark withQuery(String query) { + if (this.innerProperties() == null) { + this.innerProperties = new HuntingBookmarkProperties(); + } + this.innerProperties().withQuery(query); + return this; + } + + /** + * Get the queryResult property: The query result of the bookmark. + * + * @return the queryResult value. + */ + public String queryResult() { + return this.innerProperties() == null ? null : this.innerProperties().queryResult(); + } + + /** + * Set the queryResult property: The query result of the bookmark. + * + * @param queryResult the queryResult value to set. + * @return the HuntingBookmark object itself. + */ + public HuntingBookmark withQueryResult(String queryResult) { + if (this.innerProperties() == null) { + this.innerProperties = new HuntingBookmarkProperties(); + } + this.innerProperties().withQueryResult(queryResult); + return this; + } + + /** + * Get the updated property: The last time the bookmark was updated. + * + * @return the updated value. + */ + public OffsetDateTime updated() { + return this.innerProperties() == null ? null : this.innerProperties().updated(); + } + + /** + * Set the updated property: The last time the bookmark was updated. + * + * @param updated the updated value to set. + * @return the HuntingBookmark object itself. + */ + public HuntingBookmark withUpdated(OffsetDateTime updated) { + if (this.innerProperties() == null) { + this.innerProperties = new HuntingBookmarkProperties(); + } + this.innerProperties().withUpdated(updated); + return this; + } + + /** + * Get the updatedBy property: Describes a user that updated the bookmark. + * + * @return the updatedBy value. + */ + public UserInfo updatedBy() { + return this.innerProperties() == null ? null : this.innerProperties().updatedBy(); + } + + /** + * Set the updatedBy property: Describes a user that updated the bookmark. + * + * @param updatedBy the updatedBy value to set. + * @return the HuntingBookmark object itself. + */ + public HuntingBookmark withUpdatedBy(UserInfo updatedBy) { + if (this.innerProperties() == null) { + this.innerProperties = new HuntingBookmarkProperties(); + } + this.innerProperties().withUpdatedBy(updatedBy); + return this; + } + + /** + * Get the incidentInfo property: Describes an incident that relates to bookmark. + * + * @return the incidentInfo value. + */ + public IncidentInfo incidentInfo() { + return this.innerProperties() == null ? null : this.innerProperties().incidentInfo(); + } + + /** + * Set the incidentInfo property: Describes an incident that relates to bookmark. + * + * @param incidentInfo the incidentInfo value to set. + * @return the HuntingBookmark object itself. + */ + public HuntingBookmark withIncidentInfo(IncidentInfo incidentInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new HuntingBookmarkProperties(); + } + this.innerProperties().withIncidentInfo(incidentInfo); + return this; + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Incident.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Incident.java new file mode 100644 index 000000000000..01cdeed669b0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Incident.java @@ -0,0 +1,694 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentInner; +import com.azure.resourcemanager.securityinsights.fluent.models.TeamInformationInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of Incident. */ +public interface Incident { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the additionalData property: Additional data on the incident. + * + * @return the additionalData value. + */ + IncidentAdditionalData additionalData(); + + /** + * Gets the classification property: The reason the incident was closed. + * + * @return the classification value. + */ + IncidentClassification classification(); + + /** + * Gets the classificationComment property: Describes the reason the incident was closed. + * + * @return the classificationComment value. + */ + String classificationComment(); + + /** + * Gets the classificationReason property: The classification reason the incident was closed with. + * + * @return the classificationReason value. + */ + IncidentClassificationReason classificationReason(); + + /** + * Gets the createdTimeUtc property: The time the incident was created. + * + * @return the createdTimeUtc value. + */ + OffsetDateTime createdTimeUtc(); + + /** + * Gets the description property: The description of the incident. + * + * @return the description value. + */ + String description(); + + /** + * Gets the firstActivityTimeUtc property: The time of the first activity in the incident. + * + * @return the firstActivityTimeUtc value. + */ + OffsetDateTime firstActivityTimeUtc(); + + /** + * Gets the incidentUrl property: The deep-link url to the incident in Azure portal. + * + * @return the incidentUrl value. + */ + String incidentUrl(); + + /** + * Gets the incidentNumber property: A sequential number. + * + * @return the incidentNumber value. + */ + Integer incidentNumber(); + + /** + * Gets the labels property: List of labels relevant to this incident. + * + * @return the labels value. + */ + List labels(); + + /** + * Gets the providerName property: The name of the source provider that generated the incident. + * + * @return the providerName value. + */ + String providerName(); + + /** + * Gets the providerIncidentId property: The incident ID assigned by the incident provider. + * + * @return the providerIncidentId value. + */ + String providerIncidentId(); + + /** + * Gets the lastActivityTimeUtc property: The time of the last activity in the incident. + * + * @return the lastActivityTimeUtc value. + */ + OffsetDateTime lastActivityTimeUtc(); + + /** + * Gets the lastModifiedTimeUtc property: The last time the incident was updated. + * + * @return the lastModifiedTimeUtc value. + */ + OffsetDateTime lastModifiedTimeUtc(); + + /** + * Gets the owner property: Describes a user that the incident is assigned to. + * + * @return the owner value. + */ + IncidentOwnerInfo owner(); + + /** + * Gets the relatedAnalyticRuleIds property: List of resource ids of Analytic rules related to the incident. + * + * @return the relatedAnalyticRuleIds value. + */ + List relatedAnalyticRuleIds(); + + /** + * Gets the severity property: The severity of the incident. + * + * @return the severity value. + */ + IncidentSeverity severity(); + + /** + * Gets the status property: The status of the incident. + * + * @return the status value. + */ + IncidentStatus status(); + + /** + * Gets the teamInformation property: Describes a team for the incident. + * + * @return the teamInformation value. + */ + TeamInformation teamInformation(); + + /** + * Gets the title property: The title of the incident. + * + * @return the title value. + */ + String title(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.IncidentInner object. + * + * @return the inner object. + */ + IncidentInner innerModel(); + + /** The entirety of the Incident definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Incident definition stages. */ + interface DefinitionStages { + /** The first stage of the Incident definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Incident definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @return the next definition stage. + */ + WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); + } + /** + * The stage of the Incident definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithEtag, + DefinitionStages.WithClassification, + DefinitionStages.WithClassificationComment, + DefinitionStages.WithClassificationReason, + DefinitionStages.WithDescription, + DefinitionStages.WithFirstActivityTimeUtc, + DefinitionStages.WithLabels, + DefinitionStages.WithProviderName, + DefinitionStages.WithProviderIncidentId, + DefinitionStages.WithLastActivityTimeUtc, + DefinitionStages.WithOwner, + DefinitionStages.WithSeverity, + DefinitionStages.WithStatus, + DefinitionStages.WithTeamInformation, + DefinitionStages.WithTitle { + /** + * Executes the create request. + * + * @return the created resource. + */ + Incident create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Incident create(Context context); + } + /** The stage of the Incident definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Etag of the azure resource. + * + * @param etag Etag of the azure resource. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the Incident definition allowing to specify classification. */ + interface WithClassification { + /** + * Specifies the classification property: The reason the incident was closed. + * + * @param classification The reason the incident was closed. + * @return the next definition stage. + */ + WithCreate withClassification(IncidentClassification classification); + } + /** The stage of the Incident definition allowing to specify classificationComment. */ + interface WithClassificationComment { + /** + * Specifies the classificationComment property: Describes the reason the incident was closed. + * + * @param classificationComment Describes the reason the incident was closed. + * @return the next definition stage. + */ + WithCreate withClassificationComment(String classificationComment); + } + /** The stage of the Incident definition allowing to specify classificationReason. */ + interface WithClassificationReason { + /** + * Specifies the classificationReason property: The classification reason the incident was closed with. + * + * @param classificationReason The classification reason the incident was closed with. + * @return the next definition stage. + */ + WithCreate withClassificationReason(IncidentClassificationReason classificationReason); + } + /** The stage of the Incident definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The description of the incident. + * + * @param description The description of the incident. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the Incident definition allowing to specify firstActivityTimeUtc. */ + interface WithFirstActivityTimeUtc { + /** + * Specifies the firstActivityTimeUtc property: The time of the first activity in the incident. + * + * @param firstActivityTimeUtc The time of the first activity in the incident. + * @return the next definition stage. + */ + WithCreate withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc); + } + /** The stage of the Incident definition allowing to specify labels. */ + interface WithLabels { + /** + * Specifies the labels property: List of labels relevant to this incident. + * + * @param labels List of labels relevant to this incident. + * @return the next definition stage. + */ + WithCreate withLabels(List labels); + } + /** The stage of the Incident definition allowing to specify providerName. */ + interface WithProviderName { + /** + * Specifies the providerName property: The name of the source provider that generated the incident. + * + * @param providerName The name of the source provider that generated the incident. + * @return the next definition stage. + */ + WithCreate withProviderName(String providerName); + } + /** The stage of the Incident definition allowing to specify providerIncidentId. */ + interface WithProviderIncidentId { + /** + * Specifies the providerIncidentId property: The incident ID assigned by the incident provider. + * + * @param providerIncidentId The incident ID assigned by the incident provider. + * @return the next definition stage. + */ + WithCreate withProviderIncidentId(String providerIncidentId); + } + /** The stage of the Incident definition allowing to specify lastActivityTimeUtc. */ + interface WithLastActivityTimeUtc { + /** + * Specifies the lastActivityTimeUtc property: The time of the last activity in the incident. + * + * @param lastActivityTimeUtc The time of the last activity in the incident. + * @return the next definition stage. + */ + WithCreate withLastActivityTimeUtc(OffsetDateTime lastActivityTimeUtc); + } + /** The stage of the Incident definition allowing to specify owner. */ + interface WithOwner { + /** + * Specifies the owner property: Describes a user that the incident is assigned to. + * + * @param owner Describes a user that the incident is assigned to. + * @return the next definition stage. + */ + WithCreate withOwner(IncidentOwnerInfo owner); + } + /** The stage of the Incident definition allowing to specify severity. */ + interface WithSeverity { + /** + * Specifies the severity property: The severity of the incident. + * + * @param severity The severity of the incident. + * @return the next definition stage. + */ + WithCreate withSeverity(IncidentSeverity severity); + } + /** The stage of the Incident definition allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: The status of the incident. + * + * @param status The status of the incident. + * @return the next definition stage. + */ + WithCreate withStatus(IncidentStatus status); + } + /** The stage of the Incident definition allowing to specify teamInformation. */ + interface WithTeamInformation { + /** + * Specifies the teamInformation property: Describes a team for the incident. + * + * @param teamInformation Describes a team for the incident. + * @return the next definition stage. + */ + WithCreate withTeamInformation(TeamInformationInner teamInformation); + } + /** The stage of the Incident definition allowing to specify title. */ + interface WithTitle { + /** + * Specifies the title property: The title of the incident. + * + * @param title The title of the incident. + * @return the next definition stage. + */ + WithCreate withTitle(String title); + } + } + /** + * Begins update for the Incident resource. + * + * @return the stage of resource update. + */ + Incident.Update update(); + + /** The template for Incident update. */ + interface Update + extends UpdateStages.WithEtag, + UpdateStages.WithClassification, + UpdateStages.WithClassificationComment, + UpdateStages.WithClassificationReason, + UpdateStages.WithDescription, + UpdateStages.WithFirstActivityTimeUtc, + UpdateStages.WithLabels, + UpdateStages.WithProviderName, + UpdateStages.WithProviderIncidentId, + UpdateStages.WithLastActivityTimeUtc, + UpdateStages.WithOwner, + UpdateStages.WithSeverity, + UpdateStages.WithStatus, + UpdateStages.WithTeamInformation, + UpdateStages.WithTitle { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Incident apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Incident apply(Context context); + } + /** The Incident update stages. */ + interface UpdateStages { + /** The stage of the Incident update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Etag of the azure resource. + * + * @param etag Etag of the azure resource. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + /** The stage of the Incident update allowing to specify classification. */ + interface WithClassification { + /** + * Specifies the classification property: The reason the incident was closed. + * + * @param classification The reason the incident was closed. + * @return the next definition stage. + */ + Update withClassification(IncidentClassification classification); + } + /** The stage of the Incident update allowing to specify classificationComment. */ + interface WithClassificationComment { + /** + * Specifies the classificationComment property: Describes the reason the incident was closed. + * + * @param classificationComment Describes the reason the incident was closed. + * @return the next definition stage. + */ + Update withClassificationComment(String classificationComment); + } + /** The stage of the Incident update allowing to specify classificationReason. */ + interface WithClassificationReason { + /** + * Specifies the classificationReason property: The classification reason the incident was closed with. + * + * @param classificationReason The classification reason the incident was closed with. + * @return the next definition stage. + */ + Update withClassificationReason(IncidentClassificationReason classificationReason); + } + /** The stage of the Incident update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The description of the incident. + * + * @param description The description of the incident. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the Incident update allowing to specify firstActivityTimeUtc. */ + interface WithFirstActivityTimeUtc { + /** + * Specifies the firstActivityTimeUtc property: The time of the first activity in the incident. + * + * @param firstActivityTimeUtc The time of the first activity in the incident. + * @return the next definition stage. + */ + Update withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc); + } + /** The stage of the Incident update allowing to specify labels. */ + interface WithLabels { + /** + * Specifies the labels property: List of labels relevant to this incident. + * + * @param labels List of labels relevant to this incident. + * @return the next definition stage. + */ + Update withLabels(List labels); + } + /** The stage of the Incident update allowing to specify providerName. */ + interface WithProviderName { + /** + * Specifies the providerName property: The name of the source provider that generated the incident. + * + * @param providerName The name of the source provider that generated the incident. + * @return the next definition stage. + */ + Update withProviderName(String providerName); + } + /** The stage of the Incident update allowing to specify providerIncidentId. */ + interface WithProviderIncidentId { + /** + * Specifies the providerIncidentId property: The incident ID assigned by the incident provider. + * + * @param providerIncidentId The incident ID assigned by the incident provider. + * @return the next definition stage. + */ + Update withProviderIncidentId(String providerIncidentId); + } + /** The stage of the Incident update allowing to specify lastActivityTimeUtc. */ + interface WithLastActivityTimeUtc { + /** + * Specifies the lastActivityTimeUtc property: The time of the last activity in the incident. + * + * @param lastActivityTimeUtc The time of the last activity in the incident. + * @return the next definition stage. + */ + Update withLastActivityTimeUtc(OffsetDateTime lastActivityTimeUtc); + } + /** The stage of the Incident update allowing to specify owner. */ + interface WithOwner { + /** + * Specifies the owner property: Describes a user that the incident is assigned to. + * + * @param owner Describes a user that the incident is assigned to. + * @return the next definition stage. + */ + Update withOwner(IncidentOwnerInfo owner); + } + /** The stage of the Incident update allowing to specify severity. */ + interface WithSeverity { + /** + * Specifies the severity property: The severity of the incident. + * + * @param severity The severity of the incident. + * @return the next definition stage. + */ + Update withSeverity(IncidentSeverity severity); + } + /** The stage of the Incident update allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: The status of the incident. + * + * @param status The status of the incident. + * @return the next definition stage. + */ + Update withStatus(IncidentStatus status); + } + /** The stage of the Incident update allowing to specify teamInformation. */ + interface WithTeamInformation { + /** + * Specifies the teamInformation property: Describes a team for the incident. + * + * @param teamInformation Describes a team for the incident. + * @return the next definition stage. + */ + Update withTeamInformation(TeamInformationInner teamInformation); + } + /** The stage of the Incident update allowing to specify title. */ + interface WithTitle { + /** + * Specifies the title property: The title of the incident. + * + * @param title The title of the incident. + * @return the next definition stage. + */ + Update withTitle(String title); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Incident refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Incident refresh(Context context); + + /** + * Creates a Microsoft team to investigate the incident by sharing information and insights between participants. + * + * @param teamProperties Team properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes team information. + */ + TeamInformation createTeam(TeamProperties teamProperties); + + /** + * Creates a Microsoft team to investigate the incident by sharing information and insights between participants. + * + * @param teamProperties Team properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes team information. + */ + Response createTeamWithResponse(TeamProperties teamProperties, Context context); + + /** + * Gets all incident alerts. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident alerts. + */ + IncidentAlertList listAlerts(); + + /** + * Gets all incident alerts. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident alerts. + */ + Response listAlertsWithResponse(Context context); + + /** + * Gets all incident bookmarks. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident bookmarks. + */ + IncidentBookmarkList listBookmarks(); + + /** + * Gets all incident bookmarks. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident bookmarks. + */ + Response listBookmarksWithResponse(Context context); + + /** + * Gets all incident related entities. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident related entities. + */ + IncidentEntitiesResponse listEntities(); + + /** + * Gets all incident related entities. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident related entities. + */ + Response listEntitiesWithResponse(Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentAdditionalData.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentAdditionalData.java new file mode 100644 index 000000000000..196d81f538bf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentAdditionalData.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Incident additional data property bag. */ +@Immutable +public final class IncidentAdditionalData { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IncidentAdditionalData.class); + + /* + * The number of alerts in the incident + */ + @JsonProperty(value = "alertsCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer alertsCount; + + /* + * The number of bookmarks in the incident + */ + @JsonProperty(value = "bookmarksCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer bookmarksCount; + + /* + * The number of comments in the incident + */ + @JsonProperty(value = "commentsCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer commentsCount; + + /* + * List of product names of alerts in the incident + */ + @JsonProperty(value = "alertProductNames", access = JsonProperty.Access.WRITE_ONLY) + private List alertProductNames; + + /* + * The tactics associated with incident + */ + @JsonProperty(value = "tactics", access = JsonProperty.Access.WRITE_ONLY) + private List tactics; + + /** + * Get the alertsCount property: The number of alerts in the incident. + * + * @return the alertsCount value. + */ + public Integer alertsCount() { + return this.alertsCount; + } + + /** + * Get the bookmarksCount property: The number of bookmarks in the incident. + * + * @return the bookmarksCount value. + */ + public Integer bookmarksCount() { + return this.bookmarksCount; + } + + /** + * Get the commentsCount property: The number of comments in the incident. + * + * @return the commentsCount value. + */ + public Integer commentsCount() { + return this.commentsCount; + } + + /** + * Get the alertProductNames property: List of product names of alerts in the incident. + * + * @return the alertProductNames value. + */ + public List alertProductNames() { + return this.alertProductNames; + } + + /** + * Get the tactics property: The tactics associated with incident. + * + * @return the tactics value. + */ + public List tactics() { + return this.tactics; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentAlertList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentAlertList.java new file mode 100644 index 000000000000..afbf75330535 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentAlertList.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentAlertListInner; +import java.util.List; + +/** An immutable client-side representation of IncidentAlertList. */ +public interface IncidentAlertList { + /** + * Gets the value property: Array of incident alerts. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.IncidentAlertListInner object. + * + * @return the inner object. + */ + IncidentAlertListInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentBookmarkList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentBookmarkList.java new file mode 100644 index 000000000000..8bcb3e64a075 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentBookmarkList.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentBookmarkListInner; +import java.util.List; + +/** An immutable client-side representation of IncidentBookmarkList. */ +public interface IncidentBookmarkList { + /** + * Gets the value property: Array of incident bookmarks. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.IncidentBookmarkListInner object. + * + * @return the inner object. + */ + IncidentBookmarkListInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentClassification.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentClassification.java new file mode 100644 index 000000000000..1c95a4a7dda8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentClassification.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IncidentClassification. */ +public final class IncidentClassification extends ExpandableStringEnum { + /** Static value Undetermined for IncidentClassification. */ + public static final IncidentClassification UNDETERMINED = fromString("Undetermined"); + + /** Static value TruePositive for IncidentClassification. */ + public static final IncidentClassification TRUE_POSITIVE = fromString("TruePositive"); + + /** Static value BenignPositive for IncidentClassification. */ + public static final IncidentClassification BENIGN_POSITIVE = fromString("BenignPositive"); + + /** Static value FalsePositive for IncidentClassification. */ + public static final IncidentClassification FALSE_POSITIVE = fromString("FalsePositive"); + + /** + * Creates or finds a IncidentClassification from its string representation. + * + * @param name a name to look for. + * @return the corresponding IncidentClassification. + */ + @JsonCreator + public static IncidentClassification fromString(String name) { + return fromString(name, IncidentClassification.class); + } + + /** @return known IncidentClassification values. */ + public static Collection values() { + return values(IncidentClassification.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentClassificationReason.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentClassificationReason.java new file mode 100644 index 000000000000..72b8025bc5db --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentClassificationReason.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IncidentClassificationReason. */ +public final class IncidentClassificationReason extends ExpandableStringEnum { + /** Static value SuspiciousActivity for IncidentClassificationReason. */ + public static final IncidentClassificationReason SUSPICIOUS_ACTIVITY = fromString("SuspiciousActivity"); + + /** Static value SuspiciousButExpected for IncidentClassificationReason. */ + public static final IncidentClassificationReason SUSPICIOUS_BUT_EXPECTED = fromString("SuspiciousButExpected"); + + /** Static value IncorrectAlertLogic for IncidentClassificationReason. */ + public static final IncidentClassificationReason INCORRECT_ALERT_LOGIC = fromString("IncorrectAlertLogic"); + + /** Static value InaccurateData for IncidentClassificationReason. */ + public static final IncidentClassificationReason INACCURATE_DATA = fromString("InaccurateData"); + + /** + * Creates or finds a IncidentClassificationReason from its string representation. + * + * @param name a name to look for. + * @return the corresponding IncidentClassificationReason. + */ + @JsonCreator + public static IncidentClassificationReason fromString(String name) { + return fromString(name, IncidentClassificationReason.class); + } + + /** @return known IncidentClassificationReason values. */ + public static Collection values() { + return values(IncidentClassificationReason.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentComment.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentComment.java new file mode 100644 index 000000000000..7accd32c581b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentComment.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentCommentInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of IncidentComment. */ +public interface IncidentComment { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the createdTimeUtc property: The time the comment was created. + * + * @return the createdTimeUtc value. + */ + OffsetDateTime createdTimeUtc(); + + /** + * Gets the lastModifiedTimeUtc property: The time the comment was updated. + * + * @return the lastModifiedTimeUtc value. + */ + OffsetDateTime lastModifiedTimeUtc(); + + /** + * Gets the message property: The comment message. + * + * @return the message value. + */ + String message(); + + /** + * Gets the author property: Describes the client that created the comment. + * + * @return the author value. + */ + ClientInfo author(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.IncidentCommentInner object. + * + * @return the inner object. + */ + IncidentCommentInner innerModel(); + + /** The entirety of the IncidentComment definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The IncidentComment definition stages. */ + interface DefinitionStages { + /** The first stage of the IncidentComment definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the IncidentComment definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName, incidentId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @return the next definition stage. + */ + WithCreate withExistingIncident(String resourceGroupName, String workspaceName, String incidentId); + } + /** + * The stage of the IncidentComment definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithEtag, DefinitionStages.WithMessage { + /** + * Executes the create request. + * + * @return the created resource. + */ + IncidentComment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IncidentComment create(Context context); + } + /** The stage of the IncidentComment definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Etag of the azure resource. + * + * @param etag Etag of the azure resource. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the IncidentComment definition allowing to specify message. */ + interface WithMessage { + /** + * Specifies the message property: The comment message. + * + * @param message The comment message. + * @return the next definition stage. + */ + WithCreate withMessage(String message); + } + } + /** + * Begins update for the IncidentComment resource. + * + * @return the stage of resource update. + */ + IncidentComment.Update update(); + + /** The template for IncidentComment update. */ + interface Update extends UpdateStages.WithEtag, UpdateStages.WithMessage { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IncidentComment apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IncidentComment apply(Context context); + } + /** The IncidentComment update stages. */ + interface UpdateStages { + /** The stage of the IncidentComment update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Etag of the azure resource. + * + * @param etag Etag of the azure resource. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + /** The stage of the IncidentComment update allowing to specify message. */ + interface WithMessage { + /** + * Specifies the message property: The comment message. + * + * @param message The comment message. + * @return the next definition stage. + */ + Update withMessage(String message); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IncidentComment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IncidentComment refresh(Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentCommentList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentCommentList.java new file mode 100644 index 000000000000..d74c5cd2de98 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentCommentList.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentCommentInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of incident comments. */ +@Fluent +public final class IncidentCommentList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IncidentCommentList.class); + + /* + * URL to fetch the next set of comments. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of comments. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the nextLink property: URL to fetch the next set of comments. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of comments. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of comments. + * + * @param value the value value to set. + * @return the IncidentCommentList object itself. + */ + public IncidentCommentList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model IncidentCommentList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentComments.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentComments.java new file mode 100644 index 000000000000..59b3f8a926cf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentComments.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of IncidentComments. */ +public interface IncidentComments { + /** + * Gets all incident comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident comments. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String incidentId); + + /** + * Gets all incident comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident comments. + */ + PagedIterable list( + String resourceGroupName, + String workspaceName, + String incidentId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context); + + /** + * Gets an incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident comment. + */ + IncidentComment get(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId); + + /** + * Gets an incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident comment. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId, Context context); + + /** + * Delete the incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId); + + /** + * Delete the incident comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param incidentCommentId Incident comment ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId, Context context); + + /** + * Gets an incident comment. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident comment. + */ + IncidentComment getById(String id); + + /** + * Gets an incident comment. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident comment. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the incident comment. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the incident comment. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new IncidentComment resource. + * + * @param name resource name. + * @return the first stage of the new IncidentComment definition. + */ + IncidentComment.DefinitionStages.Blank define(String name); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentConfiguration.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentConfiguration.java new file mode 100644 index 000000000000..91ae65e2ed07 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentConfiguration.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Incident Configuration property bag. */ +@Fluent +public final class IncidentConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IncidentConfiguration.class); + + /* + * Create incidents from alerts triggered by this analytics rule + */ + @JsonProperty(value = "createIncident", required = true) + private boolean createIncident; + + /* + * Set how the alerts that are triggered by this analytics rule, are + * grouped into incidents + */ + @JsonProperty(value = "groupingConfiguration") + private GroupingConfiguration groupingConfiguration; + + /** + * Get the createIncident property: Create incidents from alerts triggered by this analytics rule. + * + * @return the createIncident value. + */ + public boolean createIncident() { + return this.createIncident; + } + + /** + * Set the createIncident property: Create incidents from alerts triggered by this analytics rule. + * + * @param createIncident the createIncident value to set. + * @return the IncidentConfiguration object itself. + */ + public IncidentConfiguration withCreateIncident(boolean createIncident) { + this.createIncident = createIncident; + return this; + } + + /** + * Get the groupingConfiguration property: Set how the alerts that are triggered by this analytics rule, are grouped + * into incidents. + * + * @return the groupingConfiguration value. + */ + public GroupingConfiguration groupingConfiguration() { + return this.groupingConfiguration; + } + + /** + * Set the groupingConfiguration property: Set how the alerts that are triggered by this analytics rule, are grouped + * into incidents. + * + * @param groupingConfiguration the groupingConfiguration value to set. + * @return the IncidentConfiguration object itself. + */ + public IncidentConfiguration withGroupingConfiguration(GroupingConfiguration groupingConfiguration) { + this.groupingConfiguration = groupingConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (groupingConfiguration() != null) { + groupingConfiguration().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentEntitiesResponse.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentEntitiesResponse.java new file mode 100644 index 000000000000..4e3fdd26852c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentEntitiesResponse.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentEntitiesResponseInner; +import java.util.List; + +/** An immutable client-side representation of IncidentEntitiesResponse. */ +public interface IncidentEntitiesResponse { + /** + * Gets the entities property: Array of the incident related entities. + * + * @return the entities value. + */ + List entities(); + + /** + * Gets the metadata property: The metadata from the incident related entities results. + * + * @return the metadata value. + */ + List metadata(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.IncidentEntitiesResponseInner object. + * + * @return the inner object. + */ + IncidentEntitiesResponseInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentEntitiesResultsMetadata.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentEntitiesResultsMetadata.java new file mode 100644 index 000000000000..7302043080fa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentEntitiesResultsMetadata.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Information of a specific aggregation in the incident related entities result. */ +@Fluent +public final class IncidentEntitiesResultsMetadata { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IncidentEntitiesResultsMetadata.class); + + /* + * Total number of aggregations of the given kind in the incident related + * entities result. + */ + @JsonProperty(value = "count", required = true) + private int count; + + /* + * The kind of the aggregated entity. + */ + @JsonProperty(value = "entityKind", required = true) + private EntityKind entityKind; + + /** + * Get the count property: Total number of aggregations of the given kind in the incident related entities result. + * + * @return the count value. + */ + public int count() { + return this.count; + } + + /** + * Set the count property: Total number of aggregations of the given kind in the incident related entities result. + * + * @param count the count value to set. + * @return the IncidentEntitiesResultsMetadata object itself. + */ + public IncidentEntitiesResultsMetadata withCount(int count) { + this.count = count; + return this; + } + + /** + * Get the entityKind property: The kind of the aggregated entity. + * + * @return the entityKind value. + */ + public EntityKind entityKind() { + return this.entityKind; + } + + /** + * Set the entityKind property: The kind of the aggregated entity. + * + * @param entityKind the entityKind value to set. + * @return the IncidentEntitiesResultsMetadata object itself. + */ + public IncidentEntitiesResultsMetadata withEntityKind(EntityKind entityKind) { + this.entityKind = entityKind; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (entityKind() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property entityKind in model IncidentEntitiesResultsMetadata")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentInfo.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentInfo.java new file mode 100644 index 000000000000..a85b46a449b1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentInfo.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes related incident information for the bookmark. */ +@Fluent +public final class IncidentInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IncidentInfo.class); + + /* + * Incident Id + */ + @JsonProperty(value = "incidentId") + private String incidentId; + + /* + * The severity of the incident + */ + @JsonProperty(value = "severity") + private IncidentSeverity severity; + + /* + * The title of the incident + */ + @JsonProperty(value = "title") + private String title; + + /* + * Relation Name + */ + @JsonProperty(value = "relationName") + private String relationName; + + /** + * Get the incidentId property: Incident Id. + * + * @return the incidentId value. + */ + public String incidentId() { + return this.incidentId; + } + + /** + * Set the incidentId property: Incident Id. + * + * @param incidentId the incidentId value to set. + * @return the IncidentInfo object itself. + */ + public IncidentInfo withIncidentId(String incidentId) { + this.incidentId = incidentId; + return this; + } + + /** + * Get the severity property: The severity of the incident. + * + * @return the severity value. + */ + public IncidentSeverity severity() { + return this.severity; + } + + /** + * Set the severity property: The severity of the incident. + * + * @param severity the severity value to set. + * @return the IncidentInfo object itself. + */ + public IncidentInfo withSeverity(IncidentSeverity severity) { + this.severity = severity; + return this; + } + + /** + * Get the title property: The title of the incident. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: The title of the incident. + * + * @param title the title value to set. + * @return the IncidentInfo object itself. + */ + public IncidentInfo withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the relationName property: Relation Name. + * + * @return the relationName value. + */ + public String relationName() { + return this.relationName; + } + + /** + * Set the relationName property: Relation Name. + * + * @param relationName the relationName value to set. + * @return the IncidentInfo object itself. + */ + public IncidentInfo withRelationName(String relationName) { + this.relationName = relationName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentLabel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentLabel.java new file mode 100644 index 000000000000..a19b5fd6f937 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentLabel.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Represents an incident label. */ +@Fluent +public final class IncidentLabel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IncidentLabel.class); + + /* + * The name of the label + */ + @JsonProperty(value = "labelName", required = true) + private String labelName; + + /* + * The type of the label + */ + @JsonProperty(value = "labelType", access = JsonProperty.Access.WRITE_ONLY) + private IncidentLabelType labelType; + + /** + * Get the labelName property: The name of the label. + * + * @return the labelName value. + */ + public String labelName() { + return this.labelName; + } + + /** + * Set the labelName property: The name of the label. + * + * @param labelName the labelName value to set. + * @return the IncidentLabel object itself. + */ + public IncidentLabel withLabelName(String labelName) { + this.labelName = labelName; + return this; + } + + /** + * Get the labelType property: The type of the label. + * + * @return the labelType value. + */ + public IncidentLabelType labelType() { + return this.labelType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (labelName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property labelName in model IncidentLabel")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentLabelType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentLabelType.java new file mode 100644 index 000000000000..d1036f278737 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentLabelType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IncidentLabelType. */ +public final class IncidentLabelType extends ExpandableStringEnum { + /** Static value User for IncidentLabelType. */ + public static final IncidentLabelType USER = fromString("User"); + + /** Static value System for IncidentLabelType. */ + public static final IncidentLabelType SYSTEM = fromString("System"); + + /** + * Creates or finds a IncidentLabelType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IncidentLabelType. + */ + @JsonCreator + public static IncidentLabelType fromString(String name) { + return fromString(name, IncidentLabelType.class); + } + + /** @return known IncidentLabelType values. */ + public static Collection values() { + return values(IncidentLabelType.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentList.java new file mode 100644 index 000000000000..30a5d40ce6e7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentList.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List all the incidents. */ +@Fluent +public final class IncidentList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IncidentList.class); + + /* + * URL to fetch the next set of incidents. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of incidents. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the nextLink property: URL to fetch the next set of incidents. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of incidents. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of incidents. + * + * @param value the value value to set. + * @return the IncidentList object itself. + */ + public IncidentList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model IncidentList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentOwnerInfo.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentOwnerInfo.java new file mode 100644 index 000000000000..8ec2616f03a6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentOwnerInfo.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** Information on the user an incident is assigned to. */ +@Fluent +public final class IncidentOwnerInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IncidentOwnerInfo.class); + + /* + * The email of the user the incident is assigned to. + */ + @JsonProperty(value = "email") + private String email; + + /* + * The name of the user the incident is assigned to. + */ + @JsonProperty(value = "assignedTo") + private String assignedTo; + + /* + * The object id of the user the incident is assigned to. + */ + @JsonProperty(value = "objectId") + private UUID objectId; + + /* + * The user principal name of the user the incident is assigned to. + */ + @JsonProperty(value = "userPrincipalName") + private String userPrincipalName; + + /* + * The type of the owner the incident is assigned to. + */ + @JsonProperty(value = "ownerType", access = JsonProperty.Access.WRITE_ONLY) + private OwnerType ownerType; + + /** + * Get the email property: The email of the user the incident is assigned to. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: The email of the user the incident is assigned to. + * + * @param email the email value to set. + * @return the IncidentOwnerInfo object itself. + */ + public IncidentOwnerInfo withEmail(String email) { + this.email = email; + return this; + } + + /** + * Get the assignedTo property: The name of the user the incident is assigned to. + * + * @return the assignedTo value. + */ + public String assignedTo() { + return this.assignedTo; + } + + /** + * Set the assignedTo property: The name of the user the incident is assigned to. + * + * @param assignedTo the assignedTo value to set. + * @return the IncidentOwnerInfo object itself. + */ + public IncidentOwnerInfo withAssignedTo(String assignedTo) { + this.assignedTo = assignedTo; + return this; + } + + /** + * Get the objectId property: The object id of the user the incident is assigned to. + * + * @return the objectId value. + */ + public UUID objectId() { + return this.objectId; + } + + /** + * Set the objectId property: The object id of the user the incident is assigned to. + * + * @param objectId the objectId value to set. + * @return the IncidentOwnerInfo object itself. + */ + public IncidentOwnerInfo withObjectId(UUID objectId) { + this.objectId = objectId; + return this; + } + + /** + * Get the userPrincipalName property: The user principal name of the user the incident is assigned to. + * + * @return the userPrincipalName value. + */ + public String userPrincipalName() { + return this.userPrincipalName; + } + + /** + * Set the userPrincipalName property: The user principal name of the user the incident is assigned to. + * + * @param userPrincipalName the userPrincipalName value to set. + * @return the IncidentOwnerInfo object itself. + */ + public IncidentOwnerInfo withUserPrincipalName(String userPrincipalName) { + this.userPrincipalName = userPrincipalName; + return this; + } + + /** + * Get the ownerType property: The type of the owner the incident is assigned to. + * + * @return the ownerType value. + */ + public OwnerType ownerType() { + return this.ownerType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentProperties.java new file mode 100644 index 000000000000..924ddce626e4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentProperties.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentPropertiesInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of IncidentProperties. */ +public interface IncidentProperties { + /** + * Gets the additionalData property: Additional data on the incident. + * + * @return the additionalData value. + */ + IncidentAdditionalData additionalData(); + + /** + * Gets the classification property: The reason the incident was closed. + * + * @return the classification value. + */ + IncidentClassification classification(); + + /** + * Gets the classificationComment property: Describes the reason the incident was closed. + * + * @return the classificationComment value. + */ + String classificationComment(); + + /** + * Gets the classificationReason property: The classification reason the incident was closed with. + * + * @return the classificationReason value. + */ + IncidentClassificationReason classificationReason(); + + /** + * Gets the createdTimeUtc property: The time the incident was created. + * + * @return the createdTimeUtc value. + */ + OffsetDateTime createdTimeUtc(); + + /** + * Gets the description property: The description of the incident. + * + * @return the description value. + */ + String description(); + + /** + * Gets the firstActivityTimeUtc property: The time of the first activity in the incident. + * + * @return the firstActivityTimeUtc value. + */ + OffsetDateTime firstActivityTimeUtc(); + + /** + * Gets the incidentUrl property: The deep-link url to the incident in Azure portal. + * + * @return the incidentUrl value. + */ + String incidentUrl(); + + /** + * Gets the incidentNumber property: A sequential number. + * + * @return the incidentNumber value. + */ + Integer incidentNumber(); + + /** + * Gets the labels property: List of labels relevant to this incident. + * + * @return the labels value. + */ + List labels(); + + /** + * Gets the providerName property: The name of the source provider that generated the incident. + * + * @return the providerName value. + */ + String providerName(); + + /** + * Gets the providerIncidentId property: The incident ID assigned by the incident provider. + * + * @return the providerIncidentId value. + */ + String providerIncidentId(); + + /** + * Gets the lastActivityTimeUtc property: The time of the last activity in the incident. + * + * @return the lastActivityTimeUtc value. + */ + OffsetDateTime lastActivityTimeUtc(); + + /** + * Gets the lastModifiedTimeUtc property: The last time the incident was updated. + * + * @return the lastModifiedTimeUtc value. + */ + OffsetDateTime lastModifiedTimeUtc(); + + /** + * Gets the owner property: Describes a user that the incident is assigned to. + * + * @return the owner value. + */ + IncidentOwnerInfo owner(); + + /** + * Gets the relatedAnalyticRuleIds property: List of resource ids of Analytic rules related to the incident. + * + * @return the relatedAnalyticRuleIds value. + */ + List relatedAnalyticRuleIds(); + + /** + * Gets the severity property: The severity of the incident. + * + * @return the severity value. + */ + IncidentSeverity severity(); + + /** + * Gets the status property: The status of the incident. + * + * @return the status value. + */ + IncidentStatus status(); + + /** + * Gets the teamInformation property: Describes a team for the incident. + * + * @return the teamInformation value. + */ + TeamInformation teamInformation(); + + /** + * Gets the title property: The title of the incident. + * + * @return the title value. + */ + String title(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.IncidentPropertiesInner object. + * + * @return the inner object. + */ + IncidentPropertiesInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentRelations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentRelations.java new file mode 100644 index 000000000000..0f2b88dd0aee --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentRelations.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; + +/** Resource collection API of IncidentRelations. */ +public interface IncidentRelations { + /** + * Gets all incident relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident relations. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String incidentId); + + /** + * Gets all incident relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident relations. + */ + PagedIterable list( + String resourceGroupName, + String workspaceName, + String incidentId, + String filter, + String orderby, + Integer top, + String skipToken, + Context context); + + /** + * Gets an incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident relation. + */ + Relation get(String resourceGroupName, String workspaceName, String incidentId, String relationName); + + /** + * Gets an incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident relation. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String incidentId, String relationName, Context context); + + /** + * Creates or updates the incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @param relation The relation model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a relation between two resources. + */ + Relation createOrUpdate( + String resourceGroupName, String workspaceName, String incidentId, String relationName, RelationInner relation); + + /** + * Creates or updates the incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @param relation The relation model. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a relation between two resources. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String incidentId, + String relationName, + RelationInner relation, + Context context); + + /** + * Delete the incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String incidentId, String relationName); + + /** + * Delete the incident relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param relationName Relation Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String incidentId, String relationName, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentSeverity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentSeverity.java new file mode 100644 index 000000000000..befb55104a1a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentSeverity.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IncidentSeverity. */ +public final class IncidentSeverity extends ExpandableStringEnum { + /** Static value High for IncidentSeverity. */ + public static final IncidentSeverity HIGH = fromString("High"); + + /** Static value Medium for IncidentSeverity. */ + public static final IncidentSeverity MEDIUM = fromString("Medium"); + + /** Static value Low for IncidentSeverity. */ + public static final IncidentSeverity LOW = fromString("Low"); + + /** Static value Informational for IncidentSeverity. */ + public static final IncidentSeverity INFORMATIONAL = fromString("Informational"); + + /** + * Creates or finds a IncidentSeverity from its string representation. + * + * @param name a name to look for. + * @return the corresponding IncidentSeverity. + */ + @JsonCreator + public static IncidentSeverity fromString(String name) { + return fromString(name, IncidentSeverity.class); + } + + /** @return known IncidentSeverity values. */ + public static Collection values() { + return values(IncidentSeverity.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentStatus.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentStatus.java new file mode 100644 index 000000000000..119061ec0e24 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentStatus.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IncidentStatus. */ +public final class IncidentStatus extends ExpandableStringEnum { + /** Static value New for IncidentStatus. */ + public static final IncidentStatus NEW = fromString("New"); + + /** Static value Active for IncidentStatus. */ + public static final IncidentStatus ACTIVE = fromString("Active"); + + /** Static value Closed for IncidentStatus. */ + public static final IncidentStatus CLOSED = fromString("Closed"); + + /** + * Creates or finds a IncidentStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding IncidentStatus. + */ + @JsonCreator + public static IncidentStatus fromString(String name) { + return fromString(name, IncidentStatus.class); + } + + /** @return known IncidentStatus values. */ + public static Collection values() { + return values(IncidentStatus.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Incidents.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Incidents.java new file mode 100644 index 000000000000..e51e57a88f38 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Incidents.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Incidents. */ +public interface Incidents { + /** + * Gets all incidents. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incidents. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all incidents. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incidents. + */ + PagedIterable list( + String resourceGroupName, + String workspaceName, + String filter, + String orderby, + Integer top, + String skipToken, + Context context); + + /** + * Gets an incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident. + */ + Incident get(String resourceGroupName, String workspaceName, String incidentId); + + /** + * Gets an incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String incidentId, Context context); + + /** + * Delete the incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String incidentId); + + /** + * Delete the incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String incidentId, Context context); + + /** + * Creates a Microsoft team to investigate the incident by sharing information and insights between participants. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param teamProperties Team properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes team information. + */ + TeamInformation createTeam( + String resourceGroupName, String workspaceName, String incidentId, TeamProperties teamProperties); + + /** + * Creates a Microsoft team to investigate the incident by sharing information and insights between participants. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param teamProperties Team properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes team information. + */ + Response createTeamWithResponse( + String resourceGroupName, + String workspaceName, + String incidentId, + TeamProperties teamProperties, + Context context); + + /** + * Gets all incident alerts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident alerts. + */ + IncidentAlertList listAlerts(String resourceGroupName, String workspaceName, String incidentId); + + /** + * Gets all incident alerts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident alerts. + */ + Response listAlertsWithResponse( + String resourceGroupName, String workspaceName, String incidentId, Context context); + + /** + * Gets all incident bookmarks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident bookmarks. + */ + IncidentBookmarkList listBookmarks(String resourceGroupName, String workspaceName, String incidentId); + + /** + * Gets all incident bookmarks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident bookmarks. + */ + Response listBookmarksWithResponse( + String resourceGroupName, String workspaceName, String incidentId, Context context); + + /** + * Gets all incident related entities. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident related entities. + */ + IncidentEntitiesResponse listEntities(String resourceGroupName, String workspaceName, String incidentId); + + /** + * Gets all incident related entities. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident related entities. + */ + Response listEntitiesWithResponse( + String resourceGroupName, String workspaceName, String incidentId, Context context); + + /** + * Gets an incident. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident. + */ + Incident getById(String id); + + /** + * Gets an incident. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incident. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the incident. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the incident. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Incident resource. + * + * @param name resource name. + * @return the first stage of the new Incident definition. + */ + Incident.DefinitionStages.Blank define(String name); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItem.java new file mode 100644 index 000000000000..c15691f02f91 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItem.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents Insight Query. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Insight") +@Fluent +public final class InsightQueryItem extends EntityQueryItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InsightQueryItem.class); + + /* + * Properties bag for InsightQueryItem + */ + @JsonProperty(value = "properties") + private InsightQueryItemProperties properties; + + /** + * Get the properties property: Properties bag for InsightQueryItem. + * + * @return the properties value. + */ + public InsightQueryItemProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties bag for InsightQueryItem. + * + * @param properties the properties value to set. + * @return the InsightQueryItem object itself. + */ + public InsightQueryItem withProperties(InsightQueryItemProperties properties) { + this.properties = properties; + return this; + } + + /** {@inheritDoc} */ + @Override + public InsightQueryItem withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public InsightQueryItem withType(String type) { + super.withType(type); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemProperties.java new file mode 100644 index 000000000000..6fc85b278017 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemProperties.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents Insight Query. */ +@Fluent +public final class InsightQueryItemProperties extends EntityQueryItemProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InsightQueryItemProperties.class); + + /* + * The insight display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The insight description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The base query of the insight. + */ + @JsonProperty(value = "baseQuery") + private String baseQuery; + + /* + * The insight table query. + */ + @JsonProperty(value = "tableQuery") + private InsightQueryItemPropertiesTableQuery tableQuery; + + /* + * The insight chart query. + */ + @JsonProperty(value = "chartQuery") + private Object chartQuery; + + /* + * The activity query definitions. + */ + @JsonProperty(value = "additionalQuery") + private InsightQueryItemPropertiesAdditionalQuery additionalQuery; + + /* + * The insight chart query. + */ + @JsonProperty(value = "defaultTimeRange") + private InsightQueryItemPropertiesDefaultTimeRange defaultTimeRange; + + /* + * The insight chart query. + */ + @JsonProperty(value = "referenceTimeRange") + private InsightQueryItemPropertiesReferenceTimeRange referenceTimeRange; + + /** + * Get the displayName property: The insight display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The insight display name. + * + * @param displayName the displayName value to set. + * @return the InsightQueryItemProperties object itself. + */ + public InsightQueryItemProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description property: The insight description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The insight description. + * + * @param description the description value to set. + * @return the InsightQueryItemProperties object itself. + */ + public InsightQueryItemProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the baseQuery property: The base query of the insight. + * + * @return the baseQuery value. + */ + public String baseQuery() { + return this.baseQuery; + } + + /** + * Set the baseQuery property: The base query of the insight. + * + * @param baseQuery the baseQuery value to set. + * @return the InsightQueryItemProperties object itself. + */ + public InsightQueryItemProperties withBaseQuery(String baseQuery) { + this.baseQuery = baseQuery; + return this; + } + + /** + * Get the tableQuery property: The insight table query. + * + * @return the tableQuery value. + */ + public InsightQueryItemPropertiesTableQuery tableQuery() { + return this.tableQuery; + } + + /** + * Set the tableQuery property: The insight table query. + * + * @param tableQuery the tableQuery value to set. + * @return the InsightQueryItemProperties object itself. + */ + public InsightQueryItemProperties withTableQuery(InsightQueryItemPropertiesTableQuery tableQuery) { + this.tableQuery = tableQuery; + return this; + } + + /** + * Get the chartQuery property: The insight chart query. + * + * @return the chartQuery value. + */ + public Object chartQuery() { + return this.chartQuery; + } + + /** + * Set the chartQuery property: The insight chart query. + * + * @param chartQuery the chartQuery value to set. + * @return the InsightQueryItemProperties object itself. + */ + public InsightQueryItemProperties withChartQuery(Object chartQuery) { + this.chartQuery = chartQuery; + return this; + } + + /** + * Get the additionalQuery property: The activity query definitions. + * + * @return the additionalQuery value. + */ + public InsightQueryItemPropertiesAdditionalQuery additionalQuery() { + return this.additionalQuery; + } + + /** + * Set the additionalQuery property: The activity query definitions. + * + * @param additionalQuery the additionalQuery value to set. + * @return the InsightQueryItemProperties object itself. + */ + public InsightQueryItemProperties withAdditionalQuery(InsightQueryItemPropertiesAdditionalQuery additionalQuery) { + this.additionalQuery = additionalQuery; + return this; + } + + /** + * Get the defaultTimeRange property: The insight chart query. + * + * @return the defaultTimeRange value. + */ + public InsightQueryItemPropertiesDefaultTimeRange defaultTimeRange() { + return this.defaultTimeRange; + } + + /** + * Set the defaultTimeRange property: The insight chart query. + * + * @param defaultTimeRange the defaultTimeRange value to set. + * @return the InsightQueryItemProperties object itself. + */ + public InsightQueryItemProperties withDefaultTimeRange( + InsightQueryItemPropertiesDefaultTimeRange defaultTimeRange) { + this.defaultTimeRange = defaultTimeRange; + return this; + } + + /** + * Get the referenceTimeRange property: The insight chart query. + * + * @return the referenceTimeRange value. + */ + public InsightQueryItemPropertiesReferenceTimeRange referenceTimeRange() { + return this.referenceTimeRange; + } + + /** + * Set the referenceTimeRange property: The insight chart query. + * + * @param referenceTimeRange the referenceTimeRange value to set. + * @return the InsightQueryItemProperties object itself. + */ + public InsightQueryItemProperties withReferenceTimeRange( + InsightQueryItemPropertiesReferenceTimeRange referenceTimeRange) { + this.referenceTimeRange = referenceTimeRange; + return this; + } + + /** {@inheritDoc} */ + @Override + public InsightQueryItemProperties withDataTypes(List dataTypes) { + super.withDataTypes(dataTypes); + return this; + } + + /** {@inheritDoc} */ + @Override + public InsightQueryItemProperties withInputEntityType(EntityType inputEntityType) { + super.withInputEntityType(inputEntityType); + return this; + } + + /** {@inheritDoc} */ + @Override + public InsightQueryItemProperties withRequiredInputFieldsSets(List> requiredInputFieldsSets) { + super.withRequiredInputFieldsSets(requiredInputFieldsSets); + return this; + } + + /** {@inheritDoc} */ + @Override + public InsightQueryItemProperties withEntitiesFilter(Object entitiesFilter) { + super.withEntitiesFilter(entitiesFilter); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (tableQuery() != null) { + tableQuery().validate(); + } + if (additionalQuery() != null) { + additionalQuery().validate(); + } + if (defaultTimeRange() != null) { + defaultTimeRange().validate(); + } + if (referenceTimeRange() != null) { + referenceTimeRange().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesAdditionalQuery.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesAdditionalQuery.java new file mode 100644 index 000000000000..944b5c724609 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesAdditionalQuery.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The activity query definitions. */ +@Fluent +public final class InsightQueryItemPropertiesAdditionalQuery { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InsightQueryItemPropertiesAdditionalQuery.class); + + /* + * The insight query. + */ + @JsonProperty(value = "query") + private String query; + + /* + * The insight text. + */ + @JsonProperty(value = "text") + private String text; + + /** + * Get the query property: The insight query. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * Set the query property: The insight query. + * + * @param query the query value to set. + * @return the InsightQueryItemPropertiesAdditionalQuery object itself. + */ + public InsightQueryItemPropertiesAdditionalQuery withQuery(String query) { + this.query = query; + return this; + } + + /** + * Get the text property: The insight text. + * + * @return the text value. + */ + public String text() { + return this.text; + } + + /** + * Set the text property: The insight text. + * + * @param text the text value to set. + * @return the InsightQueryItemPropertiesAdditionalQuery object itself. + */ + public InsightQueryItemPropertiesAdditionalQuery withText(String text) { + this.text = text; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesDefaultTimeRange.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesDefaultTimeRange.java new file mode 100644 index 000000000000..43576829c24e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesDefaultTimeRange.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The insight chart query. */ +@Fluent +public final class InsightQueryItemPropertiesDefaultTimeRange { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InsightQueryItemPropertiesDefaultTimeRange.class); + + /* + * The padding for the start time of the query. + */ + @JsonProperty(value = "beforeRange") + private String beforeRange; + + /* + * The padding for the end time of the query. + */ + @JsonProperty(value = "afterRange") + private String afterRange; + + /** + * Get the beforeRange property: The padding for the start time of the query. + * + * @return the beforeRange value. + */ + public String beforeRange() { + return this.beforeRange; + } + + /** + * Set the beforeRange property: The padding for the start time of the query. + * + * @param beforeRange the beforeRange value to set. + * @return the InsightQueryItemPropertiesDefaultTimeRange object itself. + */ + public InsightQueryItemPropertiesDefaultTimeRange withBeforeRange(String beforeRange) { + this.beforeRange = beforeRange; + return this; + } + + /** + * Get the afterRange property: The padding for the end time of the query. + * + * @return the afterRange value. + */ + public String afterRange() { + return this.afterRange; + } + + /** + * Set the afterRange property: The padding for the end time of the query. + * + * @param afterRange the afterRange value to set. + * @return the InsightQueryItemPropertiesDefaultTimeRange object itself. + */ + public InsightQueryItemPropertiesDefaultTimeRange withAfterRange(String afterRange) { + this.afterRange = afterRange; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesReferenceTimeRange.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesReferenceTimeRange.java new file mode 100644 index 000000000000..8e229956204d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesReferenceTimeRange.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The insight chart query. */ +@Fluent +public final class InsightQueryItemPropertiesReferenceTimeRange { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(InsightQueryItemPropertiesReferenceTimeRange.class); + + /* + * Additional query time for looking back. + */ + @JsonProperty(value = "beforeRange") + private String beforeRange; + + /** + * Get the beforeRange property: Additional query time for looking back. + * + * @return the beforeRange value. + */ + public String beforeRange() { + return this.beforeRange; + } + + /** + * Set the beforeRange property: Additional query time for looking back. + * + * @param beforeRange the beforeRange value to set. + * @return the InsightQueryItemPropertiesReferenceTimeRange object itself. + */ + public InsightQueryItemPropertiesReferenceTimeRange withBeforeRange(String beforeRange) { + this.beforeRange = beforeRange; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQuery.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQuery.java new file mode 100644 index 000000000000..5e4bcd9b3146 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQuery.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The insight table query. */ +@Fluent +public final class InsightQueryItemPropertiesTableQuery { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InsightQueryItemPropertiesTableQuery.class); + + /* + * List of insight column definitions. + */ + @JsonProperty(value = "columnsDefinitions") + private List columnsDefinitions; + + /* + * List of insight queries definitions. + */ + @JsonProperty(value = "queriesDefinitions") + private List queriesDefinitions; + + /** + * Get the columnsDefinitions property: List of insight column definitions. + * + * @return the columnsDefinitions value. + */ + public List columnsDefinitions() { + return this.columnsDefinitions; + } + + /** + * Set the columnsDefinitions property: List of insight column definitions. + * + * @param columnsDefinitions the columnsDefinitions value to set. + * @return the InsightQueryItemPropertiesTableQuery object itself. + */ + public InsightQueryItemPropertiesTableQuery withColumnsDefinitions( + List columnsDefinitions) { + this.columnsDefinitions = columnsDefinitions; + return this; + } + + /** + * Get the queriesDefinitions property: List of insight queries definitions. + * + * @return the queriesDefinitions value. + */ + public List queriesDefinitions() { + return this.queriesDefinitions; + } + + /** + * Set the queriesDefinitions property: List of insight queries definitions. + * + * @param queriesDefinitions the queriesDefinitions value to set. + * @return the InsightQueryItemPropertiesTableQuery object itself. + */ + public InsightQueryItemPropertiesTableQuery withQueriesDefinitions( + List queriesDefinitions) { + this.queriesDefinitions = queriesDefinitions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (columnsDefinitions() != null) { + columnsDefinitions().forEach(e -> e.validate()); + } + if (queriesDefinitions() != null) { + queriesDefinitions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem.java new file mode 100644 index 000000000000..437077c7307e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem model. */ +@Fluent +public final class InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem.class); + + /* + * Insight column header. + */ + @JsonProperty(value = "header") + private String headerProperty; + + /* + * Insights Column type. + */ + @JsonProperty(value = "outputType") + private OutputType outputType; + + /* + * Is query supports deep-link. + */ + @JsonProperty(value = "supportDeepLink") + private Boolean supportDeepLink; + + /** + * Get the headerProperty property: Insight column header. + * + * @return the headerProperty value. + */ + public String headerProperty() { + return this.headerProperty; + } + + /** + * Set the headerProperty property: Insight column header. + * + * @param headerProperty the headerProperty value to set. + * @return the InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem object itself. + */ + public InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem withHeaderProperty(String headerProperty) { + this.headerProperty = headerProperty; + return this; + } + + /** + * Get the outputType property: Insights Column type. + * + * @return the outputType value. + */ + public OutputType outputType() { + return this.outputType; + } + + /** + * Set the outputType property: Insights Column type. + * + * @param outputType the outputType value to set. + * @return the InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem object itself. + */ + public InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem withOutputType(OutputType outputType) { + this.outputType = outputType; + return this; + } + + /** + * Get the supportDeepLink property: Is query supports deep-link. + * + * @return the supportDeepLink value. + */ + public Boolean supportDeepLink() { + return this.supportDeepLink; + } + + /** + * Set the supportDeepLink property: Is query supports deep-link. + * + * @param supportDeepLink the supportDeepLink value to set. + * @return the InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem object itself. + */ + public InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem withSupportDeepLink(Boolean supportDeepLink) { + this.supportDeepLink = supportDeepLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem.java new file mode 100644 index 000000000000..628c36885641 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem model. */ +@Fluent +public final class InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem.class); + + /* + * Insight column header. + */ + @JsonProperty(value = "filter") + private String filter; + + /* + * Insight column header. + */ + @JsonProperty(value = "summarize") + private String summarize; + + /* + * Insight column header. + */ + @JsonProperty(value = "project") + private String project; + + /* + * Insight column header. + */ + @JsonProperty(value = "linkColumnsDefinitions") + private List linkColumnsDefinitions; + + /** + * Get the filter property: Insight column header. + * + * @return the filter value. + */ + public String filter() { + return this.filter; + } + + /** + * Set the filter property: Insight column header. + * + * @param filter the filter value to set. + * @return the InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem object itself. + */ + public InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem withFilter(String filter) { + this.filter = filter; + return this; + } + + /** + * Get the summarize property: Insight column header. + * + * @return the summarize value. + */ + public String summarize() { + return this.summarize; + } + + /** + * Set the summarize property: Insight column header. + * + * @param summarize the summarize value to set. + * @return the InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem object itself. + */ + public InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem withSummarize(String summarize) { + this.summarize = summarize; + return this; + } + + /** + * Get the project property: Insight column header. + * + * @return the project value. + */ + public String project() { + return this.project; + } + + /** + * Set the project property: Insight column header. + * + * @param project the project value to set. + * @return the InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem object itself. + */ + public InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem withProject(String project) { + this.project = project; + return this; + } + + /** + * Get the linkColumnsDefinitions property: Insight column header. + * + * @return the linkColumnsDefinitions value. + */ + public List linkColumnsDefinitions() { + return this.linkColumnsDefinitions; + } + + /** + * Set the linkColumnsDefinitions property: Insight column header. + * + * @param linkColumnsDefinitions the linkColumnsDefinitions value to set. + * @return the InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem object itself. + */ + public InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem withLinkColumnsDefinitions( + List linkColumnsDefinitions) { + this.linkColumnsDefinitions = linkColumnsDefinitions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (linkColumnsDefinitions() != null) { + linkColumnsDefinitions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem.java new file mode 100644 index 000000000000..cbbf6fa58d62 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem model. */ +@Fluent +public final class InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem.class); + + /* + * Insight Link Definition Projected Name. + */ + @JsonProperty(value = "projectedName") + private String projectedName; + + /* + * Insight Link Definition Query. + */ + @JsonProperty(value = "Query") + private String query; + + /** + * Get the projectedName property: Insight Link Definition Projected Name. + * + * @return the projectedName value. + */ + public String projectedName() { + return this.projectedName; + } + + /** + * Set the projectedName property: Insight Link Definition Projected Name. + * + * @param projectedName the projectedName value to set. + * @return the InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem object itself. + */ + public InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem withProjectedName( + String projectedName) { + this.projectedName = projectedName; + return this; + } + + /** + * Get the query property: Insight Link Definition Query. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * Set the query property: Insight Link Definition Query. + * + * @param query the query value to set. + * @return the InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem object itself. + */ + public InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem withQuery(String query) { + this.query = query; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightsTableResult.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightsTableResult.java new file mode 100644 index 000000000000..2a7ad50b751c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightsTableResult.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Query results for table insights query. */ +@Fluent +public final class InsightsTableResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InsightsTableResult.class); + + /* + * Columns Metadata of the table + */ + @JsonProperty(value = "columns") + private List columns; + + /* + * Rows data of the table + */ + @JsonProperty(value = "rows") + private List> rows; + + /** + * Get the columns property: Columns Metadata of the table. + * + * @return the columns value. + */ + public List columns() { + return this.columns; + } + + /** + * Set the columns property: Columns Metadata of the table. + * + * @param columns the columns value to set. + * @return the InsightsTableResult object itself. + */ + public InsightsTableResult withColumns(List columns) { + this.columns = columns; + return this; + } + + /** + * Get the rows property: Rows data of the table. + * + * @return the rows value. + */ + public List> rows() { + return this.rows; + } + + /** + * Set the rows property: Rows data of the table. + * + * @param rows the rows value to set. + * @return the InsightsTableResult object itself. + */ + public InsightsTableResult withRows(List> rows) { + this.rows = rows; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (columns() != null) { + columns().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightsTableResultColumnsItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightsTableResultColumnsItem.java new file mode 100644 index 000000000000..be60e9c9ee14 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightsTableResultColumnsItem.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The InsightsTableResultColumnsItem model. */ +@Fluent +public final class InsightsTableResultColumnsItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InsightsTableResultColumnsItem.class); + + /* + * the type of the colum + */ + @JsonProperty(value = "type") + private String type; + + /* + * the name of the colum + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the type property: the type of the colum. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: the type of the colum. + * + * @param type the type value to set. + * @return the InsightsTableResultColumnsItem object itself. + */ + public InsightsTableResultColumnsItem withType(String type) { + this.type = type; + return this; + } + + /** + * Get the name property: the name of the colum. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: the name of the colum. + * + * @param name the name value to set. + * @return the InsightsTableResultColumnsItem object itself. + */ + public InsightsTableResultColumnsItem withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionSteps.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionSteps.java new file mode 100644 index 000000000000..6fbd0d91cff3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionSteps.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Instruction steps to enable the connector. */ +@Fluent +public class InstructionSteps { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InstructionSteps.class); + + /* + * Instruction step title + */ + @JsonProperty(value = "title") + private String title; + + /* + * Instruction step description + */ + @JsonProperty(value = "description") + private String description; + + /* + * Instruction step details + */ + @JsonProperty(value = "instructions") + private List instructions; + + /** + * Get the title property: Instruction step title. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: Instruction step title. + * + * @param title the title value to set. + * @return the InstructionSteps object itself. + */ + public InstructionSteps withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the description property: Instruction step description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Instruction step description. + * + * @param description the description value to set. + * @return the InstructionSteps object itself. + */ + public InstructionSteps withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the instructions property: Instruction step details. + * + * @return the instructions value. + */ + public List instructions() { + return this.instructions; + } + + /** + * Set the instructions property: Instruction step details. + * + * @param instructions the instructions value to set. + * @return the InstructionSteps object itself. + */ + public InstructionSteps withInstructions(List instructions) { + this.instructions = instructions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (instructions() != null) { + instructions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionStepsInstructionsItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionStepsInstructionsItem.java new file mode 100644 index 000000000000..a2ea95557785 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionStepsInstructionsItem.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The InstructionStepsInstructionsItem model. */ +@Fluent +public final class InstructionStepsInstructionsItem extends ConnectorInstructionModelBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InstructionStepsInstructionsItem.class); + + /** {@inheritDoc} */ + @Override + public InstructionStepsInstructionsItem withParameters(Object parameters) { + super.withParameters(parameters); + return this; + } + + /** {@inheritDoc} */ + @Override + public InstructionStepsInstructionsItem withType(SettingType type) { + super.withType(type); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IoTDeviceEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IoTDeviceEntity.java new file mode 100644 index 000000000000..646c8be48910 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IoTDeviceEntity.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.azure.resourcemanager.securityinsights.fluent.models.IoTDeviceEntityProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/** Represents an IoT device entity. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("IoTDevice") +@Fluent +public final class IoTDeviceEntity extends EntityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IoTDeviceEntity.class); + + /* + * IoTDevice entity properties + */ + @JsonProperty(value = "properties") + private IoTDeviceEntityProperties innerProperties; + + /** + * Get the innerProperties property: IoTDevice entity properties. + * + * @return the innerProperties value. + */ + private IoTDeviceEntityProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the deviceId property: The ID of the IoT Device in the IoT Hub. + * + * @return the deviceId value. + */ + public String deviceId() { + return this.innerProperties() == null ? null : this.innerProperties().deviceId(); + } + + /** + * Get the deviceName property: The friendly name of the device. + * + * @return the deviceName value. + */ + public String deviceName() { + return this.innerProperties() == null ? null : this.innerProperties().deviceName(); + } + + /** + * Get the source property: The source of the device. + * + * @return the source value. + */ + public String source() { + return this.innerProperties() == null ? null : this.innerProperties().source(); + } + + /** + * Get the iotSecurityAgentId property: The ID of the security agent running on the device. + * + * @return the iotSecurityAgentId value. + */ + public UUID iotSecurityAgentId() { + return this.innerProperties() == null ? null : this.innerProperties().iotSecurityAgentId(); + } + + /** + * Get the deviceType property: The type of the device. + * + * @return the deviceType value. + */ + public String deviceType() { + return this.innerProperties() == null ? null : this.innerProperties().deviceType(); + } + + /** + * Get the vendor property: The vendor of the device. + * + * @return the vendor value. + */ + public String vendor() { + return this.innerProperties() == null ? null : this.innerProperties().vendor(); + } + + /** + * Get the edgeId property: The ID of the edge device. + * + * @return the edgeId value. + */ + public String edgeId() { + return this.innerProperties() == null ? null : this.innerProperties().edgeId(); + } + + /** + * Get the macAddress property: The MAC address of the device. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.innerProperties() == null ? null : this.innerProperties().macAddress(); + } + + /** + * Get the model property: The model of the device. + * + * @return the model value. + */ + public String model() { + return this.innerProperties() == null ? null : this.innerProperties().model(); + } + + /** + * Get the serialNumber property: The serial number of the device. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.innerProperties() == null ? null : this.innerProperties().serialNumber(); + } + + /** + * Get the firmwareVersion property: The firmware version of the device. + * + * @return the firmwareVersion value. + */ + public String firmwareVersion() { + return this.innerProperties() == null ? null : this.innerProperties().firmwareVersion(); + } + + /** + * Get the operatingSystem property: The operating system of the device. + * + * @return the operatingSystem value. + */ + public String operatingSystem() { + return this.innerProperties() == null ? null : this.innerProperties().operatingSystem(); + } + + /** + * Get the iotHubEntityId property: The AzureResource entity id of the IoT Hub. + * + * @return the iotHubEntityId value. + */ + public String iotHubEntityId() { + return this.innerProperties() == null ? null : this.innerProperties().iotHubEntityId(); + } + + /** + * Get the hostEntityId property: The Host entity id of this device. + * + * @return the hostEntityId value. + */ + public String hostEntityId() { + return this.innerProperties() == null ? null : this.innerProperties().hostEntityId(); + } + + /** + * Get the ipAddressEntityId property: The IP entity if of this device. + * + * @return the ipAddressEntityId value. + */ + public String ipAddressEntityId() { + return this.innerProperties() == null ? null : this.innerProperties().ipAddressEntityId(); + } + + /** + * Get the threatIntelligence property: A list of TI contexts attached to the IoTDevice entity. + * + * @return the threatIntelligence value. + */ + public List threatIntelligence() { + return this.innerProperties() == null ? null : this.innerProperties().threatIntelligence(); + } + + /** + * Get the protocols property: A list of protocols of the IoTDevice entity. + * + * @return the protocols value. + */ + public List protocols() { + return this.innerProperties() == null ? null : this.innerProperties().protocols(); + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IpEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IpEntity.java new file mode 100644 index 000000000000..d44529bf3e2e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IpEntity.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.azure.resourcemanager.securityinsights.fluent.models.IpEntityProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Represents an ip entity. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Ip") +@Fluent +public final class IpEntity extends EntityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpEntity.class); + + /* + * Ip entity properties + */ + @JsonProperty(value = "properties") + private IpEntityProperties innerProperties; + + /** + * Get the innerProperties property: Ip entity properties. + * + * @return the innerProperties value. + */ + private IpEntityProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the address property: The IP address as string, e.g. 127.0.0.1 (either in Ipv4 or Ipv6). + * + * @return the address value. + */ + public String address() { + return this.innerProperties() == null ? null : this.innerProperties().address(); + } + + /** + * Get the location property: The geo-location context attached to the ip entity. + * + * @return the location value. + */ + public GeoLocation location() { + return this.innerProperties() == null ? null : this.innerProperties().location(); + } + + /** + * Get the threatIntelligence property: A list of TI contexts attached to the ip entity. + * + * @return the threatIntelligence value. + */ + public List threatIntelligence() { + return this.innerProperties() == null ? null : this.innerProperties().threatIntelligence(); + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IpGeodatas.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IpGeodatas.java new file mode 100644 index 000000000000..9422f748e010 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IpGeodatas.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of IpGeodatas. */ +public interface IpGeodatas { + /** + * Get geodata for a single IP address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipAddress IP address (v4 or v6) to be enriched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return geodata for a single IP address. + */ + EnrichmentIpGeodata get(String resourceGroupName, String ipAddress); + + /** + * Get geodata for a single IP address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipAddress IP address (v4 or v6) to be enriched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return geodata for a single IP address. + */ + Response getWithResponse(String resourceGroupName, String ipAddress, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/KillChainIntent.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/KillChainIntent.java new file mode 100644 index 000000000000..6ef9c235f2ce --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/KillChainIntent.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for KillChainIntent. */ +public final class KillChainIntent extends ExpandableStringEnum { + /** Static value Unknown for KillChainIntent. */ + public static final KillChainIntent UNKNOWN = fromString("Unknown"); + + /** Static value Probing for KillChainIntent. */ + public static final KillChainIntent PROBING = fromString("Probing"); + + /** Static value Exploitation for KillChainIntent. */ + public static final KillChainIntent EXPLOITATION = fromString("Exploitation"); + + /** Static value Persistence for KillChainIntent. */ + public static final KillChainIntent PERSISTENCE = fromString("Persistence"); + + /** Static value PrivilegeEscalation for KillChainIntent. */ + public static final KillChainIntent PRIVILEGE_ESCALATION = fromString("PrivilegeEscalation"); + + /** Static value DefenseEvasion for KillChainIntent. */ + public static final KillChainIntent DEFENSE_EVASION = fromString("DefenseEvasion"); + + /** Static value CredentialAccess for KillChainIntent. */ + public static final KillChainIntent CREDENTIAL_ACCESS = fromString("CredentialAccess"); + + /** Static value Discovery for KillChainIntent. */ + public static final KillChainIntent DISCOVERY = fromString("Discovery"); + + /** Static value LateralMovement for KillChainIntent. */ + public static final KillChainIntent LATERAL_MOVEMENT = fromString("LateralMovement"); + + /** Static value Execution for KillChainIntent. */ + public static final KillChainIntent EXECUTION = fromString("Execution"); + + /** Static value Collection for KillChainIntent. */ + public static final KillChainIntent COLLECTION = fromString("Collection"); + + /** Static value Exfiltration for KillChainIntent. */ + public static final KillChainIntent EXFILTRATION = fromString("Exfiltration"); + + /** Static value CommandAndControl for KillChainIntent. */ + public static final KillChainIntent COMMAND_AND_CONTROL = fromString("CommandAndControl"); + + /** Static value Impact for KillChainIntent. */ + public static final KillChainIntent IMPACT = fromString("Impact"); + + /** + * Creates or finds a KillChainIntent from its string representation. + * + * @param name a name to look for. + * @return the corresponding KillChainIntent. + */ + @JsonCreator + public static KillChainIntent fromString(String name) { + return fromString(name, KillChainIntent.class); + } + + /** @return known KillChainIntent values. */ + public static Collection values() { + return values(KillChainIntent.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Kind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Kind.java new file mode 100644 index 000000000000..be9a0df49f6a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Kind.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Kind. */ +public final class Kind extends ExpandableStringEnum { + /** Static value DataConnector for Kind. */ + public static final Kind DATA_CONNECTOR = fromString("DataConnector"); + + /** Static value DataType for Kind. */ + public static final Kind DATA_TYPE = fromString("DataType"); + + /** Static value Workbook for Kind. */ + public static final Kind WORKBOOK = fromString("Workbook"); + + /** Static value WorkbookTemplate for Kind. */ + public static final Kind WORKBOOK_TEMPLATE = fromString("WorkbookTemplate"); + + /** Static value Playbook for Kind. */ + public static final Kind PLAYBOOK = fromString("Playbook"); + + /** Static value PlaybookTemplate for Kind. */ + public static final Kind PLAYBOOK_TEMPLATE = fromString("PlaybookTemplate"); + + /** Static value AnalyticsRuleTemplate for Kind. */ + public static final Kind ANALYTICS_RULE_TEMPLATE = fromString("AnalyticsRuleTemplate"); + + /** Static value AnalyticsRule for Kind. */ + public static final Kind ANALYTICS_RULE = fromString("AnalyticsRule"); + + /** Static value HuntingQuery for Kind. */ + public static final Kind HUNTING_QUERY = fromString("HuntingQuery"); + + /** Static value InvestigationQuery for Kind. */ + public static final Kind INVESTIGATION_QUERY = fromString("InvestigationQuery"); + + /** Static value Parser for Kind. */ + public static final Kind PARSER = fromString("Parser"); + + /** Static value Watchlist for Kind. */ + public static final Kind WATCHLIST = fromString("Watchlist"); + + /** Static value WatchlistTemplate for Kind. */ + public static final Kind WATCHLIST_TEMPLATE = fromString("WatchlistTemplate"); + + /** Static value Solution for Kind. */ + public static final Kind SOLUTION = fromString("Solution"); + + /** + * Creates or finds a Kind from its string representation. + * + * @param name a name to look for. + * @return the corresponding Kind. + */ + @JsonCreator + public static Kind fromString(String name) { + return fromString(name, Kind.class); + } + + /** @return known Kind values. */ + public static Collection values() { + return values(Kind.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/LastDataReceivedDataType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/LastDataReceivedDataType.java new file mode 100644 index 000000000000..c29aad4abc40 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/LastDataReceivedDataType.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Data type for last data received. */ +@Fluent +public class LastDataReceivedDataType { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LastDataReceivedDataType.class); + + /* + * Name of the data type to show in the graph. can be use with + * {{graphQueriesTableName}} placeholder + */ + @JsonProperty(value = "name") + private String name; + + /* + * Query for indicate last data received + */ + @JsonProperty(value = "lastDataReceivedQuery") + private String lastDataReceivedQuery; + + /** + * Get the name property: Name of the data type to show in the graph. can be use with {{graphQueriesTableName}} + * placeholder. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the data type to show in the graph. can be use with {{graphQueriesTableName}} + * placeholder. + * + * @param name the name value to set. + * @return the LastDataReceivedDataType object itself. + */ + public LastDataReceivedDataType withName(String name) { + this.name = name; + return this; + } + + /** + * Get the lastDataReceivedQuery property: Query for indicate last data received. + * + * @return the lastDataReceivedQuery value. + */ + public String lastDataReceivedQuery() { + return this.lastDataReceivedQuery; + } + + /** + * Set the lastDataReceivedQuery property: Query for indicate last data received. + * + * @param lastDataReceivedQuery the lastDataReceivedQuery value to set. + * @return the LastDataReceivedDataType object itself. + */ + public LastDataReceivedDataType withLastDataReceivedQuery(String lastDataReceivedQuery) { + this.lastDataReceivedQuery = lastDataReceivedQuery; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MLBehaviorAnalyticsAlertRule.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MLBehaviorAnalyticsAlertRule.java new file mode 100644 index 000000000000..4df5f08acb44 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MLBehaviorAnalyticsAlertRule.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; +import com.azure.resourcemanager.securityinsights.fluent.models.MLBehaviorAnalyticsAlertRuleProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** Represents MLBehaviorAnalytics alert rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("MLBehaviorAnalytics") +@Fluent +public final class MLBehaviorAnalyticsAlertRule extends AlertRuleInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MLBehaviorAnalyticsAlertRule.class); + + /* + * MLBehaviorAnalytics alert rule properties + */ + @JsonProperty(value = "properties") + private MLBehaviorAnalyticsAlertRuleProperties innerProperties; + + /** + * Get the innerProperties property: MLBehaviorAnalytics alert rule properties. + * + * @return the innerProperties value. + */ + private MLBehaviorAnalyticsAlertRuleProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public MLBehaviorAnalyticsAlertRule withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. + * + * @return the alertRuleTemplateName value. + */ + public String alertRuleTemplateName() { + return this.innerProperties() == null ? null : this.innerProperties().alertRuleTemplateName(); + } + + /** + * Set the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. + * + * @param alertRuleTemplateName the alertRuleTemplateName value to set. + * @return the MLBehaviorAnalyticsAlertRule object itself. + */ + public MLBehaviorAnalyticsAlertRule withAlertRuleTemplateName(String alertRuleTemplateName) { + if (this.innerProperties() == null) { + this.innerProperties = new MLBehaviorAnalyticsAlertRuleProperties(); + } + this.innerProperties().withAlertRuleTemplateName(alertRuleTemplateName); + return this; + } + + /** + * Get the description property: The description of the alert rule. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Get the displayName property: The display name for alerts created by this alert rule. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Get the enabled property: Determines whether this alert rule is enabled or disabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.innerProperties() == null ? null : this.innerProperties().enabled(); + } + + /** + * Set the enabled property: Determines whether this alert rule is enabled or disabled. + * + * @param enabled the enabled value to set. + * @return the MLBehaviorAnalyticsAlertRule object itself. + */ + public MLBehaviorAnalyticsAlertRule withEnabled(Boolean enabled) { + if (this.innerProperties() == null) { + this.innerProperties = new MLBehaviorAnalyticsAlertRuleProperties(); + } + this.innerProperties().withEnabled(enabled); + return this; + } + + /** + * Get the lastModifiedUtc property: The last time that this alert rule has been modified. + * + * @return the lastModifiedUtc value. + */ + public OffsetDateTime lastModifiedUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedUtc(); + } + + /** + * Get the severity property: The severity for alerts created by this alert rule. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.innerProperties() == null ? null : this.innerProperties().severity(); + } + + /** + * Get the tactics property: The tactics of the alert rule. + * + * @return the tactics value. + */ + public List tactics() { + return this.innerProperties() == null ? null : this.innerProperties().tactics(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MLBehaviorAnalyticsAlertRuleTemplate.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MLBehaviorAnalyticsAlertRuleTemplate.java new file mode 100644 index 000000000000..cba55a5dee28 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MLBehaviorAnalyticsAlertRuleTemplate.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; +import com.azure.resourcemanager.securityinsights.fluent.models.MLBehaviorAnalyticsAlertRuleTemplateProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** Represents MLBehaviorAnalytics alert rule template. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("MLBehaviorAnalytics") +@Fluent +public final class MLBehaviorAnalyticsAlertRuleTemplate extends AlertRuleTemplateInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MLBehaviorAnalyticsAlertRuleTemplate.class); + + /* + * MLBehaviorAnalytics alert rule template properties. + */ + @JsonProperty(value = "properties") + private MLBehaviorAnalyticsAlertRuleTemplateProperties innerProperties; + + /** + * Get the innerProperties property: MLBehaviorAnalytics alert rule template properties. + * + * @return the innerProperties value. + */ + private MLBehaviorAnalyticsAlertRuleTemplateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the severity property: The severity for alerts created by this alert rule. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.innerProperties() == null ? null : this.innerProperties().severity(); + } + + /** + * Set the severity property: The severity for alerts created by this alert rule. + * + * @param severity the severity value to set. + * @return the MLBehaviorAnalyticsAlertRuleTemplate object itself. + */ + public MLBehaviorAnalyticsAlertRuleTemplate withSeverity(AlertSeverity severity) { + if (this.innerProperties() == null) { + this.innerProperties = new MLBehaviorAnalyticsAlertRuleTemplateProperties(); + } + this.innerProperties().withSeverity(severity); + return this; + } + + /** + * Get the tactics property: The tactics of the alert rule template. + * + * @return the tactics value. + */ + public List tactics() { + return this.innerProperties() == null ? null : this.innerProperties().tactics(); + } + + /** + * Set the tactics property: The tactics of the alert rule template. + * + * @param tactics the tactics value to set. + * @return the MLBehaviorAnalyticsAlertRuleTemplate object itself. + */ + public MLBehaviorAnalyticsAlertRuleTemplate withTactics(List tactics) { + if (this.innerProperties() == null) { + this.innerProperties = new MLBehaviorAnalyticsAlertRuleTemplateProperties(); + } + this.innerProperties().withTactics(tactics); + return this; + } + + /** + * Get the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. + * + * @return the alertRulesCreatedByTemplateCount value. + */ + public Integer alertRulesCreatedByTemplateCount() { + return this.innerProperties() == null ? null : this.innerProperties().alertRulesCreatedByTemplateCount(); + } + + /** + * Set the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. + * + * @param alertRulesCreatedByTemplateCount the alertRulesCreatedByTemplateCount value to set. + * @return the MLBehaviorAnalyticsAlertRuleTemplate object itself. + */ + public MLBehaviorAnalyticsAlertRuleTemplate withAlertRulesCreatedByTemplateCount( + Integer alertRulesCreatedByTemplateCount) { + if (this.innerProperties() == null) { + this.innerProperties = new MLBehaviorAnalyticsAlertRuleTemplateProperties(); + } + this.innerProperties().withAlertRulesCreatedByTemplateCount(alertRulesCreatedByTemplateCount); + return this; + } + + /** + * Get the lastUpdatedDateUtc property: The last time that this alert rule template has been updated. + * + * @return the lastUpdatedDateUtc value. + */ + public OffsetDateTime lastUpdatedDateUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedDateUtc(); + } + + /** + * Get the createdDateUtc property: The time that this alert rule template has been added. + * + * @return the createdDateUtc value. + */ + public OffsetDateTime createdDateUtc() { + return this.innerProperties() == null ? null : this.innerProperties().createdDateUtc(); + } + + /** + * Get the description property: The description of the alert rule template. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of the alert rule template. + * + * @param description the description value to set. + * @return the MLBehaviorAnalyticsAlertRuleTemplate object itself. + */ + public MLBehaviorAnalyticsAlertRuleTemplate withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new MLBehaviorAnalyticsAlertRuleTemplateProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the displayName property: The display name for alert rule template. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name for alert rule template. + * + * @param displayName the displayName value to set. + * @return the MLBehaviorAnalyticsAlertRuleTemplate object itself. + */ + public MLBehaviorAnalyticsAlertRuleTemplate withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new MLBehaviorAnalyticsAlertRuleTemplateProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the requiredDataConnectors property: The required data sources for this template. + * + * @return the requiredDataConnectors value. + */ + public List requiredDataConnectors() { + return this.innerProperties() == null ? null : this.innerProperties().requiredDataConnectors(); + } + + /** + * Set the requiredDataConnectors property: The required data sources for this template. + * + * @param requiredDataConnectors the requiredDataConnectors value to set. + * @return the MLBehaviorAnalyticsAlertRuleTemplate object itself. + */ + public MLBehaviorAnalyticsAlertRuleTemplate withRequiredDataConnectors( + List requiredDataConnectors) { + if (this.innerProperties() == null) { + this.innerProperties = new MLBehaviorAnalyticsAlertRuleTemplateProperties(); + } + this.innerProperties().withRequiredDataConnectors(requiredDataConnectors); + return this; + } + + /** + * Get the status property: The alert rule template status. + * + * @return the status value. + */ + public TemplateStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The alert rule template status. + * + * @param status the status value to set. + * @return the MLBehaviorAnalyticsAlertRuleTemplate object itself. + */ + public MLBehaviorAnalyticsAlertRuleTemplate withStatus(TemplateStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new MLBehaviorAnalyticsAlertRuleTemplateProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MailClusterEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MailClusterEntity.java new file mode 100644 index 000000000000..de9263b6a6bd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MailClusterEntity.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.azure.resourcemanager.securityinsights.fluent.models.MailClusterEntityProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Represents a mail cluster entity. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("MailCluster") +@Fluent +public final class MailClusterEntity extends EntityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MailClusterEntity.class); + + /* + * Mail cluster entity properties + */ + @JsonProperty(value = "properties") + private MailClusterEntityProperties innerProperties; + + /** + * Get the innerProperties property: Mail cluster entity properties. + * + * @return the innerProperties value. + */ + private MailClusterEntityProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the networkMessageIds property: The mail message IDs that are part of the mail cluster. + * + * @return the networkMessageIds value. + */ + public List networkMessageIds() { + return this.innerProperties() == null ? null : this.innerProperties().networkMessageIds(); + } + + /** + * Get the countByDeliveryStatus property: Count of mail messages by DeliveryStatus string representation. + * + * @return the countByDeliveryStatus value. + */ + public Object countByDeliveryStatus() { + return this.innerProperties() == null ? null : this.innerProperties().countByDeliveryStatus(); + } + + /** + * Get the countByThreatType property: Count of mail messages by ThreatType string representation. + * + * @return the countByThreatType value. + */ + public Object countByThreatType() { + return this.innerProperties() == null ? null : this.innerProperties().countByThreatType(); + } + + /** + * Get the countByProtectionStatus property: Count of mail messages by ProtectionStatus string representation. + * + * @return the countByProtectionStatus value. + */ + public Object countByProtectionStatus() { + return this.innerProperties() == null ? null : this.innerProperties().countByProtectionStatus(); + } + + /** + * Get the threats property: The threats of mail messages that are part of the mail cluster. + * + * @return the threats value. + */ + public List threats() { + return this.innerProperties() == null ? null : this.innerProperties().threats(); + } + + /** + * Get the query property: The query that was used to identify the messages of the mail cluster. + * + * @return the query value. + */ + public String query() { + return this.innerProperties() == null ? null : this.innerProperties().query(); + } + + /** + * Get the queryTime property: The query time. + * + * @return the queryTime value. + */ + public OffsetDateTime queryTime() { + return this.innerProperties() == null ? null : this.innerProperties().queryTime(); + } + + /** + * Get the mailCount property: The number of mail messages that are part of the mail cluster. + * + * @return the mailCount value. + */ + public Integer mailCount() { + return this.innerProperties() == null ? null : this.innerProperties().mailCount(); + } + + /** + * Get the isVolumeAnomaly property: Is this a volume anomaly mail cluster. + * + * @return the isVolumeAnomaly value. + */ + public Boolean isVolumeAnomaly() { + return this.innerProperties() == null ? null : this.innerProperties().isVolumeAnomaly(); + } + + /** + * Get the source property: The source of the mail cluster (default is 'O365 ATP'). + * + * @return the source value. + */ + public String source() { + return this.innerProperties() == null ? null : this.innerProperties().source(); + } + + /** + * Get the clusterSourceIdentifier property: The id of the cluster source. + * + * @return the clusterSourceIdentifier value. + */ + public String clusterSourceIdentifier() { + return this.innerProperties() == null ? null : this.innerProperties().clusterSourceIdentifier(); + } + + /** + * Get the clusterSourceType property: The type of the cluster source. + * + * @return the clusterSourceType value. + */ + public String clusterSourceType() { + return this.innerProperties() == null ? null : this.innerProperties().clusterSourceType(); + } + + /** + * Get the clusterQueryStartTime property: The cluster query start time. + * + * @return the clusterQueryStartTime value. + */ + public OffsetDateTime clusterQueryStartTime() { + return this.innerProperties() == null ? null : this.innerProperties().clusterQueryStartTime(); + } + + /** + * Get the clusterQueryEndTime property: The cluster query end time. + * + * @return the clusterQueryEndTime value. + */ + public OffsetDateTime clusterQueryEndTime() { + return this.innerProperties() == null ? null : this.innerProperties().clusterQueryEndTime(); + } + + /** + * Get the clusterGroup property: The cluster group. + * + * @return the clusterGroup value. + */ + public String clusterGroup() { + return this.innerProperties() == null ? null : this.innerProperties().clusterGroup(); + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MailMessageEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MailMessageEntity.java new file mode 100644 index 000000000000..9161d6490397 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MailMessageEntity.java @@ -0,0 +1,412 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.azure.resourcemanager.securityinsights.fluent.models.MailMessageEntityProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/** Represents a mail message entity. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("MailMessage") +@Fluent +public final class MailMessageEntity extends EntityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MailMessageEntity.class); + + /* + * Mail message entity properties + */ + @JsonProperty(value = "properties") + private MailMessageEntityProperties innerProperties; + + /** + * Get the innerProperties property: Mail message entity properties. + * + * @return the innerProperties value. + */ + private MailMessageEntityProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the fileEntityIds property: The File entity ids of this mail message's attachments. + * + * @return the fileEntityIds value. + */ + public List fileEntityIds() { + return this.innerProperties() == null ? null : this.innerProperties().fileEntityIds(); + } + + /** + * Get the recipient property: The recipient of this mail message. Note that in case of multiple recipients the mail + * message is forked and each copy has one recipient. + * + * @return the recipient value. + */ + public String recipient() { + return this.innerProperties() == null ? null : this.innerProperties().recipient(); + } + + /** + * Get the urls property: The Urls contained in this mail message. + * + * @return the urls value. + */ + public List urls() { + return this.innerProperties() == null ? null : this.innerProperties().urls(); + } + + /** + * Get the threats property: The threats of this mail message. + * + * @return the threats value. + */ + public List threats() { + return this.innerProperties() == null ? null : this.innerProperties().threats(); + } + + /** + * Get the p1Sender property: The p1 sender's email address. + * + * @return the p1Sender value. + */ + public String p1Sender() { + return this.innerProperties() == null ? null : this.innerProperties().p1Sender(); + } + + /** + * Get the p1SenderDisplayName property: The p1 sender's display name. + * + * @return the p1SenderDisplayName value. + */ + public String p1SenderDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().p1SenderDisplayName(); + } + + /** + * Get the p1SenderDomain property: The p1 sender's domain. + * + * @return the p1SenderDomain value. + */ + public String p1SenderDomain() { + return this.innerProperties() == null ? null : this.innerProperties().p1SenderDomain(); + } + + /** + * Get the senderIp property: The sender's IP address. + * + * @return the senderIp value. + */ + public String senderIp() { + return this.innerProperties() == null ? null : this.innerProperties().senderIp(); + } + + /** + * Get the p2Sender property: The p2 sender's email address. + * + * @return the p2Sender value. + */ + public String p2Sender() { + return this.innerProperties() == null ? null : this.innerProperties().p2Sender(); + } + + /** + * Get the p2SenderDisplayName property: The p2 sender's display name. + * + * @return the p2SenderDisplayName value. + */ + public String p2SenderDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().p2SenderDisplayName(); + } + + /** + * Get the p2SenderDomain property: The p2 sender's domain. + * + * @return the p2SenderDomain value. + */ + public String p2SenderDomain() { + return this.innerProperties() == null ? null : this.innerProperties().p2SenderDomain(); + } + + /** + * Get the receiveDate property: The receive date of this message. + * + * @return the receiveDate value. + */ + public OffsetDateTime receiveDate() { + return this.innerProperties() == null ? null : this.innerProperties().receiveDate(); + } + + /** + * Get the networkMessageId property: The network message id of this mail message. + * + * @return the networkMessageId value. + */ + public UUID networkMessageId() { + return this.innerProperties() == null ? null : this.innerProperties().networkMessageId(); + } + + /** + * Get the internetMessageId property: The internet message id of this mail message. + * + * @return the internetMessageId value. + */ + public String internetMessageId() { + return this.innerProperties() == null ? null : this.innerProperties().internetMessageId(); + } + + /** + * Get the subject property: The subject of this mail message. + * + * @return the subject value. + */ + public String subject() { + return this.innerProperties() == null ? null : this.innerProperties().subject(); + } + + /** + * Get the language property: The language of this mail message. + * + * @return the language value. + */ + public String language() { + return this.innerProperties() == null ? null : this.innerProperties().language(); + } + + /** + * Get the threatDetectionMethods property: The threat detection methods. + * + * @return the threatDetectionMethods value. + */ + public List threatDetectionMethods() { + return this.innerProperties() == null ? null : this.innerProperties().threatDetectionMethods(); + } + + /** + * Get the bodyFingerprintBin1 property: The bodyFingerprintBin1. + * + * @return the bodyFingerprintBin1 value. + */ + public Integer bodyFingerprintBin1() { + return this.innerProperties() == null ? null : this.innerProperties().bodyFingerprintBin1(); + } + + /** + * Set the bodyFingerprintBin1 property: The bodyFingerprintBin1. + * + * @param bodyFingerprintBin1 the bodyFingerprintBin1 value to set. + * @return the MailMessageEntity object itself. + */ + public MailMessageEntity withBodyFingerprintBin1(Integer bodyFingerprintBin1) { + if (this.innerProperties() == null) { + this.innerProperties = new MailMessageEntityProperties(); + } + this.innerProperties().withBodyFingerprintBin1(bodyFingerprintBin1); + return this; + } + + /** + * Get the bodyFingerprintBin2 property: The bodyFingerprintBin2. + * + * @return the bodyFingerprintBin2 value. + */ + public Integer bodyFingerprintBin2() { + return this.innerProperties() == null ? null : this.innerProperties().bodyFingerprintBin2(); + } + + /** + * Set the bodyFingerprintBin2 property: The bodyFingerprintBin2. + * + * @param bodyFingerprintBin2 the bodyFingerprintBin2 value to set. + * @return the MailMessageEntity object itself. + */ + public MailMessageEntity withBodyFingerprintBin2(Integer bodyFingerprintBin2) { + if (this.innerProperties() == null) { + this.innerProperties = new MailMessageEntityProperties(); + } + this.innerProperties().withBodyFingerprintBin2(bodyFingerprintBin2); + return this; + } + + /** + * Get the bodyFingerprintBin3 property: The bodyFingerprintBin3. + * + * @return the bodyFingerprintBin3 value. + */ + public Integer bodyFingerprintBin3() { + return this.innerProperties() == null ? null : this.innerProperties().bodyFingerprintBin3(); + } + + /** + * Set the bodyFingerprintBin3 property: The bodyFingerprintBin3. + * + * @param bodyFingerprintBin3 the bodyFingerprintBin3 value to set. + * @return the MailMessageEntity object itself. + */ + public MailMessageEntity withBodyFingerprintBin3(Integer bodyFingerprintBin3) { + if (this.innerProperties() == null) { + this.innerProperties = new MailMessageEntityProperties(); + } + this.innerProperties().withBodyFingerprintBin3(bodyFingerprintBin3); + return this; + } + + /** + * Get the bodyFingerprintBin4 property: The bodyFingerprintBin4. + * + * @return the bodyFingerprintBin4 value. + */ + public Integer bodyFingerprintBin4() { + return this.innerProperties() == null ? null : this.innerProperties().bodyFingerprintBin4(); + } + + /** + * Set the bodyFingerprintBin4 property: The bodyFingerprintBin4. + * + * @param bodyFingerprintBin4 the bodyFingerprintBin4 value to set. + * @return the MailMessageEntity object itself. + */ + public MailMessageEntity withBodyFingerprintBin4(Integer bodyFingerprintBin4) { + if (this.innerProperties() == null) { + this.innerProperties = new MailMessageEntityProperties(); + } + this.innerProperties().withBodyFingerprintBin4(bodyFingerprintBin4); + return this; + } + + /** + * Get the bodyFingerprintBin5 property: The bodyFingerprintBin5. + * + * @return the bodyFingerprintBin5 value. + */ + public Integer bodyFingerprintBin5() { + return this.innerProperties() == null ? null : this.innerProperties().bodyFingerprintBin5(); + } + + /** + * Set the bodyFingerprintBin5 property: The bodyFingerprintBin5. + * + * @param bodyFingerprintBin5 the bodyFingerprintBin5 value to set. + * @return the MailMessageEntity object itself. + */ + public MailMessageEntity withBodyFingerprintBin5(Integer bodyFingerprintBin5) { + if (this.innerProperties() == null) { + this.innerProperties = new MailMessageEntityProperties(); + } + this.innerProperties().withBodyFingerprintBin5(bodyFingerprintBin5); + return this; + } + + /** + * Get the antispamDirection property: The directionality of this mail message. + * + * @return the antispamDirection value. + */ + public AntispamMailDirection antispamDirection() { + return this.innerProperties() == null ? null : this.innerProperties().antispamDirection(); + } + + /** + * Set the antispamDirection property: The directionality of this mail message. + * + * @param antispamDirection the antispamDirection value to set. + * @return the MailMessageEntity object itself. + */ + public MailMessageEntity withAntispamDirection(AntispamMailDirection antispamDirection) { + if (this.innerProperties() == null) { + this.innerProperties = new MailMessageEntityProperties(); + } + this.innerProperties().withAntispamDirection(antispamDirection); + return this; + } + + /** + * Get the deliveryAction property: The delivery action of this mail message like Delivered, Blocked, Replaced etc. + * + * @return the deliveryAction value. + */ + public DeliveryAction deliveryAction() { + return this.innerProperties() == null ? null : this.innerProperties().deliveryAction(); + } + + /** + * Set the deliveryAction property: The delivery action of this mail message like Delivered, Blocked, Replaced etc. + * + * @param deliveryAction the deliveryAction value to set. + * @return the MailMessageEntity object itself. + */ + public MailMessageEntity withDeliveryAction(DeliveryAction deliveryAction) { + if (this.innerProperties() == null) { + this.innerProperties = new MailMessageEntityProperties(); + } + this.innerProperties().withDeliveryAction(deliveryAction); + return this; + } + + /** + * Get the deliveryLocation property: The delivery location of this mail message like Inbox, JunkFolder etc. + * + * @return the deliveryLocation value. + */ + public DeliveryLocation deliveryLocation() { + return this.innerProperties() == null ? null : this.innerProperties().deliveryLocation(); + } + + /** + * Set the deliveryLocation property: The delivery location of this mail message like Inbox, JunkFolder etc. + * + * @param deliveryLocation the deliveryLocation value to set. + * @return the MailMessageEntity object itself. + */ + public MailMessageEntity withDeliveryLocation(DeliveryLocation deliveryLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new MailMessageEntityProperties(); + } + this.innerProperties().withDeliveryLocation(deliveryLocation); + return this; + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MailboxEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MailboxEntity.java new file mode 100644 index 000000000000..11addd831b33 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MailboxEntity.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.azure.resourcemanager.securityinsights.fluent.models.MailboxEntityProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; +import java.util.UUID; + +/** Represents a mailbox entity. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Mailbox") +@Fluent +public final class MailboxEntity extends EntityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MailboxEntity.class); + + /* + * Mailbox entity properties + */ + @JsonProperty(value = "properties") + private MailboxEntityProperties innerProperties; + + /** + * Get the innerProperties property: Mailbox entity properties. + * + * @return the innerProperties value. + */ + private MailboxEntityProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the mailboxPrimaryAddress property: The mailbox's primary address. + * + * @return the mailboxPrimaryAddress value. + */ + public String mailboxPrimaryAddress() { + return this.innerProperties() == null ? null : this.innerProperties().mailboxPrimaryAddress(); + } + + /** + * Get the displayName property: The mailbox's display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Get the upn property: The mailbox's UPN. + * + * @return the upn value. + */ + public String upn() { + return this.innerProperties() == null ? null : this.innerProperties().upn(); + } + + /** + * Get the externalDirectoryObjectId property: The AzureAD identifier of mailbox. Similar to AadUserId in account + * entity but this property is specific to mailbox object on office side. + * + * @return the externalDirectoryObjectId value. + */ + public UUID externalDirectoryObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().externalDirectoryObjectId(); + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MalwareEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MalwareEntity.java new file mode 100644 index 000000000000..a7d8aa4695b7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MalwareEntity.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.azure.resourcemanager.securityinsights.fluent.models.MalwareEntityProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Represents a malware entity. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Malware") +@Fluent +public final class MalwareEntity extends EntityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MalwareEntity.class); + + /* + * File entity properties + */ + @JsonProperty(value = "properties") + private MalwareEntityProperties innerProperties; + + /** + * Get the innerProperties property: File entity properties. + * + * @return the innerProperties value. + */ + private MalwareEntityProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the category property: The malware category by the vendor, e.g. Trojan. + * + * @return the category value. + */ + public String category() { + return this.innerProperties() == null ? null : this.innerProperties().category(); + } + + /** + * Get the fileEntityIds property: List of linked file entity identifiers on which the malware was found. + * + * @return the fileEntityIds value. + */ + public List fileEntityIds() { + return this.innerProperties() == null ? null : this.innerProperties().fileEntityIds(); + } + + /** + * Get the malwareName property: The malware name by the vendor, e.g. Win32/Toga!rfn. + * + * @return the malwareName value. + */ + public String malwareName() { + return this.innerProperties() == null ? null : this.innerProperties().malwareName(); + } + + /** + * Get the processEntityIds property: List of linked process entity identifiers on which the malware was found. + * + * @return the processEntityIds value. + */ + public List processEntityIds() { + return this.innerProperties() == null ? null : this.innerProperties().processEntityIds(); + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MatchingMethod.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MatchingMethod.java new file mode 100644 index 000000000000..e5be13f96734 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MatchingMethod.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MatchingMethod. */ +public final class MatchingMethod extends ExpandableStringEnum { + /** Static value AllEntities for MatchingMethod. */ + public static final MatchingMethod ALL_ENTITIES = fromString("AllEntities"); + + /** Static value AnyAlert for MatchingMethod. */ + public static final MatchingMethod ANY_ALERT = fromString("AnyAlert"); + + /** Static value Selected for MatchingMethod. */ + public static final MatchingMethod SELECTED = fromString("Selected"); + + /** + * Creates or finds a MatchingMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding MatchingMethod. + */ + @JsonCreator + public static MatchingMethod fromString(String name) { + return fromString(name, MatchingMethod.class); + } + + /** @return known MatchingMethod values. */ + public static Collection values() { + return values(MatchingMethod.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/McasCheckRequirements.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/McasCheckRequirements.java new file mode 100644 index 000000000000..89c5717e04ff --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/McasCheckRequirements.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.McasCheckRequirementsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents MCAS (Microsoft Cloud App Security) requirements check request. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("MicrosoftCloudAppSecurity") +@Fluent +public final class McasCheckRequirements extends DataConnectorsCheckRequirements { + @JsonIgnore private final ClientLogger logger = new ClientLogger(McasCheckRequirements.class); + + /* + * MCAS (Microsoft Cloud App Security) requirements check properties. + */ + @JsonProperty(value = "properties") + private McasCheckRequirementsProperties innerProperties; + + /** + * Get the innerProperties property: MCAS (Microsoft Cloud App Security) requirements check properties. + * + * @return the innerProperties value. + */ + private McasCheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/McasDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/McasDataConnector.java new file mode 100644 index 000000000000..7ce0e096cac9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/McasDataConnector.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.McasDataConnectorProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents MCAS (Microsoft Cloud App Security) data connector. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("MicrosoftCloudAppSecurity") +@Fluent +public final class McasDataConnector extends DataConnectorInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(McasDataConnector.class); + + /* + * MCAS (Microsoft Cloud App Security) data connector properties. + */ + @JsonProperty(value = "properties") + private McasDataConnectorProperties innerProperties; + + /** + * Get the innerProperties property: MCAS (Microsoft Cloud App Security) data connector properties. + * + * @return the innerProperties value. + */ + private McasDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public McasDataConnector withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public McasDataConnectorDataTypes dataTypes() { + return this.innerProperties() == null ? null : this.innerProperties().dataTypes(); + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the McasDataConnector object itself. + */ + public McasDataConnector withDataTypes(McasDataConnectorDataTypes dataTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new McasDataConnectorProperties(); + } + this.innerProperties().withDataTypes(dataTypes); + return this; + } + + /** + * Get the tenantId property: The tenant id to connect to, and get the data from. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Set the tenantId property: The tenant id to connect to, and get the data from. + * + * @param tenantId the tenantId value to set. + * @return the McasDataConnector object itself. + */ + public McasDataConnector withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new McasDataConnectorProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/McasDataConnectorDataTypes.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/McasDataConnectorDataTypes.java new file mode 100644 index 000000000000..95f476273a76 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/McasDataConnectorDataTypes.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The available data types for MCAS (Microsoft Cloud App Security) data connector. */ +@Fluent +public final class McasDataConnectorDataTypes extends AlertsDataTypeOfDataConnector { + @JsonIgnore private final ClientLogger logger = new ClientLogger(McasDataConnectorDataTypes.class); + + /* + * Discovery log data type connection. + */ + @JsonProperty(value = "discoveryLogs") + private DataConnectorDataTypeCommon discoveryLogs; + + /** + * Get the discoveryLogs property: Discovery log data type connection. + * + * @return the discoveryLogs value. + */ + public DataConnectorDataTypeCommon discoveryLogs() { + return this.discoveryLogs; + } + + /** + * Set the discoveryLogs property: Discovery log data type connection. + * + * @param discoveryLogs the discoveryLogs value to set. + * @return the McasDataConnectorDataTypes object itself. + */ + public McasDataConnectorDataTypes withDiscoveryLogs(DataConnectorDataTypeCommon discoveryLogs) { + this.discoveryLogs = discoveryLogs; + return this; + } + + /** {@inheritDoc} */ + @Override + public McasDataConnectorDataTypes withAlerts(DataConnectorDataTypeCommon alerts) { + super.withAlerts(alerts); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (discoveryLogs() != null) { + discoveryLogs().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MdatpCheckRequirements.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MdatpCheckRequirements.java new file mode 100644 index 000000000000..70038344124e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MdatpCheckRequirements.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.MdatpCheckRequirementsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents MDATP (Microsoft Defender Advanced Threat Protection) requirements check request. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("MicrosoftDefenderAdvancedThreatProtection") +@Fluent +public final class MdatpCheckRequirements extends DataConnectorsCheckRequirements { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MdatpCheckRequirements.class); + + /* + * MDATP (Microsoft Defender Advanced Threat Protection) requirements check + * properties. + */ + @JsonProperty(value = "properties") + private MdatpCheckRequirementsProperties innerProperties; + + /** + * Get the innerProperties property: MDATP (Microsoft Defender Advanced Threat Protection) requirements check + * properties. + * + * @return the innerProperties value. + */ + private MdatpCheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MdatpDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MdatpDataConnector.java new file mode 100644 index 000000000000..f5c1ea4bf0a7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MdatpDataConnector.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.MdatpDataConnectorProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents MDATP (Microsoft Defender Advanced Threat Protection) data connector. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("MicrosoftDefenderAdvancedThreatProtection") +@Fluent +public final class MdatpDataConnector extends DataConnectorInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MdatpDataConnector.class); + + /* + * MDATP (Microsoft Defender Advanced Threat Protection) data connector + * properties. + */ + @JsonProperty(value = "properties") + private MdatpDataConnectorProperties innerProperties; + + /** + * Get the innerProperties property: MDATP (Microsoft Defender Advanced Threat Protection) data connector + * properties. + * + * @return the innerProperties value. + */ + private MdatpDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public MdatpDataConnector withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public AlertsDataTypeOfDataConnector dataTypes() { + return this.innerProperties() == null ? null : this.innerProperties().dataTypes(); + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the MdatpDataConnector object itself. + */ + public MdatpDataConnector withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new MdatpDataConnectorProperties(); + } + this.innerProperties().withDataTypes(dataTypes); + return this; + } + + /** + * Get the tenantId property: The tenant id to connect to, and get the data from. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Set the tenantId property: The tenant id to connect to, and get the data from. + * + * @param tenantId the tenantId value to set. + * @return the MdatpDataConnector object itself. + */ + public MdatpDataConnector withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new MdatpDataConnectorProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataAuthor.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataAuthor.java new file mode 100644 index 000000000000..b22cc01381a5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataAuthor.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Publisher or creator of the content item. */ +@Fluent +public final class MetadataAuthor { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetadataAuthor.class); + + /* + * Name of the author. Company or person. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Email of author contact + */ + @JsonProperty(value = "email") + private String email; + + /* + * Link for author/vendor page + */ + @JsonProperty(value = "link") + private String link; + + /** + * Get the name property: Name of the author. Company or person. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the author. Company or person. + * + * @param name the name value to set. + * @return the MetadataAuthor object itself. + */ + public MetadataAuthor withName(String name) { + this.name = name; + return this; + } + + /** + * Get the email property: Email of author contact. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: Email of author contact. + * + * @param email the email value to set. + * @return the MetadataAuthor object itself. + */ + public MetadataAuthor withEmail(String email) { + this.email = email; + return this; + } + + /** + * Get the link property: Link for author/vendor page. + * + * @return the link value. + */ + public String link() { + return this.link; + } + + /** + * Set the link property: Link for author/vendor page. + * + * @param link the link value to set. + * @return the MetadataAuthor object itself. + */ + public MetadataAuthor withLink(String link) { + this.link = link; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataCategories.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataCategories.java new file mode 100644 index 000000000000..f1b34af50c70 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataCategories.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ies for the solution content item. */ +@Fluent +public final class MetadataCategories { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetadataCategories.class); + + /* + * domain for the solution content item + */ + @JsonProperty(value = "domains") + private List domains; + + /* + * Industry verticals for the solution content item + */ + @JsonProperty(value = "verticals") + private List verticals; + + /** + * Get the domains property: domain for the solution content item. + * + * @return the domains value. + */ + public List domains() { + return this.domains; + } + + /** + * Set the domains property: domain for the solution content item. + * + * @param domains the domains value to set. + * @return the MetadataCategories object itself. + */ + public MetadataCategories withDomains(List domains) { + this.domains = domains; + return this; + } + + /** + * Get the verticals property: Industry verticals for the solution content item. + * + * @return the verticals value. + */ + public List verticals() { + return this.verticals; + } + + /** + * Set the verticals property: Industry verticals for the solution content item. + * + * @param verticals the verticals value to set. + * @return the MetadataCategories object itself. + */ + public MetadataCategories withVerticals(List verticals) { + this.verticals = verticals; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataDependencies.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataDependencies.java new file mode 100644 index 000000000000..f641c8057a04 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataDependencies.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Dependencies for the content item, what other content items it requires to work. Can describe more complex + * dependencies using a recursive/nested structure. For a single dependency an id/kind/version can be supplied or + * operator/criteria for complex dependencies. + */ +@Fluent +public final class MetadataDependencies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetadataDependencies.class); + + /* + * Id of the content item we depend on + */ + @JsonProperty(value = "contentId") + private String contentId; + + /* + * Type of the content item we depend on + */ + @JsonProperty(value = "kind") + private Kind kind; + + /* + * Version of the the content item we depend on. Can be blank, * or + * missing to indicate any version fulfills the dependency. If version + * does not match our defined numeric format then an exact match is + * required. + */ + @JsonProperty(value = "version") + private String version; + + /* + * Name of the content item + */ + @JsonProperty(value = "name") + private String name; + + /* + * Operator used for list of dependencies in criteria array. + */ + @JsonProperty(value = "operator") + private Operator operator; + + /* + * This is the list of dependencies we must fulfill, according to the + * AND/OR operator + */ + @JsonProperty(value = "criteria") + private List criteria; + + /** + * Get the contentId property: Id of the content item we depend on. + * + * @return the contentId value. + */ + public String contentId() { + return this.contentId; + } + + /** + * Set the contentId property: Id of the content item we depend on. + * + * @param contentId the contentId value to set. + * @return the MetadataDependencies object itself. + */ + public MetadataDependencies withContentId(String contentId) { + this.contentId = contentId; + return this; + } + + /** + * Get the kind property: Type of the content item we depend on. + * + * @return the kind value. + */ + public Kind kind() { + return this.kind; + } + + /** + * Set the kind property: Type of the content item we depend on. + * + * @param kind the kind value to set. + * @return the MetadataDependencies object itself. + */ + public MetadataDependencies withKind(Kind kind) { + this.kind = kind; + return this; + } + + /** + * Get the version property: Version of the the content item we depend on. Can be blank, * or missing to indicate + * any version fulfills the dependency. If version does not match our defined numeric format then an exact match is + * required. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version of the the content item we depend on. Can be blank, * or missing to indicate + * any version fulfills the dependency. If version does not match our defined numeric format then an exact match is + * required. + * + * @param version the version value to set. + * @return the MetadataDependencies object itself. + */ + public MetadataDependencies withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the name property: Name of the content item. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the content item. + * + * @param name the name value to set. + * @return the MetadataDependencies object itself. + */ + public MetadataDependencies withName(String name) { + this.name = name; + return this; + } + + /** + * Get the operator property: Operator used for list of dependencies in criteria array. + * + * @return the operator value. + */ + public Operator operator() { + return this.operator; + } + + /** + * Set the operator property: Operator used for list of dependencies in criteria array. + * + * @param operator the operator value to set. + * @return the MetadataDependencies object itself. + */ + public MetadataDependencies withOperator(Operator operator) { + this.operator = operator; + return this; + } + + /** + * Get the criteria property: This is the list of dependencies we must fulfill, according to the AND/OR operator. + * + * @return the criteria value. + */ + public List criteria() { + return this.criteria; + } + + /** + * Set the criteria property: This is the list of dependencies we must fulfill, according to the AND/OR operator. + * + * @param criteria the criteria value to set. + * @return the MetadataDependencies object itself. + */ + public MetadataDependencies withCriteria(List criteria) { + this.criteria = criteria; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (criteria() != null) { + criteria().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataList.java new file mode 100644 index 000000000000..075718b04bfa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataList.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.MetadataModelInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of all the metadata. */ +@Fluent +public final class MetadataList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetadataList.class); + + /* + * Array of metadata. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * URL to fetch the next page of metadata. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of metadata. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of metadata. + * + * @param value the value value to set. + * @return the MetadataList object itself. + */ + public MetadataList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to fetch the next page of metadata. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model MetadataList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataModel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataModel.java new file mode 100644 index 000000000000..8a601c815edd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataModel.java @@ -0,0 +1,544 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.MetadataModelInner; +import java.time.LocalDate; +import java.util.List; + +/** An immutable client-side representation of MetadataModel. */ +public interface MetadataModel { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the contentId property: Static ID for the content. Used to identify dependencies and content from solutions + * or community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This is the + * resource name. + * + * @return the contentId value. + */ + String contentId(); + + /** + * Gets the parentId property: Full parent resource ID of the content item the metadata is for. This is the full + * resource ID including the scope (subscription and resource group). + * + * @return the parentId value. + */ + String parentId(); + + /** + * Gets the version property: Version of the content. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0, + * 1.0.0.0), following ARM template best practices. Can also be any string, but then we cannot guarantee any version + * checks. + * + * @return the version value. + */ + String version(); + + /** + * Gets the kind property: The kind of content the metadata is for. + * + * @return the kind value. + */ + Kind kind(); + + /** + * Gets the source property: Source of the content. This is where/how it was created. + * + * @return the source value. + */ + MetadataSource source(); + + /** + * Gets the author property: The creator of the content item. + * + * @return the author value. + */ + MetadataAuthor author(); + + /** + * Gets the support property: Support information for the metadata - type, name, contact information. + * + * @return the support value. + */ + MetadataSupport support(); + + /** + * Gets the dependencies property: Dependencies for the content item, what other content items it requires to work. + * Can describe more complex dependencies using a recursive/nested structure. For a single dependency an + * id/kind/version can be supplied or operator/criteria for complex formats. + * + * @return the dependencies value. + */ + MetadataDependencies dependencies(); + + /** + * Gets the categories property: Categories for the solution content item. + * + * @return the categories value. + */ + MetadataCategories categories(); + + /** + * Gets the providers property: Providers for the solution content item. + * + * @return the providers value. + */ + List providers(); + + /** + * Gets the firstPublishDate property: first publish date solution content item. + * + * @return the firstPublishDate value. + */ + LocalDate firstPublishDate(); + + /** + * Gets the lastPublishDate property: last publish date for the solution content item. + * + * @return the lastPublishDate value. + */ + LocalDate lastPublishDate(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.MetadataModelInner object. + * + * @return the inner object. + */ + MetadataModelInner innerModel(); + + /** The entirety of the MetadataModel definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The MetadataModel definition stages. */ + interface DefinitionStages { + /** The first stage of the MetadataModel definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the MetadataModel definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @return the next definition stage. + */ + WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); + } + /** + * The stage of the MetadataModel definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithEtag, + DefinitionStages.WithContentId, + DefinitionStages.WithParentId, + DefinitionStages.WithVersion, + DefinitionStages.WithKind, + DefinitionStages.WithSource, + DefinitionStages.WithAuthor, + DefinitionStages.WithSupport, + DefinitionStages.WithDependencies, + DefinitionStages.WithCategories, + DefinitionStages.WithProviders, + DefinitionStages.WithFirstPublishDate, + DefinitionStages.WithLastPublishDate { + /** + * Executes the create request. + * + * @return the created resource. + */ + MetadataModel create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + MetadataModel create(Context context); + } + /** The stage of the MetadataModel definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Etag of the azure resource. + * + * @param etag Etag of the azure resource. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the MetadataModel definition allowing to specify contentId. */ + interface WithContentId { + /** + * Specifies the contentId property: Static ID for the content. Used to identify dependencies and content + * from solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic for + * user-created. This is the resource name. + * + * @param contentId Static ID for the content. Used to identify dependencies and content from solutions or + * community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This + * is the resource name. + * @return the next definition stage. + */ + WithCreate withContentId(String contentId); + } + /** The stage of the MetadataModel definition allowing to specify parentId. */ + interface WithParentId { + /** + * Specifies the parentId property: Full parent resource ID of the content item the metadata is for. This is + * the full resource ID including the scope (subscription and resource group). + * + * @param parentId Full parent resource ID of the content item the metadata is for. This is the full + * resource ID including the scope (subscription and resource group). + * @return the next definition stage. + */ + WithCreate withParentId(String parentId); + } + /** The stage of the MetadataModel definition allowing to specify version. */ + interface WithVersion { + /** + * Specifies the version property: Version of the content. Default and recommended format is numeric (e.g. + * 1, 1.0, 1.0.0, 1.0.0.0), following ARM template best practices. Can also be any string, but then we + * cannot guarantee any version checks. + * + * @param version Version of the content. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0, + * 1.0.0.0), following ARM template best practices. Can also be any string, but then we cannot guarantee + * any version checks. + * @return the next definition stage. + */ + WithCreate withVersion(String version); + } + /** The stage of the MetadataModel definition allowing to specify kind. */ + interface WithKind { + /** + * Specifies the kind property: The kind of content the metadata is for.. + * + * @param kind The kind of content the metadata is for. + * @return the next definition stage. + */ + WithCreate withKind(Kind kind); + } + /** The stage of the MetadataModel definition allowing to specify source. */ + interface WithSource { + /** + * Specifies the source property: Source of the content. This is where/how it was created.. + * + * @param source Source of the content. This is where/how it was created. + * @return the next definition stage. + */ + WithCreate withSource(MetadataSource source); + } + /** The stage of the MetadataModel definition allowing to specify author. */ + interface WithAuthor { + /** + * Specifies the author property: The creator of the content item.. + * + * @param author The creator of the content item. + * @return the next definition stage. + */ + WithCreate withAuthor(MetadataAuthor author); + } + /** The stage of the MetadataModel definition allowing to specify support. */ + interface WithSupport { + /** + * Specifies the support property: Support information for the metadata - type, name, contact information. + * + * @param support Support information for the metadata - type, name, contact information. + * @return the next definition stage. + */ + WithCreate withSupport(MetadataSupport support); + } + /** The stage of the MetadataModel definition allowing to specify dependencies. */ + interface WithDependencies { + /** + * Specifies the dependencies property: Dependencies for the content item, what other content items it + * requires to work. Can describe more complex dependencies using a recursive/nested structure. For a single + * dependency an id/kind/version can be supplied or operator/criteria for complex formats.. + * + * @param dependencies Dependencies for the content item, what other content items it requires to work. Can + * describe more complex dependencies using a recursive/nested structure. For a single dependency an + * id/kind/version can be supplied or operator/criteria for complex formats. + * @return the next definition stage. + */ + WithCreate withDependencies(MetadataDependencies dependencies); + } + /** The stage of the MetadataModel definition allowing to specify categories. */ + interface WithCategories { + /** + * Specifies the categories property: Categories for the solution content item. + * + * @param categories Categories for the solution content item. + * @return the next definition stage. + */ + WithCreate withCategories(MetadataCategories categories); + } + /** The stage of the MetadataModel definition allowing to specify providers. */ + interface WithProviders { + /** + * Specifies the providers property: Providers for the solution content item. + * + * @param providers Providers for the solution content item. + * @return the next definition stage. + */ + WithCreate withProviders(List providers); + } + /** The stage of the MetadataModel definition allowing to specify firstPublishDate. */ + interface WithFirstPublishDate { + /** + * Specifies the firstPublishDate property: first publish date solution content item. + * + * @param firstPublishDate first publish date solution content item. + * @return the next definition stage. + */ + WithCreate withFirstPublishDate(LocalDate firstPublishDate); + } + /** The stage of the MetadataModel definition allowing to specify lastPublishDate. */ + interface WithLastPublishDate { + /** + * Specifies the lastPublishDate property: last publish date for the solution content item. + * + * @param lastPublishDate last publish date for the solution content item. + * @return the next definition stage. + */ + WithCreate withLastPublishDate(LocalDate lastPublishDate); + } + } + /** + * Begins update for the MetadataModel resource. + * + * @return the stage of resource update. + */ + MetadataModel.Update update(); + + /** The template for MetadataModel update. */ + interface Update + extends UpdateStages.WithEtag, + UpdateStages.WithContentId, + UpdateStages.WithParentId, + UpdateStages.WithVersion, + UpdateStages.WithKind, + UpdateStages.WithSource, + UpdateStages.WithAuthor, + UpdateStages.WithSupport, + UpdateStages.WithDependencies, + UpdateStages.WithCategories, + UpdateStages.WithProviders, + UpdateStages.WithFirstPublishDate, + UpdateStages.WithLastPublishDate { + /** + * Executes the update request. + * + * @return the updated resource. + */ + MetadataModel apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + MetadataModel apply(Context context); + } + /** The MetadataModel update stages. */ + interface UpdateStages { + /** The stage of the MetadataModel update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Etag of the azure resource. + * + * @param etag Etag of the azure resource. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + /** The stage of the MetadataModel update allowing to specify contentId. */ + interface WithContentId { + /** + * Specifies the contentId property: Static ID for the content. Used to identify dependencies and content + * from solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic for + * user-created. This is the resource name. + * + * @param contentId Static ID for the content. Used to identify dependencies and content from solutions or + * community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This + * is the resource name. + * @return the next definition stage. + */ + Update withContentId(String contentId); + } + /** The stage of the MetadataModel update allowing to specify parentId. */ + interface WithParentId { + /** + * Specifies the parentId property: Full parent resource ID of the content item the metadata is for. This is + * the full resource ID including the scope (subscription and resource group). + * + * @param parentId Full parent resource ID of the content item the metadata is for. This is the full + * resource ID including the scope (subscription and resource group). + * @return the next definition stage. + */ + Update withParentId(String parentId); + } + /** The stage of the MetadataModel update allowing to specify version. */ + interface WithVersion { + /** + * Specifies the version property: Version of the content. Default and recommended format is numeric (e.g. + * 1, 1.0, 1.0.0, 1.0.0.0), following ARM template best practices. Can also be any string, but then we + * cannot guarantee any version checks. + * + * @param version Version of the content. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0, + * 1.0.0.0), following ARM template best practices. Can also be any string, but then we cannot guarantee + * any version checks. + * @return the next definition stage. + */ + Update withVersion(String version); + } + /** The stage of the MetadataModel update allowing to specify kind. */ + interface WithKind { + /** + * Specifies the kind property: The kind of content the metadata is for.. + * + * @param kind The kind of content the metadata is for. + * @return the next definition stage. + */ + Update withKind(Kind kind); + } + /** The stage of the MetadataModel update allowing to specify source. */ + interface WithSource { + /** + * Specifies the source property: Source of the content. This is where/how it was created.. + * + * @param source Source of the content. This is where/how it was created. + * @return the next definition stage. + */ + Update withSource(MetadataSource source); + } + /** The stage of the MetadataModel update allowing to specify author. */ + interface WithAuthor { + /** + * Specifies the author property: The creator of the content item.. + * + * @param author The creator of the content item. + * @return the next definition stage. + */ + Update withAuthor(MetadataAuthor author); + } + /** The stage of the MetadataModel update allowing to specify support. */ + interface WithSupport { + /** + * Specifies the support property: Support information for the metadata - type, name, contact information. + * + * @param support Support information for the metadata - type, name, contact information. + * @return the next definition stage. + */ + Update withSupport(MetadataSupport support); + } + /** The stage of the MetadataModel update allowing to specify dependencies. */ + interface WithDependencies { + /** + * Specifies the dependencies property: Dependencies for the content item, what other content items it + * requires to work. Can describe more complex dependencies using a recursive/nested structure. For a single + * dependency an id/kind/version can be supplied or operator/criteria for complex formats.. + * + * @param dependencies Dependencies for the content item, what other content items it requires to work. Can + * describe more complex dependencies using a recursive/nested structure. For a single dependency an + * id/kind/version can be supplied or operator/criteria for complex formats. + * @return the next definition stage. + */ + Update withDependencies(MetadataDependencies dependencies); + } + /** The stage of the MetadataModel update allowing to specify categories. */ + interface WithCategories { + /** + * Specifies the categories property: Categories for the solution content item. + * + * @param categories Categories for the solution content item. + * @return the next definition stage. + */ + Update withCategories(MetadataCategories categories); + } + /** The stage of the MetadataModel update allowing to specify providers. */ + interface WithProviders { + /** + * Specifies the providers property: Providers for the solution content item. + * + * @param providers Providers for the solution content item. + * @return the next definition stage. + */ + Update withProviders(List providers); + } + /** The stage of the MetadataModel update allowing to specify firstPublishDate. */ + interface WithFirstPublishDate { + /** + * Specifies the firstPublishDate property: first publish date solution content item. + * + * @param firstPublishDate first publish date solution content item. + * @return the next definition stage. + */ + Update withFirstPublishDate(LocalDate firstPublishDate); + } + /** The stage of the MetadataModel update allowing to specify lastPublishDate. */ + interface WithLastPublishDate { + /** + * Specifies the lastPublishDate property: last publish date for the solution content item. + * + * @param lastPublishDate last publish date for the solution content item. + * @return the next definition stage. + */ + Update withLastPublishDate(LocalDate lastPublishDate); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + MetadataModel refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + MetadataModel refresh(Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataPatch.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataPatch.java new file mode 100644 index 000000000000..8d9bdd6f4199 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataPatch.java @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.MetadataPropertiesPatch; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.LocalDate; +import java.util.List; + +/** Metadata patch request body. */ +@Fluent +public final class MetadataPatch extends ResourceWithEtag { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetadataPatch.class); + + /* + * Metadata patch request body + */ + @JsonProperty(value = "properties") + private MetadataPropertiesPatch innerProperties; + + /** + * Get the innerProperties property: Metadata patch request body. + * + * @return the innerProperties value. + */ + private MetadataPropertiesPatch innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public MetadataPatch withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the contentId property: Static ID for the content. Used to identify dependencies and content from solutions + * or community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This is the + * resource name. + * + * @return the contentId value. + */ + public String contentId() { + return this.innerProperties() == null ? null : this.innerProperties().contentId(); + } + + /** + * Set the contentId property: Static ID for the content. Used to identify dependencies and content from solutions + * or community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This is the + * resource name. + * + * @param contentId the contentId value to set. + * @return the MetadataPatch object itself. + */ + public MetadataPatch withContentId(String contentId) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataPropertiesPatch(); + } + this.innerProperties().withContentId(contentId); + return this; + } + + /** + * Get the parentId property: Full parent resource ID of the content item the metadata is for. This is the full + * resource ID including the scope (subscription and resource group). + * + * @return the parentId value. + */ + public String parentId() { + return this.innerProperties() == null ? null : this.innerProperties().parentId(); + } + + /** + * Set the parentId property: Full parent resource ID of the content item the metadata is for. This is the full + * resource ID including the scope (subscription and resource group). + * + * @param parentId the parentId value to set. + * @return the MetadataPatch object itself. + */ + public MetadataPatch withParentId(String parentId) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataPropertiesPatch(); + } + this.innerProperties().withParentId(parentId); + return this; + } + + /** + * Get the version property: Version of the content. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0, + * 1.0.0.0), following ARM template best practices. Can also be any string, but then we cannot guarantee any version + * checks. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Set the version property: Version of the content. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0, + * 1.0.0.0), following ARM template best practices. Can also be any string, but then we cannot guarantee any version + * checks. + * + * @param version the version value to set. + * @return the MetadataPatch object itself. + */ + public MetadataPatch withVersion(String version) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataPropertiesPatch(); + } + this.innerProperties().withVersion(version); + return this; + } + + /** + * Get the kind property: The kind of content the metadata is for. + * + * @return the kind value. + */ + public Kind kind() { + return this.innerProperties() == null ? null : this.innerProperties().kind(); + } + + /** + * Set the kind property: The kind of content the metadata is for. + * + * @param kind the kind value to set. + * @return the MetadataPatch object itself. + */ + public MetadataPatch withKind(Kind kind) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataPropertiesPatch(); + } + this.innerProperties().withKind(kind); + return this; + } + + /** + * Get the source property: Source of the content. This is where/how it was created. + * + * @return the source value. + */ + public MetadataSource source() { + return this.innerProperties() == null ? null : this.innerProperties().source(); + } + + /** + * Set the source property: Source of the content. This is where/how it was created. + * + * @param source the source value to set. + * @return the MetadataPatch object itself. + */ + public MetadataPatch withSource(MetadataSource source) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataPropertiesPatch(); + } + this.innerProperties().withSource(source); + return this; + } + + /** + * Get the author property: The creator of the content item. + * + * @return the author value. + */ + public MetadataAuthor author() { + return this.innerProperties() == null ? null : this.innerProperties().author(); + } + + /** + * Set the author property: The creator of the content item. + * + * @param author the author value to set. + * @return the MetadataPatch object itself. + */ + public MetadataPatch withAuthor(MetadataAuthor author) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataPropertiesPatch(); + } + this.innerProperties().withAuthor(author); + return this; + } + + /** + * Get the support property: Support information for the metadata - type, name, contact information. + * + * @return the support value. + */ + public MetadataSupport support() { + return this.innerProperties() == null ? null : this.innerProperties().support(); + } + + /** + * Set the support property: Support information for the metadata - type, name, contact information. + * + * @param support the support value to set. + * @return the MetadataPatch object itself. + */ + public MetadataPatch withSupport(MetadataSupport support) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataPropertiesPatch(); + } + this.innerProperties().withSupport(support); + return this; + } + + /** + * Get the dependencies property: Dependencies for the content item, what other content items it requires to work. + * Can describe more complex dependencies using a recursive/nested structure. For a single dependency an + * id/kind/version can be supplied or operator/criteria for complex formats. + * + * @return the dependencies value. + */ + public MetadataDependencies dependencies() { + return this.innerProperties() == null ? null : this.innerProperties().dependencies(); + } + + /** + * Set the dependencies property: Dependencies for the content item, what other content items it requires to work. + * Can describe more complex dependencies using a recursive/nested structure. For a single dependency an + * id/kind/version can be supplied or operator/criteria for complex formats. + * + * @param dependencies the dependencies value to set. + * @return the MetadataPatch object itself. + */ + public MetadataPatch withDependencies(MetadataDependencies dependencies) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataPropertiesPatch(); + } + this.innerProperties().withDependencies(dependencies); + return this; + } + + /** + * Get the categories property: Categories for the solution content item. + * + * @return the categories value. + */ + public MetadataCategories categories() { + return this.innerProperties() == null ? null : this.innerProperties().categories(); + } + + /** + * Set the categories property: Categories for the solution content item. + * + * @param categories the categories value to set. + * @return the MetadataPatch object itself. + */ + public MetadataPatch withCategories(MetadataCategories categories) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataPropertiesPatch(); + } + this.innerProperties().withCategories(categories); + return this; + } + + /** + * Get the providers property: Providers for the solution content item. + * + * @return the providers value. + */ + public List providers() { + return this.innerProperties() == null ? null : this.innerProperties().providers(); + } + + /** + * Set the providers property: Providers for the solution content item. + * + * @param providers the providers value to set. + * @return the MetadataPatch object itself. + */ + public MetadataPatch withProviders(List providers) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataPropertiesPatch(); + } + this.innerProperties().withProviders(providers); + return this; + } + + /** + * Get the firstPublishDate property: first publish date solution content item. + * + * @return the firstPublishDate value. + */ + public LocalDate firstPublishDate() { + return this.innerProperties() == null ? null : this.innerProperties().firstPublishDate(); + } + + /** + * Set the firstPublishDate property: first publish date solution content item. + * + * @param firstPublishDate the firstPublishDate value to set. + * @return the MetadataPatch object itself. + */ + public MetadataPatch withFirstPublishDate(LocalDate firstPublishDate) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataPropertiesPatch(); + } + this.innerProperties().withFirstPublishDate(firstPublishDate); + return this; + } + + /** + * Get the lastPublishDate property: last publish date for the solution content item. + * + * @return the lastPublishDate value. + */ + public LocalDate lastPublishDate() { + return this.innerProperties() == null ? null : this.innerProperties().lastPublishDate(); + } + + /** + * Set the lastPublishDate property: last publish date for the solution content item. + * + * @param lastPublishDate the lastPublishDate value to set. + * @return the MetadataPatch object itself. + */ + public MetadataPatch withLastPublishDate(LocalDate lastPublishDate) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataPropertiesPatch(); + } + this.innerProperties().withLastPublishDate(lastPublishDate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataSource.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataSource.java new file mode 100644 index 000000000000..aa647f834f85 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataSource.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The original source of the content item, where it comes from. */ +@Fluent +public final class MetadataSource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetadataSource.class); + + /* + * Source type of the content + */ + @JsonProperty(value = "kind", required = true) + private SourceKind kind; + + /* + * Name of the content source. The repo name, solution name, LA workspace + * name etc. + */ + @JsonProperty(value = "name") + private String name; + + /* + * ID of the content source. The solution ID, workspace ID, etc + */ + @JsonProperty(value = "sourceId") + private String sourceId; + + /** + * Get the kind property: Source type of the content. + * + * @return the kind value. + */ + public SourceKind kind() { + return this.kind; + } + + /** + * Set the kind property: Source type of the content. + * + * @param kind the kind value to set. + * @return the MetadataSource object itself. + */ + public MetadataSource withKind(SourceKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the name property: Name of the content source. The repo name, solution name, LA workspace name etc. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the content source. The repo name, solution name, LA workspace name etc. + * + * @param name the name value to set. + * @return the MetadataSource object itself. + */ + public MetadataSource withName(String name) { + this.name = name; + return this; + } + + /** + * Get the sourceId property: ID of the content source. The solution ID, workspace ID, etc. + * + * @return the sourceId value. + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set the sourceId property: ID of the content source. The solution ID, workspace ID, etc. + * + * @param sourceId the sourceId value to set. + * @return the MetadataSource object itself. + */ + public MetadataSource withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (kind() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property kind in model MetadataSource")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataSupport.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataSupport.java new file mode 100644 index 000000000000..72e05a5887b7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataSupport.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Support information for the content item. */ +@Fluent +public final class MetadataSupport { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetadataSupport.class); + + /* + * Type of support for content item + */ + @JsonProperty(value = "tier", required = true) + private SupportTier tier; + + /* + * Name of the support contact. Company or person. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Email of support contact + */ + @JsonProperty(value = "email") + private String email; + + /* + * Link for support help, like to support page to open a ticket etc. + */ + @JsonProperty(value = "link") + private String link; + + /** + * Get the tier property: Type of support for content item. + * + * @return the tier value. + */ + public SupportTier tier() { + return this.tier; + } + + /** + * Set the tier property: Type of support for content item. + * + * @param tier the tier value to set. + * @return the MetadataSupport object itself. + */ + public MetadataSupport withTier(SupportTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the name property: Name of the support contact. Company or person. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the support contact. Company or person. + * + * @param name the name value to set. + * @return the MetadataSupport object itself. + */ + public MetadataSupport withName(String name) { + this.name = name; + return this; + } + + /** + * Get the email property: Email of support contact. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: Email of support contact. + * + * @param email the email value to set. + * @return the MetadataSupport object itself. + */ + public MetadataSupport withEmail(String email) { + this.email = email; + return this; + } + + /** + * Get the link property: Link for support help, like to support page to open a ticket etc. + * + * @return the link value. + */ + public String link() { + return this.link; + } + + /** + * Set the link property: Link for support help, like to support page to open a ticket etc. + * + * @param link the link value to set. + * @return the MetadataSupport object itself. + */ + public MetadataSupport withLink(String link) { + this.link = link; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tier() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property tier in model MetadataSupport")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Metadatas.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Metadatas.java new file mode 100644 index 000000000000..bf129db529de --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Metadatas.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Metadatas. */ +public interface Metadatas { + /** + * List of all metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the metadata. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * List of all metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skip Used to skip n elements in the OData query (offset). Returns a nextLink to the next page of results + * if there are any left. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the metadata. + */ + PagedIterable list( + String resourceGroupName, + String workspaceName, + String filter, + String orderby, + Integer top, + Integer skip, + Context context); + + /** + * Get a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Metadata. + */ + MetadataModel get(String resourceGroupName, String workspaceName, String metadataName); + + /** + * Get a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Metadata. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String metadataName, Context context); + + /** + * Delete a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String metadataName); + + /** + * Delete a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param metadataName The Metadata name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String metadataName, Context context); + + /** + * Get a Metadata. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Metadata. + */ + MetadataModel getById(String id); + + /** + * Get a Metadata. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Metadata. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Metadata. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Metadata. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new MetadataModel resource. + * + * @param name resource name. + * @return the first stage of the new MetadataModel definition. + */ + MetadataModel.DefinitionStages.Blank define(String name); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftSecurityIncidentCreationAlertRule.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftSecurityIncidentCreationAlertRule.java new file mode 100644 index 000000000000..22081611bf76 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftSecurityIncidentCreationAlertRule.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; +import com.azure.resourcemanager.securityinsights.fluent.models.MicrosoftSecurityIncidentCreationAlertRuleProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** Represents MicrosoftSecurityIncidentCreation rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("MicrosoftSecurityIncidentCreation") +@Fluent +public final class MicrosoftSecurityIncidentCreationAlertRule extends AlertRuleInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MicrosoftSecurityIncidentCreationAlertRule.class); + + /* + * MicrosoftSecurityIncidentCreation rule properties + */ + @JsonProperty(value = "properties") + private MicrosoftSecurityIncidentCreationAlertRuleProperties innerProperties; + + /** + * Get the innerProperties property: MicrosoftSecurityIncidentCreation rule properties. + * + * @return the innerProperties value. + */ + private MicrosoftSecurityIncidentCreationAlertRuleProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public MicrosoftSecurityIncidentCreationAlertRule withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. + * + * @return the alertRuleTemplateName value. + */ + public String alertRuleTemplateName() { + return this.innerProperties() == null ? null : this.innerProperties().alertRuleTemplateName(); + } + + /** + * Set the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. + * + * @param alertRuleTemplateName the alertRuleTemplateName value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRule object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRule withAlertRuleTemplateName(String alertRuleTemplateName) { + if (this.innerProperties() == null) { + this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleProperties(); + } + this.innerProperties().withAlertRuleTemplateName(alertRuleTemplateName); + return this; + } + + /** + * Get the description property: The description of the alert rule. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of the alert rule. + * + * @param description the description value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRule object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRule withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the displayName property: The display name for alerts created by this alert rule. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name for alerts created by this alert rule. + * + * @param displayName the displayName value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRule object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRule withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the enabled property: Determines whether this alert rule is enabled or disabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.innerProperties() == null ? null : this.innerProperties().enabled(); + } + + /** + * Set the enabled property: Determines whether this alert rule is enabled or disabled. + * + * @param enabled the enabled value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRule object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRule withEnabled(Boolean enabled) { + if (this.innerProperties() == null) { + this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleProperties(); + } + this.innerProperties().withEnabled(enabled); + return this; + } + + /** + * Get the lastModifiedUtc property: The last time that this alert has been modified. + * + * @return the lastModifiedUtc value. + */ + public OffsetDateTime lastModifiedUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedUtc(); + } + + /** + * Get the displayNamesFilter property: the alerts' displayNames on which the cases will be generated. + * + * @return the displayNamesFilter value. + */ + public List displayNamesFilter() { + return this.innerProperties() == null ? null : this.innerProperties().displayNamesFilter(); + } + + /** + * Set the displayNamesFilter property: the alerts' displayNames on which the cases will be generated. + * + * @param displayNamesFilter the displayNamesFilter value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRule object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRule withDisplayNamesFilter(List displayNamesFilter) { + if (this.innerProperties() == null) { + this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleProperties(); + } + this.innerProperties().withDisplayNamesFilter(displayNamesFilter); + return this; + } + + /** + * Get the displayNamesExcludeFilter property: the alerts' displayNames on which the cases will not be generated. + * + * @return the displayNamesExcludeFilter value. + */ + public List displayNamesExcludeFilter() { + return this.innerProperties() == null ? null : this.innerProperties().displayNamesExcludeFilter(); + } + + /** + * Set the displayNamesExcludeFilter property: the alerts' displayNames on which the cases will not be generated. + * + * @param displayNamesExcludeFilter the displayNamesExcludeFilter value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRule object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRule withDisplayNamesExcludeFilter( + List displayNamesExcludeFilter) { + if (this.innerProperties() == null) { + this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleProperties(); + } + this.innerProperties().withDisplayNamesExcludeFilter(displayNamesExcludeFilter); + return this; + } + + /** + * Get the productFilter property: The alerts' productName on which the cases will be generated. + * + * @return the productFilter value. + */ + public MicrosoftSecurityProductName productFilter() { + return this.innerProperties() == null ? null : this.innerProperties().productFilter(); + } + + /** + * Set the productFilter property: The alerts' productName on which the cases will be generated. + * + * @param productFilter the productFilter value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRule object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRule withProductFilter(MicrosoftSecurityProductName productFilter) { + if (this.innerProperties() == null) { + this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleProperties(); + } + this.innerProperties().withProductFilter(productFilter); + return this; + } + + /** + * Get the severitiesFilter property: the alerts' severities on which the cases will be generated. + * + * @return the severitiesFilter value. + */ + public List severitiesFilter() { + return this.innerProperties() == null ? null : this.innerProperties().severitiesFilter(); + } + + /** + * Set the severitiesFilter property: the alerts' severities on which the cases will be generated. + * + * @param severitiesFilter the severitiesFilter value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRule object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRule withSeveritiesFilter(List severitiesFilter) { + if (this.innerProperties() == null) { + this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleProperties(); + } + this.innerProperties().withSeveritiesFilter(severitiesFilter); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftSecurityIncidentCreationAlertRuleCommonProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftSecurityIncidentCreationAlertRuleCommonProperties.java new file mode 100644 index 000000000000..ea81f058d004 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftSecurityIncidentCreationAlertRuleCommonProperties.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** MicrosoftSecurityIncidentCreation rule common property bag. */ +@Fluent +public class MicrosoftSecurityIncidentCreationAlertRuleCommonProperties { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(MicrosoftSecurityIncidentCreationAlertRuleCommonProperties.class); + + /* + * the alerts' displayNames on which the cases will be generated + */ + @JsonProperty(value = "displayNamesFilter") + private List displayNamesFilter; + + /* + * the alerts' displayNames on which the cases will not be generated + */ + @JsonProperty(value = "displayNamesExcludeFilter") + private List displayNamesExcludeFilter; + + /* + * The alerts' productName on which the cases will be generated + */ + @JsonProperty(value = "productFilter", required = true) + private MicrosoftSecurityProductName productFilter; + + /* + * the alerts' severities on which the cases will be generated + */ + @JsonProperty(value = "severitiesFilter") + private List severitiesFilter; + + /** + * Get the displayNamesFilter property: the alerts' displayNames on which the cases will be generated. + * + * @return the displayNamesFilter value. + */ + public List displayNamesFilter() { + return this.displayNamesFilter; + } + + /** + * Set the displayNamesFilter property: the alerts' displayNames on which the cases will be generated. + * + * @param displayNamesFilter the displayNamesFilter value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRuleCommonProperties object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRuleCommonProperties withDisplayNamesFilter( + List displayNamesFilter) { + this.displayNamesFilter = displayNamesFilter; + return this; + } + + /** + * Get the displayNamesExcludeFilter property: the alerts' displayNames on which the cases will not be generated. + * + * @return the displayNamesExcludeFilter value. + */ + public List displayNamesExcludeFilter() { + return this.displayNamesExcludeFilter; + } + + /** + * Set the displayNamesExcludeFilter property: the alerts' displayNames on which the cases will not be generated. + * + * @param displayNamesExcludeFilter the displayNamesExcludeFilter value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRuleCommonProperties object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRuleCommonProperties withDisplayNamesExcludeFilter( + List displayNamesExcludeFilter) { + this.displayNamesExcludeFilter = displayNamesExcludeFilter; + return this; + } + + /** + * Get the productFilter property: The alerts' productName on which the cases will be generated. + * + * @return the productFilter value. + */ + public MicrosoftSecurityProductName productFilter() { + return this.productFilter; + } + + /** + * Set the productFilter property: The alerts' productName on which the cases will be generated. + * + * @param productFilter the productFilter value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRuleCommonProperties object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRuleCommonProperties withProductFilter( + MicrosoftSecurityProductName productFilter) { + this.productFilter = productFilter; + return this; + } + + /** + * Get the severitiesFilter property: the alerts' severities on which the cases will be generated. + * + * @return the severitiesFilter value. + */ + public List severitiesFilter() { + return this.severitiesFilter; + } + + /** + * Set the severitiesFilter property: the alerts' severities on which the cases will be generated. + * + * @param severitiesFilter the severitiesFilter value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRuleCommonProperties object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRuleCommonProperties withSeveritiesFilter( + List severitiesFilter) { + this.severitiesFilter = severitiesFilter; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (productFilter() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property productFilter in model" + + " MicrosoftSecurityIncidentCreationAlertRuleCommonProperties")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftSecurityIncidentCreationAlertRuleTemplate.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftSecurityIncidentCreationAlertRuleTemplate.java new file mode 100644 index 000000000000..4924b2270108 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftSecurityIncidentCreationAlertRuleTemplate.java @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; +import com.azure.resourcemanager.securityinsights.fluent.models.MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** Represents MicrosoftSecurityIncidentCreation rule template. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("MicrosoftSecurityIncidentCreation") +@Fluent +public final class MicrosoftSecurityIncidentCreationAlertRuleTemplate extends AlertRuleTemplateInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MicrosoftSecurityIncidentCreationAlertRuleTemplate.class); + + /* + * MicrosoftSecurityIncidentCreation rule template properties + */ + @JsonProperty(value = "properties") + private MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties innerProperties; + + /** + * Get the innerProperties property: MicrosoftSecurityIncidentCreation rule template properties. + * + * @return the innerProperties value. + */ + private MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the displayNamesFilter property: the alerts' displayNames on which the cases will be generated. + * + * @return the displayNamesFilter value. + */ + public List displayNamesFilter() { + return this.innerProperties() == null ? null : this.innerProperties().displayNamesFilter(); + } + + /** + * Set the displayNamesFilter property: the alerts' displayNames on which the cases will be generated. + * + * @param displayNamesFilter the displayNamesFilter value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplate object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRuleTemplate withDisplayNamesFilter(List displayNamesFilter) { + if (this.innerProperties() == null) { + this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties(); + } + this.innerProperties().withDisplayNamesFilter(displayNamesFilter); + return this; + } + + /** + * Get the displayNamesExcludeFilter property: the alerts' displayNames on which the cases will not be generated. + * + * @return the displayNamesExcludeFilter value. + */ + public List displayNamesExcludeFilter() { + return this.innerProperties() == null ? null : this.innerProperties().displayNamesExcludeFilter(); + } + + /** + * Set the displayNamesExcludeFilter property: the alerts' displayNames on which the cases will not be generated. + * + * @param displayNamesExcludeFilter the displayNamesExcludeFilter value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplate object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRuleTemplate withDisplayNamesExcludeFilter( + List displayNamesExcludeFilter) { + if (this.innerProperties() == null) { + this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties(); + } + this.innerProperties().withDisplayNamesExcludeFilter(displayNamesExcludeFilter); + return this; + } + + /** + * Get the productFilter property: The alerts' productName on which the cases will be generated. + * + * @return the productFilter value. + */ + public MicrosoftSecurityProductName productFilter() { + return this.innerProperties() == null ? null : this.innerProperties().productFilter(); + } + + /** + * Set the productFilter property: The alerts' productName on which the cases will be generated. + * + * @param productFilter the productFilter value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplate object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRuleTemplate withProductFilter( + MicrosoftSecurityProductName productFilter) { + if (this.innerProperties() == null) { + this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties(); + } + this.innerProperties().withProductFilter(productFilter); + return this; + } + + /** + * Get the severitiesFilter property: the alerts' severities on which the cases will be generated. + * + * @return the severitiesFilter value. + */ + public List severitiesFilter() { + return this.innerProperties() == null ? null : this.innerProperties().severitiesFilter(); + } + + /** + * Set the severitiesFilter property: the alerts' severities on which the cases will be generated. + * + * @param severitiesFilter the severitiesFilter value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplate object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRuleTemplate withSeveritiesFilter( + List severitiesFilter) { + if (this.innerProperties() == null) { + this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties(); + } + this.innerProperties().withSeveritiesFilter(severitiesFilter); + return this; + } + + /** + * Get the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. + * + * @return the alertRulesCreatedByTemplateCount value. + */ + public Integer alertRulesCreatedByTemplateCount() { + return this.innerProperties() == null ? null : this.innerProperties().alertRulesCreatedByTemplateCount(); + } + + /** + * Set the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. + * + * @param alertRulesCreatedByTemplateCount the alertRulesCreatedByTemplateCount value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplate object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRuleTemplate withAlertRulesCreatedByTemplateCount( + Integer alertRulesCreatedByTemplateCount) { + if (this.innerProperties() == null) { + this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties(); + } + this.innerProperties().withAlertRulesCreatedByTemplateCount(alertRulesCreatedByTemplateCount); + return this; + } + + /** + * Get the lastUpdatedDateUtc property: The last time that this alert rule template has been updated. + * + * @return the lastUpdatedDateUtc value. + */ + public OffsetDateTime lastUpdatedDateUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedDateUtc(); + } + + /** + * Get the createdDateUtc property: The time that this alert rule template has been added. + * + * @return the createdDateUtc value. + */ + public OffsetDateTime createdDateUtc() { + return this.innerProperties() == null ? null : this.innerProperties().createdDateUtc(); + } + + /** + * Get the description property: The description of the alert rule template. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of the alert rule template. + * + * @param description the description value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplate object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRuleTemplate withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the displayName property: The display name for alert rule template. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name for alert rule template. + * + * @param displayName the displayName value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplate object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRuleTemplate withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the requiredDataConnectors property: The required data sources for this template. + * + * @return the requiredDataConnectors value. + */ + public List requiredDataConnectors() { + return this.innerProperties() == null ? null : this.innerProperties().requiredDataConnectors(); + } + + /** + * Set the requiredDataConnectors property: The required data sources for this template. + * + * @param requiredDataConnectors the requiredDataConnectors value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplate object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRuleTemplate withRequiredDataConnectors( + List requiredDataConnectors) { + if (this.innerProperties() == null) { + this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties(); + } + this.innerProperties().withRequiredDataConnectors(requiredDataConnectors); + return this; + } + + /** + * Get the status property: The alert rule template status. + * + * @return the status value. + */ + public TemplateStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The alert rule template status. + * + * @param status the status value to set. + * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplate object itself. + */ + public MicrosoftSecurityIncidentCreationAlertRuleTemplate withStatus(TemplateStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftSecurityProductName.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftSecurityProductName.java new file mode 100644 index 000000000000..0e34a9e529ac --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftSecurityProductName.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MicrosoftSecurityProductName. */ +public final class MicrosoftSecurityProductName extends ExpandableStringEnum { + /** Static value Microsoft Cloud App Security for MicrosoftSecurityProductName. */ + public static final MicrosoftSecurityProductName MICROSOFT_CLOUD_APP_SECURITY = + fromString("Microsoft Cloud App Security"); + + /** Static value Azure Security Center for MicrosoftSecurityProductName. */ + public static final MicrosoftSecurityProductName AZURE_SECURITY_CENTER = fromString("Azure Security Center"); + + /** Static value Azure Advanced Threat Protection for MicrosoftSecurityProductName. */ + public static final MicrosoftSecurityProductName AZURE_ADVANCED_THREAT_PROTECTION = + fromString("Azure Advanced Threat Protection"); + + /** Static value Azure Active Directory Identity Protection for MicrosoftSecurityProductName. */ + public static final MicrosoftSecurityProductName AZURE_ACTIVE_DIRECTORY_IDENTITY_PROTECTION = + fromString("Azure Active Directory Identity Protection"); + + /** Static value Azure Security Center for IoT for MicrosoftSecurityProductName. */ + public static final MicrosoftSecurityProductName AZURE_SECURITY_CENTER_FOR_IOT = + fromString("Azure Security Center for IoT"); + + /** Static value Office 365 Advanced Threat Protection for MicrosoftSecurityProductName. */ + public static final MicrosoftSecurityProductName OFFICE_365_ADVANCED_THREAT_PROTECTION = + fromString("Office 365 Advanced Threat Protection"); + + /** Static value Microsoft Defender Advanced Threat Protection for MicrosoftSecurityProductName. */ + public static final MicrosoftSecurityProductName MICROSOFT_DEFENDER_ADVANCED_THREAT_PROTECTION = + fromString("Microsoft Defender Advanced Threat Protection"); + + /** + * Creates or finds a MicrosoftSecurityProductName from its string representation. + * + * @param name a name to look for. + * @return the corresponding MicrosoftSecurityProductName. + */ + @JsonCreator + public static MicrosoftSecurityProductName fromString(String name) { + return fromString(name, MicrosoftSecurityProductName.class); + } + + /** @return known MicrosoftSecurityProductName values. */ + public static Collection values() { + return values(MicrosoftSecurityProductName.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiCheckRequirements.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiCheckRequirements.java new file mode 100644 index 000000000000..a764a311663d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiCheckRequirements.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.MstiCheckRequirementsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents Microsoft Threat Intelligence requirements check request. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("MicrosoftThreatIntelligence") +@Fluent +public final class MstiCheckRequirements extends DataConnectorsCheckRequirements { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MstiCheckRequirements.class); + + /* + * Microsoft Threat Intelligence requirements check properties. + */ + @JsonProperty(value = "properties") + private MstiCheckRequirementsProperties innerProperties; + + /** + * Get the innerProperties property: Microsoft Threat Intelligence requirements check properties. + * + * @return the innerProperties value. + */ + private MstiCheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiDataConnector.java new file mode 100644 index 000000000000..792084b88fb6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiDataConnector.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.MstiDataConnectorProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents Microsoft Threat Intelligence data connector. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("MicrosoftThreatIntelligence") +@Fluent +public final class MstiDataConnector extends DataConnectorInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MstiDataConnector.class); + + /* + * Microsoft Threat Intelligence data connector properties. + */ + @JsonProperty(value = "properties") + private MstiDataConnectorProperties innerProperties; + + /** + * Get the innerProperties property: Microsoft Threat Intelligence data connector properties. + * + * @return the innerProperties value. + */ + private MstiDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public MstiDataConnector withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public MstiDataConnectorDataTypes dataTypes() { + return this.innerProperties() == null ? null : this.innerProperties().dataTypes(); + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the MstiDataConnector object itself. + */ + public MstiDataConnector withDataTypes(MstiDataConnectorDataTypes dataTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new MstiDataConnectorProperties(); + } + this.innerProperties().withDataTypes(dataTypes); + return this; + } + + /** + * Get the tenantId property: The tenant id to connect to, and get the data from. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Set the tenantId property: The tenant id to connect to, and get the data from. + * + * @param tenantId the tenantId value to set. + * @return the MstiDataConnector object itself. + */ + public MstiDataConnector withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new MstiDataConnectorProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiDataConnectorDataTypes.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiDataConnectorDataTypes.java new file mode 100644 index 000000000000..2ee2b4c5e334 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiDataConnectorDataTypes.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The available data types for Microsoft Threat Intelligence Platforms data connector. */ +@Fluent +public final class MstiDataConnectorDataTypes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MstiDataConnectorDataTypes.class); + + /* + * Data type for Microsoft Threat Intelligence Platforms data connector. + */ + @JsonProperty(value = "bingSafetyPhishingURL", required = true) + private MstiDataConnectorDataTypesBingSafetyPhishingUrl bingSafetyPhishingUrl; + + /* + * Data type for Microsoft Threat Intelligence Platforms data connector. + */ + @JsonProperty(value = "microsoftEmergingThreatFeed", required = true) + private MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed microsoftEmergingThreatFeed; + + /** + * Get the bingSafetyPhishingUrl property: Data type for Microsoft Threat Intelligence Platforms data connector. + * + * @return the bingSafetyPhishingUrl value. + */ + public MstiDataConnectorDataTypesBingSafetyPhishingUrl bingSafetyPhishingUrl() { + return this.bingSafetyPhishingUrl; + } + + /** + * Set the bingSafetyPhishingUrl property: Data type for Microsoft Threat Intelligence Platforms data connector. + * + * @param bingSafetyPhishingUrl the bingSafetyPhishingUrl value to set. + * @return the MstiDataConnectorDataTypes object itself. + */ + public MstiDataConnectorDataTypes withBingSafetyPhishingUrl( + MstiDataConnectorDataTypesBingSafetyPhishingUrl bingSafetyPhishingUrl) { + this.bingSafetyPhishingUrl = bingSafetyPhishingUrl; + return this; + } + + /** + * Get the microsoftEmergingThreatFeed property: Data type for Microsoft Threat Intelligence Platforms data + * connector. + * + * @return the microsoftEmergingThreatFeed value. + */ + public MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed microsoftEmergingThreatFeed() { + return this.microsoftEmergingThreatFeed; + } + + /** + * Set the microsoftEmergingThreatFeed property: Data type for Microsoft Threat Intelligence Platforms data + * connector. + * + * @param microsoftEmergingThreatFeed the microsoftEmergingThreatFeed value to set. + * @return the MstiDataConnectorDataTypes object itself. + */ + public MstiDataConnectorDataTypes withMicrosoftEmergingThreatFeed( + MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed microsoftEmergingThreatFeed) { + this.microsoftEmergingThreatFeed = microsoftEmergingThreatFeed; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (bingSafetyPhishingUrl() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property bingSafetyPhishingUrl in model MstiDataConnectorDataTypes")); + } else { + bingSafetyPhishingUrl().validate(); + } + if (microsoftEmergingThreatFeed() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property microsoftEmergingThreatFeed in model MstiDataConnectorDataTypes")); + } else { + microsoftEmergingThreatFeed().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiDataConnectorDataTypesBingSafetyPhishingUrl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiDataConnectorDataTypesBingSafetyPhishingUrl.java new file mode 100644 index 000000000000..99b3574bec33 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiDataConnectorDataTypesBingSafetyPhishingUrl.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Data type for Microsoft Threat Intelligence Platforms data connector. */ +@Fluent +public final class MstiDataConnectorDataTypesBingSafetyPhishingUrl extends DataConnectorDataTypeCommon { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MstiDataConnectorDataTypesBingSafetyPhishingUrl.class); + + /* + * lookback period + */ + @JsonProperty(value = "lookbackPeriod", required = true) + private String lookbackPeriod; + + /** + * Get the lookbackPeriod property: lookback period. + * + * @return the lookbackPeriod value. + */ + public String lookbackPeriod() { + return this.lookbackPeriod; + } + + /** + * Set the lookbackPeriod property: lookback period. + * + * @param lookbackPeriod the lookbackPeriod value to set. + * @return the MstiDataConnectorDataTypesBingSafetyPhishingUrl object itself. + */ + public MstiDataConnectorDataTypesBingSafetyPhishingUrl withLookbackPeriod(String lookbackPeriod) { + this.lookbackPeriod = lookbackPeriod; + return this; + } + + /** {@inheritDoc} */ + @Override + public MstiDataConnectorDataTypesBingSafetyPhishingUrl withState(DataTypeState state) { + super.withState(state); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (lookbackPeriod() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property lookbackPeriod in model" + + " MstiDataConnectorDataTypesBingSafetyPhishingUrl")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed.java new file mode 100644 index 000000000000..b767f5e2fac5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Data type for Microsoft Threat Intelligence Platforms data connector. */ +@Fluent +public final class MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed extends DataConnectorDataTypeCommon { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed.class); + + /* + * lookback period + */ + @JsonProperty(value = "lookbackPeriod", required = true) + private String lookbackPeriod; + + /** + * Get the lookbackPeriod property: lookback period. + * + * @return the lookbackPeriod value. + */ + public String lookbackPeriod() { + return this.lookbackPeriod; + } + + /** + * Set the lookbackPeriod property: lookback period. + * + * @param lookbackPeriod the lookbackPeriod value to set. + * @return the MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed object itself. + */ + public MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed withLookbackPeriod(String lookbackPeriod) { + this.lookbackPeriod = lookbackPeriod; + return this; + } + + /** {@inheritDoc} */ + @Override + public MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed withState(DataTypeState state) { + super.withState(state); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (lookbackPeriod() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property lookbackPeriod in model" + + " MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpCheckRequirements.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpCheckRequirements.java new file mode 100644 index 000000000000..530eab6fc0b7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpCheckRequirements.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.MtpCheckRequirementsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents MTP (Microsoft Threat Protection) requirements check request. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("MicrosoftThreatProtection") +@Fluent +public final class MtpCheckRequirements extends DataConnectorsCheckRequirements { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MtpCheckRequirements.class); + + /* + * MTP (Microsoft Threat Protection) requirements check properties. + */ + @JsonProperty(value = "properties") + private MtpCheckRequirementsProperties innerProperties; + + /** + * Get the innerProperties property: MTP (Microsoft Threat Protection) requirements check properties. + * + * @return the innerProperties value. + */ + private MtpCheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpDataConnector.java new file mode 100644 index 000000000000..b965ba518bf2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpDataConnector.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.MtpDataConnectorProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents MTP (Microsoft Threat Protection) data connector. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("MicrosoftThreatProtection") +@Fluent +public final class MtpDataConnector extends DataConnectorInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MtpDataConnector.class); + + /* + * MTP (Microsoft Threat Protection) data connector properties. + */ + @JsonProperty(value = "properties") + private MtpDataConnectorProperties innerProperties; + + /** + * Get the innerProperties property: MTP (Microsoft Threat Protection) data connector properties. + * + * @return the innerProperties value. + */ + private MtpDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public MtpDataConnector withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public MtpDataConnectorDataTypes dataTypes() { + return this.innerProperties() == null ? null : this.innerProperties().dataTypes(); + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the MtpDataConnector object itself. + */ + public MtpDataConnector withDataTypes(MtpDataConnectorDataTypes dataTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new MtpDataConnectorProperties(); + } + this.innerProperties().withDataTypes(dataTypes); + return this; + } + + /** + * Get the tenantId property: The tenant id to connect to, and get the data from. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Set the tenantId property: The tenant id to connect to, and get the data from. + * + * @param tenantId the tenantId value to set. + * @return the MtpDataConnector object itself. + */ + public MtpDataConnector withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new MtpDataConnectorProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpDataConnectorDataTypes.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpDataConnectorDataTypes.java new file mode 100644 index 000000000000..9388cae2cff1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpDataConnectorDataTypes.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The available data types for Microsoft Threat Protection Platforms data connector. */ +@Fluent +public final class MtpDataConnectorDataTypes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MtpDataConnectorDataTypes.class); + + /* + * Data type for Microsoft Threat Protection Platforms data connector. + */ + @JsonProperty(value = "incidents", required = true) + private MtpDataConnectorDataTypesIncidents incidents; + + /** + * Get the incidents property: Data type for Microsoft Threat Protection Platforms data connector. + * + * @return the incidents value. + */ + public MtpDataConnectorDataTypesIncidents incidents() { + return this.incidents; + } + + /** + * Set the incidents property: Data type for Microsoft Threat Protection Platforms data connector. + * + * @param incidents the incidents value to set. + * @return the MtpDataConnectorDataTypes object itself. + */ + public MtpDataConnectorDataTypes withIncidents(MtpDataConnectorDataTypesIncidents incidents) { + this.incidents = incidents; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (incidents() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property incidents in model MtpDataConnectorDataTypes")); + } else { + incidents().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpDataConnectorDataTypesIncidents.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpDataConnectorDataTypesIncidents.java new file mode 100644 index 000000000000..110dd684be3d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpDataConnectorDataTypesIncidents.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Data type for Microsoft Threat Protection Platforms data connector. */ +@Fluent +public final class MtpDataConnectorDataTypesIncidents extends DataConnectorDataTypeCommon { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MtpDataConnectorDataTypesIncidents.class); + + /** {@inheritDoc} */ + @Override + public MtpDataConnectorDataTypesIncidents withState(DataTypeState state) { + super.withState(state); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/NrtAlertRule.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/NrtAlertRule.java new file mode 100644 index 000000000000..833c5896c25d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/NrtAlertRule.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; +import com.azure.resourcemanager.securityinsights.fluent.models.NrtAlertRuleProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents NRT alert rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("NRT") +@Fluent +public final class NrtAlertRule extends AlertRuleInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NrtAlertRule.class); + + /* + * NRT alert rule properties + */ + @JsonProperty(value = "properties") + private NrtAlertRuleProperties innerProperties; + + /** + * Get the innerProperties property: NRT alert rule properties. + * + * @return the innerProperties value. + */ + private NrtAlertRuleProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public NrtAlertRule withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/NrtAlertRuleTemplate.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/NrtAlertRuleTemplate.java new file mode 100644 index 000000000000..8d6ab80cffbb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/NrtAlertRuleTemplate.java @@ -0,0 +1,349 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; +import com.azure.resourcemanager.securityinsights.fluent.models.NrtAlertRuleTemplateProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Represents NRT alert rule template. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("NRT") +@Fluent +public final class NrtAlertRuleTemplate extends AlertRuleTemplateInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NrtAlertRuleTemplate.class); + + /* + * NRT alert rule template properties + */ + @JsonProperty(value = "properties") + private NrtAlertRuleTemplateProperties innerProperties; + + /** + * Get the innerProperties property: NRT alert rule template properties. + * + * @return the innerProperties value. + */ + private NrtAlertRuleTemplateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the query property: The query that creates alerts for this rule. + * + * @return the query value. + */ + public String query() { + return this.innerProperties() == null ? null : this.innerProperties().query(); + } + + /** + * Set the query property: The query that creates alerts for this rule. + * + * @param query the query value to set. + * @return the NrtAlertRuleTemplate object itself. + */ + public NrtAlertRuleTemplate withQuery(String query) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleTemplateProperties(); + } + this.innerProperties().withQuery(query); + return this; + } + + /** + * Get the severity property: The severity for alerts created by this alert rule. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.innerProperties() == null ? null : this.innerProperties().severity(); + } + + /** + * Set the severity property: The severity for alerts created by this alert rule. + * + * @param severity the severity value to set. + * @return the NrtAlertRuleTemplate object itself. + */ + public NrtAlertRuleTemplate withSeverity(AlertSeverity severity) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleTemplateProperties(); + } + this.innerProperties().withSeverity(severity); + return this; + } + + /** + * Get the tactics property: The tactics of the alert rule. + * + * @return the tactics value. + */ + public List tactics() { + return this.innerProperties() == null ? null : this.innerProperties().tactics(); + } + + /** + * Set the tactics property: The tactics of the alert rule. + * + * @param tactics the tactics value to set. + * @return the NrtAlertRuleTemplate object itself. + */ + public NrtAlertRuleTemplate withTactics(List tactics) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleTemplateProperties(); + } + this.innerProperties().withTactics(tactics); + return this; + } + + /** + * Get the version property: The version of this template - in format <a.b.c>, where all are numbers. For + * example <1.0.2>. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Set the version property: The version of this template - in format <a.b.c>, where all are numbers. For + * example <1.0.2>. + * + * @param version the version value to set. + * @return the NrtAlertRuleTemplate object itself. + */ + public NrtAlertRuleTemplate withVersion(String version) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleTemplateProperties(); + } + this.innerProperties().withVersion(version); + return this; + } + + /** + * Get the customDetails property: Dictionary of string key-value pairs of columns to be attached to the alert. + * + * @return the customDetails value. + */ + public Map customDetails() { + return this.innerProperties() == null ? null : this.innerProperties().customDetails(); + } + + /** + * Set the customDetails property: Dictionary of string key-value pairs of columns to be attached to the alert. + * + * @param customDetails the customDetails value to set. + * @return the NrtAlertRuleTemplate object itself. + */ + public NrtAlertRuleTemplate withCustomDetails(Map customDetails) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleTemplateProperties(); + } + this.innerProperties().withCustomDetails(customDetails); + return this; + } + + /** + * Get the entityMappings property: Array of the entity mappings of the alert rule. + * + * @return the entityMappings value. + */ + public List entityMappings() { + return this.innerProperties() == null ? null : this.innerProperties().entityMappings(); + } + + /** + * Set the entityMappings property: Array of the entity mappings of the alert rule. + * + * @param entityMappings the entityMappings value to set. + * @return the NrtAlertRuleTemplate object itself. + */ + public NrtAlertRuleTemplate withEntityMappings(List entityMappings) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleTemplateProperties(); + } + this.innerProperties().withEntityMappings(entityMappings); + return this; + } + + /** + * Get the alertDetailsOverride property: The alert details override settings. + * + * @return the alertDetailsOverride value. + */ + public AlertDetailsOverride alertDetailsOverride() { + return this.innerProperties() == null ? null : this.innerProperties().alertDetailsOverride(); + } + + /** + * Set the alertDetailsOverride property: The alert details override settings. + * + * @param alertDetailsOverride the alertDetailsOverride value to set. + * @return the NrtAlertRuleTemplate object itself. + */ + public NrtAlertRuleTemplate withAlertDetailsOverride(AlertDetailsOverride alertDetailsOverride) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleTemplateProperties(); + } + this.innerProperties().withAlertDetailsOverride(alertDetailsOverride); + return this; + } + + /** + * Get the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. + * + * @return the alertRulesCreatedByTemplateCount value. + */ + public Integer alertRulesCreatedByTemplateCount() { + return this.innerProperties() == null ? null : this.innerProperties().alertRulesCreatedByTemplateCount(); + } + + /** + * Set the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. + * + * @param alertRulesCreatedByTemplateCount the alertRulesCreatedByTemplateCount value to set. + * @return the NrtAlertRuleTemplate object itself. + */ + public NrtAlertRuleTemplate withAlertRulesCreatedByTemplateCount(Integer alertRulesCreatedByTemplateCount) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleTemplateProperties(); + } + this.innerProperties().withAlertRulesCreatedByTemplateCount(alertRulesCreatedByTemplateCount); + return this; + } + + /** + * Get the lastUpdatedDateUtc property: The last time that this alert rule template has been updated. + * + * @return the lastUpdatedDateUtc value. + */ + public OffsetDateTime lastUpdatedDateUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedDateUtc(); + } + + /** + * Get the createdDateUtc property: The time that this alert rule template has been added. + * + * @return the createdDateUtc value. + */ + public OffsetDateTime createdDateUtc() { + return this.innerProperties() == null ? null : this.innerProperties().createdDateUtc(); + } + + /** + * Get the description property: The description of the alert rule template. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of the alert rule template. + * + * @param description the description value to set. + * @return the NrtAlertRuleTemplate object itself. + */ + public NrtAlertRuleTemplate withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleTemplateProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the displayName property: The display name for alert rule template. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name for alert rule template. + * + * @param displayName the displayName value to set. + * @return the NrtAlertRuleTemplate object itself. + */ + public NrtAlertRuleTemplate withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleTemplateProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the requiredDataConnectors property: The required data sources for this template. + * + * @return the requiredDataConnectors value. + */ + public List requiredDataConnectors() { + return this.innerProperties() == null ? null : this.innerProperties().requiredDataConnectors(); + } + + /** + * Set the requiredDataConnectors property: The required data sources for this template. + * + * @param requiredDataConnectors the requiredDataConnectors value to set. + * @return the NrtAlertRuleTemplate object itself. + */ + public NrtAlertRuleTemplate withRequiredDataConnectors(List requiredDataConnectors) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleTemplateProperties(); + } + this.innerProperties().withRequiredDataConnectors(requiredDataConnectors); + return this; + } + + /** + * Get the status property: The alert rule template status. + * + * @return the status value. + */ + public TemplateStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The alert rule template status. + * + * @param status the status value to set. + * @return the NrtAlertRuleTemplate object itself. + */ + public NrtAlertRuleTemplate withStatus(TemplateStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleTemplateProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OSFamily.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OSFamily.java new file mode 100644 index 000000000000..a76bc08086fc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OSFamily.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for OSFamily. */ +public enum OSFamily { + /** Enum value Linux. */ + LINUX("Linux"), + + /** Enum value Windows. */ + WINDOWS("Windows"), + + /** Enum value Android. */ + ANDROID("Android"), + + /** Enum value IOS. */ + IOS("IOS"), + + /** Enum value Unknown. */ + UNKNOWN("Unknown"); + + /** The actual serialized value for a OSFamily instance. */ + private final String value; + + OSFamily(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OSFamily instance. + * + * @param value the serialized value to parse. + * @return the parsed OSFamily object, or null if unable to parse. + */ + @JsonCreator + public static OSFamily fromString(String value) { + OSFamily[] items = OSFamily.values(); + for (OSFamily item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeAtpCheckRequirements.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeAtpCheckRequirements.java new file mode 100644 index 000000000000..1cfd946362e5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeAtpCheckRequirements.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficeAtpCheckRequirementsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents OfficeATP (Office 365 Advanced Threat Protection) requirements check request. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("OfficeATP") +@Fluent +public final class OfficeAtpCheckRequirements extends DataConnectorsCheckRequirements { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OfficeAtpCheckRequirements.class); + + /* + * OfficeATP (Office 365 Advanced Threat Protection) requirements check + * properties. + */ + @JsonProperty(value = "properties") + private OfficeAtpCheckRequirementsProperties innerProperties; + + /** + * Get the innerProperties property: OfficeATP (Office 365 Advanced Threat Protection) requirements check + * properties. + * + * @return the innerProperties value. + */ + private OfficeAtpCheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeAtpDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeAtpDataConnector.java new file mode 100644 index 000000000000..29aa2f6389be --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeAtpDataConnector.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficeAtpDataConnectorProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents OfficeATP (Office 365 Advanced Threat Protection) data connector. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("OfficeATP") +@Fluent +public final class OfficeAtpDataConnector extends DataConnectorInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OfficeAtpDataConnector.class); + + /* + * OfficeATP (Office 365 Advanced Threat Protection) data connector + * properties. + */ + @JsonProperty(value = "properties") + private OfficeAtpDataConnectorProperties innerProperties; + + /** + * Get the innerProperties property: OfficeATP (Office 365 Advanced Threat Protection) data connector properties. + * + * @return the innerProperties value. + */ + private OfficeAtpDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public OfficeAtpDataConnector withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public AlertsDataTypeOfDataConnector dataTypes() { + return this.innerProperties() == null ? null : this.innerProperties().dataTypes(); + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the OfficeAtpDataConnector object itself. + */ + public OfficeAtpDataConnector withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new OfficeAtpDataConnectorProperties(); + } + this.innerProperties().withDataTypes(dataTypes); + return this; + } + + /** + * Get the tenantId property: The tenant id to connect to, and get the data from. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Set the tenantId property: The tenant id to connect to, and get the data from. + * + * @param tenantId the tenantId value to set. + * @return the OfficeAtpDataConnector object itself. + */ + public OfficeAtpDataConnector withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new OfficeAtpDataConnectorProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeConsent.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeConsent.java new file mode 100644 index 000000000000..537732e3a122 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeConsent.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficeConsentInner; + +/** An immutable client-side representation of OfficeConsent. */ +public interface OfficeConsent { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the tenantId property: The tenantId of the Office365 with the consent. + * + * @return the tenantId value. + */ + String tenantId(); + + /** + * Gets the consentId property: Help to easily cascade among the data layers. + * + * @return the consentId value. + */ + String consentId(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.OfficeConsentInner object. + * + * @return the inner object. + */ + OfficeConsentInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeConsentList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeConsentList.java new file mode 100644 index 000000000000..7157f1b0f3f8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeConsentList.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficeConsentInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of all the office365 consents. */ +@Fluent +public final class OfficeConsentList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OfficeConsentList.class); + + /* + * URL to fetch the next set of office consents. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of the consents. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the nextLink property: URL to fetch the next set of office consents. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of the consents. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of the consents. + * + * @param value the value value to set. + * @return the OfficeConsentList object itself. + */ + public OfficeConsentList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model OfficeConsentList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeConsents.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeConsents.java new file mode 100644 index 000000000000..06eacf481861 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeConsents.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of OfficeConsents. */ +public interface OfficeConsents { + /** + * Gets all office365 consents. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all office365 consents. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all office365 consents. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all office365 consents. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets an office365 consent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param consentId consent ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an office365 consent. + */ + OfficeConsent get(String resourceGroupName, String workspaceName, String consentId); + + /** + * Gets an office365 consent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param consentId consent ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an office365 consent. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String consentId, Context context); + + /** + * Delete the office365 consent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param consentId consent ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String consentId); + + /** + * Delete the office365 consent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param consentId consent ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String consentId, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnector.java new file mode 100644 index 000000000000..79408d2e705c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnector.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficeDataConnectorProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents office data connector. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Office365") +@Fluent +public final class OfficeDataConnector extends DataConnectorInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OfficeDataConnector.class); + + /* + * Office data connector properties. + */ + @JsonProperty(value = "properties") + private OfficeDataConnectorProperties innerProperties; + + /** + * Get the innerProperties property: Office data connector properties. + * + * @return the innerProperties value. + */ + private OfficeDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public OfficeDataConnector withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public OfficeDataConnectorDataTypes dataTypes() { + return this.innerProperties() == null ? null : this.innerProperties().dataTypes(); + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the OfficeDataConnector object itself. + */ + public OfficeDataConnector withDataTypes(OfficeDataConnectorDataTypes dataTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new OfficeDataConnectorProperties(); + } + this.innerProperties().withDataTypes(dataTypes); + return this; + } + + /** + * Get the tenantId property: The tenant id to connect to, and get the data from. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Set the tenantId property: The tenant id to connect to, and get the data from. + * + * @param tenantId the tenantId value to set. + * @return the OfficeDataConnector object itself. + */ + public OfficeDataConnector withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new OfficeDataConnectorProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnectorDataTypes.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnectorDataTypes.java new file mode 100644 index 000000000000..b677200c53a9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnectorDataTypes.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The available data types for office data connector. */ +@Fluent +public final class OfficeDataConnectorDataTypes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OfficeDataConnectorDataTypes.class); + + /* + * Exchange data type connection. + */ + @JsonProperty(value = "exchange", required = true) + private OfficeDataConnectorDataTypesExchange exchange; + + /* + * SharePoint data type connection. + */ + @JsonProperty(value = "sharePoint", required = true) + private OfficeDataConnectorDataTypesSharePoint sharePoint; + + /* + * Teams data type connection. + */ + @JsonProperty(value = "teams", required = true) + private OfficeDataConnectorDataTypesTeams teams; + + /** + * Get the exchange property: Exchange data type connection. + * + * @return the exchange value. + */ + public OfficeDataConnectorDataTypesExchange exchange() { + return this.exchange; + } + + /** + * Set the exchange property: Exchange data type connection. + * + * @param exchange the exchange value to set. + * @return the OfficeDataConnectorDataTypes object itself. + */ + public OfficeDataConnectorDataTypes withExchange(OfficeDataConnectorDataTypesExchange exchange) { + this.exchange = exchange; + return this; + } + + /** + * Get the sharePoint property: SharePoint data type connection. + * + * @return the sharePoint value. + */ + public OfficeDataConnectorDataTypesSharePoint sharePoint() { + return this.sharePoint; + } + + /** + * Set the sharePoint property: SharePoint data type connection. + * + * @param sharePoint the sharePoint value to set. + * @return the OfficeDataConnectorDataTypes object itself. + */ + public OfficeDataConnectorDataTypes withSharePoint(OfficeDataConnectorDataTypesSharePoint sharePoint) { + this.sharePoint = sharePoint; + return this; + } + + /** + * Get the teams property: Teams data type connection. + * + * @return the teams value. + */ + public OfficeDataConnectorDataTypesTeams teams() { + return this.teams; + } + + /** + * Set the teams property: Teams data type connection. + * + * @param teams the teams value to set. + * @return the OfficeDataConnectorDataTypes object itself. + */ + public OfficeDataConnectorDataTypes withTeams(OfficeDataConnectorDataTypesTeams teams) { + this.teams = teams; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (exchange() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property exchange in model OfficeDataConnectorDataTypes")); + } else { + exchange().validate(); + } + if (sharePoint() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sharePoint in model OfficeDataConnectorDataTypes")); + } else { + sharePoint().validate(); + } + if (teams() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property teams in model OfficeDataConnectorDataTypes")); + } else { + teams().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnectorDataTypesExchange.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnectorDataTypesExchange.java new file mode 100644 index 000000000000..aad232ee7797 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnectorDataTypesExchange.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Exchange data type connection. */ +@Fluent +public final class OfficeDataConnectorDataTypesExchange extends DataConnectorDataTypeCommon { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OfficeDataConnectorDataTypesExchange.class); + + /** {@inheritDoc} */ + @Override + public OfficeDataConnectorDataTypesExchange withState(DataTypeState state) { + super.withState(state); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnectorDataTypesSharePoint.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnectorDataTypesSharePoint.java new file mode 100644 index 000000000000..6a396be856ab --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnectorDataTypesSharePoint.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** SharePoint data type connection. */ +@Fluent +public final class OfficeDataConnectorDataTypesSharePoint extends DataConnectorDataTypeCommon { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OfficeDataConnectorDataTypesSharePoint.class); + + /** {@inheritDoc} */ + @Override + public OfficeDataConnectorDataTypesSharePoint withState(DataTypeState state) { + super.withState(state); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnectorDataTypesTeams.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnectorDataTypesTeams.java new file mode 100644 index 000000000000..97a7e28e9a7e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnectorDataTypesTeams.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Teams data type connection. */ +@Fluent +public final class OfficeDataConnectorDataTypesTeams extends DataConnectorDataTypeCommon { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OfficeDataConnectorDataTypesTeams.class); + + /** {@inheritDoc} */ + @Override + public OfficeDataConnectorDataTypesTeams withState(DataTypeState state) { + super.withState(state); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeIrmCheckRequirements.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeIrmCheckRequirements.java new file mode 100644 index 000000000000..b949ff3c66c5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeIrmCheckRequirements.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficeIrmCheckRequirementsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents OfficeIRM (Microsoft Insider Risk Management) requirements check request. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("OfficeIRM") +@Fluent +public final class OfficeIrmCheckRequirements extends DataConnectorsCheckRequirements { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OfficeIrmCheckRequirements.class); + + /* + * OfficeIRM (Microsoft Insider Risk Management) requirements check + * properties. + */ + @JsonProperty(value = "properties") + private OfficeIrmCheckRequirementsProperties innerProperties; + + /** + * Get the innerProperties property: OfficeIRM (Microsoft Insider Risk Management) requirements check properties. + * + * @return the innerProperties value. + */ + private OfficeIrmCheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeIrmDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeIrmDataConnector.java new file mode 100644 index 000000000000..54834b763a9d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeIrmDataConnector.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficeIrmDataConnectorProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Represents OfficeIRM (Microsoft Insider Risk Management) data connector. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("OfficeIRM") +@Fluent +public final class OfficeIrmDataConnector extends DataConnectorInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OfficeIrmDataConnector.class); + + /* + * OfficeIRM (Microsoft Insider Risk Management) data connector properties. + */ + @JsonProperty(value = "properties") + private OfficeIrmDataConnectorProperties innerProperties; + + /** + * Get the innerProperties property: OfficeIRM (Microsoft Insider Risk Management) data connector properties. + * + * @return the innerProperties value. + */ + private OfficeIrmDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public OfficeIrmDataConnector withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public AlertsDataTypeOfDataConnector dataTypes() { + return this.innerProperties() == null ? null : this.innerProperties().dataTypes(); + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the OfficeIrmDataConnector object itself. + */ + public OfficeIrmDataConnector withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new OfficeIrmDataConnectorProperties(); + } + this.innerProperties().withDataTypes(dataTypes); + return this; + } + + /** + * Get the tenantId property: The tenant id to connect to, and get the data from. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Set the tenantId property: The tenant id to connect to, and get the data from. + * + * @param tenantId the tenantId value to set. + * @return the OfficeIrmDataConnector object itself. + */ + public OfficeIrmDataConnector withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new OfficeIrmDataConnectorProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Operation.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Operation.java new file mode 100644 index 000000000000..add782a2afc1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Operation.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the display property: Properties of the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the name property: Name of the operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the origin property: The origin of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OperationDisplay.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OperationDisplay.java new file mode 100644 index 000000000000..7a6447e2d0b2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the operation. */ +@Fluent +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * Description of the operation + */ + @JsonProperty(value = "description") + private String description; + + /* + * Operation name + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Provider name + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Resource name + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Get the description property: Description of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the operation property: Operation name. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Operation name. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the provider property: Provider name. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Provider name. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Resource name. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Resource name. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Operations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Operations.java new file mode 100644 index 000000000000..16a8948448cd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all operations available Azure Security Insights Resource Provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists the operations available in the SecurityInsights RP. + */ + PagedIterable list(); + + /** + * Lists all operations available Azure Security Insights Resource Provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists the operations available in the SecurityInsights RP. + */ + PagedIterable list(Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OperationsList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OperationsList.java new file mode 100644 index 000000000000..22471deec814 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OperationsList.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Lists the operations available in the SecurityInsights RP. */ +@Fluent +public final class OperationsList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsList.class); + + /* + * URL to fetch the next set of operations. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of operations + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the nextLink property: URL to fetch the next set of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of operations. + * + * @param value the value value to set. + * @return the OperationsList object itself. + */ + public OperationsList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model OperationsList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Operator.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Operator.java new file mode 100644 index 000000000000..b4178f77fcf3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Operator.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Operator. */ +public final class Operator extends ExpandableStringEnum { + /** Static value AND for Operator. */ + public static final Operator AND = fromString("AND"); + + /** Static value OR for Operator. */ + public static final Operator OR = fromString("OR"); + + /** + * Creates or finds a Operator from its string representation. + * + * @param name a name to look for. + * @return the corresponding Operator. + */ + @JsonCreator + public static Operator fromString(String name) { + return fromString(name, Operator.class); + } + + /** @return known Operator values. */ + public static Collection values() { + return values(Operator.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OutputType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OutputType.java new file mode 100644 index 000000000000..a8ec9c5155e9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OutputType.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OutputType. */ +public final class OutputType extends ExpandableStringEnum { + /** Static value Number for OutputType. */ + public static final OutputType NUMBER = fromString("Number"); + + /** Static value String for OutputType. */ + public static final OutputType STRING = fromString("String"); + + /** Static value Date for OutputType. */ + public static final OutputType DATE = fromString("Date"); + + /** Static value Entity for OutputType. */ + public static final OutputType ENTITY = fromString("Entity"); + + /** + * Creates or finds a OutputType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OutputType. + */ + @JsonCreator + public static OutputType fromString(String name) { + return fromString(name, OutputType.class); + } + + /** @return known OutputType values. */ + public static Collection values() { + return values(OutputType.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OwnerType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OwnerType.java new file mode 100644 index 000000000000..8c9b75b45a1a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OwnerType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OwnerType. */ +public final class OwnerType extends ExpandableStringEnum { + /** Static value Unknown for OwnerType. */ + public static final OwnerType UNKNOWN = fromString("Unknown"); + + /** Static value User for OwnerType. */ + public static final OwnerType USER = fromString("User"); + + /** Static value Group for OwnerType. */ + public static final OwnerType GROUP = fromString("Group"); + + /** + * Creates or finds a OwnerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OwnerType. + */ + @JsonCreator + public static OwnerType fromString(String name) { + return fromString(name, OwnerType.class); + } + + /** @return known OwnerType values. */ + public static Collection values() { + return values(OwnerType.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PermissionProviderScope.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PermissionProviderScope.java new file mode 100644 index 000000000000..ec80015a2752 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PermissionProviderScope.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PermissionProviderScope. */ +public final class PermissionProviderScope extends ExpandableStringEnum { + /** Static value ResourceGroup for PermissionProviderScope. */ + public static final PermissionProviderScope RESOURCE_GROUP = fromString("ResourceGroup"); + + /** Static value Subscription for PermissionProviderScope. */ + public static final PermissionProviderScope SUBSCRIPTION = fromString("Subscription"); + + /** Static value Workspace for PermissionProviderScope. */ + public static final PermissionProviderScope WORKSPACE = fromString("Workspace"); + + /** + * Creates or finds a PermissionProviderScope from its string representation. + * + * @param name a name to look for. + * @return the corresponding PermissionProviderScope. + */ + @JsonCreator + public static PermissionProviderScope fromString(String name) { + return fromString(name, PermissionProviderScope.class); + } + + /** @return known PermissionProviderScope values. */ + public static Collection values() { + return values(PermissionProviderScope.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Permissions.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Permissions.java new file mode 100644 index 000000000000..861229ce1f25 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Permissions.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Permissions required for the connector. */ +@Fluent +public final class Permissions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Permissions.class); + + /* + * Resource provider permissions required for the connector + */ + @JsonProperty(value = "resourceProvider") + private List resourceProvider; + + /* + * Customs permissions required for the connector + */ + @JsonProperty(value = "customs") + private List customs; + + /** + * Get the resourceProvider property: Resource provider permissions required for the connector. + * + * @return the resourceProvider value. + */ + public List resourceProvider() { + return this.resourceProvider; + } + + /** + * Set the resourceProvider property: Resource provider permissions required for the connector. + * + * @param resourceProvider the resourceProvider value to set. + * @return the Permissions object itself. + */ + public Permissions withResourceProvider(List resourceProvider) { + this.resourceProvider = resourceProvider; + return this; + } + + /** + * Get the customs property: Customs permissions required for the connector. + * + * @return the customs value. + */ + public List customs() { + return this.customs; + } + + /** + * Set the customs property: Customs permissions required for the connector. + * + * @param customs the customs value to set. + * @return the Permissions object itself. + */ + public Permissions withCustoms(List customs) { + this.customs = customs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceProvider() != null) { + resourceProvider().forEach(e -> e.validate()); + } + if (customs() != null) { + customs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PermissionsCustomsItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PermissionsCustomsItem.java new file mode 100644 index 000000000000..cd107227bd9f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PermissionsCustomsItem.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The PermissionsCustomsItem model. */ +@Fluent +public final class PermissionsCustomsItem extends Customs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PermissionsCustomsItem.class); + + /** {@inheritDoc} */ + @Override + public PermissionsCustomsItem withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public PermissionsCustomsItem withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PermissionsResourceProviderItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PermissionsResourceProviderItem.java new file mode 100644 index 000000000000..8deb6cf4af2d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PermissionsResourceProviderItem.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The PermissionsResourceProviderItem model. */ +@Fluent +public final class PermissionsResourceProviderItem extends ResourceProvider { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PermissionsResourceProviderItem.class); + + /** {@inheritDoc} */ + @Override + public PermissionsResourceProviderItem withProvider(ProviderName provider) { + super.withProvider(provider); + return this; + } + + /** {@inheritDoc} */ + @Override + public PermissionsResourceProviderItem withPermissionsDisplayText(String permissionsDisplayText) { + super.withPermissionsDisplayText(permissionsDisplayText); + return this; + } + + /** {@inheritDoc} */ + @Override + public PermissionsResourceProviderItem withProviderDisplayName(String providerDisplayName) { + super.withProviderDisplayName(providerDisplayName); + return this; + } + + /** {@inheritDoc} */ + @Override + public PermissionsResourceProviderItem withScope(PermissionProviderScope scope) { + super.withScope(scope); + return this; + } + + /** {@inheritDoc} */ + @Override + public PermissionsResourceProviderItem withRequiredPermissions(RequiredPermissions requiredPermissions) { + super.withRequiredPermissions(requiredPermissions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PollingFrequency.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PollingFrequency.java new file mode 100644 index 000000000000..131e990e6b8c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PollingFrequency.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PollingFrequency. */ +public final class PollingFrequency extends ExpandableStringEnum { + /** Static value OnceAMinute for PollingFrequency. */ + public static final PollingFrequency ONCE_AMINUTE = fromString("OnceAMinute"); + + /** Static value OnceAnHour for PollingFrequency. */ + public static final PollingFrequency ONCE_AN_HOUR = fromString("OnceAnHour"); + + /** Static value OnceADay for PollingFrequency. */ + public static final PollingFrequency ONCE_ADAY = fromString("OnceADay"); + + /** + * Creates or finds a PollingFrequency from its string representation. + * + * @param name a name to look for. + * @return the corresponding PollingFrequency. + */ + @JsonCreator + public static PollingFrequency fromString(String name) { + return fromString(name, PollingFrequency.class); + } + + /** @return known PollingFrequency values. */ + public static Collection values() { + return values(PollingFrequency.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProcessEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProcessEntity.java new file mode 100644 index 000000000000..9ae792e00317 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProcessEntity.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.azure.resourcemanager.securityinsights.fluent.models.ProcessEntityProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Represents a process entity. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Process") +@Fluent +public final class ProcessEntity extends EntityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProcessEntity.class); + + /* + * Process entity properties + */ + @JsonProperty(value = "properties") + private ProcessEntityProperties innerProperties; + + /** + * Get the innerProperties property: Process entity properties. + * + * @return the innerProperties value. + */ + private ProcessEntityProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the accountEntityId property: The account entity id running the processes. + * + * @return the accountEntityId value. + */ + public String accountEntityId() { + return this.innerProperties() == null ? null : this.innerProperties().accountEntityId(); + } + + /** + * Get the commandLine property: The command line used to create the process. + * + * @return the commandLine value. + */ + public String commandLine() { + return this.innerProperties() == null ? null : this.innerProperties().commandLine(); + } + + /** + * Get the creationTimeUtc property: The time when the process started to run. + * + * @return the creationTimeUtc value. + */ + public OffsetDateTime creationTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().creationTimeUtc(); + } + + /** + * Get the elevationToken property: The elevation token associated with the process. + * + * @return the elevationToken value. + */ + public ElevationToken elevationToken() { + return this.innerProperties() == null ? null : this.innerProperties().elevationToken(); + } + + /** + * Set the elevationToken property: The elevation token associated with the process. + * + * @param elevationToken the elevationToken value to set. + * @return the ProcessEntity object itself. + */ + public ProcessEntity withElevationToken(ElevationToken elevationToken) { + if (this.innerProperties() == null) { + this.innerProperties = new ProcessEntityProperties(); + } + this.innerProperties().withElevationToken(elevationToken); + return this; + } + + /** + * Get the hostEntityId property: The host entity id on which the process was running. + * + * @return the hostEntityId value. + */ + public String hostEntityId() { + return this.innerProperties() == null ? null : this.innerProperties().hostEntityId(); + } + + /** + * Get the hostLogonSessionEntityId property: The session entity id in which the process was running. + * + * @return the hostLogonSessionEntityId value. + */ + public String hostLogonSessionEntityId() { + return this.innerProperties() == null ? null : this.innerProperties().hostLogonSessionEntityId(); + } + + /** + * Get the imageFileEntityId property: Image file entity id. + * + * @return the imageFileEntityId value. + */ + public String imageFileEntityId() { + return this.innerProperties() == null ? null : this.innerProperties().imageFileEntityId(); + } + + /** + * Get the parentProcessEntityId property: The parent process entity id. + * + * @return the parentProcessEntityId value. + */ + public String parentProcessEntityId() { + return this.innerProperties() == null ? null : this.innerProperties().parentProcessEntityId(); + } + + /** + * Get the processId property: The process ID. + * + * @return the processId value. + */ + public String processId() { + return this.innerProperties() == null ? null : this.innerProperties().processId(); + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductSettings.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductSettings.java new file mode 100644 index 000000000000..8011618330ee --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductSettings.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; + +/** Resource collection API of ProductSettings. */ +public interface ProductSettings { + /** + * List of all the settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the settings. + */ + SettingList list(String resourceGroupName, String workspaceName); + + /** + * List of all the settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the settings. + */ + Response listWithResponse(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets a setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a setting. + */ + Settings get(String resourceGroupName, String workspaceName, String settingsName); + + /** + * Gets a setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a setting. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String settingsName, Context context); + + /** + * Delete setting of the product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String settingsName); + + /** + * Delete setting of the product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String settingsName, Context context); + + /** + * Updates setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @param settings The setting. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Setting. + */ + Settings update(String resourceGroupName, String workspaceName, String settingsName, SettingsInner settings); + + /** + * Updates setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @param settings The setting. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Setting. + */ + Response updateWithResponse( + String resourceGroupName, String workspaceName, String settingsName, SettingsInner settings, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProviderName.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProviderName.java new file mode 100644 index 000000000000..54a92d5faa00 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProviderName.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProviderName. */ +public final class ProviderName extends ExpandableStringEnum { + /** Static value Microsoft.OperationalInsights/solutions for ProviderName. */ + public static final ProviderName MICROSOFT_OPERATIONAL_INSIGHTS_SOLUTIONS = + fromString("Microsoft.OperationalInsights/solutions"); + + /** Static value Microsoft.OperationalInsights/workspaces for ProviderName. */ + public static final ProviderName MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES = + fromString("Microsoft.OperationalInsights/workspaces"); + + /** Static value Microsoft.OperationalInsights/workspaces/datasources for ProviderName. */ + public static final ProviderName MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES_DATASOURCES = + fromString("Microsoft.OperationalInsights/workspaces/datasources"); + + /** Static value microsoft.aadiam/diagnosticSettings for ProviderName. */ + public static final ProviderName MICROSOFT_AADIAM_DIAGNOSTIC_SETTINGS = + fromString("microsoft.aadiam/diagnosticSettings"); + + /** Static value Microsoft.OperationalInsights/workspaces/sharedKeys for ProviderName. */ + public static final ProviderName MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES_SHARED_KEYS = + fromString("Microsoft.OperationalInsights/workspaces/sharedKeys"); + + /** Static value Microsoft.Authorization/policyAssignments for ProviderName. */ + public static final ProviderName MICROSOFT_AUTHORIZATION_POLICY_ASSIGNMENTS = + fromString("Microsoft.Authorization/policyAssignments"); + + /** + * Creates or finds a ProviderName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProviderName. + */ + @JsonCreator + public static ProviderName fromString(String name) { + return fromString(name, ProviderName.class); + } + + /** @return known ProviderName values. */ + public static Collection values() { + return values(ProviderName.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QueryBasedAlertRuleProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QueryBasedAlertRuleProperties.java new file mode 100644 index 000000000000..679f98e22be2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QueryBasedAlertRuleProperties.java @@ -0,0 +1,443 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Query based alert rule base property bag. */ +@Fluent +public class QueryBasedAlertRuleProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QueryBasedAlertRuleProperties.class); + + /* + * The Name of the alert rule template used to create this rule. + */ + @JsonProperty(value = "alertRuleTemplateName") + private String alertRuleTemplateName; + + /* + * The version of the alert rule template used to create this rule - in + * format , where all are numbers, for example 0 <1.0.2> + */ + @JsonProperty(value = "templateVersion") + private String templateVersion; + + /* + * The description of the alert rule. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The query that creates alerts for this rule. + */ + @JsonProperty(value = "query") + private String query; + + /* + * The display name for alerts created by this alert rule. + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /* + * Determines whether this alert rule is enabled or disabled. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * The last time that this alert rule has been modified. + */ + @JsonProperty(value = "lastModifiedUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedUtc; + + /* + * The suppression (in ISO 8601 duration format) to wait since last time + * this alert rule been triggered. + */ + @JsonProperty(value = "suppressionDuration", required = true) + private Duration suppressionDuration; + + /* + * Determines whether the suppression for this alert rule is enabled or + * disabled. + */ + @JsonProperty(value = "suppressionEnabled", required = true) + private boolean suppressionEnabled; + + /* + * The severity for alerts created by this alert rule. + */ + @JsonProperty(value = "severity") + private AlertSeverity severity; + + /* + * The tactics of the alert rule + */ + @JsonProperty(value = "tactics") + private List tactics; + + /* + * The settings of the incidents that created from alerts triggered by this + * analytics rule + */ + @JsonProperty(value = "incidentConfiguration") + private IncidentConfiguration incidentConfiguration; + + /* + * Dictionary of string key-value pairs of columns to be attached to the + * alert + */ + @JsonProperty(value = "customDetails") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map customDetails; + + /* + * Array of the entity mappings of the alert rule + */ + @JsonProperty(value = "entityMappings") + private List entityMappings; + + /* + * The alert details override settings + */ + @JsonProperty(value = "alertDetailsOverride") + private AlertDetailsOverride alertDetailsOverride; + + /** + * Get the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. + * + * @return the alertRuleTemplateName value. + */ + public String alertRuleTemplateName() { + return this.alertRuleTemplateName; + } + + /** + * Set the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. + * + * @param alertRuleTemplateName the alertRuleTemplateName value to set. + * @return the QueryBasedAlertRuleProperties object itself. + */ + public QueryBasedAlertRuleProperties withAlertRuleTemplateName(String alertRuleTemplateName) { + this.alertRuleTemplateName = alertRuleTemplateName; + return this; + } + + /** + * Get the templateVersion property: The version of the alert rule template used to create this rule - in format + * <a.b.c>, where all are numbers, for example 0 <1.0.2>. + * + * @return the templateVersion value. + */ + public String templateVersion() { + return this.templateVersion; + } + + /** + * Set the templateVersion property: The version of the alert rule template used to create this rule - in format + * <a.b.c>, where all are numbers, for example 0 <1.0.2>. + * + * @param templateVersion the templateVersion value to set. + * @return the QueryBasedAlertRuleProperties object itself. + */ + public QueryBasedAlertRuleProperties withTemplateVersion(String templateVersion) { + this.templateVersion = templateVersion; + return this; + } + + /** + * Get the description property: The description of the alert rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the alert rule. + * + * @param description the description value to set. + * @return the QueryBasedAlertRuleProperties object itself. + */ + public QueryBasedAlertRuleProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the query property: The query that creates alerts for this rule. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * Set the query property: The query that creates alerts for this rule. + * + * @param query the query value to set. + * @return the QueryBasedAlertRuleProperties object itself. + */ + public QueryBasedAlertRuleProperties withQuery(String query) { + this.query = query; + return this; + } + + /** + * Get the displayName property: The display name for alerts created by this alert rule. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name for alerts created by this alert rule. + * + * @param displayName the displayName value to set. + * @return the QueryBasedAlertRuleProperties object itself. + */ + public QueryBasedAlertRuleProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the enabled property: Determines whether this alert rule is enabled or disabled. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Determines whether this alert rule is enabled or disabled. + * + * @param enabled the enabled value to set. + * @return the QueryBasedAlertRuleProperties object itself. + */ + public QueryBasedAlertRuleProperties withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the lastModifiedUtc property: The last time that this alert rule has been modified. + * + * @return the lastModifiedUtc value. + */ + public OffsetDateTime lastModifiedUtc() { + return this.lastModifiedUtc; + } + + /** + * Get the suppressionDuration property: The suppression (in ISO 8601 duration format) to wait since last time this + * alert rule been triggered. + * + * @return the suppressionDuration value. + */ + public Duration suppressionDuration() { + return this.suppressionDuration; + } + + /** + * Set the suppressionDuration property: The suppression (in ISO 8601 duration format) to wait since last time this + * alert rule been triggered. + * + * @param suppressionDuration the suppressionDuration value to set. + * @return the QueryBasedAlertRuleProperties object itself. + */ + public QueryBasedAlertRuleProperties withSuppressionDuration(Duration suppressionDuration) { + this.suppressionDuration = suppressionDuration; + return this; + } + + /** + * Get the suppressionEnabled property: Determines whether the suppression for this alert rule is enabled or + * disabled. + * + * @return the suppressionEnabled value. + */ + public boolean suppressionEnabled() { + return this.suppressionEnabled; + } + + /** + * Set the suppressionEnabled property: Determines whether the suppression for this alert rule is enabled or + * disabled. + * + * @param suppressionEnabled the suppressionEnabled value to set. + * @return the QueryBasedAlertRuleProperties object itself. + */ + public QueryBasedAlertRuleProperties withSuppressionEnabled(boolean suppressionEnabled) { + this.suppressionEnabled = suppressionEnabled; + return this; + } + + /** + * Get the severity property: The severity for alerts created by this alert rule. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.severity; + } + + /** + * Set the severity property: The severity for alerts created by this alert rule. + * + * @param severity the severity value to set. + * @return the QueryBasedAlertRuleProperties object itself. + */ + public QueryBasedAlertRuleProperties withSeverity(AlertSeverity severity) { + this.severity = severity; + return this; + } + + /** + * Get the tactics property: The tactics of the alert rule. + * + * @return the tactics value. + */ + public List tactics() { + return this.tactics; + } + + /** + * Set the tactics property: The tactics of the alert rule. + * + * @param tactics the tactics value to set. + * @return the QueryBasedAlertRuleProperties object itself. + */ + public QueryBasedAlertRuleProperties withTactics(List tactics) { + this.tactics = tactics; + return this; + } + + /** + * Get the incidentConfiguration property: The settings of the incidents that created from alerts triggered by this + * analytics rule. + * + * @return the incidentConfiguration value. + */ + public IncidentConfiguration incidentConfiguration() { + return this.incidentConfiguration; + } + + /** + * Set the incidentConfiguration property: The settings of the incidents that created from alerts triggered by this + * analytics rule. + * + * @param incidentConfiguration the incidentConfiguration value to set. + * @return the QueryBasedAlertRuleProperties object itself. + */ + public QueryBasedAlertRuleProperties withIncidentConfiguration(IncidentConfiguration incidentConfiguration) { + this.incidentConfiguration = incidentConfiguration; + return this; + } + + /** + * Get the customDetails property: Dictionary of string key-value pairs of columns to be attached to the alert. + * + * @return the customDetails value. + */ + public Map customDetails() { + return this.customDetails; + } + + /** + * Set the customDetails property: Dictionary of string key-value pairs of columns to be attached to the alert. + * + * @param customDetails the customDetails value to set. + * @return the QueryBasedAlertRuleProperties object itself. + */ + public QueryBasedAlertRuleProperties withCustomDetails(Map customDetails) { + this.customDetails = customDetails; + return this; + } + + /** + * Get the entityMappings property: Array of the entity mappings of the alert rule. + * + * @return the entityMappings value. + */ + public List entityMappings() { + return this.entityMappings; + } + + /** + * Set the entityMappings property: Array of the entity mappings of the alert rule. + * + * @param entityMappings the entityMappings value to set. + * @return the QueryBasedAlertRuleProperties object itself. + */ + public QueryBasedAlertRuleProperties withEntityMappings(List entityMappings) { + this.entityMappings = entityMappings; + return this; + } + + /** + * Get the alertDetailsOverride property: The alert details override settings. + * + * @return the alertDetailsOverride value. + */ + public AlertDetailsOverride alertDetailsOverride() { + return this.alertDetailsOverride; + } + + /** + * Set the alertDetailsOverride property: The alert details override settings. + * + * @param alertDetailsOverride the alertDetailsOverride value to set. + * @return the QueryBasedAlertRuleProperties object itself. + */ + public QueryBasedAlertRuleProperties withAlertDetailsOverride(AlertDetailsOverride alertDetailsOverride) { + this.alertDetailsOverride = alertDetailsOverride; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (displayName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property displayName in model QueryBasedAlertRuleProperties")); + } + if (suppressionDuration() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property suppressionDuration in model QueryBasedAlertRuleProperties")); + } + if (incidentConfiguration() != null) { + incidentConfiguration().validate(); + } + if (entityMappings() != null) { + entityMappings().forEach(e -> e.validate()); + } + if (alertDetailsOverride() != null) { + alertDetailsOverride().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QueryBasedAlertRuleTemplateProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QueryBasedAlertRuleTemplateProperties.java new file mode 100644 index 000000000000..bca982c12454 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QueryBasedAlertRuleTemplateProperties.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Query based alert rule template base property bag. */ +@Fluent +public class QueryBasedAlertRuleTemplateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QueryBasedAlertRuleTemplateProperties.class); + + /* + * The query that creates alerts for this rule. + */ + @JsonProperty(value = "query") + private String query; + + /* + * The severity for alerts created by this alert rule. + */ + @JsonProperty(value = "severity") + private AlertSeverity severity; + + /* + * The tactics of the alert rule + */ + @JsonProperty(value = "tactics") + private List tactics; + + /* + * The version of this template - in format , where all are numbers. + * For example <1.0.2>. + */ + @JsonProperty(value = "version") + private String version; + + /* + * Dictionary of string key-value pairs of columns to be attached to the + * alert + */ + @JsonProperty(value = "customDetails") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map customDetails; + + /* + * Array of the entity mappings of the alert rule + */ + @JsonProperty(value = "entityMappings") + private List entityMappings; + + /* + * The alert details override settings + */ + @JsonProperty(value = "alertDetailsOverride") + private AlertDetailsOverride alertDetailsOverride; + + /** + * Get the query property: The query that creates alerts for this rule. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * Set the query property: The query that creates alerts for this rule. + * + * @param query the query value to set. + * @return the QueryBasedAlertRuleTemplateProperties object itself. + */ + public QueryBasedAlertRuleTemplateProperties withQuery(String query) { + this.query = query; + return this; + } + + /** + * Get the severity property: The severity for alerts created by this alert rule. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.severity; + } + + /** + * Set the severity property: The severity for alerts created by this alert rule. + * + * @param severity the severity value to set. + * @return the QueryBasedAlertRuleTemplateProperties object itself. + */ + public QueryBasedAlertRuleTemplateProperties withSeverity(AlertSeverity severity) { + this.severity = severity; + return this; + } + + /** + * Get the tactics property: The tactics of the alert rule. + * + * @return the tactics value. + */ + public List tactics() { + return this.tactics; + } + + /** + * Set the tactics property: The tactics of the alert rule. + * + * @param tactics the tactics value to set. + * @return the QueryBasedAlertRuleTemplateProperties object itself. + */ + public QueryBasedAlertRuleTemplateProperties withTactics(List tactics) { + this.tactics = tactics; + return this; + } + + /** + * Get the version property: The version of this template - in format <a.b.c>, where all are numbers. For + * example <1.0.2>. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of this template - in format <a.b.c>, where all are numbers. For + * example <1.0.2>. + * + * @param version the version value to set. + * @return the QueryBasedAlertRuleTemplateProperties object itself. + */ + public QueryBasedAlertRuleTemplateProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the customDetails property: Dictionary of string key-value pairs of columns to be attached to the alert. + * + * @return the customDetails value. + */ + public Map customDetails() { + return this.customDetails; + } + + /** + * Set the customDetails property: Dictionary of string key-value pairs of columns to be attached to the alert. + * + * @param customDetails the customDetails value to set. + * @return the QueryBasedAlertRuleTemplateProperties object itself. + */ + public QueryBasedAlertRuleTemplateProperties withCustomDetails(Map customDetails) { + this.customDetails = customDetails; + return this; + } + + /** + * Get the entityMappings property: Array of the entity mappings of the alert rule. + * + * @return the entityMappings value. + */ + public List entityMappings() { + return this.entityMappings; + } + + /** + * Set the entityMappings property: Array of the entity mappings of the alert rule. + * + * @param entityMappings the entityMappings value to set. + * @return the QueryBasedAlertRuleTemplateProperties object itself. + */ + public QueryBasedAlertRuleTemplateProperties withEntityMappings(List entityMappings) { + this.entityMappings = entityMappings; + return this; + } + + /** + * Get the alertDetailsOverride property: The alert details override settings. + * + * @return the alertDetailsOverride value. + */ + public AlertDetailsOverride alertDetailsOverride() { + return this.alertDetailsOverride; + } + + /** + * Set the alertDetailsOverride property: The alert details override settings. + * + * @param alertDetailsOverride the alertDetailsOverride value to set. + * @return the QueryBasedAlertRuleTemplateProperties object itself. + */ + public QueryBasedAlertRuleTemplateProperties withAlertDetailsOverride(AlertDetailsOverride alertDetailsOverride) { + this.alertDetailsOverride = alertDetailsOverride; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (entityMappings() != null) { + entityMappings().forEach(e -> e.validate()); + } + if (alertDetailsOverride() != null) { + alertDetailsOverride().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RegistryHive.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RegistryHive.java new file mode 100644 index 000000000000..43a775588284 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RegistryHive.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RegistryHive. */ +public final class RegistryHive extends ExpandableStringEnum { + /** Static value HKEY_LOCAL_MACHINE for RegistryHive. */ + public static final RegistryHive HKEY_LOCAL_MACHINE = fromString("HKEY_LOCAL_MACHINE"); + + /** Static value HKEY_CLASSES_ROOT for RegistryHive. */ + public static final RegistryHive HKEY_CLASSES_ROOT = fromString("HKEY_CLASSES_ROOT"); + + /** Static value HKEY_CURRENT_CONFIG for RegistryHive. */ + public static final RegistryHive HKEY_CURRENT_CONFIG = fromString("HKEY_CURRENT_CONFIG"); + + /** Static value HKEY_USERS for RegistryHive. */ + public static final RegistryHive HKEY_USERS = fromString("HKEY_USERS"); + + /** Static value HKEY_CURRENT_USER_LOCAL_SETTINGS for RegistryHive. */ + public static final RegistryHive HKEY_CURRENT_USER_LOCAL_SETTINGS = fromString("HKEY_CURRENT_USER_LOCAL_SETTINGS"); + + /** Static value HKEY_PERFORMANCE_DATA for RegistryHive. */ + public static final RegistryHive HKEY_PERFORMANCE_DATA = fromString("HKEY_PERFORMANCE_DATA"); + + /** Static value HKEY_PERFORMANCE_NLSTEXT for RegistryHive. */ + public static final RegistryHive HKEY_PERFORMANCE_NLSTEXT = fromString("HKEY_PERFORMANCE_NLSTEXT"); + + /** Static value HKEY_PERFORMANCE_TEXT for RegistryHive. */ + public static final RegistryHive HKEY_PERFORMANCE_TEXT = fromString("HKEY_PERFORMANCE_TEXT"); + + /** Static value HKEY_A for RegistryHive. */ + public static final RegistryHive HKEY_A = fromString("HKEY_A"); + + /** Static value HKEY_CURRENT_USER for RegistryHive. */ + public static final RegistryHive HKEY_CURRENT_USER = fromString("HKEY_CURRENT_USER"); + + /** + * Creates or finds a RegistryHive from its string representation. + * + * @param name a name to look for. + * @return the corresponding RegistryHive. + */ + @JsonCreator + public static RegistryHive fromString(String name) { + return fromString(name, RegistryHive.class); + } + + /** @return known RegistryHive values. */ + public static Collection values() { + return values(RegistryHive.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RegistryKeyEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RegistryKeyEntity.java new file mode 100644 index 000000000000..c17a04189a35 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RegistryKeyEntity.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.azure.resourcemanager.securityinsights.fluent.models.RegistryKeyEntityProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** Represents a registry key entity. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("RegistryKey") +@Fluent +public final class RegistryKeyEntity extends EntityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistryKeyEntity.class); + + /* + * RegistryKey entity properties + */ + @JsonProperty(value = "properties") + private RegistryKeyEntityProperties innerProperties; + + /** + * Get the innerProperties property: RegistryKey entity properties. + * + * @return the innerProperties value. + */ + private RegistryKeyEntityProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the hive property: the hive that holds the registry key. + * + * @return the hive value. + */ + public RegistryHive hive() { + return this.innerProperties() == null ? null : this.innerProperties().hive(); + } + + /** + * Get the key property: The registry key path. + * + * @return the key value. + */ + public String key() { + return this.innerProperties() == null ? null : this.innerProperties().key(); + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RegistryValueEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RegistryValueEntity.java new file mode 100644 index 000000000000..02308d3261fa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RegistryValueEntity.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.azure.resourcemanager.securityinsights.fluent.models.RegistryValueEntityProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** Represents a registry value entity. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("RegistryValue") +@Fluent +public final class RegistryValueEntity extends EntityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistryValueEntity.class); + + /* + * RegistryKey entity properties + */ + @JsonProperty(value = "properties") + private RegistryValueEntityProperties innerProperties; + + /** + * Get the innerProperties property: RegistryKey entity properties. + * + * @return the innerProperties value. + */ + private RegistryValueEntityProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the keyEntityId property: The registry key entity id. + * + * @return the keyEntityId value. + */ + public String keyEntityId() { + return this.innerProperties() == null ? null : this.innerProperties().keyEntityId(); + } + + /** + * Get the valueData property: String formatted representation of the value data. + * + * @return the valueData value. + */ + public String valueData() { + return this.innerProperties() == null ? null : this.innerProperties().valueData(); + } + + /** + * Get the valueName property: The registry value name. + * + * @return the valueName value. + */ + public String valueName() { + return this.innerProperties() == null ? null : this.innerProperties().valueName(); + } + + /** + * Get the valueType property: Specifies the data types to use when storing values in the registry, or identifies + * the data type of a value in the registry. + * + * @return the valueType value. + */ + public RegistryValueKind valueType() { + return this.innerProperties() == null ? null : this.innerProperties().valueType(); + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RegistryValueKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RegistryValueKind.java new file mode 100644 index 000000000000..d1a31150569b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RegistryValueKind.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RegistryValueKind. */ +public final class RegistryValueKind extends ExpandableStringEnum { + /** Static value None for RegistryValueKind. */ + public static final RegistryValueKind NONE = fromString("None"); + + /** Static value Unknown for RegistryValueKind. */ + public static final RegistryValueKind UNKNOWN = fromString("Unknown"); + + /** Static value String for RegistryValueKind. */ + public static final RegistryValueKind STRING = fromString("String"); + + /** Static value ExpandString for RegistryValueKind. */ + public static final RegistryValueKind EXPAND_STRING = fromString("ExpandString"); + + /** Static value Binary for RegistryValueKind. */ + public static final RegistryValueKind BINARY = fromString("Binary"); + + /** Static value DWord for RegistryValueKind. */ + public static final RegistryValueKind DWORD = fromString("DWord"); + + /** Static value MultiString for RegistryValueKind. */ + public static final RegistryValueKind MULTI_STRING = fromString("MultiString"); + + /** Static value QWord for RegistryValueKind. */ + public static final RegistryValueKind QWORD = fromString("QWord"); + + /** + * Creates or finds a RegistryValueKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding RegistryValueKind. + */ + @JsonCreator + public static RegistryValueKind fromString(String name) { + return fromString(name, RegistryValueKind.class); + } + + /** @return known RegistryValueKind values. */ + public static Collection values() { + return values(RegistryValueKind.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Relation.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Relation.java new file mode 100644 index 000000000000..dcb666f0c2cb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Relation.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; + +/** An immutable client-side representation of Relation. */ +public interface Relation { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the relatedResourceId property: The resource ID of the related resource. + * + * @return the relatedResourceId value. + */ + String relatedResourceId(); + + /** + * Gets the relatedResourceName property: The name of the related resource. + * + * @return the relatedResourceName value. + */ + String relatedResourceName(); + + /** + * Gets the relatedResourceType property: The resource type of the related resource. + * + * @return the relatedResourceType value. + */ + String relatedResourceType(); + + /** + * Gets the relatedResourceKind property: The resource kind of the related resource. + * + * @return the relatedResourceKind value. + */ + String relatedResourceKind(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.RelationInner object. + * + * @return the inner object. + */ + RelationInner innerModel(); + + /** The entirety of the Relation definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Relation definition stages. */ + interface DefinitionStages { + /** The first stage of the Relation definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Relation definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName, bookmarkId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID. + * @return the next definition stage. + */ + WithCreate withExistingBookmark(String resourceGroupName, String workspaceName, String bookmarkId); + } + /** + * The stage of the Relation definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithEtag, DefinitionStages.WithRelatedResourceId { + /** + * Executes the create request. + * + * @return the created resource. + */ + Relation create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Relation create(Context context); + } + /** The stage of the Relation definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Etag of the azure resource. + * + * @param etag Etag of the azure resource. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the Relation definition allowing to specify relatedResourceId. */ + interface WithRelatedResourceId { + /** + * Specifies the relatedResourceId property: The resource ID of the related resource. + * + * @param relatedResourceId The resource ID of the related resource. + * @return the next definition stage. + */ + WithCreate withRelatedResourceId(String relatedResourceId); + } + } + /** + * Begins update for the Relation resource. + * + * @return the stage of resource update. + */ + Relation.Update update(); + + /** The template for Relation update. */ + interface Update extends UpdateStages.WithEtag, UpdateStages.WithRelatedResourceId { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Relation apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Relation apply(Context context); + } + /** The Relation update stages. */ + interface UpdateStages { + /** The stage of the Relation update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Etag of the azure resource. + * + * @param etag Etag of the azure resource. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + /** The stage of the Relation update allowing to specify relatedResourceId. */ + interface WithRelatedResourceId { + /** + * Specifies the relatedResourceId property: The resource ID of the related resource. + * + * @param relatedResourceId The resource ID of the related resource. + * @return the next definition stage. + */ + Update withRelatedResourceId(String relatedResourceId); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Relation refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Relation refresh(Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RelationList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RelationList.java new file mode 100644 index 000000000000..496214aad5c9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RelationList.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of relations. */ +@Fluent +public final class RelationList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RelationList.class); + + /* + * URL to fetch the next set of relations. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of relations. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the nextLink property: URL to fetch the next set of relations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of relations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of relations. + * + * @param value the value value to set. + * @return the RelationList object itself. + */ + public RelationList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model RelationList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Repo.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Repo.java new file mode 100644 index 000000000000..8510709ca5b3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Repo.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.RepoInner; +import java.util.List; + +/** An immutable client-side representation of Repo. */ +public interface Repo { + /** + * Gets the url property: The url to access the repository. + * + * @return the url value. + */ + String url(); + + /** + * Gets the fullName property: The name of the repository. + * + * @return the fullName value. + */ + String fullName(); + + /** + * Gets the branches property: Array of branches. + * + * @return the branches value. + */ + List branches(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.RepoInner object. + * + * @return the inner object. + */ + RepoInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepoList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepoList.java new file mode 100644 index 000000000000..74b4a2a2c2ae --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepoList.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.RepoInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List all the source controls. */ +@Fluent +public final class RepoList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RepoList.class); + + /* + * URL to fetch the next set of repositories. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of repositories. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the nextLink property: URL to fetch the next set of repositories. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of repositories. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of repositories. + * + * @param value the value value to set. + * @return the RepoList object itself. + */ + public RepoList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property value in model RepoList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepoType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepoType.java new file mode 100644 index 000000000000..fb2d3803d4bf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepoType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RepoType. */ +public final class RepoType extends ExpandableStringEnum { + /** Static value Github for RepoType. */ + public static final RepoType GITHUB = fromString("Github"); + + /** Static value DevOps for RepoType. */ + public static final RepoType DEV_OPS = fromString("DevOps"); + + /** + * Creates or finds a RepoType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RepoType. + */ + @JsonCreator + public static RepoType fromString(String name) { + return fromString(name, RepoType.class); + } + + /** @return known RepoType values. */ + public static Collection values() { + return values(RepoType.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Repository.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Repository.java new file mode 100644 index 000000000000..9c2a5094a235 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Repository.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** metadata of a repository. */ +@Fluent +public final class Repository { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Repository.class); + + /* + * Url of repository. + */ + @JsonProperty(value = "url") + private String url; + + /* + * Branch name of repository. + */ + @JsonProperty(value = "branch") + private String branch; + + /* + * Display url of repository. + */ + @JsonProperty(value = "displayUrl") + private String displayUrl; + + /* + * Url to access repository action logs. + */ + @JsonProperty(value = "deploymentLogsUrl") + private String deploymentLogsUrl; + + /* + * Dictionary of source control content type and path mapping. + */ + @JsonProperty(value = "pathMapping") + private List pathMapping; + + /** + * Get the url property: Url of repository. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: Url of repository. + * + * @param url the url value to set. + * @return the Repository object itself. + */ + public Repository withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the branch property: Branch name of repository. + * + * @return the branch value. + */ + public String branch() { + return this.branch; + } + + /** + * Set the branch property: Branch name of repository. + * + * @param branch the branch value to set. + * @return the Repository object itself. + */ + public Repository withBranch(String branch) { + this.branch = branch; + return this; + } + + /** + * Get the displayUrl property: Display url of repository. + * + * @return the displayUrl value. + */ + public String displayUrl() { + return this.displayUrl; + } + + /** + * Set the displayUrl property: Display url of repository. + * + * @param displayUrl the displayUrl value to set. + * @return the Repository object itself. + */ + public Repository withDisplayUrl(String displayUrl) { + this.displayUrl = displayUrl; + return this; + } + + /** + * Get the deploymentLogsUrl property: Url to access repository action logs. + * + * @return the deploymentLogsUrl value. + */ + public String deploymentLogsUrl() { + return this.deploymentLogsUrl; + } + + /** + * Set the deploymentLogsUrl property: Url to access repository action logs. + * + * @param deploymentLogsUrl the deploymentLogsUrl value to set. + * @return the Repository object itself. + */ + public Repository withDeploymentLogsUrl(String deploymentLogsUrl) { + this.deploymentLogsUrl = deploymentLogsUrl; + return this; + } + + /** + * Get the pathMapping property: Dictionary of source control content type and path mapping. + * + * @return the pathMapping value. + */ + public List pathMapping() { + return this.pathMapping; + } + + /** + * Set the pathMapping property: Dictionary of source control content type and path mapping. + * + * @param pathMapping the pathMapping value to set. + * @return the Repository object itself. + */ + public Repository withPathMapping(List pathMapping) { + this.pathMapping = pathMapping; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (pathMapping() != null) { + pathMapping().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RequiredPermissions.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RequiredPermissions.java new file mode 100644 index 000000000000..5a312b1a6b49 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RequiredPermissions.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Required permissions for the connector. */ +@Fluent +public final class RequiredPermissions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RequiredPermissions.class); + + /* + * action permission + */ + @JsonProperty(value = "action") + private Boolean action; + + /* + * write permission + */ + @JsonProperty(value = "write") + private Boolean write; + + /* + * read permission + */ + @JsonProperty(value = "read") + private Boolean read; + + /* + * delete permission + */ + @JsonProperty(value = "delete") + private Boolean delete; + + /** + * Get the action property: action permission. + * + * @return the action value. + */ + public Boolean action() { + return this.action; + } + + /** + * Set the action property: action permission. + * + * @param action the action value to set. + * @return the RequiredPermissions object itself. + */ + public RequiredPermissions withAction(Boolean action) { + this.action = action; + return this; + } + + /** + * Get the write property: write permission. + * + * @return the write value. + */ + public Boolean write() { + return this.write; + } + + /** + * Set the write property: write permission. + * + * @param write the write value to set. + * @return the RequiredPermissions object itself. + */ + public RequiredPermissions withWrite(Boolean write) { + this.write = write; + return this; + } + + /** + * Get the read property: read permission. + * + * @return the read value. + */ + public Boolean read() { + return this.read; + } + + /** + * Set the read property: read permission. + * + * @param read the read value to set. + * @return the RequiredPermissions object itself. + */ + public RequiredPermissions withRead(Boolean read) { + this.read = read; + return this; + } + + /** + * Get the delete property: delete permission. + * + * @return the delete value. + */ + public Boolean delete() { + return this.delete; + } + + /** + * Set the delete property: delete permission. + * + * @param delete the delete value to set. + * @return the RequiredPermissions object itself. + */ + public RequiredPermissions withDelete(Boolean delete) { + this.delete = delete; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceProvider.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceProvider.java new file mode 100644 index 000000000000..ab9e5e06d76f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceProvider.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resource provider permissions required for the connector. */ +@Fluent +public class ResourceProvider { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProvider.class); + + /* + * Provider name + */ + @JsonProperty(value = "provider") + private ProviderName provider; + + /* + * Permission description text + */ + @JsonProperty(value = "permissionsDisplayText") + private String permissionsDisplayText; + + /* + * Permission provider display name + */ + @JsonProperty(value = "providerDisplayName") + private String providerDisplayName; + + /* + * Permission provider scope + */ + @JsonProperty(value = "scope") + private PermissionProviderScope scope; + + /* + * Required permissions for the connector + */ + @JsonProperty(value = "requiredPermissions") + private RequiredPermissions requiredPermissions; + + /** + * Get the provider property: Provider name. + * + * @return the provider value. + */ + public ProviderName provider() { + return this.provider; + } + + /** + * Set the provider property: Provider name. + * + * @param provider the provider value to set. + * @return the ResourceProvider object itself. + */ + public ResourceProvider withProvider(ProviderName provider) { + this.provider = provider; + return this; + } + + /** + * Get the permissionsDisplayText property: Permission description text. + * + * @return the permissionsDisplayText value. + */ + public String permissionsDisplayText() { + return this.permissionsDisplayText; + } + + /** + * Set the permissionsDisplayText property: Permission description text. + * + * @param permissionsDisplayText the permissionsDisplayText value to set. + * @return the ResourceProvider object itself. + */ + public ResourceProvider withPermissionsDisplayText(String permissionsDisplayText) { + this.permissionsDisplayText = permissionsDisplayText; + return this; + } + + /** + * Get the providerDisplayName property: Permission provider display name. + * + * @return the providerDisplayName value. + */ + public String providerDisplayName() { + return this.providerDisplayName; + } + + /** + * Set the providerDisplayName property: Permission provider display name. + * + * @param providerDisplayName the providerDisplayName value to set. + * @return the ResourceProvider object itself. + */ + public ResourceProvider withProviderDisplayName(String providerDisplayName) { + this.providerDisplayName = providerDisplayName; + return this; + } + + /** + * Get the scope property: Permission provider scope. + * + * @return the scope value. + */ + public PermissionProviderScope scope() { + return this.scope; + } + + /** + * Set the scope property: Permission provider scope. + * + * @param scope the scope value to set. + * @return the ResourceProvider object itself. + */ + public ResourceProvider withScope(PermissionProviderScope scope) { + this.scope = scope; + return this; + } + + /** + * Get the requiredPermissions property: Required permissions for the connector. + * + * @return the requiredPermissions value. + */ + public RequiredPermissions requiredPermissions() { + return this.requiredPermissions; + } + + /** + * Set the requiredPermissions property: Required permissions for the connector. + * + * @param requiredPermissions the requiredPermissions value to set. + * @return the ResourceProvider object itself. + */ + public ResourceProvider withRequiredPermissions(RequiredPermissions requiredPermissions) { + this.requiredPermissions = requiredPermissions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (requiredPermissions() != null) { + requiredPermissions().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceWithEtag.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceWithEtag.java new file mode 100644 index 000000000000..08fa61058077 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceWithEtag.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An azure resource object with an Etag property. */ +@Fluent +public class ResourceWithEtag extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceWithEtag.class); + + /* + * Etag of the azure resource + */ + @JsonProperty(value = "etag") + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Etag of the azure resource. + * + * @param etag the etag value to set. + * @return the ResourceWithEtag object itself. + */ + public ResourceWithEtag withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SampleQueries.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SampleQueries.java new file mode 100644 index 000000000000..cbc4781224c9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SampleQueries.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The sample queries for the connector. */ +@Fluent +public class SampleQueries { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SampleQueries.class); + + /* + * The sample query description + */ + @JsonProperty(value = "description") + private String description; + + /* + * the sample query + */ + @JsonProperty(value = "query") + private String query; + + /** + * Get the description property: The sample query description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The sample query description. + * + * @param description the description value to set. + * @return the SampleQueries object itself. + */ + public SampleQueries withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the query property: the sample query. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * Set the query property: the sample query. + * + * @param query the query value to set. + * @return the SampleQueries object itself. + */ + public SampleQueries withQuery(String query) { + this.query = query; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ScheduledAlertRule.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ScheduledAlertRule.java new file mode 100644 index 000000000000..36f412347bf4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ScheduledAlertRule.java @@ -0,0 +1,515 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; +import com.azure.resourcemanager.securityinsights.fluent.models.ScheduledAlertRuleProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Represents scheduled alert rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Scheduled") +@Fluent +public final class ScheduledAlertRule extends AlertRuleInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduledAlertRule.class); + + /* + * Scheduled alert rule properties + */ + @JsonProperty(value = "properties") + private ScheduledAlertRuleProperties innerProperties; + + /** + * Get the innerProperties property: Scheduled alert rule properties. + * + * @return the innerProperties value. + */ + private ScheduledAlertRuleProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public ScheduledAlertRule withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. + * + * @return the alertRuleTemplateName value. + */ + public String alertRuleTemplateName() { + return this.innerProperties() == null ? null : this.innerProperties().alertRuleTemplateName(); + } + + /** + * Set the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. + * + * @param alertRuleTemplateName the alertRuleTemplateName value to set. + * @return the ScheduledAlertRule object itself. + */ + public ScheduledAlertRule withAlertRuleTemplateName(String alertRuleTemplateName) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleProperties(); + } + this.innerProperties().withAlertRuleTemplateName(alertRuleTemplateName); + return this; + } + + /** + * Get the templateVersion property: The version of the alert rule template used to create this rule - in format + * <a.b.c>, where all are numbers, for example 0 <1.0.2>. + * + * @return the templateVersion value. + */ + public String templateVersion() { + return this.innerProperties() == null ? null : this.innerProperties().templateVersion(); + } + + /** + * Set the templateVersion property: The version of the alert rule template used to create this rule - in format + * <a.b.c>, where all are numbers, for example 0 <1.0.2>. + * + * @param templateVersion the templateVersion value to set. + * @return the ScheduledAlertRule object itself. + */ + public ScheduledAlertRule withTemplateVersion(String templateVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleProperties(); + } + this.innerProperties().withTemplateVersion(templateVersion); + return this; + } + + /** + * Get the description property: The description of the alert rule. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of the alert rule. + * + * @param description the description value to set. + * @return the ScheduledAlertRule object itself. + */ + public ScheduledAlertRule withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the query property: The query that creates alerts for this rule. + * + * @return the query value. + */ + public String query() { + return this.innerProperties() == null ? null : this.innerProperties().query(); + } + + /** + * Set the query property: The query that creates alerts for this rule. + * + * @param query the query value to set. + * @return the ScheduledAlertRule object itself. + */ + public ScheduledAlertRule withQuery(String query) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleProperties(); + } + this.innerProperties().withQuery(query); + return this; + } + + /** + * Get the displayName property: The display name for alerts created by this alert rule. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name for alerts created by this alert rule. + * + * @param displayName the displayName value to set. + * @return the ScheduledAlertRule object itself. + */ + public ScheduledAlertRule withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the enabled property: Determines whether this alert rule is enabled or disabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.innerProperties() == null ? null : this.innerProperties().enabled(); + } + + /** + * Set the enabled property: Determines whether this alert rule is enabled or disabled. + * + * @param enabled the enabled value to set. + * @return the ScheduledAlertRule object itself. + */ + public ScheduledAlertRule withEnabled(Boolean enabled) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleProperties(); + } + this.innerProperties().withEnabled(enabled); + return this; + } + + /** + * Get the lastModifiedUtc property: The last time that this alert rule has been modified. + * + * @return the lastModifiedUtc value. + */ + public OffsetDateTime lastModifiedUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedUtc(); + } + + /** + * Get the suppressionDuration property: The suppression (in ISO 8601 duration format) to wait since last time this + * alert rule been triggered. + * + * @return the suppressionDuration value. + */ + public Duration suppressionDuration() { + return this.innerProperties() == null ? null : this.innerProperties().suppressionDuration(); + } + + /** + * Set the suppressionDuration property: The suppression (in ISO 8601 duration format) to wait since last time this + * alert rule been triggered. + * + * @param suppressionDuration the suppressionDuration value to set. + * @return the ScheduledAlertRule object itself. + */ + public ScheduledAlertRule withSuppressionDuration(Duration suppressionDuration) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleProperties(); + } + this.innerProperties().withSuppressionDuration(suppressionDuration); + return this; + } + + /** + * Get the suppressionEnabled property: Determines whether the suppression for this alert rule is enabled or + * disabled. + * + * @return the suppressionEnabled value. + */ + public Boolean suppressionEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().suppressionEnabled(); + } + + /** + * Set the suppressionEnabled property: Determines whether the suppression for this alert rule is enabled or + * disabled. + * + * @param suppressionEnabled the suppressionEnabled value to set. + * @return the ScheduledAlertRule object itself. + */ + public ScheduledAlertRule withSuppressionEnabled(Boolean suppressionEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleProperties(); + } + this.innerProperties().withSuppressionEnabled(suppressionEnabled); + return this; + } + + /** + * Get the severity property: The severity for alerts created by this alert rule. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.innerProperties() == null ? null : this.innerProperties().severity(); + } + + /** + * Set the severity property: The severity for alerts created by this alert rule. + * + * @param severity the severity value to set. + * @return the ScheduledAlertRule object itself. + */ + public ScheduledAlertRule withSeverity(AlertSeverity severity) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleProperties(); + } + this.innerProperties().withSeverity(severity); + return this; + } + + /** + * Get the tactics property: The tactics of the alert rule. + * + * @return the tactics value. + */ + public List tactics() { + return this.innerProperties() == null ? null : this.innerProperties().tactics(); + } + + /** + * Set the tactics property: The tactics of the alert rule. + * + * @param tactics the tactics value to set. + * @return the ScheduledAlertRule object itself. + */ + public ScheduledAlertRule withTactics(List tactics) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleProperties(); + } + this.innerProperties().withTactics(tactics); + return this; + } + + /** + * Get the incidentConfiguration property: The settings of the incidents that created from alerts triggered by this + * analytics rule. + * + * @return the incidentConfiguration value. + */ + public IncidentConfiguration incidentConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().incidentConfiguration(); + } + + /** + * Set the incidentConfiguration property: The settings of the incidents that created from alerts triggered by this + * analytics rule. + * + * @param incidentConfiguration the incidentConfiguration value to set. + * @return the ScheduledAlertRule object itself. + */ + public ScheduledAlertRule withIncidentConfiguration(IncidentConfiguration incidentConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleProperties(); + } + this.innerProperties().withIncidentConfiguration(incidentConfiguration); + return this; + } + + /** + * Get the customDetails property: Dictionary of string key-value pairs of columns to be attached to the alert. + * + * @return the customDetails value. + */ + public Map customDetails() { + return this.innerProperties() == null ? null : this.innerProperties().customDetails(); + } + + /** + * Set the customDetails property: Dictionary of string key-value pairs of columns to be attached to the alert. + * + * @param customDetails the customDetails value to set. + * @return the ScheduledAlertRule object itself. + */ + public ScheduledAlertRule withCustomDetails(Map customDetails) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleProperties(); + } + this.innerProperties().withCustomDetails(customDetails); + return this; + } + + /** + * Get the entityMappings property: Array of the entity mappings of the alert rule. + * + * @return the entityMappings value. + */ + public List entityMappings() { + return this.innerProperties() == null ? null : this.innerProperties().entityMappings(); + } + + /** + * Set the entityMappings property: Array of the entity mappings of the alert rule. + * + * @param entityMappings the entityMappings value to set. + * @return the ScheduledAlertRule object itself. + */ + public ScheduledAlertRule withEntityMappings(List entityMappings) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleProperties(); + } + this.innerProperties().withEntityMappings(entityMappings); + return this; + } + + /** + * Get the alertDetailsOverride property: The alert details override settings. + * + * @return the alertDetailsOverride value. + */ + public AlertDetailsOverride alertDetailsOverride() { + return this.innerProperties() == null ? null : this.innerProperties().alertDetailsOverride(); + } + + /** + * Set the alertDetailsOverride property: The alert details override settings. + * + * @param alertDetailsOverride the alertDetailsOverride value to set. + * @return the ScheduledAlertRule object itself. + */ + public ScheduledAlertRule withAlertDetailsOverride(AlertDetailsOverride alertDetailsOverride) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleProperties(); + } + this.innerProperties().withAlertDetailsOverride(alertDetailsOverride); + return this; + } + + /** + * Get the queryFrequency property: The frequency (in ISO 8601 duration format) for this alert rule to run. + * + * @return the queryFrequency value. + */ + public Duration queryFrequency() { + return this.innerProperties() == null ? null : this.innerProperties().queryFrequency(); + } + + /** + * Set the queryFrequency property: The frequency (in ISO 8601 duration format) for this alert rule to run. + * + * @param queryFrequency the queryFrequency value to set. + * @return the ScheduledAlertRule object itself. + */ + public ScheduledAlertRule withQueryFrequency(Duration queryFrequency) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleProperties(); + } + this.innerProperties().withQueryFrequency(queryFrequency); + return this; + } + + /** + * Get the queryPeriod property: The period (in ISO 8601 duration format) that this alert rule looks at. + * + * @return the queryPeriod value. + */ + public Duration queryPeriod() { + return this.innerProperties() == null ? null : this.innerProperties().queryPeriod(); + } + + /** + * Set the queryPeriod property: The period (in ISO 8601 duration format) that this alert rule looks at. + * + * @param queryPeriod the queryPeriod value to set. + * @return the ScheduledAlertRule object itself. + */ + public ScheduledAlertRule withQueryPeriod(Duration queryPeriod) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleProperties(); + } + this.innerProperties().withQueryPeriod(queryPeriod); + return this; + } + + /** + * Get the triggerOperator property: The operation against the threshold that triggers alert rule. + * + * @return the triggerOperator value. + */ + public TriggerOperator triggerOperator() { + return this.innerProperties() == null ? null : this.innerProperties().triggerOperator(); + } + + /** + * Set the triggerOperator property: The operation against the threshold that triggers alert rule. + * + * @param triggerOperator the triggerOperator value to set. + * @return the ScheduledAlertRule object itself. + */ + public ScheduledAlertRule withTriggerOperator(TriggerOperator triggerOperator) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleProperties(); + } + this.innerProperties().withTriggerOperator(triggerOperator); + return this; + } + + /** + * Get the triggerThreshold property: The threshold triggers this alert rule. + * + * @return the triggerThreshold value. + */ + public Integer triggerThreshold() { + return this.innerProperties() == null ? null : this.innerProperties().triggerThreshold(); + } + + /** + * Set the triggerThreshold property: The threshold triggers this alert rule. + * + * @param triggerThreshold the triggerThreshold value to set. + * @return the ScheduledAlertRule object itself. + */ + public ScheduledAlertRule withTriggerThreshold(Integer triggerThreshold) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleProperties(); + } + this.innerProperties().withTriggerThreshold(triggerThreshold); + return this; + } + + /** + * Get the eventGroupingSettings property: The event grouping settings. + * + * @return the eventGroupingSettings value. + */ + public EventGroupingSettings eventGroupingSettings() { + return this.innerProperties() == null ? null : this.innerProperties().eventGroupingSettings(); + } + + /** + * Set the eventGroupingSettings property: The event grouping settings. + * + * @param eventGroupingSettings the eventGroupingSettings value to set. + * @return the ScheduledAlertRule object itself. + */ + public ScheduledAlertRule withEventGroupingSettings(EventGroupingSettings eventGroupingSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleProperties(); + } + this.innerProperties().withEventGroupingSettings(eventGroupingSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ScheduledAlertRuleCommonProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ScheduledAlertRuleCommonProperties.java new file mode 100644 index 000000000000..00c665103e5b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ScheduledAlertRuleCommonProperties.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; + +/** Scheduled alert rule template property bag. */ +@Fluent +public class ScheduledAlertRuleCommonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduledAlertRuleCommonProperties.class); + + /* + * The frequency (in ISO 8601 duration format) for this alert rule to run. + */ + @JsonProperty(value = "queryFrequency") + private Duration queryFrequency; + + /* + * The period (in ISO 8601 duration format) that this alert rule looks at. + */ + @JsonProperty(value = "queryPeriod") + private Duration queryPeriod; + + /* + * The operation against the threshold that triggers alert rule. + */ + @JsonProperty(value = "triggerOperator") + private TriggerOperator triggerOperator; + + /* + * The threshold triggers this alert rule. + */ + @JsonProperty(value = "triggerThreshold") + private Integer triggerThreshold; + + /* + * The event grouping settings. + */ + @JsonProperty(value = "eventGroupingSettings") + private EventGroupingSettings eventGroupingSettings; + + /** + * Get the queryFrequency property: The frequency (in ISO 8601 duration format) for this alert rule to run. + * + * @return the queryFrequency value. + */ + public Duration queryFrequency() { + return this.queryFrequency; + } + + /** + * Set the queryFrequency property: The frequency (in ISO 8601 duration format) for this alert rule to run. + * + * @param queryFrequency the queryFrequency value to set. + * @return the ScheduledAlertRuleCommonProperties object itself. + */ + public ScheduledAlertRuleCommonProperties withQueryFrequency(Duration queryFrequency) { + this.queryFrequency = queryFrequency; + return this; + } + + /** + * Get the queryPeriod property: The period (in ISO 8601 duration format) that this alert rule looks at. + * + * @return the queryPeriod value. + */ + public Duration queryPeriod() { + return this.queryPeriod; + } + + /** + * Set the queryPeriod property: The period (in ISO 8601 duration format) that this alert rule looks at. + * + * @param queryPeriod the queryPeriod value to set. + * @return the ScheduledAlertRuleCommonProperties object itself. + */ + public ScheduledAlertRuleCommonProperties withQueryPeriod(Duration queryPeriod) { + this.queryPeriod = queryPeriod; + return this; + } + + /** + * Get the triggerOperator property: The operation against the threshold that triggers alert rule. + * + * @return the triggerOperator value. + */ + public TriggerOperator triggerOperator() { + return this.triggerOperator; + } + + /** + * Set the triggerOperator property: The operation against the threshold that triggers alert rule. + * + * @param triggerOperator the triggerOperator value to set. + * @return the ScheduledAlertRuleCommonProperties object itself. + */ + public ScheduledAlertRuleCommonProperties withTriggerOperator(TriggerOperator triggerOperator) { + this.triggerOperator = triggerOperator; + return this; + } + + /** + * Get the triggerThreshold property: The threshold triggers this alert rule. + * + * @return the triggerThreshold value. + */ + public Integer triggerThreshold() { + return this.triggerThreshold; + } + + /** + * Set the triggerThreshold property: The threshold triggers this alert rule. + * + * @param triggerThreshold the triggerThreshold value to set. + * @return the ScheduledAlertRuleCommonProperties object itself. + */ + public ScheduledAlertRuleCommonProperties withTriggerThreshold(Integer triggerThreshold) { + this.triggerThreshold = triggerThreshold; + return this; + } + + /** + * Get the eventGroupingSettings property: The event grouping settings. + * + * @return the eventGroupingSettings value. + */ + public EventGroupingSettings eventGroupingSettings() { + return this.eventGroupingSettings; + } + + /** + * Set the eventGroupingSettings property: The event grouping settings. + * + * @param eventGroupingSettings the eventGroupingSettings value to set. + * @return the ScheduledAlertRuleCommonProperties object itself. + */ + public ScheduledAlertRuleCommonProperties withEventGroupingSettings(EventGroupingSettings eventGroupingSettings) { + this.eventGroupingSettings = eventGroupingSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (eventGroupingSettings() != null) { + eventGroupingSettings().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ScheduledAlertRuleTemplate.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ScheduledAlertRuleTemplate.java new file mode 100644 index 000000000000..897d8d1edbb9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ScheduledAlertRuleTemplate.java @@ -0,0 +1,466 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; +import com.azure.resourcemanager.securityinsights.fluent.models.ScheduledAlertRuleTemplateProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Represents scheduled alert rule template. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Scheduled") +@Fluent +public final class ScheduledAlertRuleTemplate extends AlertRuleTemplateInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduledAlertRuleTemplate.class); + + /* + * Scheduled alert rule template properties + */ + @JsonProperty(value = "properties") + private ScheduledAlertRuleTemplateProperties innerProperties; + + /** + * Get the innerProperties property: Scheduled alert rule template properties. + * + * @return the innerProperties value. + */ + private ScheduledAlertRuleTemplateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the query property: The query that creates alerts for this rule. + * + * @return the query value. + */ + public String query() { + return this.innerProperties() == null ? null : this.innerProperties().query(); + } + + /** + * Set the query property: The query that creates alerts for this rule. + * + * @param query the query value to set. + * @return the ScheduledAlertRuleTemplate object itself. + */ + public ScheduledAlertRuleTemplate withQuery(String query) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleTemplateProperties(); + } + this.innerProperties().withQuery(query); + return this; + } + + /** + * Get the severity property: The severity for alerts created by this alert rule. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.innerProperties() == null ? null : this.innerProperties().severity(); + } + + /** + * Set the severity property: The severity for alerts created by this alert rule. + * + * @param severity the severity value to set. + * @return the ScheduledAlertRuleTemplate object itself. + */ + public ScheduledAlertRuleTemplate withSeverity(AlertSeverity severity) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleTemplateProperties(); + } + this.innerProperties().withSeverity(severity); + return this; + } + + /** + * Get the tactics property: The tactics of the alert rule. + * + * @return the tactics value. + */ + public List tactics() { + return this.innerProperties() == null ? null : this.innerProperties().tactics(); + } + + /** + * Set the tactics property: The tactics of the alert rule. + * + * @param tactics the tactics value to set. + * @return the ScheduledAlertRuleTemplate object itself. + */ + public ScheduledAlertRuleTemplate withTactics(List tactics) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleTemplateProperties(); + } + this.innerProperties().withTactics(tactics); + return this; + } + + /** + * Get the version property: The version of this template - in format <a.b.c>, where all are numbers. For + * example <1.0.2>. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Set the version property: The version of this template - in format <a.b.c>, where all are numbers. For + * example <1.0.2>. + * + * @param version the version value to set. + * @return the ScheduledAlertRuleTemplate object itself. + */ + public ScheduledAlertRuleTemplate withVersion(String version) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleTemplateProperties(); + } + this.innerProperties().withVersion(version); + return this; + } + + /** + * Get the customDetails property: Dictionary of string key-value pairs of columns to be attached to the alert. + * + * @return the customDetails value. + */ + public Map customDetails() { + return this.innerProperties() == null ? null : this.innerProperties().customDetails(); + } + + /** + * Set the customDetails property: Dictionary of string key-value pairs of columns to be attached to the alert. + * + * @param customDetails the customDetails value to set. + * @return the ScheduledAlertRuleTemplate object itself. + */ + public ScheduledAlertRuleTemplate withCustomDetails(Map customDetails) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleTemplateProperties(); + } + this.innerProperties().withCustomDetails(customDetails); + return this; + } + + /** + * Get the entityMappings property: Array of the entity mappings of the alert rule. + * + * @return the entityMappings value. + */ + public List entityMappings() { + return this.innerProperties() == null ? null : this.innerProperties().entityMappings(); + } + + /** + * Set the entityMappings property: Array of the entity mappings of the alert rule. + * + * @param entityMappings the entityMappings value to set. + * @return the ScheduledAlertRuleTemplate object itself. + */ + public ScheduledAlertRuleTemplate withEntityMappings(List entityMappings) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleTemplateProperties(); + } + this.innerProperties().withEntityMappings(entityMappings); + return this; + } + + /** + * Get the alertDetailsOverride property: The alert details override settings. + * + * @return the alertDetailsOverride value. + */ + public AlertDetailsOverride alertDetailsOverride() { + return this.innerProperties() == null ? null : this.innerProperties().alertDetailsOverride(); + } + + /** + * Set the alertDetailsOverride property: The alert details override settings. + * + * @param alertDetailsOverride the alertDetailsOverride value to set. + * @return the ScheduledAlertRuleTemplate object itself. + */ + public ScheduledAlertRuleTemplate withAlertDetailsOverride(AlertDetailsOverride alertDetailsOverride) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleTemplateProperties(); + } + this.innerProperties().withAlertDetailsOverride(alertDetailsOverride); + return this; + } + + /** + * Get the queryFrequency property: The frequency (in ISO 8601 duration format) for this alert rule to run. + * + * @return the queryFrequency value. + */ + public Duration queryFrequency() { + return this.innerProperties() == null ? null : this.innerProperties().queryFrequency(); + } + + /** + * Set the queryFrequency property: The frequency (in ISO 8601 duration format) for this alert rule to run. + * + * @param queryFrequency the queryFrequency value to set. + * @return the ScheduledAlertRuleTemplate object itself. + */ + public ScheduledAlertRuleTemplate withQueryFrequency(Duration queryFrequency) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleTemplateProperties(); + } + this.innerProperties().withQueryFrequency(queryFrequency); + return this; + } + + /** + * Get the queryPeriod property: The period (in ISO 8601 duration format) that this alert rule looks at. + * + * @return the queryPeriod value. + */ + public Duration queryPeriod() { + return this.innerProperties() == null ? null : this.innerProperties().queryPeriod(); + } + + /** + * Set the queryPeriod property: The period (in ISO 8601 duration format) that this alert rule looks at. + * + * @param queryPeriod the queryPeriod value to set. + * @return the ScheduledAlertRuleTemplate object itself. + */ + public ScheduledAlertRuleTemplate withQueryPeriod(Duration queryPeriod) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleTemplateProperties(); + } + this.innerProperties().withQueryPeriod(queryPeriod); + return this; + } + + /** + * Get the triggerOperator property: The operation against the threshold that triggers alert rule. + * + * @return the triggerOperator value. + */ + public TriggerOperator triggerOperator() { + return this.innerProperties() == null ? null : this.innerProperties().triggerOperator(); + } + + /** + * Set the triggerOperator property: The operation against the threshold that triggers alert rule. + * + * @param triggerOperator the triggerOperator value to set. + * @return the ScheduledAlertRuleTemplate object itself. + */ + public ScheduledAlertRuleTemplate withTriggerOperator(TriggerOperator triggerOperator) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleTemplateProperties(); + } + this.innerProperties().withTriggerOperator(triggerOperator); + return this; + } + + /** + * Get the triggerThreshold property: The threshold triggers this alert rule. + * + * @return the triggerThreshold value. + */ + public Integer triggerThreshold() { + return this.innerProperties() == null ? null : this.innerProperties().triggerThreshold(); + } + + /** + * Set the triggerThreshold property: The threshold triggers this alert rule. + * + * @param triggerThreshold the triggerThreshold value to set. + * @return the ScheduledAlertRuleTemplate object itself. + */ + public ScheduledAlertRuleTemplate withTriggerThreshold(Integer triggerThreshold) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleTemplateProperties(); + } + this.innerProperties().withTriggerThreshold(triggerThreshold); + return this; + } + + /** + * Get the eventGroupingSettings property: The event grouping settings. + * + * @return the eventGroupingSettings value. + */ + public EventGroupingSettings eventGroupingSettings() { + return this.innerProperties() == null ? null : this.innerProperties().eventGroupingSettings(); + } + + /** + * Set the eventGroupingSettings property: The event grouping settings. + * + * @param eventGroupingSettings the eventGroupingSettings value to set. + * @return the ScheduledAlertRuleTemplate object itself. + */ + public ScheduledAlertRuleTemplate withEventGroupingSettings(EventGroupingSettings eventGroupingSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleTemplateProperties(); + } + this.innerProperties().withEventGroupingSettings(eventGroupingSettings); + return this; + } + + /** + * Get the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. + * + * @return the alertRulesCreatedByTemplateCount value. + */ + public Integer alertRulesCreatedByTemplateCount() { + return this.innerProperties() == null ? null : this.innerProperties().alertRulesCreatedByTemplateCount(); + } + + /** + * Set the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. + * + * @param alertRulesCreatedByTemplateCount the alertRulesCreatedByTemplateCount value to set. + * @return the ScheduledAlertRuleTemplate object itself. + */ + public ScheduledAlertRuleTemplate withAlertRulesCreatedByTemplateCount(Integer alertRulesCreatedByTemplateCount) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleTemplateProperties(); + } + this.innerProperties().withAlertRulesCreatedByTemplateCount(alertRulesCreatedByTemplateCount); + return this; + } + + /** + * Get the lastUpdatedDateUtc property: The last time that this alert rule template has been updated. + * + * @return the lastUpdatedDateUtc value. + */ + public OffsetDateTime lastUpdatedDateUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedDateUtc(); + } + + /** + * Get the createdDateUtc property: The time that this alert rule template has been added. + * + * @return the createdDateUtc value. + */ + public OffsetDateTime createdDateUtc() { + return this.innerProperties() == null ? null : this.innerProperties().createdDateUtc(); + } + + /** + * Get the description property: The description of the alert rule template. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of the alert rule template. + * + * @param description the description value to set. + * @return the ScheduledAlertRuleTemplate object itself. + */ + public ScheduledAlertRuleTemplate withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleTemplateProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the displayName property: The display name for alert rule template. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name for alert rule template. + * + * @param displayName the displayName value to set. + * @return the ScheduledAlertRuleTemplate object itself. + */ + public ScheduledAlertRuleTemplate withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleTemplateProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the requiredDataConnectors property: The required data sources for this template. + * + * @return the requiredDataConnectors value. + */ + public List requiredDataConnectors() { + return this.innerProperties() == null ? null : this.innerProperties().requiredDataConnectors(); + } + + /** + * Set the requiredDataConnectors property: The required data sources for this template. + * + * @param requiredDataConnectors the requiredDataConnectors value to set. + * @return the ScheduledAlertRuleTemplate object itself. + */ + public ScheduledAlertRuleTemplate withRequiredDataConnectors( + List requiredDataConnectors) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleTemplateProperties(); + } + this.innerProperties().withRequiredDataConnectors(requiredDataConnectors); + return this; + } + + /** + * Get the status property: The alert rule template status. + * + * @return the status value. + */ + public TemplateStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The alert rule template status. + * + * @param status the status value to set. + * @return the ScheduledAlertRuleTemplate object itself. + */ + public ScheduledAlertRuleTemplate withStatus(TemplateStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleTemplateProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityAlert.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityAlert.java new file mode 100644 index 000000000000..759a6284a547 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityAlert.java @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.azure.resourcemanager.securityinsights.fluent.models.SecurityAlertProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Represents a security alert entity. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("SecurityAlert") +@Fluent +public final class SecurityAlert extends EntityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAlert.class); + + /* + * SecurityAlert entity properties + */ + @JsonProperty(value = "properties") + private SecurityAlertProperties innerProperties; + + /** + * Get the innerProperties property: SecurityAlert entity properties. + * + * @return the innerProperties value. + */ + private SecurityAlertProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the alertDisplayName property: The display name of the alert. + * + * @return the alertDisplayName value. + */ + public String alertDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().alertDisplayName(); + } + + /** + * Get the alertType property: The type name of the alert. + * + * @return the alertType value. + */ + public String alertType() { + return this.innerProperties() == null ? null : this.innerProperties().alertType(); + } + + /** + * Get the compromisedEntity property: Display name of the main entity being reported on. + * + * @return the compromisedEntity value. + */ + public String compromisedEntity() { + return this.innerProperties() == null ? null : this.innerProperties().compromisedEntity(); + } + + /** + * Get the confidenceLevel property: The confidence level of this alert. + * + * @return the confidenceLevel value. + */ + public ConfidenceLevel confidenceLevel() { + return this.innerProperties() == null ? null : this.innerProperties().confidenceLevel(); + } + + /** + * Get the confidenceReasons property: The confidence reasons. + * + * @return the confidenceReasons value. + */ + public List confidenceReasons() { + return this.innerProperties() == null ? null : this.innerProperties().confidenceReasons(); + } + + /** + * Get the confidenceScore property: The confidence score of the alert. + * + * @return the confidenceScore value. + */ + public Double confidenceScore() { + return this.innerProperties() == null ? null : this.innerProperties().confidenceScore(); + } + + /** + * Get the confidenceScoreStatus property: The confidence score calculation status, i.e. indicating if score + * calculation is pending for this alert, not applicable or final. + * + * @return the confidenceScoreStatus value. + */ + public ConfidenceScoreStatus confidenceScoreStatus() { + return this.innerProperties() == null ? null : this.innerProperties().confidenceScoreStatus(); + } + + /** + * Get the description property: Alert description. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Get the endTimeUtc property: The impact end time of the alert (the time of the last event contributing to the + * alert). + * + * @return the endTimeUtc value. + */ + public OffsetDateTime endTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().endTimeUtc(); + } + + /** + * Get the intent property: Holds the alert intent stage(s) mapping for this alert. + * + * @return the intent value. + */ + public KillChainIntent intent() { + return this.innerProperties() == null ? null : this.innerProperties().intent(); + } + + /** + * Get the providerAlertId property: The identifier of the alert inside the product which generated the alert. + * + * @return the providerAlertId value. + */ + public String providerAlertId() { + return this.innerProperties() == null ? null : this.innerProperties().providerAlertId(); + } + + /** + * Get the processingEndTime property: The time the alert was made available for consumption. + * + * @return the processingEndTime value. + */ + public OffsetDateTime processingEndTime() { + return this.innerProperties() == null ? null : this.innerProperties().processingEndTime(); + } + + /** + * Get the productComponentName property: The name of a component inside the product which generated the alert. + * + * @return the productComponentName value. + */ + public String productComponentName() { + return this.innerProperties() == null ? null : this.innerProperties().productComponentName(); + } + + /** + * Get the productName property: The name of the product which published this alert. + * + * @return the productName value. + */ + public String productName() { + return this.innerProperties() == null ? null : this.innerProperties().productName(); + } + + /** + * Get the productVersion property: The version of the product generating the alert. + * + * @return the productVersion value. + */ + public String productVersion() { + return this.innerProperties() == null ? null : this.innerProperties().productVersion(); + } + + /** + * Get the remediationSteps property: Manual action items to take to remediate the alert. + * + * @return the remediationSteps value. + */ + public List remediationSteps() { + return this.innerProperties() == null ? null : this.innerProperties().remediationSteps(); + } + + /** + * Get the severity property: The severity of the alert. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.innerProperties() == null ? null : this.innerProperties().severity(); + } + + /** + * Set the severity property: The severity of the alert. + * + * @param severity the severity value to set. + * @return the SecurityAlert object itself. + */ + public SecurityAlert withSeverity(AlertSeverity severity) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAlertProperties(); + } + this.innerProperties().withSeverity(severity); + return this; + } + + /** + * Get the startTimeUtc property: The impact start time of the alert (the time of the first event contributing to + * the alert). + * + * @return the startTimeUtc value. + */ + public OffsetDateTime startTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().startTimeUtc(); + } + + /** + * Get the status property: The lifecycle status of the alert. + * + * @return the status value. + */ + public AlertStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the systemAlertId property: Holds the product identifier of the alert for the product. + * + * @return the systemAlertId value. + */ + public String systemAlertId() { + return this.innerProperties() == null ? null : this.innerProperties().systemAlertId(); + } + + /** + * Get the tactics property: The tactics of the alert. + * + * @return the tactics value. + */ + public List tactics() { + return this.innerProperties() == null ? null : this.innerProperties().tactics(); + } + + /** + * Get the timeGenerated property: The time the alert was generated. + * + * @return the timeGenerated value. + */ + public OffsetDateTime timeGenerated() { + return this.innerProperties() == null ? null : this.innerProperties().timeGenerated(); + } + + /** + * Get the vendorName property: The name of the vendor that raise the alert. + * + * @return the vendorName value. + */ + public String vendorName() { + return this.innerProperties() == null ? null : this.innerProperties().vendorName(); + } + + /** + * Get the alertLink property: The uri link of the alert. + * + * @return the alertLink value. + */ + public String alertLink() { + return this.innerProperties() == null ? null : this.innerProperties().alertLink(); + } + + /** + * Get the resourceIdentifiers property: The list of resource identifiers of the alert. + * + * @return the resourceIdentifiers value. + */ + public List resourceIdentifiers() { + return this.innerProperties() == null ? null : this.innerProperties().resourceIdentifiers(); + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityAlertPropertiesConfidenceReasonsItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityAlertPropertiesConfidenceReasonsItem.java new file mode 100644 index 000000000000..5260009b85c3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityAlertPropertiesConfidenceReasonsItem.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** confidence reason item. */ +@Immutable +public final class SecurityAlertPropertiesConfidenceReasonsItem { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(SecurityAlertPropertiesConfidenceReasonsItem.class); + + /* + * The reason's description + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /* + * The type (category) of the reason + */ + @JsonProperty(value = "reasonType", access = JsonProperty.Access.WRITE_ONLY) + private String reasonType; + + /** + * Get the reason property: The reason's description. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Get the reasonType property: The type (category) of the reason. + * + * @return the reasonType value. + */ + public String reasonType() { + return this.reasonType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityAlertTimelineItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityAlertTimelineItem.java new file mode 100644 index 000000000000..a61ee3406a70 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityAlertTimelineItem.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** Represents security alert timeline item. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("SecurityAlert") +@Fluent +public final class SecurityAlertTimelineItem extends EntityTimelineItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityAlertTimelineItem.class); + + /* + * The alert azure resource id. + */ + @JsonProperty(value = "azureResourceId", required = true) + private String azureResourceId; + + /* + * The alert product name. + */ + @JsonProperty(value = "productName") + private String productName; + + /* + * The alert description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The alert name. + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /* + * The alert severity. + */ + @JsonProperty(value = "severity", required = true) + private AlertSeverity severity; + + /* + * The alert end time. + */ + @JsonProperty(value = "endTimeUtc", required = true) + private OffsetDateTime endTimeUtc; + + /* + * The alert start time. + */ + @JsonProperty(value = "startTimeUtc", required = true) + private OffsetDateTime startTimeUtc; + + /* + * The alert generated time. + */ + @JsonProperty(value = "timeGenerated", required = true) + private OffsetDateTime timeGenerated; + + /* + * The name of the alert type. + */ + @JsonProperty(value = "alertType", required = true) + private String alertType; + + /** + * Get the azureResourceId property: The alert azure resource id. + * + * @return the azureResourceId value. + */ + public String azureResourceId() { + return this.azureResourceId; + } + + /** + * Set the azureResourceId property: The alert azure resource id. + * + * @param azureResourceId the azureResourceId value to set. + * @return the SecurityAlertTimelineItem object itself. + */ + public SecurityAlertTimelineItem withAzureResourceId(String azureResourceId) { + this.azureResourceId = azureResourceId; + return this; + } + + /** + * Get the productName property: The alert product name. + * + * @return the productName value. + */ + public String productName() { + return this.productName; + } + + /** + * Set the productName property: The alert product name. + * + * @param productName the productName value to set. + * @return the SecurityAlertTimelineItem object itself. + */ + public SecurityAlertTimelineItem withProductName(String productName) { + this.productName = productName; + return this; + } + + /** + * Get the description property: The alert description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The alert description. + * + * @param description the description value to set. + * @return the SecurityAlertTimelineItem object itself. + */ + public SecurityAlertTimelineItem withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the displayName property: The alert name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The alert name. + * + * @param displayName the displayName value to set. + * @return the SecurityAlertTimelineItem object itself. + */ + public SecurityAlertTimelineItem withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the severity property: The alert severity. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.severity; + } + + /** + * Set the severity property: The alert severity. + * + * @param severity the severity value to set. + * @return the SecurityAlertTimelineItem object itself. + */ + public SecurityAlertTimelineItem withSeverity(AlertSeverity severity) { + this.severity = severity; + return this; + } + + /** + * Get the endTimeUtc property: The alert end time. + * + * @return the endTimeUtc value. + */ + public OffsetDateTime endTimeUtc() { + return this.endTimeUtc; + } + + /** + * Set the endTimeUtc property: The alert end time. + * + * @param endTimeUtc the endTimeUtc value to set. + * @return the SecurityAlertTimelineItem object itself. + */ + public SecurityAlertTimelineItem withEndTimeUtc(OffsetDateTime endTimeUtc) { + this.endTimeUtc = endTimeUtc; + return this; + } + + /** + * Get the startTimeUtc property: The alert start time. + * + * @return the startTimeUtc value. + */ + public OffsetDateTime startTimeUtc() { + return this.startTimeUtc; + } + + /** + * Set the startTimeUtc property: The alert start time. + * + * @param startTimeUtc the startTimeUtc value to set. + * @return the SecurityAlertTimelineItem object itself. + */ + public SecurityAlertTimelineItem withStartTimeUtc(OffsetDateTime startTimeUtc) { + this.startTimeUtc = startTimeUtc; + return this; + } + + /** + * Get the timeGenerated property: The alert generated time. + * + * @return the timeGenerated value. + */ + public OffsetDateTime timeGenerated() { + return this.timeGenerated; + } + + /** + * Set the timeGenerated property: The alert generated time. + * + * @param timeGenerated the timeGenerated value to set. + * @return the SecurityAlertTimelineItem object itself. + */ + public SecurityAlertTimelineItem withTimeGenerated(OffsetDateTime timeGenerated) { + this.timeGenerated = timeGenerated; + return this; + } + + /** + * Get the alertType property: The name of the alert type. + * + * @return the alertType value. + */ + public String alertType() { + return this.alertType; + } + + /** + * Set the alertType property: The name of the alert type. + * + * @param alertType the alertType value to set. + * @return the SecurityAlertTimelineItem object itself. + */ + public SecurityAlertTimelineItem withAlertType(String alertType) { + this.alertType = alertType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (azureResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property azureResourceId in model SecurityAlertTimelineItem")); + } + if (displayName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property displayName in model SecurityAlertTimelineItem")); + } + if (severity() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property severity in model SecurityAlertTimelineItem")); + } + if (endTimeUtc() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property endTimeUtc in model SecurityAlertTimelineItem")); + } + if (startTimeUtc() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property startTimeUtc in model SecurityAlertTimelineItem")); + } + if (timeGenerated() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property timeGenerated in model SecurityAlertTimelineItem")); + } + if (alertType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property alertType in model SecurityAlertTimelineItem")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityGroupEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityGroupEntity.java new file mode 100644 index 000000000000..a3f0739cddb5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityGroupEntity.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.azure.resourcemanager.securityinsights.fluent.models.SecurityGroupEntityProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; +import java.util.UUID; + +/** Represents a security group entity. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("SecurityGroup") +@Fluent +public final class SecurityGroupEntity extends EntityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityGroupEntity.class); + + /* + * SecurityGroup entity properties + */ + @JsonProperty(value = "properties") + private SecurityGroupEntityProperties innerProperties; + + /** + * Get the innerProperties property: SecurityGroup entity properties. + * + * @return the innerProperties value. + */ + private SecurityGroupEntityProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the distinguishedName property: The group distinguished name. + * + * @return the distinguishedName value. + */ + public String distinguishedName() { + return this.innerProperties() == null ? null : this.innerProperties().distinguishedName(); + } + + /** + * Get the objectGuid property: A single-value attribute that is the unique identifier for the object, assigned by + * active directory. + * + * @return the objectGuid value. + */ + public UUID objectGuid() { + return this.innerProperties() == null ? null : this.innerProperties().objectGuid(); + } + + /** + * Get the sid property: The SID attribute is a single-value attribute that specifies the security identifier (SID) + * of the group. + * + * @return the sid value. + */ + public String sid() { + return this.innerProperties() == null ? null : this.innerProperties().sid(); + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SentinelOnboardingState.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SentinelOnboardingState.java new file mode 100644 index 000000000000..6d3db4d16b97 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SentinelOnboardingState.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStateInner; + +/** An immutable client-side representation of SentinelOnboardingState. */ +public interface SentinelOnboardingState { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the customerManagedKey property: Flag that indicates the status of the CMK setting. + * + * @return the customerManagedKey value. + */ + Boolean customerManagedKey(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStateInner object. + * + * @return the inner object. + */ + SentinelOnboardingStateInner innerModel(); + + /** The entirety of the SentinelOnboardingState definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The SentinelOnboardingState definition stages. */ + interface DefinitionStages { + /** The first stage of the SentinelOnboardingState definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the SentinelOnboardingState definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @return the next definition stage. + */ + WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); + } + /** + * The stage of the SentinelOnboardingState definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithEtag, DefinitionStages.WithCustomerManagedKey { + /** + * Executes the create request. + * + * @return the created resource. + */ + SentinelOnboardingState create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SentinelOnboardingState create(Context context); + } + /** The stage of the SentinelOnboardingState definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Etag of the azure resource. + * + * @param etag Etag of the azure resource. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the SentinelOnboardingState definition allowing to specify customerManagedKey. */ + interface WithCustomerManagedKey { + /** + * Specifies the customerManagedKey property: Flag that indicates the status of the CMK setting. + * + * @param customerManagedKey Flag that indicates the status of the CMK setting. + * @return the next definition stage. + */ + WithCreate withCustomerManagedKey(Boolean customerManagedKey); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SentinelOnboardingState refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SentinelOnboardingState refresh(Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SentinelOnboardingStates.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SentinelOnboardingStates.java new file mode 100644 index 000000000000..c8eefb122564 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SentinelOnboardingStates.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SentinelOnboardingStates. */ +public interface SentinelOnboardingStates { + /** + * Get Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sentinel onboarding state. + */ + SentinelOnboardingState get(String resourceGroupName, String workspaceName, String sentinelOnboardingStateName); + + /** + * Get Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sentinel onboarding state. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String sentinelOnboardingStateName, Context context); + + /** + * Delete Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String sentinelOnboardingStateName); + + /** + * Delete Sentinel onboarding state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String sentinelOnboardingStateName, Context context); + + /** + * Gets all Sentinel onboarding states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Sentinel onboarding states. + */ + SentinelOnboardingStatesList list(String resourceGroupName, String workspaceName); + + /** + * Gets all Sentinel onboarding states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Sentinel onboarding states. + */ + Response listWithResponse( + String resourceGroupName, String workspaceName, Context context); + + /** + * Get Sentinel onboarding state. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sentinel onboarding state. + */ + SentinelOnboardingState getById(String id); + + /** + * Get Sentinel onboarding state. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sentinel onboarding state. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete Sentinel onboarding state. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete Sentinel onboarding state. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SentinelOnboardingState resource. + * + * @param name resource name. + * @return the first stage of the new SentinelOnboardingState definition. + */ + SentinelOnboardingState.DefinitionStages.Blank define(String name); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SentinelOnboardingStatesList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SentinelOnboardingStatesList.java new file mode 100644 index 000000000000..0699c91c46b2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SentinelOnboardingStatesList.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStatesListInner; +import java.util.List; + +/** An immutable client-side representation of SentinelOnboardingStatesList. */ +public interface SentinelOnboardingStatesList { + /** + * Gets the value property: Array of Sentinel onboarding states. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStatesListInner object. + * + * @return the inner object. + */ + SentinelOnboardingStatesListInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingKind.java new file mode 100644 index 000000000000..3b2a780ad78b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingKind.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SettingKind. */ +public final class SettingKind extends ExpandableStringEnum { + /** Static value Anomalies for SettingKind. */ + public static final SettingKind ANOMALIES = fromString("Anomalies"); + + /** Static value EyesOn for SettingKind. */ + public static final SettingKind EYES_ON = fromString("EyesOn"); + + /** Static value EntityAnalytics for SettingKind. */ + public static final SettingKind ENTITY_ANALYTICS = fromString("EntityAnalytics"); + + /** Static value Ueba for SettingKind. */ + public static final SettingKind UEBA = fromString("Ueba"); + + /** + * Creates or finds a SettingKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding SettingKind. + */ + @JsonCreator + public static SettingKind fromString(String name) { + return fromString(name, SettingKind.class); + } + + /** @return known SettingKind values. */ + public static Collection values() { + return values(SettingKind.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingList.java new file mode 100644 index 000000000000..84b5c972e9eb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingList.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.SettingListInner; +import java.util.List; + +/** An immutable client-side representation of SettingList. */ +public interface SettingList { + /** + * Gets the value property: Array of settings. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.SettingListInner object. + * + * @return the inner object. + */ + SettingListInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingType.java new file mode 100644 index 000000000000..efb81f2cc709 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SettingType. */ +public final class SettingType extends ExpandableStringEnum { + /** Static value CopyableLabel for SettingType. */ + public static final SettingType COPYABLE_LABEL = fromString("CopyableLabel"); + + /** Static value InstructionStepsGroup for SettingType. */ + public static final SettingType INSTRUCTION_STEPS_GROUP = fromString("InstructionStepsGroup"); + + /** Static value InfoMessage for SettingType. */ + public static final SettingType INFO_MESSAGE = fromString("InfoMessage"); + + /** + * Creates or finds a SettingType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SettingType. + */ + @JsonCreator + public static SettingType fromString(String name) { + return fromString(name, SettingType.class); + } + + /** @return known SettingType values. */ + public static Collection values() { + return values(SettingType.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Settings.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Settings.java new file mode 100644 index 000000000000..9533bec7514d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Settings.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; + +/** An immutable client-side representation of Settings. */ +public interface Settings { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner object. + * + * @return the inner object. + */ + SettingsInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Source.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Source.java new file mode 100644 index 000000000000..16b8c39e003b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Source.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Source. */ +public final class Source extends ExpandableStringEnum { + /** Static value Local file for Source. */ + public static final Source LOCAL_FILE = fromString("Local file"); + + /** Static value Remote storage for Source. */ + public static final Source REMOTE_STORAGE = fromString("Remote storage"); + + /** + * Creates or finds a Source from its string representation. + * + * @param name a name to look for. + * @return the corresponding Source. + */ + @JsonCreator + public static Source fromString(String name) { + return fromString(name, Source.class); + } + + /** @return known Source values. */ + public static Collection values() { + return values(Source.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControl.java new file mode 100644 index 000000000000..c69e41b8d58c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControl.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.SourceControlInner; +import java.util.List; + +/** An immutable client-side representation of SourceControl. */ +public interface SourceControl { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the idPropertiesId property: The id (a Guid) of the source control. + * + * @return the idPropertiesId value. + */ + String idPropertiesId(); + + /** + * Gets the displayName property: The display name of the source control. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the description property: A description of the source control. + * + * @return the description value. + */ + String description(); + + /** + * Gets the repoType property: The repository type of the source control. + * + * @return the repoType value. + */ + RepoType repoType(); + + /** + * Gets the contentTypes property: Array of source control content types. + * + * @return the contentTypes value. + */ + List contentTypes(); + + /** + * Gets the repository property: Repository metadata. + * + * @return the repository value. + */ + Repository repository(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.SourceControlInner object. + * + * @return the inner object. + */ + SourceControlInner innerModel(); + + /** The entirety of the SourceControl definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The SourceControl definition stages. */ + interface DefinitionStages { + /** The first stage of the SourceControl definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the SourceControl definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @return the next definition stage. + */ + WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); + } + /** + * The stage of the SourceControl definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithEtag, + DefinitionStages.WithIdPropertiesId, + DefinitionStages.WithDisplayName, + DefinitionStages.WithDescription, + DefinitionStages.WithRepoType, + DefinitionStages.WithContentTypes, + DefinitionStages.WithRepository { + /** + * Executes the create request. + * + * @return the created resource. + */ + SourceControl create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SourceControl create(Context context); + } + /** The stage of the SourceControl definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Etag of the azure resource. + * + * @param etag Etag of the azure resource. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the SourceControl definition allowing to specify idPropertiesId. */ + interface WithIdPropertiesId { + /** + * Specifies the idPropertiesId property: The id (a Guid) of the source control. + * + * @param idPropertiesId The id (a Guid) of the source control. + * @return the next definition stage. + */ + WithCreate withIdPropertiesId(String idPropertiesId); + } + /** The stage of the SourceControl definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: The display name of the source control. + * + * @param displayName The display name of the source control. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the SourceControl definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: A description of the source control. + * + * @param description A description of the source control. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the SourceControl definition allowing to specify repoType. */ + interface WithRepoType { + /** + * Specifies the repoType property: The repository type of the source control. + * + * @param repoType The repository type of the source control. + * @return the next definition stage. + */ + WithCreate withRepoType(RepoType repoType); + } + /** The stage of the SourceControl definition allowing to specify contentTypes. */ + interface WithContentTypes { + /** + * Specifies the contentTypes property: Array of source control content types.. + * + * @param contentTypes Array of source control content types. + * @return the next definition stage. + */ + WithCreate withContentTypes(List contentTypes); + } + /** The stage of the SourceControl definition allowing to specify repository. */ + interface WithRepository { + /** + * Specifies the repository property: Repository metadata.. + * + * @param repository Repository metadata. + * @return the next definition stage. + */ + WithCreate withRepository(Repository repository); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SourceControl refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SourceControl refresh(Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControlList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControlList.java new file mode 100644 index 000000000000..9f563923c8f3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControlList.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.SourceControlInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List all the source controls. */ +@Fluent +public final class SourceControlList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceControlList.class); + + /* + * URL to fetch the next set of source controls. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of source controls. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the nextLink property: URL to fetch the next set of source controls. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of source controls. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of source controls. + * + * @param value the value value to set. + * @return the SourceControlList object itself. + */ + public SourceControlList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model SourceControlList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControls.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControls.java new file mode 100644 index 000000000000..03fb7eaddc50 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControls.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of SourceControls. */ +public interface SourceControls { + /** + * Gets a list of repositories metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param repoType The repo type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of repositories metadata. + */ + PagedIterable listRepositories(String resourceGroupName, String workspaceName, RepoType repoType); + + /** + * Gets a list of repositories metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param repoType The repo type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of repositories metadata. + */ + PagedIterable listRepositories( + String resourceGroupName, String workspaceName, RepoType repoType, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControlsOperations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControlsOperations.java new file mode 100644 index 000000000000..d7845b09df49 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControlsOperations.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SourceControlsOperations. */ +public interface SourceControlsOperations { + /** + * Gets all source controls, without source control items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all source controls, without source control items. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all source controls, without source control items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all source controls, without source control items. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets a source control byt its identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a source control byt its identifier. + */ + SourceControl get(String resourceGroupName, String workspaceName, String sourceControlId); + + /** + * Gets a source control byt its identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a source control byt its identifier. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String sourceControlId, Context context); + + /** + * Delete a source control. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String sourceControlId); + + /** + * Delete a source control. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sourceControlId Source control Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String sourceControlId, Context context); + + /** + * Gets a source control byt its identifier. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a source control byt its identifier. + */ + SourceControl getById(String id); + + /** + * Gets a source control byt its identifier. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a source control byt its identifier. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a source control. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a source control. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SourceControl resource. + * + * @param name resource name. + * @return the first stage of the new SourceControl definition. + */ + SourceControl.DefinitionStages.Blank define(String name); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceKind.java new file mode 100644 index 000000000000..6846dc4c1261 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceKind.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SourceKind. */ +public final class SourceKind extends ExpandableStringEnum { + /** Static value LocalWorkspace for SourceKind. */ + public static final SourceKind LOCAL_WORKSPACE = fromString("LocalWorkspace"); + + /** Static value Community for SourceKind. */ + public static final SourceKind COMMUNITY = fromString("Community"); + + /** Static value Solution for SourceKind. */ + public static final SourceKind SOLUTION = fromString("Solution"); + + /** Static value SourceRepository for SourceKind. */ + public static final SourceKind SOURCE_REPOSITORY = fromString("SourceRepository"); + + /** + * Creates or finds a SourceKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding SourceKind. + */ + @JsonCreator + public static SourceKind fromString(String name) { + return fromString(name, SourceKind.class); + } + + /** @return known SourceKind values. */ + public static Collection values() { + return values(SourceKind.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SubmissionMailEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SubmissionMailEntity.java new file mode 100644 index 000000000000..f35c6eb0be58 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SubmissionMailEntity.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.azure.resourcemanager.securityinsights.fluent.models.SubmissionMailEntityProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.Map; +import java.util.UUID; + +/** Represents a submission mail entity. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("SubmissionMail") +@Fluent +public final class SubmissionMailEntity extends EntityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubmissionMailEntity.class); + + /* + * Submission mail entity properties + */ + @JsonProperty(value = "properties") + private SubmissionMailEntityProperties innerProperties; + + /** + * Get the innerProperties property: Submission mail entity properties. + * + * @return the innerProperties value. + */ + private SubmissionMailEntityProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the networkMessageId property: The network message id of email to which submission belongs. + * + * @return the networkMessageId value. + */ + public UUID networkMessageId() { + return this.innerProperties() == null ? null : this.innerProperties().networkMessageId(); + } + + /** + * Get the submissionId property: The submission id. + * + * @return the submissionId value. + */ + public UUID submissionId() { + return this.innerProperties() == null ? null : this.innerProperties().submissionId(); + } + + /** + * Get the submitter property: The submitter. + * + * @return the submitter value. + */ + public String submitter() { + return this.innerProperties() == null ? null : this.innerProperties().submitter(); + } + + /** + * Get the submissionDate property: The submission date. + * + * @return the submissionDate value. + */ + public OffsetDateTime submissionDate() { + return this.innerProperties() == null ? null : this.innerProperties().submissionDate(); + } + + /** + * Get the timestamp property: The Time stamp when the message is received (Mail). + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.innerProperties() == null ? null : this.innerProperties().timestamp(); + } + + /** + * Get the recipient property: The recipient of the mail. + * + * @return the recipient value. + */ + public String recipient() { + return this.innerProperties() == null ? null : this.innerProperties().recipient(); + } + + /** + * Get the sender property: The sender of the mail. + * + * @return the sender value. + */ + public String sender() { + return this.innerProperties() == null ? null : this.innerProperties().sender(); + } + + /** + * Get the senderIp property: The sender's IP. + * + * @return the senderIp value. + */ + public String senderIp() { + return this.innerProperties() == null ? null : this.innerProperties().senderIp(); + } + + /** + * Get the subject property: The subject of submission mail. + * + * @return the subject value. + */ + public String subject() { + return this.innerProperties() == null ? null : this.innerProperties().subject(); + } + + /** + * Get the reportType property: The submission type for the given instance. This maps to Junk, Phish, Malware or + * NotJunk. + * + * @return the reportType value. + */ + public String reportType() { + return this.innerProperties() == null ? null : this.innerProperties().reportType(); + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SupportTier.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SupportTier.java new file mode 100644 index 000000000000..612057ab161a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SupportTier.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SupportTier. */ +public final class SupportTier extends ExpandableStringEnum { + /** Static value Microsoft for SupportTier. */ + public static final SupportTier MICROSOFT = fromString("Microsoft"); + + /** Static value Partner for SupportTier. */ + public static final SupportTier PARTNER = fromString("Partner"); + + /** Static value Community for SupportTier. */ + public static final SupportTier COMMUNITY = fromString("Community"); + + /** + * Creates or finds a SupportTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding SupportTier. + */ + @JsonCreator + public static SupportTier fromString(String name) { + return fromString(name, SupportTier.class); + } + + /** @return known SupportTier values. */ + public static Collection values() { + return values(SupportTier.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TICheckRequirements.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TICheckRequirements.java new file mode 100644 index 000000000000..1408b38bd97b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TICheckRequirements.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.TICheckRequirementsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Threat Intelligence Platforms data connector check requirements. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("ThreatIntelligence") +@Fluent +public final class TICheckRequirements extends DataConnectorsCheckRequirements { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TICheckRequirements.class); + + /* + * Threat Intelligence Platforms data connector check required properties + */ + @JsonProperty(value = "properties") + private TICheckRequirementsProperties innerProperties; + + /** + * Get the innerProperties property: Threat Intelligence Platforms data connector check required properties. + * + * @return the innerProperties value. + */ + private TICheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TIDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TIDataConnector.java new file mode 100644 index 000000000000..fe56b86cf2bf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TIDataConnector.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.TIDataConnectorProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** Represents threat intelligence data connector. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("ThreatIntelligence") +@Fluent +public final class TIDataConnector extends DataConnectorInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TIDataConnector.class); + + /* + * TI (Threat Intelligence) data connector properties. + */ + @JsonProperty(value = "properties") + private TIDataConnectorProperties innerProperties; + + /** + * Get the innerProperties property: TI (Threat Intelligence) data connector properties. + * + * @return the innerProperties value. + */ + private TIDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public TIDataConnector withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the tipLookbackPeriod property: The lookback period for the feed to be imported. + * + * @return the tipLookbackPeriod value. + */ + public OffsetDateTime tipLookbackPeriod() { + return this.innerProperties() == null ? null : this.innerProperties().tipLookbackPeriod(); + } + + /** + * Set the tipLookbackPeriod property: The lookback period for the feed to be imported. + * + * @param tipLookbackPeriod the tipLookbackPeriod value to set. + * @return the TIDataConnector object itself. + */ + public TIDataConnector withTipLookbackPeriod(OffsetDateTime tipLookbackPeriod) { + if (this.innerProperties() == null) { + this.innerProperties = new TIDataConnectorProperties(); + } + this.innerProperties().withTipLookbackPeriod(tipLookbackPeriod); + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public TIDataConnectorDataTypes dataTypes() { + return this.innerProperties() == null ? null : this.innerProperties().dataTypes(); + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the TIDataConnector object itself. + */ + public TIDataConnector withDataTypes(TIDataConnectorDataTypes dataTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new TIDataConnectorProperties(); + } + this.innerProperties().withDataTypes(dataTypes); + return this; + } + + /** + * Get the tenantId property: The tenant id to connect to, and get the data from. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Set the tenantId property: The tenant id to connect to, and get the data from. + * + * @param tenantId the tenantId value to set. + * @return the TIDataConnector object itself. + */ + public TIDataConnector withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new TIDataConnectorProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TIDataConnectorDataTypes.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TIDataConnectorDataTypes.java new file mode 100644 index 000000000000..f1e5a07200fa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TIDataConnectorDataTypes.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The available data types for TI (Threat Intelligence) data connector. */ +@Fluent +public final class TIDataConnectorDataTypes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TIDataConnectorDataTypes.class); + + /* + * Data type for indicators connection. + */ + @JsonProperty(value = "indicators", required = true) + private TIDataConnectorDataTypesIndicators indicators; + + /** + * Get the indicators property: Data type for indicators connection. + * + * @return the indicators value. + */ + public TIDataConnectorDataTypesIndicators indicators() { + return this.indicators; + } + + /** + * Set the indicators property: Data type for indicators connection. + * + * @param indicators the indicators value to set. + * @return the TIDataConnectorDataTypes object itself. + */ + public TIDataConnectorDataTypes withIndicators(TIDataConnectorDataTypesIndicators indicators) { + this.indicators = indicators; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (indicators() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property indicators in model TIDataConnectorDataTypes")); + } else { + indicators().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TIDataConnectorDataTypesIndicators.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TIDataConnectorDataTypesIndicators.java new file mode 100644 index 000000000000..4ec6fc845e2a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TIDataConnectorDataTypesIndicators.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Data type for indicators connection. */ +@Fluent +public final class TIDataConnectorDataTypesIndicators extends DataConnectorDataTypeCommon { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TIDataConnectorDataTypesIndicators.class); + + /** {@inheritDoc} */ + @Override + public TIDataConnectorDataTypesIndicators withState(DataTypeState state) { + super.withState(state); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TeamInformation.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TeamInformation.java new file mode 100644 index 000000000000..ea1eb3549b75 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TeamInformation.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.TeamInformationInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of TeamInformation. */ +public interface TeamInformation { + /** + * Gets the teamId property: Team ID. + * + * @return the teamId value. + */ + String teamId(); + + /** + * Gets the primaryChannelUrl property: The primary channel URL of the team. + * + * @return the primaryChannelUrl value. + */ + String primaryChannelUrl(); + + /** + * Gets the teamCreationTimeUtc property: The time the team was created. + * + * @return the teamCreationTimeUtc value. + */ + OffsetDateTime teamCreationTimeUtc(); + + /** + * Gets the name property: The name of the team. + * + * @return the name value. + */ + String name(); + + /** + * Gets the description property: The description of the team. + * + * @return the description value. + */ + String description(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.TeamInformationInner object. + * + * @return the inner object. + */ + TeamInformationInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TeamProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TeamProperties.java new file mode 100644 index 000000000000..ea62cc59bb88 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TeamProperties.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.UUID; + +/** Describes team properties. */ +@Fluent +public final class TeamProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TeamProperties.class); + + /* + * The name of the team + */ + @JsonProperty(value = "teamName", required = true) + private String teamName; + + /* + * The description of the team + */ + @JsonProperty(value = "teamDescription") + private String teamDescription; + + /* + * List of member IDs to add to the team + */ + @JsonProperty(value = "memberIds") + private List memberIds; + + /* + * List of group IDs to add their members to the team + */ + @JsonProperty(value = "groupIds") + private List groupIds; + + /** + * Get the teamName property: The name of the team. + * + * @return the teamName value. + */ + public String teamName() { + return this.teamName; + } + + /** + * Set the teamName property: The name of the team. + * + * @param teamName the teamName value to set. + * @return the TeamProperties object itself. + */ + public TeamProperties withTeamName(String teamName) { + this.teamName = teamName; + return this; + } + + /** + * Get the teamDescription property: The description of the team. + * + * @return the teamDescription value. + */ + public String teamDescription() { + return this.teamDescription; + } + + /** + * Set the teamDescription property: The description of the team. + * + * @param teamDescription the teamDescription value to set. + * @return the TeamProperties object itself. + */ + public TeamProperties withTeamDescription(String teamDescription) { + this.teamDescription = teamDescription; + return this; + } + + /** + * Get the memberIds property: List of member IDs to add to the team. + * + * @return the memberIds value. + */ + public List memberIds() { + return this.memberIds; + } + + /** + * Set the memberIds property: List of member IDs to add to the team. + * + * @param memberIds the memberIds value to set. + * @return the TeamProperties object itself. + */ + public TeamProperties withMemberIds(List memberIds) { + this.memberIds = memberIds; + return this; + } + + /** + * Get the groupIds property: List of group IDs to add their members to the team. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.groupIds; + } + + /** + * Set the groupIds property: List of group IDs to add their members to the team. + * + * @param groupIds the groupIds value to set. + * @return the TeamProperties object itself. + */ + public TeamProperties withGroupIds(List groupIds) { + this.groupIds = groupIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (teamName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property teamName in model TeamProperties")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TemplateStatus.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TemplateStatus.java new file mode 100644 index 000000000000..2a81dffc27fa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TemplateStatus.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TemplateStatus. */ +public final class TemplateStatus extends ExpandableStringEnum { + /** Static value Installed for TemplateStatus. */ + public static final TemplateStatus INSTALLED = fromString("Installed"); + + /** Static value Available for TemplateStatus. */ + public static final TemplateStatus AVAILABLE = fromString("Available"); + + /** Static value NotAvailable for TemplateStatus. */ + public static final TemplateStatus NOT_AVAILABLE = fromString("NotAvailable"); + + /** + * Creates or finds a TemplateStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding TemplateStatus. + */ + @JsonCreator + public static TemplateStatus fromString(String name) { + return fromString(name, TemplateStatus.class); + } + + /** @return known TemplateStatus values. */ + public static Collection values() { + return values(TemplateStatus.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligence.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligence.java new file mode 100644 index 000000000000..5475f5aaf2ad --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligence.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ThreatIntelligence property bag. */ +@Immutable +public final class ThreatIntelligence { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligence.class); + + /* + * Confidence (must be between 0 and 1) + */ + @JsonProperty(value = "confidence", access = JsonProperty.Access.WRITE_ONLY) + private Double confidence; + + /* + * Name of the provider from whom this Threat Intelligence information was + * received + */ + @JsonProperty(value = "providerName", access = JsonProperty.Access.WRITE_ONLY) + private String providerName; + + /* + * Report link + */ + @JsonProperty(value = "reportLink", access = JsonProperty.Access.WRITE_ONLY) + private String reportLink; + + /* + * Threat description (free text) + */ + @JsonProperty(value = "threatDescription", access = JsonProperty.Access.WRITE_ONLY) + private String threatDescription; + + /* + * Threat name (e.g. "Jedobot malware") + */ + @JsonProperty(value = "threatName", access = JsonProperty.Access.WRITE_ONLY) + private String threatName; + + /* + * Threat type (e.g. "Botnet") + */ + @JsonProperty(value = "threatType", access = JsonProperty.Access.WRITE_ONLY) + private String threatType; + + /** + * Get the confidence property: Confidence (must be between 0 and 1). + * + * @return the confidence value. + */ + public Double confidence() { + return this.confidence; + } + + /** + * Get the providerName property: Name of the provider from whom this Threat Intelligence information was received. + * + * @return the providerName value. + */ + public String providerName() { + return this.providerName; + } + + /** + * Get the reportLink property: Report link. + * + * @return the reportLink value. + */ + public String reportLink() { + return this.reportLink; + } + + /** + * Get the threatDescription property: Threat description (free text). + * + * @return the threatDescription value. + */ + public String threatDescription() { + return this.threatDescription; + } + + /** + * Get the threatName property: Threat name (e.g. "Jedobot malware"). + * + * @return the threatName value. + */ + public String threatName() { + return this.threatName; + } + + /** + * Get the threatType property: Threat type (e.g. "Botnet"). + * + * @return the threatType value. + */ + public String threatType() { + return this.threatType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceAlertRule.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceAlertRule.java new file mode 100644 index 000000000000..2c04c09c6e19 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceAlertRule.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceAlertRuleProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** Represents Threat Intelligence alert rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("ThreatIntelligence") +@Fluent +public final class ThreatIntelligenceAlertRule extends AlertRuleInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligenceAlertRule.class); + + /* + * Threat Intelligence alert rule properties + */ + @JsonProperty(value = "properties") + private ThreatIntelligenceAlertRuleProperties innerProperties; + + /** + * Get the innerProperties property: Threat Intelligence alert rule properties. + * + * @return the innerProperties value. + */ + private ThreatIntelligenceAlertRuleProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public ThreatIntelligenceAlertRule withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. + * + * @return the alertRuleTemplateName value. + */ + public String alertRuleTemplateName() { + return this.innerProperties() == null ? null : this.innerProperties().alertRuleTemplateName(); + } + + /** + * Set the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. + * + * @param alertRuleTemplateName the alertRuleTemplateName value to set. + * @return the ThreatIntelligenceAlertRule object itself. + */ + public ThreatIntelligenceAlertRule withAlertRuleTemplateName(String alertRuleTemplateName) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceAlertRuleProperties(); + } + this.innerProperties().withAlertRuleTemplateName(alertRuleTemplateName); + return this; + } + + /** + * Get the description property: The description of the alert rule. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Get the displayName property: The display name for alerts created by this alert rule. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Get the enabled property: Determines whether this alert rule is enabled or disabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.innerProperties() == null ? null : this.innerProperties().enabled(); + } + + /** + * Set the enabled property: Determines whether this alert rule is enabled or disabled. + * + * @param enabled the enabled value to set. + * @return the ThreatIntelligenceAlertRule object itself. + */ + public ThreatIntelligenceAlertRule withEnabled(Boolean enabled) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceAlertRuleProperties(); + } + this.innerProperties().withEnabled(enabled); + return this; + } + + /** + * Get the lastModifiedUtc property: The last time that this alert has been modified. + * + * @return the lastModifiedUtc value. + */ + public OffsetDateTime lastModifiedUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedUtc(); + } + + /** + * Get the severity property: The severity for alerts created by this alert rule. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.innerProperties() == null ? null : this.innerProperties().severity(); + } + + /** + * Get the tactics property: The tactics of the alert rule. + * + * @return the tactics value. + */ + public List tactics() { + return this.innerProperties() == null ? null : this.innerProperties().tactics(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceAlertRuleTemplate.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceAlertRuleTemplate.java new file mode 100644 index 000000000000..dde5fd59d17e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceAlertRuleTemplate.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceAlertRuleTemplateProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** Represents Threat Intelligence alert rule template. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("ThreatIntelligence") +@Fluent +public final class ThreatIntelligenceAlertRuleTemplate extends AlertRuleTemplateInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligenceAlertRuleTemplate.class); + + /* + * Threat Intelligence alert rule template properties + */ + @JsonProperty(value = "properties") + private ThreatIntelligenceAlertRuleTemplateProperties innerProperties; + + /** + * Get the innerProperties property: Threat Intelligence alert rule template properties. + * + * @return the innerProperties value. + */ + private ThreatIntelligenceAlertRuleTemplateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the severity property: The severity for alerts created by this alert rule. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.innerProperties() == null ? null : this.innerProperties().severity(); + } + + /** + * Set the severity property: The severity for alerts created by this alert rule. + * + * @param severity the severity value to set. + * @return the ThreatIntelligenceAlertRuleTemplate object itself. + */ + public ThreatIntelligenceAlertRuleTemplate withSeverity(AlertSeverity severity) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceAlertRuleTemplateProperties(); + } + this.innerProperties().withSeverity(severity); + return this; + } + + /** + * Get the tactics property: The tactics of the alert rule template. + * + * @return the tactics value. + */ + public List tactics() { + return this.innerProperties() == null ? null : this.innerProperties().tactics(); + } + + /** + * Set the tactics property: The tactics of the alert rule template. + * + * @param tactics the tactics value to set. + * @return the ThreatIntelligenceAlertRuleTemplate object itself. + */ + public ThreatIntelligenceAlertRuleTemplate withTactics(List tactics) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceAlertRuleTemplateProperties(); + } + this.innerProperties().withTactics(tactics); + return this; + } + + /** + * Get the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. + * + * @return the alertRulesCreatedByTemplateCount value. + */ + public Integer alertRulesCreatedByTemplateCount() { + return this.innerProperties() == null ? null : this.innerProperties().alertRulesCreatedByTemplateCount(); + } + + /** + * Set the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. + * + * @param alertRulesCreatedByTemplateCount the alertRulesCreatedByTemplateCount value to set. + * @return the ThreatIntelligenceAlertRuleTemplate object itself. + */ + public ThreatIntelligenceAlertRuleTemplate withAlertRulesCreatedByTemplateCount( + Integer alertRulesCreatedByTemplateCount) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceAlertRuleTemplateProperties(); + } + this.innerProperties().withAlertRulesCreatedByTemplateCount(alertRulesCreatedByTemplateCount); + return this; + } + + /** + * Get the lastUpdatedDateUtc property: The last time that this alert rule template has been updated. + * + * @return the lastUpdatedDateUtc value. + */ + public OffsetDateTime lastUpdatedDateUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedDateUtc(); + } + + /** + * Get the createdDateUtc property: The time that this alert rule template has been added. + * + * @return the createdDateUtc value. + */ + public OffsetDateTime createdDateUtc() { + return this.innerProperties() == null ? null : this.innerProperties().createdDateUtc(); + } + + /** + * Get the description property: The description of the alert rule template. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of the alert rule template. + * + * @param description the description value to set. + * @return the ThreatIntelligenceAlertRuleTemplate object itself. + */ + public ThreatIntelligenceAlertRuleTemplate withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceAlertRuleTemplateProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the displayName property: The display name for alert rule template. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name for alert rule template. + * + * @param displayName the displayName value to set. + * @return the ThreatIntelligenceAlertRuleTemplate object itself. + */ + public ThreatIntelligenceAlertRuleTemplate withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceAlertRuleTemplateProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the requiredDataConnectors property: The required data sources for this template. + * + * @return the requiredDataConnectors value. + */ + public List requiredDataConnectors() { + return this.innerProperties() == null ? null : this.innerProperties().requiredDataConnectors(); + } + + /** + * Set the requiredDataConnectors property: The required data sources for this template. + * + * @param requiredDataConnectors the requiredDataConnectors value to set. + * @return the ThreatIntelligenceAlertRuleTemplate object itself. + */ + public ThreatIntelligenceAlertRuleTemplate withRequiredDataConnectors( + List requiredDataConnectors) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceAlertRuleTemplateProperties(); + } + this.innerProperties().withRequiredDataConnectors(requiredDataConnectors); + return this; + } + + /** + * Get the status property: The alert rule template status. + * + * @return the status value. + */ + public TemplateStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The alert rule template status. + * + * @param status the status value to set. + * @return the ThreatIntelligenceAlertRuleTemplate object itself. + */ + public ThreatIntelligenceAlertRuleTemplate withStatus(TemplateStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceAlertRuleTemplateProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceAppendTags.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceAppendTags.java new file mode 100644 index 000000000000..14a229bba752 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceAppendTags.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Array of tags to be appended to the threat intelligence indicator. */ +@Fluent +public final class ThreatIntelligenceAppendTags { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligenceAppendTags.class); + + /* + * List of tags to be appended. + */ + @JsonProperty(value = "threatIntelligenceTags") + private List threatIntelligenceTags; + + /** + * Get the threatIntelligenceTags property: List of tags to be appended. + * + * @return the threatIntelligenceTags value. + */ + public List threatIntelligenceTags() { + return this.threatIntelligenceTags; + } + + /** + * Set the threatIntelligenceTags property: List of tags to be appended. + * + * @param threatIntelligenceTags the threatIntelligenceTags value to set. + * @return the ThreatIntelligenceAppendTags object itself. + */ + public ThreatIntelligenceAppendTags withThreatIntelligenceTags(List threatIntelligenceTags) { + this.threatIntelligenceTags = threatIntelligenceTags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceExternalReference.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceExternalReference.java new file mode 100644 index 000000000000..68e105cf433b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceExternalReference.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes external reference. */ +@Fluent +public final class ThreatIntelligenceExternalReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligenceExternalReference.class); + + /* + * External reference description + */ + @JsonProperty(value = "description") + private String description; + + /* + * External reference ID + */ + @JsonProperty(value = "externalId") + private String externalId; + + /* + * External reference source name + */ + @JsonProperty(value = "sourceName") + private String sourceName; + + /* + * External reference URL + */ + @JsonProperty(value = "url") + private String url; + + /* + * External reference hashes + */ + @JsonProperty(value = "hashes") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map hashes; + + /** + * Get the description property: External reference description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: External reference description. + * + * @param description the description value to set. + * @return the ThreatIntelligenceExternalReference object itself. + */ + public ThreatIntelligenceExternalReference withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the externalId property: External reference ID. + * + * @return the externalId value. + */ + public String externalId() { + return this.externalId; + } + + /** + * Set the externalId property: External reference ID. + * + * @param externalId the externalId value to set. + * @return the ThreatIntelligenceExternalReference object itself. + */ + public ThreatIntelligenceExternalReference withExternalId(String externalId) { + this.externalId = externalId; + return this; + } + + /** + * Get the sourceName property: External reference source name. + * + * @return the sourceName value. + */ + public String sourceName() { + return this.sourceName; + } + + /** + * Set the sourceName property: External reference source name. + * + * @param sourceName the sourceName value to set. + * @return the ThreatIntelligenceExternalReference object itself. + */ + public ThreatIntelligenceExternalReference withSourceName(String sourceName) { + this.sourceName = sourceName; + return this; + } + + /** + * Get the url property: External reference URL. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: External reference URL. + * + * @param url the url value to set. + * @return the ThreatIntelligenceExternalReference object itself. + */ + public ThreatIntelligenceExternalReference withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the hashes property: External reference hashes. + * + * @return the hashes value. + */ + public Map hashes() { + return this.hashes; + } + + /** + * Set the hashes property: External reference hashes. + * + * @param hashes the hashes value to set. + * @return the ThreatIntelligenceExternalReference object itself. + */ + public ThreatIntelligenceExternalReference withHashes(Map hashes) { + this.hashes = hashes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceFilteringCriteria.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceFilteringCriteria.java new file mode 100644 index 000000000000..aa02c64de743 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceFilteringCriteria.java @@ -0,0 +1,366 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Filtering criteria for querying threat intelligence indicators. */ +@Fluent +public final class ThreatIntelligenceFilteringCriteria { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligenceFilteringCriteria.class); + + /* + * Page size + */ + @JsonProperty(value = "pageSize") + private Integer pageSize; + + /* + * Minimum confidence. + */ + @JsonProperty(value = "minConfidence") + private Integer minConfidence; + + /* + * Maximum confidence. + */ + @JsonProperty(value = "maxConfidence") + private Integer maxConfidence; + + /* + * Start time for ValidUntil filter. + */ + @JsonProperty(value = "minValidUntil") + private String minValidUntil; + + /* + * End time for ValidUntil filter. + */ + @JsonProperty(value = "maxValidUntil") + private String maxValidUntil; + + /* + * Parameter to include/exclude disabled indicators. + */ + @JsonProperty(value = "includeDisabled") + private Boolean includeDisabled; + + /* + * Columns to sort by and sorting order + */ + @JsonProperty(value = "sortBy") + private List sortBy; + + /* + * Sources of threat intelligence indicators + */ + @JsonProperty(value = "sources") + private List sources; + + /* + * Pattern types + */ + @JsonProperty(value = "patternTypes") + private List patternTypes; + + /* + * Threat types of threat intelligence indicators + */ + @JsonProperty(value = "threatTypes") + private List threatTypes; + + /* + * Ids of threat intelligence indicators + */ + @JsonProperty(value = "ids") + private List ids; + + /* + * Keywords for searching threat intelligence indicators + */ + @JsonProperty(value = "keywords") + private List keywords; + + /* + * Skip token. + */ + @JsonProperty(value = "skipToken") + private String skipToken; + + /** + * Get the pageSize property: Page size. + * + * @return the pageSize value. + */ + public Integer pageSize() { + return this.pageSize; + } + + /** + * Set the pageSize property: Page size. + * + * @param pageSize the pageSize value to set. + * @return the ThreatIntelligenceFilteringCriteria object itself. + */ + public ThreatIntelligenceFilteringCriteria withPageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Get the minConfidence property: Minimum confidence. + * + * @return the minConfidence value. + */ + public Integer minConfidence() { + return this.minConfidence; + } + + /** + * Set the minConfidence property: Minimum confidence. + * + * @param minConfidence the minConfidence value to set. + * @return the ThreatIntelligenceFilteringCriteria object itself. + */ + public ThreatIntelligenceFilteringCriteria withMinConfidence(Integer minConfidence) { + this.minConfidence = minConfidence; + return this; + } + + /** + * Get the maxConfidence property: Maximum confidence. + * + * @return the maxConfidence value. + */ + public Integer maxConfidence() { + return this.maxConfidence; + } + + /** + * Set the maxConfidence property: Maximum confidence. + * + * @param maxConfidence the maxConfidence value to set. + * @return the ThreatIntelligenceFilteringCriteria object itself. + */ + public ThreatIntelligenceFilteringCriteria withMaxConfidence(Integer maxConfidence) { + this.maxConfidence = maxConfidence; + return this; + } + + /** + * Get the minValidUntil property: Start time for ValidUntil filter. + * + * @return the minValidUntil value. + */ + public String minValidUntil() { + return this.minValidUntil; + } + + /** + * Set the minValidUntil property: Start time for ValidUntil filter. + * + * @param minValidUntil the minValidUntil value to set. + * @return the ThreatIntelligenceFilteringCriteria object itself. + */ + public ThreatIntelligenceFilteringCriteria withMinValidUntil(String minValidUntil) { + this.minValidUntil = minValidUntil; + return this; + } + + /** + * Get the maxValidUntil property: End time for ValidUntil filter. + * + * @return the maxValidUntil value. + */ + public String maxValidUntil() { + return this.maxValidUntil; + } + + /** + * Set the maxValidUntil property: End time for ValidUntil filter. + * + * @param maxValidUntil the maxValidUntil value to set. + * @return the ThreatIntelligenceFilteringCriteria object itself. + */ + public ThreatIntelligenceFilteringCriteria withMaxValidUntil(String maxValidUntil) { + this.maxValidUntil = maxValidUntil; + return this; + } + + /** + * Get the includeDisabled property: Parameter to include/exclude disabled indicators. + * + * @return the includeDisabled value. + */ + public Boolean includeDisabled() { + return this.includeDisabled; + } + + /** + * Set the includeDisabled property: Parameter to include/exclude disabled indicators. + * + * @param includeDisabled the includeDisabled value to set. + * @return the ThreatIntelligenceFilteringCriteria object itself. + */ + public ThreatIntelligenceFilteringCriteria withIncludeDisabled(Boolean includeDisabled) { + this.includeDisabled = includeDisabled; + return this; + } + + /** + * Get the sortBy property: Columns to sort by and sorting order. + * + * @return the sortBy value. + */ + public List sortBy() { + return this.sortBy; + } + + /** + * Set the sortBy property: Columns to sort by and sorting order. + * + * @param sortBy the sortBy value to set. + * @return the ThreatIntelligenceFilteringCriteria object itself. + */ + public ThreatIntelligenceFilteringCriteria withSortBy(List sortBy) { + this.sortBy = sortBy; + return this; + } + + /** + * Get the sources property: Sources of threat intelligence indicators. + * + * @return the sources value. + */ + public List sources() { + return this.sources; + } + + /** + * Set the sources property: Sources of threat intelligence indicators. + * + * @param sources the sources value to set. + * @return the ThreatIntelligenceFilteringCriteria object itself. + */ + public ThreatIntelligenceFilteringCriteria withSources(List sources) { + this.sources = sources; + return this; + } + + /** + * Get the patternTypes property: Pattern types. + * + * @return the patternTypes value. + */ + public List patternTypes() { + return this.patternTypes; + } + + /** + * Set the patternTypes property: Pattern types. + * + * @param patternTypes the patternTypes value to set. + * @return the ThreatIntelligenceFilteringCriteria object itself. + */ + public ThreatIntelligenceFilteringCriteria withPatternTypes(List patternTypes) { + this.patternTypes = patternTypes; + return this; + } + + /** + * Get the threatTypes property: Threat types of threat intelligence indicators. + * + * @return the threatTypes value. + */ + public List threatTypes() { + return this.threatTypes; + } + + /** + * Set the threatTypes property: Threat types of threat intelligence indicators. + * + * @param threatTypes the threatTypes value to set. + * @return the ThreatIntelligenceFilteringCriteria object itself. + */ + public ThreatIntelligenceFilteringCriteria withThreatTypes(List threatTypes) { + this.threatTypes = threatTypes; + return this; + } + + /** + * Get the ids property: Ids of threat intelligence indicators. + * + * @return the ids value. + */ + public List ids() { + return this.ids; + } + + /** + * Set the ids property: Ids of threat intelligence indicators. + * + * @param ids the ids value to set. + * @return the ThreatIntelligenceFilteringCriteria object itself. + */ + public ThreatIntelligenceFilteringCriteria withIds(List ids) { + this.ids = ids; + return this; + } + + /** + * Get the keywords property: Keywords for searching threat intelligence indicators. + * + * @return the keywords value. + */ + public List keywords() { + return this.keywords; + } + + /** + * Set the keywords property: Keywords for searching threat intelligence indicators. + * + * @param keywords the keywords value to set. + * @return the ThreatIntelligenceFilteringCriteria object itself. + */ + public ThreatIntelligenceFilteringCriteria withKeywords(List keywords) { + this.keywords = keywords; + return this; + } + + /** + * Get the skipToken property: Skip token. + * + * @return the skipToken value. + */ + public String skipToken() { + return this.skipToken; + } + + /** + * Set the skipToken property: Skip token. + * + * @param skipToken the skipToken value to set. + * @return the ThreatIntelligenceFilteringCriteria object itself. + */ + public ThreatIntelligenceFilteringCriteria withSkipToken(String skipToken) { + this.skipToken = skipToken; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sortBy() != null) { + sortBy().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceGranularMarkingModel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceGranularMarkingModel.java new file mode 100644 index 000000000000..6ddcc9a1a494 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceGranularMarkingModel.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes threat granular marking model entity. */ +@Fluent +public final class ThreatIntelligenceGranularMarkingModel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligenceGranularMarkingModel.class); + + /* + * Language granular marking model + */ + @JsonProperty(value = "language") + private String language; + + /* + * marking reference granular marking model + */ + @JsonProperty(value = "markingRef") + private Integer markingRef; + + /* + * granular marking model selectors + */ + @JsonProperty(value = "selectors") + private List selectors; + + /** + * Get the language property: Language granular marking model. + * + * @return the language value. + */ + public String language() { + return this.language; + } + + /** + * Set the language property: Language granular marking model. + * + * @param language the language value to set. + * @return the ThreatIntelligenceGranularMarkingModel object itself. + */ + public ThreatIntelligenceGranularMarkingModel withLanguage(String language) { + this.language = language; + return this; + } + + /** + * Get the markingRef property: marking reference granular marking model. + * + * @return the markingRef value. + */ + public Integer markingRef() { + return this.markingRef; + } + + /** + * Set the markingRef property: marking reference granular marking model. + * + * @param markingRef the markingRef value to set. + * @return the ThreatIntelligenceGranularMarkingModel object itself. + */ + public ThreatIntelligenceGranularMarkingModel withMarkingRef(Integer markingRef) { + this.markingRef = markingRef; + return this; + } + + /** + * Get the selectors property: granular marking model selectors. + * + * @return the selectors value. + */ + public List selectors() { + return this.selectors; + } + + /** + * Set the selectors property: granular marking model selectors. + * + * @param selectors the selectors value to set. + * @return the ThreatIntelligenceGranularMarkingModel object itself. + */ + public ThreatIntelligenceGranularMarkingModel withSelectors(List selectors) { + this.selectors = selectors; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicatorMetrics.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicatorMetrics.java new file mode 100644 index 000000000000..4b63803d510b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicatorMetrics.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ThreatIntelligenceIndicatorMetrics. */ +public interface ThreatIntelligenceIndicatorMetrics { + /** + * Get threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). + */ + ThreatIntelligenceMetricsList list(String resourceGroupName, String workspaceName); + + /** + * Get threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). + */ + Response listWithResponse( + String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicatorModel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicatorModel.java new file mode 100644 index 000000000000..7f973e689841 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicatorModel.java @@ -0,0 +1,726 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceIndicatorProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceInformationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Threat intelligence indicator entity. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("indicator") +@Fluent +public final class ThreatIntelligenceIndicatorModel extends ThreatIntelligenceInformationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligenceIndicatorModel.class); + + /* + * Threat Intelligence Entity properties + */ + @JsonProperty(value = "properties") + private ThreatIntelligenceIndicatorProperties innerProperties; + + /** + * Get the innerProperties property: Threat Intelligence Entity properties. + * + * @return the innerProperties value. + */ + private ThreatIntelligenceIndicatorProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public ThreatIntelligenceIndicatorModel withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the threatIntelligenceTags property: List of tags. + * + * @return the threatIntelligenceTags value. + */ + public List threatIntelligenceTags() { + return this.innerProperties() == null ? null : this.innerProperties().threatIntelligenceTags(); + } + + /** + * Set the threatIntelligenceTags property: List of tags. + * + * @param threatIntelligenceTags the threatIntelligenceTags value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withThreatIntelligenceTags(List threatIntelligenceTags) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withThreatIntelligenceTags(threatIntelligenceTags); + return this; + } + + /** + * Get the lastUpdatedTimeUtc property: Last updated time in UTC. + * + * @return the lastUpdatedTimeUtc value. + */ + public String lastUpdatedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedTimeUtc(); + } + + /** + * Set the lastUpdatedTimeUtc property: Last updated time in UTC. + * + * @param lastUpdatedTimeUtc the lastUpdatedTimeUtc value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withLastUpdatedTimeUtc(String lastUpdatedTimeUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withLastUpdatedTimeUtc(lastUpdatedTimeUtc); + return this; + } + + /** + * Get the source property: Source of a threat intelligence entity. + * + * @return the source value. + */ + public String source() { + return this.innerProperties() == null ? null : this.innerProperties().source(); + } + + /** + * Set the source property: Source of a threat intelligence entity. + * + * @param source the source value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withSource(String source) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withSource(source); + return this; + } + + /** + * Get the displayName property: Display name of a threat intelligence entity. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: Display name of a threat intelligence entity. + * + * @param displayName the displayName value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the description property: Description of a threat intelligence entity. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: Description of a threat intelligence entity. + * + * @param description the description value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the indicatorTypes property: Indicator types of threat intelligence entities. + * + * @return the indicatorTypes value. + */ + public List indicatorTypes() { + return this.innerProperties() == null ? null : this.innerProperties().indicatorTypes(); + } + + /** + * Set the indicatorTypes property: Indicator types of threat intelligence entities. + * + * @param indicatorTypes the indicatorTypes value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withIndicatorTypes(List indicatorTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withIndicatorTypes(indicatorTypes); + return this; + } + + /** + * Get the pattern property: Pattern of a threat intelligence entity. + * + * @return the pattern value. + */ + public String pattern() { + return this.innerProperties() == null ? null : this.innerProperties().pattern(); + } + + /** + * Set the pattern property: Pattern of a threat intelligence entity. + * + * @param pattern the pattern value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withPattern(String pattern) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withPattern(pattern); + return this; + } + + /** + * Get the patternType property: Pattern type of a threat intelligence entity. + * + * @return the patternType value. + */ + public String patternType() { + return this.innerProperties() == null ? null : this.innerProperties().patternType(); + } + + /** + * Set the patternType property: Pattern type of a threat intelligence entity. + * + * @param patternType the patternType value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withPatternType(String patternType) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withPatternType(patternType); + return this; + } + + /** + * Get the patternVersion property: Pattern version of a threat intelligence entity. + * + * @return the patternVersion value. + */ + public String patternVersion() { + return this.innerProperties() == null ? null : this.innerProperties().patternVersion(); + } + + /** + * Set the patternVersion property: Pattern version of a threat intelligence entity. + * + * @param patternVersion the patternVersion value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withPatternVersion(String patternVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withPatternVersion(patternVersion); + return this; + } + + /** + * Get the killChainPhases property: Kill chain phases. + * + * @return the killChainPhases value. + */ + public List killChainPhases() { + return this.innerProperties() == null ? null : this.innerProperties().killChainPhases(); + } + + /** + * Set the killChainPhases property: Kill chain phases. + * + * @param killChainPhases the killChainPhases value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withKillChainPhases( + List killChainPhases) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withKillChainPhases(killChainPhases); + return this; + } + + /** + * Get the parsedPattern property: Parsed patterns. + * + * @return the parsedPattern value. + */ + public List parsedPattern() { + return this.innerProperties() == null ? null : this.innerProperties().parsedPattern(); + } + + /** + * Set the parsedPattern property: Parsed patterns. + * + * @param parsedPattern the parsedPattern value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withParsedPattern(List parsedPattern) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withParsedPattern(parsedPattern); + return this; + } + + /** + * Get the externalId property: External ID of threat intelligence entity. + * + * @return the externalId value. + */ + public String externalId() { + return this.innerProperties() == null ? null : this.innerProperties().externalId(); + } + + /** + * Set the externalId property: External ID of threat intelligence entity. + * + * @param externalId the externalId value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withExternalId(String externalId) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withExternalId(externalId); + return this; + } + + /** + * Get the createdByRef property: Created by reference of threat intelligence entity. + * + * @return the createdByRef value. + */ + public String createdByRef() { + return this.innerProperties() == null ? null : this.innerProperties().createdByRef(); + } + + /** + * Set the createdByRef property: Created by reference of threat intelligence entity. + * + * @param createdByRef the createdByRef value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withCreatedByRef(String createdByRef) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withCreatedByRef(createdByRef); + return this; + } + + /** + * Get the defanged property: Is threat intelligence entity defanged. + * + * @return the defanged value. + */ + public Boolean defanged() { + return this.innerProperties() == null ? null : this.innerProperties().defanged(); + } + + /** + * Set the defanged property: Is threat intelligence entity defanged. + * + * @param defanged the defanged value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withDefanged(Boolean defanged) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withDefanged(defanged); + return this; + } + + /** + * Get the externalLastUpdatedTimeUtc property: External last updated time in UTC. + * + * @return the externalLastUpdatedTimeUtc value. + */ + public String externalLastUpdatedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().externalLastUpdatedTimeUtc(); + } + + /** + * Set the externalLastUpdatedTimeUtc property: External last updated time in UTC. + * + * @param externalLastUpdatedTimeUtc the externalLastUpdatedTimeUtc value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withExternalLastUpdatedTimeUtc(String externalLastUpdatedTimeUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withExternalLastUpdatedTimeUtc(externalLastUpdatedTimeUtc); + return this; + } + + /** + * Get the externalReferences property: External References. + * + * @return the externalReferences value. + */ + public List externalReferences() { + return this.innerProperties() == null ? null : this.innerProperties().externalReferences(); + } + + /** + * Set the externalReferences property: External References. + * + * @param externalReferences the externalReferences value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withExternalReferences( + List externalReferences) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withExternalReferences(externalReferences); + return this; + } + + /** + * Get the granularMarkings property: Granular Markings. + * + * @return the granularMarkings value. + */ + public List granularMarkings() { + return this.innerProperties() == null ? null : this.innerProperties().granularMarkings(); + } + + /** + * Set the granularMarkings property: Granular Markings. + * + * @param granularMarkings the granularMarkings value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withGranularMarkings( + List granularMarkings) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withGranularMarkings(granularMarkings); + return this; + } + + /** + * Get the labels property: Labels of threat intelligence entity. + * + * @return the labels value. + */ + public List labels() { + return this.innerProperties() == null ? null : this.innerProperties().labels(); + } + + /** + * Set the labels property: Labels of threat intelligence entity. + * + * @param labels the labels value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withLabels(List labels) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withLabels(labels); + return this; + } + + /** + * Get the revoked property: Is threat intelligence entity revoked. + * + * @return the revoked value. + */ + public Boolean revoked() { + return this.innerProperties() == null ? null : this.innerProperties().revoked(); + } + + /** + * Set the revoked property: Is threat intelligence entity revoked. + * + * @param revoked the revoked value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withRevoked(Boolean revoked) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withRevoked(revoked); + return this; + } + + /** + * Get the confidence property: Confidence of threat intelligence entity. + * + * @return the confidence value. + */ + public Integer confidence() { + return this.innerProperties() == null ? null : this.innerProperties().confidence(); + } + + /** + * Set the confidence property: Confidence of threat intelligence entity. + * + * @param confidence the confidence value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withConfidence(Integer confidence) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withConfidence(confidence); + return this; + } + + /** + * Get the objectMarkingRefs property: Threat intelligence entity object marking references. + * + * @return the objectMarkingRefs value. + */ + public List objectMarkingRefs() { + return this.innerProperties() == null ? null : this.innerProperties().objectMarkingRefs(); + } + + /** + * Set the objectMarkingRefs property: Threat intelligence entity object marking references. + * + * @param objectMarkingRefs the objectMarkingRefs value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withObjectMarkingRefs(List objectMarkingRefs) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withObjectMarkingRefs(objectMarkingRefs); + return this; + } + + /** + * Get the language property: Language of threat intelligence entity. + * + * @return the language value. + */ + public String language() { + return this.innerProperties() == null ? null : this.innerProperties().language(); + } + + /** + * Set the language property: Language of threat intelligence entity. + * + * @param language the language value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withLanguage(String language) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withLanguage(language); + return this; + } + + /** + * Get the threatTypes property: Threat types. + * + * @return the threatTypes value. + */ + public List threatTypes() { + return this.innerProperties() == null ? null : this.innerProperties().threatTypes(); + } + + /** + * Set the threatTypes property: Threat types. + * + * @param threatTypes the threatTypes value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withThreatTypes(List threatTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withThreatTypes(threatTypes); + return this; + } + + /** + * Get the validFrom property: Valid from. + * + * @return the validFrom value. + */ + public String validFrom() { + return this.innerProperties() == null ? null : this.innerProperties().validFrom(); + } + + /** + * Set the validFrom property: Valid from. + * + * @param validFrom the validFrom value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withValidFrom(String validFrom) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withValidFrom(validFrom); + return this; + } + + /** + * Get the validUntil property: Valid until. + * + * @return the validUntil value. + */ + public String validUntil() { + return this.innerProperties() == null ? null : this.innerProperties().validUntil(); + } + + /** + * Set the validUntil property: Valid until. + * + * @param validUntil the validUntil value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withValidUntil(String validUntil) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withValidUntil(validUntil); + return this; + } + + /** + * Get the created property: Created by. + * + * @return the created value. + */ + public String created() { + return this.innerProperties() == null ? null : this.innerProperties().created(); + } + + /** + * Set the created property: Created by. + * + * @param created the created value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withCreated(String created) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withCreated(created); + return this; + } + + /** + * Get the modified property: Modified by. + * + * @return the modified value. + */ + public String modified() { + return this.innerProperties() == null ? null : this.innerProperties().modified(); + } + + /** + * Set the modified property: Modified by. + * + * @param modified the modified value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withModified(String modified) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withModified(modified); + return this; + } + + /** + * Get the extensions property: Extensions map. + * + * @return the extensions value. + */ + public Map extensions() { + return this.innerProperties() == null ? null : this.innerProperties().extensions(); + } + + /** + * Set the extensions property: Extensions map. + * + * @param extensions the extensions value to set. + * @return the ThreatIntelligenceIndicatorModel object itself. + */ + public ThreatIntelligenceIndicatorModel withExtensions(Map extensions) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withExtensions(extensions); + return this; + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicatorModelForRequestBody.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicatorModelForRequestBody.java new file mode 100644 index 000000000000..c7611600484d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicatorModelForRequestBody.java @@ -0,0 +1,751 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceIndicatorProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Threat intelligence indicator entity used in request body. */ +@Fluent +public final class ThreatIntelligenceIndicatorModelForRequestBody extends ThreatIntelligenceResourceKind { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ThreatIntelligenceIndicatorModelForRequestBody.class); + + /* + * Etag of the azure resource + */ + @JsonProperty(value = "etag") + private String etag; + + /* + * Threat Intelligence Entity properties + */ + @JsonProperty(value = "properties") + private ThreatIntelligenceIndicatorProperties innerProperties; + + /** + * Get the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Etag of the azure resource. + * + * @param etag the etag value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the innerProperties property: Threat Intelligence Entity properties. + * + * @return the innerProperties value. + */ + private ThreatIntelligenceIndicatorProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public ThreatIntelligenceIndicatorModelForRequestBody withKind(ThreatIntelligenceResourceKindEnum kind) { + super.withKind(kind); + return this; + } + + /** + * Get the threatIntelligenceTags property: List of tags. + * + * @return the threatIntelligenceTags value. + */ + public List threatIntelligenceTags() { + return this.innerProperties() == null ? null : this.innerProperties().threatIntelligenceTags(); + } + + /** + * Set the threatIntelligenceTags property: List of tags. + * + * @param threatIntelligenceTags the threatIntelligenceTags value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withThreatIntelligenceTags( + List threatIntelligenceTags) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withThreatIntelligenceTags(threatIntelligenceTags); + return this; + } + + /** + * Get the lastUpdatedTimeUtc property: Last updated time in UTC. + * + * @return the lastUpdatedTimeUtc value. + */ + public String lastUpdatedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedTimeUtc(); + } + + /** + * Set the lastUpdatedTimeUtc property: Last updated time in UTC. + * + * @param lastUpdatedTimeUtc the lastUpdatedTimeUtc value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withLastUpdatedTimeUtc(String lastUpdatedTimeUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withLastUpdatedTimeUtc(lastUpdatedTimeUtc); + return this; + } + + /** + * Get the source property: Source of a threat intelligence entity. + * + * @return the source value. + */ + public String source() { + return this.innerProperties() == null ? null : this.innerProperties().source(); + } + + /** + * Set the source property: Source of a threat intelligence entity. + * + * @param source the source value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withSource(String source) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withSource(source); + return this; + } + + /** + * Get the displayName property: Display name of a threat intelligence entity. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: Display name of a threat intelligence entity. + * + * @param displayName the displayName value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the description property: Description of a threat intelligence entity. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: Description of a threat intelligence entity. + * + * @param description the description value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the indicatorTypes property: Indicator types of threat intelligence entities. + * + * @return the indicatorTypes value. + */ + public List indicatorTypes() { + return this.innerProperties() == null ? null : this.innerProperties().indicatorTypes(); + } + + /** + * Set the indicatorTypes property: Indicator types of threat intelligence entities. + * + * @param indicatorTypes the indicatorTypes value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withIndicatorTypes(List indicatorTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withIndicatorTypes(indicatorTypes); + return this; + } + + /** + * Get the pattern property: Pattern of a threat intelligence entity. + * + * @return the pattern value. + */ + public String pattern() { + return this.innerProperties() == null ? null : this.innerProperties().pattern(); + } + + /** + * Set the pattern property: Pattern of a threat intelligence entity. + * + * @param pattern the pattern value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withPattern(String pattern) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withPattern(pattern); + return this; + } + + /** + * Get the patternType property: Pattern type of a threat intelligence entity. + * + * @return the patternType value. + */ + public String patternType() { + return this.innerProperties() == null ? null : this.innerProperties().patternType(); + } + + /** + * Set the patternType property: Pattern type of a threat intelligence entity. + * + * @param patternType the patternType value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withPatternType(String patternType) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withPatternType(patternType); + return this; + } + + /** + * Get the patternVersion property: Pattern version of a threat intelligence entity. + * + * @return the patternVersion value. + */ + public String patternVersion() { + return this.innerProperties() == null ? null : this.innerProperties().patternVersion(); + } + + /** + * Set the patternVersion property: Pattern version of a threat intelligence entity. + * + * @param patternVersion the patternVersion value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withPatternVersion(String patternVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withPatternVersion(patternVersion); + return this; + } + + /** + * Get the killChainPhases property: Kill chain phases. + * + * @return the killChainPhases value. + */ + public List killChainPhases() { + return this.innerProperties() == null ? null : this.innerProperties().killChainPhases(); + } + + /** + * Set the killChainPhases property: Kill chain phases. + * + * @param killChainPhases the killChainPhases value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withKillChainPhases( + List killChainPhases) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withKillChainPhases(killChainPhases); + return this; + } + + /** + * Get the parsedPattern property: Parsed patterns. + * + * @return the parsedPattern value. + */ + public List parsedPattern() { + return this.innerProperties() == null ? null : this.innerProperties().parsedPattern(); + } + + /** + * Set the parsedPattern property: Parsed patterns. + * + * @param parsedPattern the parsedPattern value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withParsedPattern( + List parsedPattern) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withParsedPattern(parsedPattern); + return this; + } + + /** + * Get the externalId property: External ID of threat intelligence entity. + * + * @return the externalId value. + */ + public String externalId() { + return this.innerProperties() == null ? null : this.innerProperties().externalId(); + } + + /** + * Set the externalId property: External ID of threat intelligence entity. + * + * @param externalId the externalId value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withExternalId(String externalId) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withExternalId(externalId); + return this; + } + + /** + * Get the createdByRef property: Created by reference of threat intelligence entity. + * + * @return the createdByRef value. + */ + public String createdByRef() { + return this.innerProperties() == null ? null : this.innerProperties().createdByRef(); + } + + /** + * Set the createdByRef property: Created by reference of threat intelligence entity. + * + * @param createdByRef the createdByRef value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withCreatedByRef(String createdByRef) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withCreatedByRef(createdByRef); + return this; + } + + /** + * Get the defanged property: Is threat intelligence entity defanged. + * + * @return the defanged value. + */ + public Boolean defanged() { + return this.innerProperties() == null ? null : this.innerProperties().defanged(); + } + + /** + * Set the defanged property: Is threat intelligence entity defanged. + * + * @param defanged the defanged value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withDefanged(Boolean defanged) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withDefanged(defanged); + return this; + } + + /** + * Get the externalLastUpdatedTimeUtc property: External last updated time in UTC. + * + * @return the externalLastUpdatedTimeUtc value. + */ + public String externalLastUpdatedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().externalLastUpdatedTimeUtc(); + } + + /** + * Set the externalLastUpdatedTimeUtc property: External last updated time in UTC. + * + * @param externalLastUpdatedTimeUtc the externalLastUpdatedTimeUtc value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withExternalLastUpdatedTimeUtc( + String externalLastUpdatedTimeUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withExternalLastUpdatedTimeUtc(externalLastUpdatedTimeUtc); + return this; + } + + /** + * Get the externalReferences property: External References. + * + * @return the externalReferences value. + */ + public List externalReferences() { + return this.innerProperties() == null ? null : this.innerProperties().externalReferences(); + } + + /** + * Set the externalReferences property: External References. + * + * @param externalReferences the externalReferences value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withExternalReferences( + List externalReferences) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withExternalReferences(externalReferences); + return this; + } + + /** + * Get the granularMarkings property: Granular Markings. + * + * @return the granularMarkings value. + */ + public List granularMarkings() { + return this.innerProperties() == null ? null : this.innerProperties().granularMarkings(); + } + + /** + * Set the granularMarkings property: Granular Markings. + * + * @param granularMarkings the granularMarkings value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withGranularMarkings( + List granularMarkings) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withGranularMarkings(granularMarkings); + return this; + } + + /** + * Get the labels property: Labels of threat intelligence entity. + * + * @return the labels value. + */ + public List labels() { + return this.innerProperties() == null ? null : this.innerProperties().labels(); + } + + /** + * Set the labels property: Labels of threat intelligence entity. + * + * @param labels the labels value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withLabels(List labels) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withLabels(labels); + return this; + } + + /** + * Get the revoked property: Is threat intelligence entity revoked. + * + * @return the revoked value. + */ + public Boolean revoked() { + return this.innerProperties() == null ? null : this.innerProperties().revoked(); + } + + /** + * Set the revoked property: Is threat intelligence entity revoked. + * + * @param revoked the revoked value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withRevoked(Boolean revoked) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withRevoked(revoked); + return this; + } + + /** + * Get the confidence property: Confidence of threat intelligence entity. + * + * @return the confidence value. + */ + public Integer confidence() { + return this.innerProperties() == null ? null : this.innerProperties().confidence(); + } + + /** + * Set the confidence property: Confidence of threat intelligence entity. + * + * @param confidence the confidence value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withConfidence(Integer confidence) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withConfidence(confidence); + return this; + } + + /** + * Get the objectMarkingRefs property: Threat intelligence entity object marking references. + * + * @return the objectMarkingRefs value. + */ + public List objectMarkingRefs() { + return this.innerProperties() == null ? null : this.innerProperties().objectMarkingRefs(); + } + + /** + * Set the objectMarkingRefs property: Threat intelligence entity object marking references. + * + * @param objectMarkingRefs the objectMarkingRefs value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withObjectMarkingRefs(List objectMarkingRefs) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withObjectMarkingRefs(objectMarkingRefs); + return this; + } + + /** + * Get the language property: Language of threat intelligence entity. + * + * @return the language value. + */ + public String language() { + return this.innerProperties() == null ? null : this.innerProperties().language(); + } + + /** + * Set the language property: Language of threat intelligence entity. + * + * @param language the language value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withLanguage(String language) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withLanguage(language); + return this; + } + + /** + * Get the threatTypes property: Threat types. + * + * @return the threatTypes value. + */ + public List threatTypes() { + return this.innerProperties() == null ? null : this.innerProperties().threatTypes(); + } + + /** + * Set the threatTypes property: Threat types. + * + * @param threatTypes the threatTypes value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withThreatTypes(List threatTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withThreatTypes(threatTypes); + return this; + } + + /** + * Get the validFrom property: Valid from. + * + * @return the validFrom value. + */ + public String validFrom() { + return this.innerProperties() == null ? null : this.innerProperties().validFrom(); + } + + /** + * Set the validFrom property: Valid from. + * + * @param validFrom the validFrom value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withValidFrom(String validFrom) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withValidFrom(validFrom); + return this; + } + + /** + * Get the validUntil property: Valid until. + * + * @return the validUntil value. + */ + public String validUntil() { + return this.innerProperties() == null ? null : this.innerProperties().validUntil(); + } + + /** + * Set the validUntil property: Valid until. + * + * @param validUntil the validUntil value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withValidUntil(String validUntil) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withValidUntil(validUntil); + return this; + } + + /** + * Get the created property: Created by. + * + * @return the created value. + */ + public String created() { + return this.innerProperties() == null ? null : this.innerProperties().created(); + } + + /** + * Set the created property: Created by. + * + * @param created the created value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withCreated(String created) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withCreated(created); + return this; + } + + /** + * Get the modified property: Modified by. + * + * @return the modified value. + */ + public String modified() { + return this.innerProperties() == null ? null : this.innerProperties().modified(); + } + + /** + * Set the modified property: Modified by. + * + * @param modified the modified value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withModified(String modified) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withModified(modified); + return this; + } + + /** + * Get the extensions property: Extensions map. + * + * @return the extensions value. + */ + public Map extensions() { + return this.innerProperties() == null ? null : this.innerProperties().extensions(); + } + + /** + * Set the extensions property: Extensions map. + * + * @param extensions the extensions value to set. + * @return the ThreatIntelligenceIndicatorModelForRequestBody object itself. + */ + public ThreatIntelligenceIndicatorModelForRequestBody withExtensions(Map extensions) { + if (this.innerProperties() == null) { + this.innerProperties = new ThreatIntelligenceIndicatorProperties(); + } + this.innerProperties().withExtensions(extensions); + return this; + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicators.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicators.java new file mode 100644 index 000000000000..1825f6b49161 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicators.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ThreatIntelligenceIndicators. */ +public interface ThreatIntelligenceIndicators { + /** + * Create a new threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + ThreatIntelligenceInformation createIndicator( + String resourceGroupName, + String workspaceName, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties); + + /** + * Create a new threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + Response createIndicatorWithResponse( + String resourceGroupName, + String workspaceName, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties, + Context context); + + /** + * View a threat intelligence indicator by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + ThreatIntelligenceInformation get(String resourceGroupName, String workspaceName, String name); + + /** + * View a threat intelligence indicator by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String name, Context context); + + /** + * Update a threat Intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + ThreatIntelligenceInformation create( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties); + + /** + * Update a threat Intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + Response createWithResponse( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties, + Context context); + + /** + * Delete a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String name); + + /** + * Delete a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, Context context); + + /** + * Query threat intelligence indicators as per filtering criteria. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param threatIntelligenceFilteringCriteria Filtering criteria for querying threat intelligence indicators. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the threat intelligence information objects. + */ + PagedIterable queryIndicators( + String resourceGroupName, + String workspaceName, + ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria); + + /** + * Query threat intelligence indicators as per filtering criteria. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param threatIntelligenceFilteringCriteria Filtering criteria for querying threat intelligence indicators. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the threat intelligence information objects. + */ + PagedIterable queryIndicators( + String resourceGroupName, + String workspaceName, + ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, + Context context); + + /** + * Append tags to a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceAppendTags The threat intelligence append tags request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void appendTags( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceAppendTags threatIntelligenceAppendTags); + + /** + * Append tags to a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceAppendTags The threat intelligence append tags request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response appendTagsWithResponse( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceAppendTags threatIntelligenceAppendTags, + Context context); + + /** + * Replace tags added to a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceReplaceTags Tags in the threat intelligence indicator to be replaced. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + ThreatIntelligenceInformation replaceTags( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceReplaceTags); + + /** + * Replace tags added to a threat intelligence indicator. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param name Threat intelligence indicator name field. + * @param threatIntelligenceReplaceTags Tags in the threat intelligence indicator to be replaced. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return threat intelligence information object. + */ + Response replaceTagsWithResponse( + String resourceGroupName, + String workspaceName, + String name, + ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceReplaceTags, + Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicatorsOperations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicatorsOperations.java new file mode 100644 index 000000000000..84f06f5d2b01 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicatorsOperations.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ThreatIntelligenceIndicatorsOperations. */ +public interface ThreatIntelligenceIndicatorsOperations { + /** + * Get all threat intelligence indicators. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all threat intelligence indicators. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Get all threat intelligence indicators. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param top Returns only the first n results. Optional. + * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all threat intelligence indicators. + */ + PagedIterable list( + String resourceGroupName, + String workspaceName, + String filter, + String orderby, + Integer top, + String skipToken, + Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceInformation.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceInformation.java new file mode 100644 index 000000000000..542cf50924ff --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceInformation.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceInformationInner; + +/** An immutable client-side representation of ThreatIntelligenceInformation. */ +public interface ThreatIntelligenceInformation { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceInformationInner + * object. + * + * @return the inner object. + */ + ThreatIntelligenceInformationInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceInformationList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceInformationList.java new file mode 100644 index 000000000000..8b5c95fe458f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceInformationList.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceInformationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of all the threat intelligence information objects. */ +@Fluent +public final class ThreatIntelligenceInformationList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligenceInformationList.class); + + /* + * URL to fetch the next set of information objects. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of threat intelligence information objects. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the nextLink property: URL to fetch the next set of information objects. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of threat intelligence information objects. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of threat intelligence information objects. + * + * @param value the value value to set. + * @return the ThreatIntelligenceInformationList object itself. + */ + public ThreatIntelligenceInformationList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model ThreatIntelligenceInformationList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceKillChainPhase.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceKillChainPhase.java new file mode 100644 index 000000000000..58a3383fd450 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceKillChainPhase.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes threat kill chain phase entity. */ +@Fluent +public final class ThreatIntelligenceKillChainPhase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligenceKillChainPhase.class); + + /* + * Kill chainName name + */ + @JsonProperty(value = "killChainName") + private String killChainName; + + /* + * Phase name + */ + @JsonProperty(value = "phaseName") + private String phaseName; + + /** + * Get the killChainName property: Kill chainName name. + * + * @return the killChainName value. + */ + public String killChainName() { + return this.killChainName; + } + + /** + * Set the killChainName property: Kill chainName name. + * + * @param killChainName the killChainName value to set. + * @return the ThreatIntelligenceKillChainPhase object itself. + */ + public ThreatIntelligenceKillChainPhase withKillChainName(String killChainName) { + this.killChainName = killChainName; + return this; + } + + /** + * Get the phaseName property: Phase name. + * + * @return the phaseName value. + */ + public String phaseName() { + return this.phaseName; + } + + /** + * Set the phaseName property: Phase name. + * + * @param phaseName the phaseName value to set. + * @return the ThreatIntelligenceKillChainPhase object itself. + */ + public ThreatIntelligenceKillChainPhase withPhaseName(String phaseName) { + this.phaseName = phaseName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceMetric.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceMetric.java new file mode 100644 index 000000000000..e6908d798b44 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceMetric.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes threat intelligence metric. */ +@Fluent +public final class ThreatIntelligenceMetric { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligenceMetric.class); + + /* + * Last updated indicator metric + */ + @JsonProperty(value = "lastUpdatedTimeUtc") + private String lastUpdatedTimeUtc; + + /* + * Threat type metrics + */ + @JsonProperty(value = "threatTypeMetrics") + private List threatTypeMetrics; + + /* + * Pattern type metrics + */ + @JsonProperty(value = "patternTypeMetrics") + private List patternTypeMetrics; + + /* + * Source metrics + */ + @JsonProperty(value = "sourceMetrics") + private List sourceMetrics; + + /** + * Get the lastUpdatedTimeUtc property: Last updated indicator metric. + * + * @return the lastUpdatedTimeUtc value. + */ + public String lastUpdatedTimeUtc() { + return this.lastUpdatedTimeUtc; + } + + /** + * Set the lastUpdatedTimeUtc property: Last updated indicator metric. + * + * @param lastUpdatedTimeUtc the lastUpdatedTimeUtc value to set. + * @return the ThreatIntelligenceMetric object itself. + */ + public ThreatIntelligenceMetric withLastUpdatedTimeUtc(String lastUpdatedTimeUtc) { + this.lastUpdatedTimeUtc = lastUpdatedTimeUtc; + return this; + } + + /** + * Get the threatTypeMetrics property: Threat type metrics. + * + * @return the threatTypeMetrics value. + */ + public List threatTypeMetrics() { + return this.threatTypeMetrics; + } + + /** + * Set the threatTypeMetrics property: Threat type metrics. + * + * @param threatTypeMetrics the threatTypeMetrics value to set. + * @return the ThreatIntelligenceMetric object itself. + */ + public ThreatIntelligenceMetric withThreatTypeMetrics(List threatTypeMetrics) { + this.threatTypeMetrics = threatTypeMetrics; + return this; + } + + /** + * Get the patternTypeMetrics property: Pattern type metrics. + * + * @return the patternTypeMetrics value. + */ + public List patternTypeMetrics() { + return this.patternTypeMetrics; + } + + /** + * Set the patternTypeMetrics property: Pattern type metrics. + * + * @param patternTypeMetrics the patternTypeMetrics value to set. + * @return the ThreatIntelligenceMetric object itself. + */ + public ThreatIntelligenceMetric withPatternTypeMetrics(List patternTypeMetrics) { + this.patternTypeMetrics = patternTypeMetrics; + return this; + } + + /** + * Get the sourceMetrics property: Source metrics. + * + * @return the sourceMetrics value. + */ + public List sourceMetrics() { + return this.sourceMetrics; + } + + /** + * Set the sourceMetrics property: Source metrics. + * + * @param sourceMetrics the sourceMetrics value to set. + * @return the ThreatIntelligenceMetric object itself. + */ + public ThreatIntelligenceMetric withSourceMetrics(List sourceMetrics) { + this.sourceMetrics = sourceMetrics; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (threatTypeMetrics() != null) { + threatTypeMetrics().forEach(e -> e.validate()); + } + if (patternTypeMetrics() != null) { + patternTypeMetrics().forEach(e -> e.validate()); + } + if (sourceMetrics() != null) { + sourceMetrics().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceMetricEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceMetricEntity.java new file mode 100644 index 000000000000..76bcef1ea3b7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceMetricEntity.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes threat intelligence metric entity. */ +@Fluent +public final class ThreatIntelligenceMetricEntity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligenceMetricEntity.class); + + /* + * Metric name + */ + @JsonProperty(value = "metricName") + private String metricName; + + /* + * Metric value + */ + @JsonProperty(value = "metricValue") + private Integer metricValue; + + /** + * Get the metricName property: Metric name. + * + * @return the metricName value. + */ + public String metricName() { + return this.metricName; + } + + /** + * Set the metricName property: Metric name. + * + * @param metricName the metricName value to set. + * @return the ThreatIntelligenceMetricEntity object itself. + */ + public ThreatIntelligenceMetricEntity withMetricName(String metricName) { + this.metricName = metricName; + return this; + } + + /** + * Get the metricValue property: Metric value. + * + * @return the metricValue value. + */ + public Integer metricValue() { + return this.metricValue; + } + + /** + * Set the metricValue property: Metric value. + * + * @param metricValue the metricValue value to set. + * @return the ThreatIntelligenceMetricEntity object itself. + */ + public ThreatIntelligenceMetricEntity withMetricValue(Integer metricValue) { + this.metricValue = metricValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceMetrics.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceMetrics.java new file mode 100644 index 000000000000..ca15ec8e365e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceMetrics.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Threat intelligence metrics. */ +@Fluent +public final class ThreatIntelligenceMetrics { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligenceMetrics.class); + + /* + * Threat intelligence metrics. + */ + @JsonProperty(value = "properties") + private ThreatIntelligenceMetric properties; + + /** + * Get the properties property: Threat intelligence metrics. + * + * @return the properties value. + */ + public ThreatIntelligenceMetric properties() { + return this.properties; + } + + /** + * Set the properties property: Threat intelligence metrics. + * + * @param properties the properties value to set. + * @return the ThreatIntelligenceMetrics object itself. + */ + public ThreatIntelligenceMetrics withProperties(ThreatIntelligenceMetric properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceMetricsList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceMetricsList.java new file mode 100644 index 000000000000..53a026fb4cb7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceMetricsList.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceMetricsListInner; +import java.util.List; + +/** An immutable client-side representation of ThreatIntelligenceMetricsList. */ +public interface ThreatIntelligenceMetricsList { + /** + * Gets the value property: Array of threat intelligence metric fields (type/threat type/source). + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceMetricsListInner + * object. + * + * @return the inner object. + */ + ThreatIntelligenceMetricsListInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceParsedPattern.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceParsedPattern.java new file mode 100644 index 000000000000..a3b93804b2de --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceParsedPattern.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes parsed pattern entity. */ +@Fluent +public final class ThreatIntelligenceParsedPattern { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligenceParsedPattern.class); + + /* + * Pattern type key + */ + @JsonProperty(value = "patternTypeKey") + private String patternTypeKey; + + /* + * Pattern type keys + */ + @JsonProperty(value = "patternTypeValues") + private List patternTypeValues; + + /** + * Get the patternTypeKey property: Pattern type key. + * + * @return the patternTypeKey value. + */ + public String patternTypeKey() { + return this.patternTypeKey; + } + + /** + * Set the patternTypeKey property: Pattern type key. + * + * @param patternTypeKey the patternTypeKey value to set. + * @return the ThreatIntelligenceParsedPattern object itself. + */ + public ThreatIntelligenceParsedPattern withPatternTypeKey(String patternTypeKey) { + this.patternTypeKey = patternTypeKey; + return this; + } + + /** + * Get the patternTypeValues property: Pattern type keys. + * + * @return the patternTypeValues value. + */ + public List patternTypeValues() { + return this.patternTypeValues; + } + + /** + * Set the patternTypeValues property: Pattern type keys. + * + * @param patternTypeValues the patternTypeValues value to set. + * @return the ThreatIntelligenceParsedPattern object itself. + */ + public ThreatIntelligenceParsedPattern withPatternTypeValues( + List patternTypeValues) { + this.patternTypeValues = patternTypeValues; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (patternTypeValues() != null) { + patternTypeValues().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceParsedPatternTypeValue.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceParsedPatternTypeValue.java new file mode 100644 index 000000000000..6c0aaaecb6d5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceParsedPatternTypeValue.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes threat kill chain phase entity. */ +@Fluent +public final class ThreatIntelligenceParsedPatternTypeValue { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligenceParsedPatternTypeValue.class); + + /* + * Type of the value + */ + @JsonProperty(value = "valueType") + private String valueType; + + /* + * Value of parsed pattern + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the valueType property: Type of the value. + * + * @return the valueType value. + */ + public String valueType() { + return this.valueType; + } + + /** + * Set the valueType property: Type of the value. + * + * @param valueType the valueType value to set. + * @return the ThreatIntelligenceParsedPatternTypeValue object itself. + */ + public ThreatIntelligenceParsedPatternTypeValue withValueType(String valueType) { + this.valueType = valueType; + return this; + } + + /** + * Get the value property: Value of parsed pattern. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Value of parsed pattern. + * + * @param value the value value to set. + * @return the ThreatIntelligenceParsedPatternTypeValue object itself. + */ + public ThreatIntelligenceParsedPatternTypeValue withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceResourceKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceResourceKind.java new file mode 100644 index 000000000000..d704e32ab418 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceResourceKind.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes an entity with kind. */ +@Fluent +public class ThreatIntelligenceResourceKind { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligenceResourceKind.class); + + /* + * The kind of the entity. + */ + @JsonProperty(value = "kind", required = true) + private ThreatIntelligenceResourceKindEnum kind; + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + public ThreatIntelligenceResourceKindEnum kind() { + return this.kind; + } + + /** + * Set the kind property: The kind of the entity. + * + * @param kind the kind value to set. + * @return the ThreatIntelligenceResourceKind object itself. + */ + public ThreatIntelligenceResourceKind withKind(ThreatIntelligenceResourceKindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (kind() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property kind in model ThreatIntelligenceResourceKind")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceResourceKindEnum.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceResourceKindEnum.java new file mode 100644 index 000000000000..b0ffaf6441dc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceResourceKindEnum.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ThreatIntelligenceResourceKindEnum. */ +public final class ThreatIntelligenceResourceKindEnum extends ExpandableStringEnum { + /** Static value indicator for ThreatIntelligenceResourceKindEnum. */ + public static final ThreatIntelligenceResourceKindEnum INDICATOR = fromString("indicator"); + + /** + * Creates or finds a ThreatIntelligenceResourceKindEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding ThreatIntelligenceResourceKindEnum. + */ + @JsonCreator + public static ThreatIntelligenceResourceKindEnum fromString(String name) { + return fromString(name, ThreatIntelligenceResourceKindEnum.class); + } + + /** @return known ThreatIntelligenceResourceKindEnum values. */ + public static Collection values() { + return values(ThreatIntelligenceResourceKindEnum.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceSortingCriteria.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceSortingCriteria.java new file mode 100644 index 000000000000..f6cd65e9f719 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceSortingCriteria.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** List of available columns for sorting. */ +@Fluent +public final class ThreatIntelligenceSortingCriteria { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThreatIntelligenceSortingCriteria.class); + + /* + * Column name + */ + @JsonProperty(value = "itemKey") + private String itemKey; + + /* + * Sorting order (ascending/descending/unsorted). + */ + @JsonProperty(value = "sortOrder") + private ThreatIntelligenceSortingCriteriaEnum sortOrder; + + /** + * Get the itemKey property: Column name. + * + * @return the itemKey value. + */ + public String itemKey() { + return this.itemKey; + } + + /** + * Set the itemKey property: Column name. + * + * @param itemKey the itemKey value to set. + * @return the ThreatIntelligenceSortingCriteria object itself. + */ + public ThreatIntelligenceSortingCriteria withItemKey(String itemKey) { + this.itemKey = itemKey; + return this; + } + + /** + * Get the sortOrder property: Sorting order (ascending/descending/unsorted). + * + * @return the sortOrder value. + */ + public ThreatIntelligenceSortingCriteriaEnum sortOrder() { + return this.sortOrder; + } + + /** + * Set the sortOrder property: Sorting order (ascending/descending/unsorted). + * + * @param sortOrder the sortOrder value to set. + * @return the ThreatIntelligenceSortingCriteria object itself. + */ + public ThreatIntelligenceSortingCriteria withSortOrder(ThreatIntelligenceSortingCriteriaEnum sortOrder) { + this.sortOrder = sortOrder; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceSortingCriteriaEnum.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceSortingCriteriaEnum.java new file mode 100644 index 000000000000..05aadaac1651 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceSortingCriteriaEnum.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ThreatIntelligenceSortingCriteriaEnum. */ +public final class ThreatIntelligenceSortingCriteriaEnum + extends ExpandableStringEnum { + /** Static value unsorted for ThreatIntelligenceSortingCriteriaEnum. */ + public static final ThreatIntelligenceSortingCriteriaEnum UNSORTED = fromString("unsorted"); + + /** Static value ascending for ThreatIntelligenceSortingCriteriaEnum. */ + public static final ThreatIntelligenceSortingCriteriaEnum ASCENDING = fromString("ascending"); + + /** Static value descending for ThreatIntelligenceSortingCriteriaEnum. */ + public static final ThreatIntelligenceSortingCriteriaEnum DESCENDING = fromString("descending"); + + /** + * Creates or finds a ThreatIntelligenceSortingCriteriaEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding ThreatIntelligenceSortingCriteriaEnum. + */ + @JsonCreator + public static ThreatIntelligenceSortingCriteriaEnum fromString(String name) { + return fromString(name, ThreatIntelligenceSortingCriteriaEnum.class); + } + + /** @return known ThreatIntelligenceSortingCriteriaEnum values. */ + public static Collection values() { + return values(ThreatIntelligenceSortingCriteriaEnum.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiCheckRequirements.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiCheckRequirements.java new file mode 100644 index 000000000000..19f419e56777 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiCheckRequirements.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.TiTaxiiCheckRequirementsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Threat Intelligence TAXII data connector check requirements. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("ThreatIntelligenceTaxii") +@Fluent +public final class TiTaxiiCheckRequirements extends DataConnectorsCheckRequirements { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TiTaxiiCheckRequirements.class); + + /* + * Threat Intelligence TAXII check required properties. + */ + @JsonProperty(value = "properties") + private TiTaxiiCheckRequirementsProperties innerProperties; + + /** + * Get the innerProperties property: Threat Intelligence TAXII check required properties. + * + * @return the innerProperties value. + */ + private TiTaxiiCheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiDataConnector.java new file mode 100644 index 000000000000..6a97a1989ab4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiDataConnector.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.TiTaxiiDataConnectorProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** Data connector to pull Threat intelligence data from TAXII 2.0/2.1 server. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("ThreatIntelligenceTaxii") +@Fluent +public final class TiTaxiiDataConnector extends DataConnectorInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TiTaxiiDataConnector.class); + + /* + * Threat intelligence TAXII data connector properties. + */ + @JsonProperty(value = "properties") + private TiTaxiiDataConnectorProperties innerProperties; + + /** + * Get the innerProperties property: Threat intelligence TAXII data connector properties. + * + * @return the innerProperties value. + */ + private TiTaxiiDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public TiTaxiiDataConnector withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the workspaceId property: The workspace id. + * + * @return the workspaceId value. + */ + public String workspaceId() { + return this.innerProperties() == null ? null : this.innerProperties().workspaceId(); + } + + /** + * Set the workspaceId property: The workspace id. + * + * @param workspaceId the workspaceId value to set. + * @return the TiTaxiiDataConnector object itself. + */ + public TiTaxiiDataConnector withWorkspaceId(String workspaceId) { + if (this.innerProperties() == null) { + this.innerProperties = new TiTaxiiDataConnectorProperties(); + } + this.innerProperties().withWorkspaceId(workspaceId); + return this; + } + + /** + * Get the friendlyName property: The friendly name for the TAXII server. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Set the friendlyName property: The friendly name for the TAXII server. + * + * @param friendlyName the friendlyName value to set. + * @return the TiTaxiiDataConnector object itself. + */ + public TiTaxiiDataConnector withFriendlyName(String friendlyName) { + if (this.innerProperties() == null) { + this.innerProperties = new TiTaxiiDataConnectorProperties(); + } + this.innerProperties().withFriendlyName(friendlyName); + return this; + } + + /** + * Get the taxiiServer property: The API root for the TAXII server. + * + * @return the taxiiServer value. + */ + public String taxiiServer() { + return this.innerProperties() == null ? null : this.innerProperties().taxiiServer(); + } + + /** + * Set the taxiiServer property: The API root for the TAXII server. + * + * @param taxiiServer the taxiiServer value to set. + * @return the TiTaxiiDataConnector object itself. + */ + public TiTaxiiDataConnector withTaxiiServer(String taxiiServer) { + if (this.innerProperties() == null) { + this.innerProperties = new TiTaxiiDataConnectorProperties(); + } + this.innerProperties().withTaxiiServer(taxiiServer); + return this; + } + + /** + * Get the collectionId property: The collection id of the TAXII server. + * + * @return the collectionId value. + */ + public String collectionId() { + return this.innerProperties() == null ? null : this.innerProperties().collectionId(); + } + + /** + * Set the collectionId property: The collection id of the TAXII server. + * + * @param collectionId the collectionId value to set. + * @return the TiTaxiiDataConnector object itself. + */ + public TiTaxiiDataConnector withCollectionId(String collectionId) { + if (this.innerProperties() == null) { + this.innerProperties = new TiTaxiiDataConnectorProperties(); + } + this.innerProperties().withCollectionId(collectionId); + return this; + } + + /** + * Get the username property: The userName for the TAXII server. + * + * @return the username value. + */ + public String username() { + return this.innerProperties() == null ? null : this.innerProperties().username(); + } + + /** + * Set the username property: The userName for the TAXII server. + * + * @param username the username value to set. + * @return the TiTaxiiDataConnector object itself. + */ + public TiTaxiiDataConnector withUsername(String username) { + if (this.innerProperties() == null) { + this.innerProperties = new TiTaxiiDataConnectorProperties(); + } + this.innerProperties().withUsername(username); + return this; + } + + /** + * Get the password property: The password for the TAXII server. + * + * @return the password value. + */ + public String password() { + return this.innerProperties() == null ? null : this.innerProperties().password(); + } + + /** + * Set the password property: The password for the TAXII server. + * + * @param password the password value to set. + * @return the TiTaxiiDataConnector object itself. + */ + public TiTaxiiDataConnector withPassword(String password) { + if (this.innerProperties() == null) { + this.innerProperties = new TiTaxiiDataConnectorProperties(); + } + this.innerProperties().withPassword(password); + return this; + } + + /** + * Get the taxiiLookbackPeriod property: The lookback period for the TAXII server. + * + * @return the taxiiLookbackPeriod value. + */ + public OffsetDateTime taxiiLookbackPeriod() { + return this.innerProperties() == null ? null : this.innerProperties().taxiiLookbackPeriod(); + } + + /** + * Set the taxiiLookbackPeriod property: The lookback period for the TAXII server. + * + * @param taxiiLookbackPeriod the taxiiLookbackPeriod value to set. + * @return the TiTaxiiDataConnector object itself. + */ + public TiTaxiiDataConnector withTaxiiLookbackPeriod(OffsetDateTime taxiiLookbackPeriod) { + if (this.innerProperties() == null) { + this.innerProperties = new TiTaxiiDataConnectorProperties(); + } + this.innerProperties().withTaxiiLookbackPeriod(taxiiLookbackPeriod); + return this; + } + + /** + * Get the pollingFrequency property: The polling frequency for the TAXII server. + * + * @return the pollingFrequency value. + */ + public PollingFrequency pollingFrequency() { + return this.innerProperties() == null ? null : this.innerProperties().pollingFrequency(); + } + + /** + * Set the pollingFrequency property: The polling frequency for the TAXII server. + * + * @param pollingFrequency the pollingFrequency value to set. + * @return the TiTaxiiDataConnector object itself. + */ + public TiTaxiiDataConnector withPollingFrequency(PollingFrequency pollingFrequency) { + if (this.innerProperties() == null) { + this.innerProperties = new TiTaxiiDataConnectorProperties(); + } + this.innerProperties().withPollingFrequency(pollingFrequency); + return this; + } + + /** + * Get the dataTypes property: The available data types for Threat Intelligence TAXII data connector. + * + * @return the dataTypes value. + */ + public TiTaxiiDataConnectorDataTypes dataTypes() { + return this.innerProperties() == null ? null : this.innerProperties().dataTypes(); + } + + /** + * Set the dataTypes property: The available data types for Threat Intelligence TAXII data connector. + * + * @param dataTypes the dataTypes value to set. + * @return the TiTaxiiDataConnector object itself. + */ + public TiTaxiiDataConnector withDataTypes(TiTaxiiDataConnectorDataTypes dataTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new TiTaxiiDataConnectorProperties(); + } + this.innerProperties().withDataTypes(dataTypes); + return this; + } + + /** + * Get the tenantId property: The tenant id to connect to, and get the data from. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Set the tenantId property: The tenant id to connect to, and get the data from. + * + * @param tenantId the tenantId value to set. + * @return the TiTaxiiDataConnector object itself. + */ + public TiTaxiiDataConnector withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new TiTaxiiDataConnectorProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiDataConnectorDataTypes.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiDataConnectorDataTypes.java new file mode 100644 index 000000000000..73823dba1c38 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiDataConnectorDataTypes.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The available data types for Threat Intelligence TAXII data connector. */ +@Fluent +public final class TiTaxiiDataConnectorDataTypes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TiTaxiiDataConnectorDataTypes.class); + + /* + * Data type for TAXII connector. + */ + @JsonProperty(value = "taxiiClient", required = true) + private TiTaxiiDataConnectorDataTypesTaxiiClient taxiiClient; + + /** + * Get the taxiiClient property: Data type for TAXII connector. + * + * @return the taxiiClient value. + */ + public TiTaxiiDataConnectorDataTypesTaxiiClient taxiiClient() { + return this.taxiiClient; + } + + /** + * Set the taxiiClient property: Data type for TAXII connector. + * + * @param taxiiClient the taxiiClient value to set. + * @return the TiTaxiiDataConnectorDataTypes object itself. + */ + public TiTaxiiDataConnectorDataTypes withTaxiiClient(TiTaxiiDataConnectorDataTypesTaxiiClient taxiiClient) { + this.taxiiClient = taxiiClient; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (taxiiClient() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property taxiiClient in model TiTaxiiDataConnectorDataTypes")); + } else { + taxiiClient().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiDataConnectorDataTypesTaxiiClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiDataConnectorDataTypesTaxiiClient.java new file mode 100644 index 000000000000..675cc954414e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiDataConnectorDataTypesTaxiiClient.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Data type for TAXII connector. */ +@Fluent +public final class TiTaxiiDataConnectorDataTypesTaxiiClient extends DataConnectorDataTypeCommon { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TiTaxiiDataConnectorDataTypesTaxiiClient.class); + + /** {@inheritDoc} */ + @Override + public TiTaxiiDataConnectorDataTypesTaxiiClient withState(DataTypeState state) { + super.withState(state); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TimelineAggregation.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TimelineAggregation.java new file mode 100644 index 000000000000..d100c569680d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TimelineAggregation.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** timeline aggregation information per kind. */ +@Fluent +public final class TimelineAggregation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TimelineAggregation.class); + + /* + * the total items found for a kind + */ + @JsonProperty(value = "count", required = true) + private int count; + + /* + * the query kind + */ + @JsonProperty(value = "kind", required = true) + private EntityTimelineKind kind; + + /** + * Get the count property: the total items found for a kind. + * + * @return the count value. + */ + public int count() { + return this.count; + } + + /** + * Set the count property: the total items found for a kind. + * + * @param count the count value to set. + * @return the TimelineAggregation object itself. + */ + public TimelineAggregation withCount(int count) { + this.count = count; + return this; + } + + /** + * Get the kind property: the query kind. + * + * @return the kind value. + */ + public EntityTimelineKind kind() { + return this.kind; + } + + /** + * Set the kind property: the query kind. + * + * @param kind the kind value to set. + * @return the TimelineAggregation object itself. + */ + public TimelineAggregation withKind(EntityTimelineKind kind) { + this.kind = kind; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (kind() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property kind in model TimelineAggregation")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TimelineError.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TimelineError.java new file mode 100644 index 000000000000..f7f475a03db3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TimelineError.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Timeline Query Errors. */ +@Fluent +public final class TimelineError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TimelineError.class); + + /* + * the query kind + */ + @JsonProperty(value = "kind", required = true) + private EntityTimelineKind kind; + + /* + * the query id + */ + @JsonProperty(value = "queryId") + private String queryId; + + /* + * the error message + */ + @JsonProperty(value = "errorMessage", required = true) + private String errorMessage; + + /** + * Get the kind property: the query kind. + * + * @return the kind value. + */ + public EntityTimelineKind kind() { + return this.kind; + } + + /** + * Set the kind property: the query kind. + * + * @param kind the kind value to set. + * @return the TimelineError object itself. + */ + public TimelineError withKind(EntityTimelineKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the queryId property: the query id. + * + * @return the queryId value. + */ + public String queryId() { + return this.queryId; + } + + /** + * Set the queryId property: the query id. + * + * @param queryId the queryId value to set. + * @return the TimelineError object itself. + */ + public TimelineError withQueryId(String queryId) { + this.queryId = queryId; + return this; + } + + /** + * Get the errorMessage property: the error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: the error message. + * + * @param errorMessage the errorMessage value to set. + * @return the TimelineError object itself. + */ + public TimelineError withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (kind() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property kind in model TimelineError")); + } + if (errorMessage() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property errorMessage in model TimelineError")); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TimelineResultsMetadata.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TimelineResultsMetadata.java new file mode 100644 index 000000000000..4956524ffe57 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TimelineResultsMetadata.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Expansion result metadata. */ +@Fluent +public final class TimelineResultsMetadata { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TimelineResultsMetadata.class); + + /* + * the total items found for the timeline request + */ + @JsonProperty(value = "totalCount", required = true) + private int totalCount; + + /* + * timeline aggregation per kind + */ + @JsonProperty(value = "aggregations", required = true) + private List aggregations; + + /* + * information about the failure queries + */ + @JsonProperty(value = "errors") + private List errors; + + /** + * Get the totalCount property: the total items found for the timeline request. + * + * @return the totalCount value. + */ + public int totalCount() { + return this.totalCount; + } + + /** + * Set the totalCount property: the total items found for the timeline request. + * + * @param totalCount the totalCount value to set. + * @return the TimelineResultsMetadata object itself. + */ + public TimelineResultsMetadata withTotalCount(int totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Get the aggregations property: timeline aggregation per kind. + * + * @return the aggregations value. + */ + public List aggregations() { + return this.aggregations; + } + + /** + * Set the aggregations property: timeline aggregation per kind. + * + * @param aggregations the aggregations value to set. + * @return the TimelineResultsMetadata object itself. + */ + public TimelineResultsMetadata withAggregations(List aggregations) { + this.aggregations = aggregations; + return this; + } + + /** + * Get the errors property: information about the failure queries. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Set the errors property: information about the failure queries. + * + * @param errors the errors value to set. + * @return the TimelineResultsMetadata object itself. + */ + public TimelineResultsMetadata withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (aggregations() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property aggregations in model TimelineResultsMetadata")); + } else { + aggregations().forEach(e -> e.validate()); + } + if (errors() != null) { + errors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TriggerOperator.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TriggerOperator.java new file mode 100644 index 000000000000..ebb5a2f689ba --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TriggerOperator.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for TriggerOperator. */ +public enum TriggerOperator { + /** Enum value GreaterThan. */ + GREATER_THAN("GreaterThan"), + + /** Enum value LessThan. */ + LESS_THAN("LessThan"), + + /** Enum value Equal. */ + EQUAL("Equal"), + + /** Enum value NotEqual. */ + NOT_EQUAL("NotEqual"); + + /** The actual serialized value for a TriggerOperator instance. */ + private final String value; + + TriggerOperator(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a TriggerOperator instance. + * + * @param value the serialized value to parse. + * @return the parsed TriggerOperator object, or null if unable to parse. + */ + @JsonCreator + public static TriggerOperator fromString(String value) { + TriggerOperator[] items = TriggerOperator.values(); + for (TriggerOperator item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TriggersOn.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TriggersOn.java new file mode 100644 index 000000000000..c73fbee08aac --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TriggersOn.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TriggersOn. */ +public final class TriggersOn extends ExpandableStringEnum { + /** Static value Incidents for TriggersOn. */ + public static final TriggersOn INCIDENTS = fromString("Incidents"); + + /** + * Creates or finds a TriggersOn from its string representation. + * + * @param name a name to look for. + * @return the corresponding TriggersOn. + */ + @JsonCreator + public static TriggersOn fromString(String name) { + return fromString(name, TriggersOn.class); + } + + /** @return known TriggersOn values. */ + public static Collection values() { + return values(TriggersOn.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TriggersWhen.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TriggersWhen.java new file mode 100644 index 000000000000..29dbbd689ded --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TriggersWhen.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TriggersWhen. */ +public final class TriggersWhen extends ExpandableStringEnum { + /** Static value Created for TriggersWhen. */ + public static final TriggersWhen CREATED = fromString("Created"); + + /** + * Creates or finds a TriggersWhen from its string representation. + * + * @param name a name to look for. + * @return the corresponding TriggersWhen. + */ + @JsonCreator + public static TriggersWhen fromString(String name) { + return fromString(name, TriggersWhen.class); + } + + /** @return known TriggersWhen values. */ + public static Collection values() { + return values(TriggersWhen.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Ueba.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Ueba.java new file mode 100644 index 000000000000..b9052d5b8aaa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Ueba.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; +import com.azure.resourcemanager.securityinsights.fluent.models.UebaProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Settings with single toggle. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Ueba") +@Fluent +public final class Ueba extends SettingsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Ueba.class); + + /* + * Ueba properties + */ + @JsonProperty(value = "properties") + private UebaProperties innerProperties; + + /** + * Get the innerProperties property: Ueba properties. + * + * @return the innerProperties value. + */ + private UebaProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public Ueba withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the dataSources property: The relevant data sources that enriched by ueba. + * + * @return the dataSources value. + */ + public List dataSources() { + return this.innerProperties() == null ? null : this.innerProperties().dataSources(); + } + + /** + * Set the dataSources property: The relevant data sources that enriched by ueba. + * + * @param dataSources the dataSources value to set. + * @return the Ueba object itself. + */ + public Ueba withDataSources(List dataSources) { + if (this.innerProperties() == null) { + this.innerProperties = new UebaProperties(); + } + this.innerProperties().withDataSources(dataSources); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/UebaDataSources.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/UebaDataSources.java new file mode 100644 index 000000000000..b578ba22ce72 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/UebaDataSources.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UebaDataSources. */ +public final class UebaDataSources extends ExpandableStringEnum { + /** Static value AuditLogs for UebaDataSources. */ + public static final UebaDataSources AUDIT_LOGS = fromString("AuditLogs"); + + /** Static value AzureActivity for UebaDataSources. */ + public static final UebaDataSources AZURE_ACTIVITY = fromString("AzureActivity"); + + /** Static value SecurityEvent for UebaDataSources. */ + public static final UebaDataSources SECURITY_EVENT = fromString("SecurityEvent"); + + /** Static value SigninLogs for UebaDataSources. */ + public static final UebaDataSources SIGNIN_LOGS = fromString("SigninLogs"); + + /** + * Creates or finds a UebaDataSources from its string representation. + * + * @param name a name to look for. + * @return the corresponding UebaDataSources. + */ + @JsonCreator + public static UebaDataSources fromString(String name) { + return fromString(name, UebaDataSources.class); + } + + /** @return known UebaDataSources values. */ + public static Collection values() { + return values(UebaDataSources.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/UrlEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/UrlEntity.java new file mode 100644 index 000000000000..798fa401ce88 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/UrlEntity.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; +import com.azure.resourcemanager.securityinsights.fluent.models.UrlEntityProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** Represents a url entity. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Url") +@Fluent +public final class UrlEntity extends EntityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UrlEntity.class); + + /* + * Url entity properties + */ + @JsonProperty(value = "properties") + private UrlEntityProperties innerProperties; + + /** + * Get the innerProperties property: Url entity properties. + * + * @return the innerProperties value. + */ + private UrlEntityProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the url property: A full URL the entity points to. + * + * @return the url value. + */ + public String url() { + return this.innerProperties() == null ? null : this.innerProperties().url(); + } + + /** + * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented + * to the user. + * + * @return the additionalData value. + */ + public Map additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + } + + /** + * Get the friendlyName property: The graph item display name which is a short humanly readable description of the + * graph item instance. This property is optional and might be system generated. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/UserInfo.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/UserInfo.java new file mode 100644 index 000000000000..e5d3e8c2af42 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/UserInfo.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** User information that made some action. */ +@Fluent +public final class UserInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserInfo.class); + + /* + * The email of the user. + */ + @JsonProperty(value = "email", access = JsonProperty.Access.WRITE_ONLY) + private String email; + + /* + * The name of the user. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The object id of the user. + */ + @JsonProperty(value = "objectId") + private UUID objectId; + + /** + * Get the email property: The email of the user. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Get the name property: The name of the user. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the objectId property: The object id of the user. + * + * @return the objectId value. + */ + public UUID objectId() { + return this.objectId; + } + + /** + * Set the objectId property: The object id of the user. + * + * @param objectId the objectId value to set. + * @return the UserInfo object itself. + */ + public UserInfo withObjectId(UUID objectId) { + this.objectId = objectId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Watchlist.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Watchlist.java new file mode 100644 index 000000000000..e2985e7cf91b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Watchlist.java @@ -0,0 +1,795 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.WatchlistInner; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of Watchlist. */ +public interface Watchlist { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the watchlistId property: The id (a Guid) of the watchlist. + * + * @return the watchlistId value. + */ + String watchlistId(); + + /** + * Gets the displayName property: The display name of the watchlist. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the provider property: The provider of the watchlist. + * + * @return the provider value. + */ + String provider(); + + /** + * Gets the source property: The source of the watchlist. + * + * @return the source value. + */ + Source source(); + + /** + * Gets the created property: The time the watchlist was created. + * + * @return the created value. + */ + OffsetDateTime created(); + + /** + * Gets the updated property: The last time the watchlist was updated. + * + * @return the updated value. + */ + OffsetDateTime updated(); + + /** + * Gets the createdBy property: Describes a user that created the watchlist. + * + * @return the createdBy value. + */ + UserInfo createdBy(); + + /** + * Gets the updatedBy property: Describes a user that updated the watchlist. + * + * @return the updatedBy value. + */ + UserInfo updatedBy(); + + /** + * Gets the description property: A description of the watchlist. + * + * @return the description value. + */ + String description(); + + /** + * Gets the watchlistType property: The type of the watchlist. + * + * @return the watchlistType value. + */ + String watchlistType(); + + /** + * Gets the watchlistAlias property: The alias of the watchlist. + * + * @return the watchlistAlias value. + */ + String watchlistAlias(); + + /** + * Gets the isDeleted property: A flag that indicates if the watchlist is deleted or not. + * + * @return the isDeleted value. + */ + Boolean isDeleted(); + + /** + * Gets the labels property: List of labels relevant to this watchlist. + * + * @return the labels value. + */ + List labels(); + + /** + * Gets the defaultDuration property: The default duration of a watchlist (in ISO 8601 duration format). + * + * @return the defaultDuration value. + */ + Duration defaultDuration(); + + /** + * Gets the tenantId property: The tenantId where the watchlist belongs to. + * + * @return the tenantId value. + */ + String tenantId(); + + /** + * Gets the numberOfLinesToSkip property: The number of lines in a csv/tsv content to skip before the header. + * + * @return the numberOfLinesToSkip value. + */ + Integer numberOfLinesToSkip(); + + /** + * Gets the rawContent property: The raw content that represents to watchlist items to create. In case of csv/tsv + * content type, it's the content of the file that will parsed by the endpoint. + * + * @return the rawContent value. + */ + String rawContent(); + + /** + * Gets the itemsSearchKey property: The search key is used to optimize query performance when using watchlists for + * joins with other data. For example, enable a column with IP addresses to be the designated SearchKey field, then + * use this field as the key field when joining to other event data by IP address. + * + * @return the itemsSearchKey value. + */ + String itemsSearchKey(); + + /** + * Gets the contentType property: The content type of the raw content. Example : text/csv or text/tsv. + * + * @return the contentType value. + */ + String contentType(); + + /** + * Gets the uploadStatus property: The status of the Watchlist upload : New, InProgress or Complete. Pls note : When + * a Watchlist upload status is equal to InProgress, the Watchlist cannot be deleted. + * + * @return the uploadStatus value. + */ + String uploadStatus(); + + /** + * Gets the watchlistItemsCount property: The number of Watchlist Items in the Watchlist. + * + * @return the watchlistItemsCount value. + */ + Integer watchlistItemsCount(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.WatchlistInner object. + * + * @return the inner object. + */ + WatchlistInner innerModel(); + + /** The entirety of the Watchlist definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Watchlist definition stages. */ + interface DefinitionStages { + /** The first stage of the Watchlist definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Watchlist definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @return the next definition stage. + */ + WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); + } + /** + * The stage of the Watchlist definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithEtag, + DefinitionStages.WithWatchlistId, + DefinitionStages.WithDisplayName, + DefinitionStages.WithProvider, + DefinitionStages.WithSource, + DefinitionStages.WithCreated, + DefinitionStages.WithUpdated, + DefinitionStages.WithCreatedBy, + DefinitionStages.WithUpdatedBy, + DefinitionStages.WithDescription, + DefinitionStages.WithWatchlistType, + DefinitionStages.WithWatchlistAlias, + DefinitionStages.WithIsDeleted, + DefinitionStages.WithLabels, + DefinitionStages.WithDefaultDuration, + DefinitionStages.WithTenantId, + DefinitionStages.WithNumberOfLinesToSkip, + DefinitionStages.WithRawContent, + DefinitionStages.WithItemsSearchKey, + DefinitionStages.WithContentType, + DefinitionStages.WithUploadStatus, + DefinitionStages.WithWatchlistItemsCount { + /** + * Executes the create request. + * + * @return the created resource. + */ + Watchlist create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Watchlist create(Context context); + } + /** The stage of the Watchlist definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Etag of the azure resource. + * + * @param etag Etag of the azure resource. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the Watchlist definition allowing to specify watchlistId. */ + interface WithWatchlistId { + /** + * Specifies the watchlistId property: The id (a Guid) of the watchlist. + * + * @param watchlistId The id (a Guid) of the watchlist. + * @return the next definition stage. + */ + WithCreate withWatchlistId(String watchlistId); + } + /** The stage of the Watchlist definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: The display name of the watchlist. + * + * @param displayName The display name of the watchlist. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the Watchlist definition allowing to specify provider. */ + interface WithProvider { + /** + * Specifies the provider property: The provider of the watchlist. + * + * @param provider The provider of the watchlist. + * @return the next definition stage. + */ + WithCreate withProvider(String provider); + } + /** The stage of the Watchlist definition allowing to specify source. */ + interface WithSource { + /** + * Specifies the source property: The source of the watchlist. + * + * @param source The source of the watchlist. + * @return the next definition stage. + */ + WithCreate withSource(Source source); + } + /** The stage of the Watchlist definition allowing to specify created. */ + interface WithCreated { + /** + * Specifies the created property: The time the watchlist was created. + * + * @param created The time the watchlist was created. + * @return the next definition stage. + */ + WithCreate withCreated(OffsetDateTime created); + } + /** The stage of the Watchlist definition allowing to specify updated. */ + interface WithUpdated { + /** + * Specifies the updated property: The last time the watchlist was updated. + * + * @param updated The last time the watchlist was updated. + * @return the next definition stage. + */ + WithCreate withUpdated(OffsetDateTime updated); + } + /** The stage of the Watchlist definition allowing to specify createdBy. */ + interface WithCreatedBy { + /** + * Specifies the createdBy property: Describes a user that created the watchlist. + * + * @param createdBy Describes a user that created the watchlist. + * @return the next definition stage. + */ + WithCreate withCreatedBy(UserInfo createdBy); + } + /** The stage of the Watchlist definition allowing to specify updatedBy. */ + interface WithUpdatedBy { + /** + * Specifies the updatedBy property: Describes a user that updated the watchlist. + * + * @param updatedBy Describes a user that updated the watchlist. + * @return the next definition stage. + */ + WithCreate withUpdatedBy(UserInfo updatedBy); + } + /** The stage of the Watchlist definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: A description of the watchlist. + * + * @param description A description of the watchlist. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the Watchlist definition allowing to specify watchlistType. */ + interface WithWatchlistType { + /** + * Specifies the watchlistType property: The type of the watchlist. + * + * @param watchlistType The type of the watchlist. + * @return the next definition stage. + */ + WithCreate withWatchlistType(String watchlistType); + } + /** The stage of the Watchlist definition allowing to specify watchlistAlias. */ + interface WithWatchlistAlias { + /** + * Specifies the watchlistAlias property: The alias of the watchlist. + * + * @param watchlistAlias The alias of the watchlist. + * @return the next definition stage. + */ + WithCreate withWatchlistAlias(String watchlistAlias); + } + /** The stage of the Watchlist definition allowing to specify isDeleted. */ + interface WithIsDeleted { + /** + * Specifies the isDeleted property: A flag that indicates if the watchlist is deleted or not. + * + * @param isDeleted A flag that indicates if the watchlist is deleted or not. + * @return the next definition stage. + */ + WithCreate withIsDeleted(Boolean isDeleted); + } + /** The stage of the Watchlist definition allowing to specify labels. */ + interface WithLabels { + /** + * Specifies the labels property: List of labels relevant to this watchlist. + * + * @param labels List of labels relevant to this watchlist. + * @return the next definition stage. + */ + WithCreate withLabels(List labels); + } + /** The stage of the Watchlist definition allowing to specify defaultDuration. */ + interface WithDefaultDuration { + /** + * Specifies the defaultDuration property: The default duration of a watchlist (in ISO 8601 duration + * format). + * + * @param defaultDuration The default duration of a watchlist (in ISO 8601 duration format). + * @return the next definition stage. + */ + WithCreate withDefaultDuration(Duration defaultDuration); + } + /** The stage of the Watchlist definition allowing to specify tenantId. */ + interface WithTenantId { + /** + * Specifies the tenantId property: The tenantId where the watchlist belongs to. + * + * @param tenantId The tenantId where the watchlist belongs to. + * @return the next definition stage. + */ + WithCreate withTenantId(String tenantId); + } + /** The stage of the Watchlist definition allowing to specify numberOfLinesToSkip. */ + interface WithNumberOfLinesToSkip { + /** + * Specifies the numberOfLinesToSkip property: The number of lines in a csv/tsv content to skip before the + * header. + * + * @param numberOfLinesToSkip The number of lines in a csv/tsv content to skip before the header. + * @return the next definition stage. + */ + WithCreate withNumberOfLinesToSkip(Integer numberOfLinesToSkip); + } + /** The stage of the Watchlist definition allowing to specify rawContent. */ + interface WithRawContent { + /** + * Specifies the rawContent property: The raw content that represents to watchlist items to create. In case + * of csv/tsv content type, it's the content of the file that will parsed by the endpoint. + * + * @param rawContent The raw content that represents to watchlist items to create. In case of csv/tsv + * content type, it's the content of the file that will parsed by the endpoint. + * @return the next definition stage. + */ + WithCreate withRawContent(String rawContent); + } + /** The stage of the Watchlist definition allowing to specify itemsSearchKey. */ + interface WithItemsSearchKey { + /** + * Specifies the itemsSearchKey property: The search key is used to optimize query performance when using + * watchlists for joins with other data. For example, enable a column with IP addresses to be the designated + * SearchKey field, then use this field as the key field when joining to other event data by IP address.. + * + * @param itemsSearchKey The search key is used to optimize query performance when using watchlists for + * joins with other data. For example, enable a column with IP addresses to be the designated SearchKey + * field, then use this field as the key field when joining to other event data by IP address. + * @return the next definition stage. + */ + WithCreate withItemsSearchKey(String itemsSearchKey); + } + /** The stage of the Watchlist definition allowing to specify contentType. */ + interface WithContentType { + /** + * Specifies the contentType property: The content type of the raw content. Example : text/csv or text/tsv . + * + * @param contentType The content type of the raw content. Example : text/csv or text/tsv. + * @return the next definition stage. + */ + WithCreate withContentType(String contentType); + } + /** The stage of the Watchlist definition allowing to specify uploadStatus. */ + interface WithUploadStatus { + /** + * Specifies the uploadStatus property: The status of the Watchlist upload : New, InProgress or Complete. + * Pls note : When a Watchlist upload status is equal to InProgress, the Watchlist cannot be deleted. + * + * @param uploadStatus The status of the Watchlist upload : New, InProgress or Complete. Pls note : When a + * Watchlist upload status is equal to InProgress, the Watchlist cannot be deleted. + * @return the next definition stage. + */ + WithCreate withUploadStatus(String uploadStatus); + } + /** The stage of the Watchlist definition allowing to specify watchlistItemsCount. */ + interface WithWatchlistItemsCount { + /** + * Specifies the watchlistItemsCount property: The number of Watchlist Items in the Watchlist. + * + * @param watchlistItemsCount The number of Watchlist Items in the Watchlist. + * @return the next definition stage. + */ + WithCreate withWatchlistItemsCount(Integer watchlistItemsCount); + } + } + /** + * Begins update for the Watchlist resource. + * + * @return the stage of resource update. + */ + Watchlist.Update update(); + + /** The template for Watchlist update. */ + interface Update + extends UpdateStages.WithEtag, + UpdateStages.WithWatchlistId, + UpdateStages.WithDisplayName, + UpdateStages.WithProvider, + UpdateStages.WithSource, + UpdateStages.WithCreated, + UpdateStages.WithUpdated, + UpdateStages.WithCreatedBy, + UpdateStages.WithUpdatedBy, + UpdateStages.WithDescription, + UpdateStages.WithWatchlistType, + UpdateStages.WithWatchlistAlias, + UpdateStages.WithIsDeleted, + UpdateStages.WithLabels, + UpdateStages.WithDefaultDuration, + UpdateStages.WithTenantId, + UpdateStages.WithNumberOfLinesToSkip, + UpdateStages.WithRawContent, + UpdateStages.WithItemsSearchKey, + UpdateStages.WithContentType, + UpdateStages.WithUploadStatus, + UpdateStages.WithWatchlistItemsCount { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Watchlist apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Watchlist apply(Context context); + } + /** The Watchlist update stages. */ + interface UpdateStages { + /** The stage of the Watchlist update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Etag of the azure resource. + * + * @param etag Etag of the azure resource. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + /** The stage of the Watchlist update allowing to specify watchlistId. */ + interface WithWatchlistId { + /** + * Specifies the watchlistId property: The id (a Guid) of the watchlist. + * + * @param watchlistId The id (a Guid) of the watchlist. + * @return the next definition stage. + */ + Update withWatchlistId(String watchlistId); + } + /** The stage of the Watchlist update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: The display name of the watchlist. + * + * @param displayName The display name of the watchlist. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the Watchlist update allowing to specify provider. */ + interface WithProvider { + /** + * Specifies the provider property: The provider of the watchlist. + * + * @param provider The provider of the watchlist. + * @return the next definition stage. + */ + Update withProvider(String provider); + } + /** The stage of the Watchlist update allowing to specify source. */ + interface WithSource { + /** + * Specifies the source property: The source of the watchlist. + * + * @param source The source of the watchlist. + * @return the next definition stage. + */ + Update withSource(Source source); + } + /** The stage of the Watchlist update allowing to specify created. */ + interface WithCreated { + /** + * Specifies the created property: The time the watchlist was created. + * + * @param created The time the watchlist was created. + * @return the next definition stage. + */ + Update withCreated(OffsetDateTime created); + } + /** The stage of the Watchlist update allowing to specify updated. */ + interface WithUpdated { + /** + * Specifies the updated property: The last time the watchlist was updated. + * + * @param updated The last time the watchlist was updated. + * @return the next definition stage. + */ + Update withUpdated(OffsetDateTime updated); + } + /** The stage of the Watchlist update allowing to specify createdBy. */ + interface WithCreatedBy { + /** + * Specifies the createdBy property: Describes a user that created the watchlist. + * + * @param createdBy Describes a user that created the watchlist. + * @return the next definition stage. + */ + Update withCreatedBy(UserInfo createdBy); + } + /** The stage of the Watchlist update allowing to specify updatedBy. */ + interface WithUpdatedBy { + /** + * Specifies the updatedBy property: Describes a user that updated the watchlist. + * + * @param updatedBy Describes a user that updated the watchlist. + * @return the next definition stage. + */ + Update withUpdatedBy(UserInfo updatedBy); + } + /** The stage of the Watchlist update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: A description of the watchlist. + * + * @param description A description of the watchlist. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the Watchlist update allowing to specify watchlistType. */ + interface WithWatchlistType { + /** + * Specifies the watchlistType property: The type of the watchlist. + * + * @param watchlistType The type of the watchlist. + * @return the next definition stage. + */ + Update withWatchlistType(String watchlistType); + } + /** The stage of the Watchlist update allowing to specify watchlistAlias. */ + interface WithWatchlistAlias { + /** + * Specifies the watchlistAlias property: The alias of the watchlist. + * + * @param watchlistAlias The alias of the watchlist. + * @return the next definition stage. + */ + Update withWatchlistAlias(String watchlistAlias); + } + /** The stage of the Watchlist update allowing to specify isDeleted. */ + interface WithIsDeleted { + /** + * Specifies the isDeleted property: A flag that indicates if the watchlist is deleted or not. + * + * @param isDeleted A flag that indicates if the watchlist is deleted or not. + * @return the next definition stage. + */ + Update withIsDeleted(Boolean isDeleted); + } + /** The stage of the Watchlist update allowing to specify labels. */ + interface WithLabels { + /** + * Specifies the labels property: List of labels relevant to this watchlist. + * + * @param labels List of labels relevant to this watchlist. + * @return the next definition stage. + */ + Update withLabels(List labels); + } + /** The stage of the Watchlist update allowing to specify defaultDuration. */ + interface WithDefaultDuration { + /** + * Specifies the defaultDuration property: The default duration of a watchlist (in ISO 8601 duration + * format). + * + * @param defaultDuration The default duration of a watchlist (in ISO 8601 duration format). + * @return the next definition stage. + */ + Update withDefaultDuration(Duration defaultDuration); + } + /** The stage of the Watchlist update allowing to specify tenantId. */ + interface WithTenantId { + /** + * Specifies the tenantId property: The tenantId where the watchlist belongs to. + * + * @param tenantId The tenantId where the watchlist belongs to. + * @return the next definition stage. + */ + Update withTenantId(String tenantId); + } + /** The stage of the Watchlist update allowing to specify numberOfLinesToSkip. */ + interface WithNumberOfLinesToSkip { + /** + * Specifies the numberOfLinesToSkip property: The number of lines in a csv/tsv content to skip before the + * header. + * + * @param numberOfLinesToSkip The number of lines in a csv/tsv content to skip before the header. + * @return the next definition stage. + */ + Update withNumberOfLinesToSkip(Integer numberOfLinesToSkip); + } + /** The stage of the Watchlist update allowing to specify rawContent. */ + interface WithRawContent { + /** + * Specifies the rawContent property: The raw content that represents to watchlist items to create. In case + * of csv/tsv content type, it's the content of the file that will parsed by the endpoint. + * + * @param rawContent The raw content that represents to watchlist items to create. In case of csv/tsv + * content type, it's the content of the file that will parsed by the endpoint. + * @return the next definition stage. + */ + Update withRawContent(String rawContent); + } + /** The stage of the Watchlist update allowing to specify itemsSearchKey. */ + interface WithItemsSearchKey { + /** + * Specifies the itemsSearchKey property: The search key is used to optimize query performance when using + * watchlists for joins with other data. For example, enable a column with IP addresses to be the designated + * SearchKey field, then use this field as the key field when joining to other event data by IP address.. + * + * @param itemsSearchKey The search key is used to optimize query performance when using watchlists for + * joins with other data. For example, enable a column with IP addresses to be the designated SearchKey + * field, then use this field as the key field when joining to other event data by IP address. + * @return the next definition stage. + */ + Update withItemsSearchKey(String itemsSearchKey); + } + /** The stage of the Watchlist update allowing to specify contentType. */ + interface WithContentType { + /** + * Specifies the contentType property: The content type of the raw content. Example : text/csv or text/tsv . + * + * @param contentType The content type of the raw content. Example : text/csv or text/tsv. + * @return the next definition stage. + */ + Update withContentType(String contentType); + } + /** The stage of the Watchlist update allowing to specify uploadStatus. */ + interface WithUploadStatus { + /** + * Specifies the uploadStatus property: The status of the Watchlist upload : New, InProgress or Complete. + * Pls note : When a Watchlist upload status is equal to InProgress, the Watchlist cannot be deleted. + * + * @param uploadStatus The status of the Watchlist upload : New, InProgress or Complete. Pls note : When a + * Watchlist upload status is equal to InProgress, the Watchlist cannot be deleted. + * @return the next definition stage. + */ + Update withUploadStatus(String uploadStatus); + } + /** The stage of the Watchlist update allowing to specify watchlistItemsCount. */ + interface WithWatchlistItemsCount { + /** + * Specifies the watchlistItemsCount property: The number of Watchlist Items in the Watchlist. + * + * @param watchlistItemsCount The number of Watchlist Items in the Watchlist. + * @return the next definition stage. + */ + Update withWatchlistItemsCount(Integer watchlistItemsCount); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Watchlist refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Watchlist refresh(Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistItem.java new file mode 100644 index 000000000000..6689727198df --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistItem.java @@ -0,0 +1,451 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.WatchlistItemInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of WatchlistItem. */ +public interface WatchlistItem { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the watchlistItemType property: The type of the watchlist item. + * + * @return the watchlistItemType value. + */ + String watchlistItemType(); + + /** + * Gets the watchlistItemId property: The id (a Guid) of the watchlist item. + * + * @return the watchlistItemId value. + */ + String watchlistItemId(); + + /** + * Gets the tenantId property: The tenantId to which the watchlist item belongs to. + * + * @return the tenantId value. + */ + String tenantId(); + + /** + * Gets the isDeleted property: A flag that indicates if the watchlist item is deleted or not. + * + * @return the isDeleted value. + */ + Boolean isDeleted(); + + /** + * Gets the created property: The time the watchlist item was created. + * + * @return the created value. + */ + OffsetDateTime created(); + + /** + * Gets the updated property: The last time the watchlist item was updated. + * + * @return the updated value. + */ + OffsetDateTime updated(); + + /** + * Gets the createdBy property: Describes a user that created the watchlist item. + * + * @return the createdBy value. + */ + UserInfo createdBy(); + + /** + * Gets the updatedBy property: Describes a user that updated the watchlist item. + * + * @return the updatedBy value. + */ + UserInfo updatedBy(); + + /** + * Gets the itemsKeyValue property: key-value pairs for a watchlist item. + * + * @return the itemsKeyValue value. + */ + Object itemsKeyValue(); + + /** + * Gets the entityMapping property: key-value pairs for a watchlist item entity mapping. + * + * @return the entityMapping value. + */ + Object entityMapping(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.WatchlistItemInner object. + * + * @return the inner object. + */ + WatchlistItemInner innerModel(); + + /** The entirety of the WatchlistItem definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The WatchlistItem definition stages. */ + interface DefinitionStages { + /** The first stage of the WatchlistItem definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the WatchlistItem definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName, watchlistAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @return the next definition stage. + */ + WithCreate withExistingWatchlist(String resourceGroupName, String workspaceName, String watchlistAlias); + } + /** + * The stage of the WatchlistItem definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithEtag, + DefinitionStages.WithWatchlistItemType, + DefinitionStages.WithWatchlistItemId, + DefinitionStages.WithTenantId, + DefinitionStages.WithIsDeleted, + DefinitionStages.WithCreated, + DefinitionStages.WithUpdated, + DefinitionStages.WithCreatedBy, + DefinitionStages.WithUpdatedBy, + DefinitionStages.WithItemsKeyValue, + DefinitionStages.WithEntityMapping { + /** + * Executes the create request. + * + * @return the created resource. + */ + WatchlistItem create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WatchlistItem create(Context context); + } + /** The stage of the WatchlistItem definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Etag of the azure resource. + * + * @param etag Etag of the azure resource. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the WatchlistItem definition allowing to specify watchlistItemType. */ + interface WithWatchlistItemType { + /** + * Specifies the watchlistItemType property: The type of the watchlist item. + * + * @param watchlistItemType The type of the watchlist item. + * @return the next definition stage. + */ + WithCreate withWatchlistItemType(String watchlistItemType); + } + /** The stage of the WatchlistItem definition allowing to specify watchlistItemId. */ + interface WithWatchlistItemId { + /** + * Specifies the watchlistItemId property: The id (a Guid) of the watchlist item. + * + * @param watchlistItemId The id (a Guid) of the watchlist item. + * @return the next definition stage. + */ + WithCreate withWatchlistItemId(String watchlistItemId); + } + /** The stage of the WatchlistItem definition allowing to specify tenantId. */ + interface WithTenantId { + /** + * Specifies the tenantId property: The tenantId to which the watchlist item belongs to. + * + * @param tenantId The tenantId to which the watchlist item belongs to. + * @return the next definition stage. + */ + WithCreate withTenantId(String tenantId); + } + /** The stage of the WatchlistItem definition allowing to specify isDeleted. */ + interface WithIsDeleted { + /** + * Specifies the isDeleted property: A flag that indicates if the watchlist item is deleted or not. + * + * @param isDeleted A flag that indicates if the watchlist item is deleted or not. + * @return the next definition stage. + */ + WithCreate withIsDeleted(Boolean isDeleted); + } + /** The stage of the WatchlistItem definition allowing to specify created. */ + interface WithCreated { + /** + * Specifies the created property: The time the watchlist item was created. + * + * @param created The time the watchlist item was created. + * @return the next definition stage. + */ + WithCreate withCreated(OffsetDateTime created); + } + /** The stage of the WatchlistItem definition allowing to specify updated. */ + interface WithUpdated { + /** + * Specifies the updated property: The last time the watchlist item was updated. + * + * @param updated The last time the watchlist item was updated. + * @return the next definition stage. + */ + WithCreate withUpdated(OffsetDateTime updated); + } + /** The stage of the WatchlistItem definition allowing to specify createdBy. */ + interface WithCreatedBy { + /** + * Specifies the createdBy property: Describes a user that created the watchlist item. + * + * @param createdBy Describes a user that created the watchlist item. + * @return the next definition stage. + */ + WithCreate withCreatedBy(UserInfo createdBy); + } + /** The stage of the WatchlistItem definition allowing to specify updatedBy. */ + interface WithUpdatedBy { + /** + * Specifies the updatedBy property: Describes a user that updated the watchlist item. + * + * @param updatedBy Describes a user that updated the watchlist item. + * @return the next definition stage. + */ + WithCreate withUpdatedBy(UserInfo updatedBy); + } + /** The stage of the WatchlistItem definition allowing to specify itemsKeyValue. */ + interface WithItemsKeyValue { + /** + * Specifies the itemsKeyValue property: key-value pairs for a watchlist item. + * + * @param itemsKeyValue key-value pairs for a watchlist item. + * @return the next definition stage. + */ + WithCreate withItemsKeyValue(Object itemsKeyValue); + } + /** The stage of the WatchlistItem definition allowing to specify entityMapping. */ + interface WithEntityMapping { + /** + * Specifies the entityMapping property: key-value pairs for a watchlist item entity mapping. + * + * @param entityMapping key-value pairs for a watchlist item entity mapping. + * @return the next definition stage. + */ + WithCreate withEntityMapping(Object entityMapping); + } + } + /** + * Begins update for the WatchlistItem resource. + * + * @return the stage of resource update. + */ + WatchlistItem.Update update(); + + /** The template for WatchlistItem update. */ + interface Update + extends UpdateStages.WithEtag, + UpdateStages.WithWatchlistItemType, + UpdateStages.WithWatchlistItemId, + UpdateStages.WithTenantId, + UpdateStages.WithIsDeleted, + UpdateStages.WithCreated, + UpdateStages.WithUpdated, + UpdateStages.WithCreatedBy, + UpdateStages.WithUpdatedBy, + UpdateStages.WithItemsKeyValue, + UpdateStages.WithEntityMapping { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WatchlistItem apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WatchlistItem apply(Context context); + } + /** The WatchlistItem update stages. */ + interface UpdateStages { + /** The stage of the WatchlistItem update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Etag of the azure resource. + * + * @param etag Etag of the azure resource. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + /** The stage of the WatchlistItem update allowing to specify watchlistItemType. */ + interface WithWatchlistItemType { + /** + * Specifies the watchlistItemType property: The type of the watchlist item. + * + * @param watchlistItemType The type of the watchlist item. + * @return the next definition stage. + */ + Update withWatchlistItemType(String watchlistItemType); + } + /** The stage of the WatchlistItem update allowing to specify watchlistItemId. */ + interface WithWatchlistItemId { + /** + * Specifies the watchlistItemId property: The id (a Guid) of the watchlist item. + * + * @param watchlistItemId The id (a Guid) of the watchlist item. + * @return the next definition stage. + */ + Update withWatchlistItemId(String watchlistItemId); + } + /** The stage of the WatchlistItem update allowing to specify tenantId. */ + interface WithTenantId { + /** + * Specifies the tenantId property: The tenantId to which the watchlist item belongs to. + * + * @param tenantId The tenantId to which the watchlist item belongs to. + * @return the next definition stage. + */ + Update withTenantId(String tenantId); + } + /** The stage of the WatchlistItem update allowing to specify isDeleted. */ + interface WithIsDeleted { + /** + * Specifies the isDeleted property: A flag that indicates if the watchlist item is deleted or not. + * + * @param isDeleted A flag that indicates if the watchlist item is deleted or not. + * @return the next definition stage. + */ + Update withIsDeleted(Boolean isDeleted); + } + /** The stage of the WatchlistItem update allowing to specify created. */ + interface WithCreated { + /** + * Specifies the created property: The time the watchlist item was created. + * + * @param created The time the watchlist item was created. + * @return the next definition stage. + */ + Update withCreated(OffsetDateTime created); + } + /** The stage of the WatchlistItem update allowing to specify updated. */ + interface WithUpdated { + /** + * Specifies the updated property: The last time the watchlist item was updated. + * + * @param updated The last time the watchlist item was updated. + * @return the next definition stage. + */ + Update withUpdated(OffsetDateTime updated); + } + /** The stage of the WatchlistItem update allowing to specify createdBy. */ + interface WithCreatedBy { + /** + * Specifies the createdBy property: Describes a user that created the watchlist item. + * + * @param createdBy Describes a user that created the watchlist item. + * @return the next definition stage. + */ + Update withCreatedBy(UserInfo createdBy); + } + /** The stage of the WatchlistItem update allowing to specify updatedBy. */ + interface WithUpdatedBy { + /** + * Specifies the updatedBy property: Describes a user that updated the watchlist item. + * + * @param updatedBy Describes a user that updated the watchlist item. + * @return the next definition stage. + */ + Update withUpdatedBy(UserInfo updatedBy); + } + /** The stage of the WatchlistItem update allowing to specify itemsKeyValue. */ + interface WithItemsKeyValue { + /** + * Specifies the itemsKeyValue property: key-value pairs for a watchlist item. + * + * @param itemsKeyValue key-value pairs for a watchlist item. + * @return the next definition stage. + */ + Update withItemsKeyValue(Object itemsKeyValue); + } + /** The stage of the WatchlistItem update allowing to specify entityMapping. */ + interface WithEntityMapping { + /** + * Specifies the entityMapping property: key-value pairs for a watchlist item entity mapping. + * + * @param entityMapping key-value pairs for a watchlist item entity mapping. + * @return the next definition stage. + */ + Update withEntityMapping(Object entityMapping); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WatchlistItem refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WatchlistItem refresh(Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistItemList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistItemList.java new file mode 100644 index 000000000000..2ffff952419d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistItemList.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.WatchlistItemInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List all the watchlist items. */ +@Fluent +public final class WatchlistItemList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WatchlistItemList.class); + + /* + * URL to fetch the next set of watchlist item. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of watchlist items. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the nextLink property: URL to fetch the next set of watchlist item. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of watchlist items. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of watchlist items. + * + * @param value the value value to set. + * @return the WatchlistItemList object itself. + */ + public WatchlistItemList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model WatchlistItemList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistItems.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistItems.java new file mode 100644 index 000000000000..d16b98bce3d8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistItems.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of WatchlistItems. */ +public interface WatchlistItems { + /** + * Gets all watchlist Items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all watchlist Items. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String watchlistAlias); + + /** + * Gets all watchlist Items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all watchlist Items. + */ + PagedIterable list( + String resourceGroupName, String workspaceName, String watchlistAlias, Context context); + + /** + * Gets a watchlist, without its watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a watchlist, without its watchlist items. + */ + WatchlistItem get(String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId); + + /** + * Gets a watchlist, without its watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a watchlist, without its watchlist items. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId, Context context); + + /** + * Delete a watchlist item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId); + + /** + * Delete a watchlist item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param watchlistItemId Watchlist Item Id (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId, Context context); + + /** + * Gets a watchlist, without its watchlist items. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a watchlist, without its watchlist items. + */ + WatchlistItem getById(String id); + + /** + * Gets a watchlist, without its watchlist items. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a watchlist, without its watchlist items. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a watchlist item. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a watchlist item. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new WatchlistItem resource. + * + * @param name resource name. + * @return the first stage of the new WatchlistItem definition. + */ + WatchlistItem.DefinitionStages.Blank define(String name); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistList.java new file mode 100644 index 000000000000..ed708dcede20 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistList.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.WatchlistInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List all the watchlists. */ +@Fluent +public final class WatchlistList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WatchlistList.class); + + /* + * URL to fetch the next set of watchlists. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of watchlist. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the nextLink property: URL to fetch the next set of watchlists. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of watchlist. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of watchlist. + * + * @param value the value value to set. + * @return the WatchlistList object itself. + */ + public WatchlistList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model WatchlistList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Watchlists.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Watchlists.java new file mode 100644 index 000000000000..26f113101eed --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Watchlists.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Watchlists. */ +public interface Watchlists { + /** + * Gets all watchlists, without watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all watchlists, without watchlist items. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all watchlists, without watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all watchlists, without watchlist items. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets a watchlist, without its watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a watchlist, without its watchlist items. + */ + Watchlist get(String resourceGroupName, String workspaceName, String watchlistAlias); + + /** + * Gets a watchlist, without its watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a watchlist, without its watchlist items. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String watchlistAlias, Context context); + + /** + * Delete a watchlist. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String watchlistAlias); + + /** + * Delete a watchlist. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param watchlistAlias Watchlist Alias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String watchlistAlias, Context context); + + /** + * Gets a watchlist, without its watchlist items. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a watchlist, without its watchlist items. + */ + Watchlist getById(String id); + + /** + * Gets a watchlist, without its watchlist items. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a watchlist, without its watchlist items. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a watchlist. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a watchlist. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Watchlist resource. + * + * @param name resource name. + * @return the first stage of the new Watchlist definition. + */ + Watchlist.DefinitionStages.Blank define(String name); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/package-info.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/package-info.java new file mode 100644 index 000000000000..7d0c87c62078 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for SecurityInsights. API spec for Microsoft.SecurityInsights (Azure Security + * Insights) resource provider. + */ +package com.azure.resourcemanager.securityinsights.models; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/package-info.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/package-info.java new file mode 100644 index 000000000000..702e4085ae09 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for SecurityInsights. API spec for Microsoft.SecurityInsights (Azure Security + * Insights) resource provider. + */ +package com.azure.resourcemanager.securityinsights; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/module-info.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/module-info.java new file mode 100644 index 000000000000..0d8b5f7fc371 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.securityinsights { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.securityinsights; + exports com.azure.resourcemanager.securityinsights.fluent; + exports com.azure.resourcemanager.securityinsights.fluent.models; + exports com.azure.resourcemanager.securityinsights.models; + + opens com.azure.resourcemanager.securityinsights.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.securityinsights.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ActionsCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ActionsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..5331bf7fb59b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ActionsCreateOrUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** Samples for Actions CreateOrUpdate. */ +public final class ActionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/actions/CreateActionOfAlertRule.json + */ + /** + * Sample code: Creates or updates an action of alert rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAnActionOfAlertRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .actions() + .define("912bec42-cb66-4c03-ac63-1761b6898c3e") + .withExistingAlertRule("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5") + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withTriggerUri( + "https://prod-31.northcentralus.logic.azure.com:443/workflows/cd3765391efd48549fd7681ded1d48d7/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=signature") + .withLogicAppResourceId( + "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.Logic/workflows/MyAlerts") + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ActionsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ActionsDeleteSamples.java new file mode 100644 index 000000000000..f3de864cb2b0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ActionsDeleteSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for Actions Delete. */ +public final class ActionsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/actions/DeleteActionOfAlertRule.json + */ + /** + * Sample code: Delete an action of alert rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAnActionOfAlertRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .actions() + .deleteWithResponse( + "myRg", + "myWorkspace", + "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + "912bec42-cb66-4c03-ac63-1761b6898c3e", + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ActionsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ActionsGetSamples.java new file mode 100644 index 000000000000..7159d8d8dfa2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ActionsGetSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for Actions Get. */ +public final class ActionsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/actions/GetActionOfAlertRuleById.json + */ + /** + * Sample code: Get an action of alert rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnActionOfAlertRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .actions() + .getWithResponse( + "myRg", + "myWorkspace", + "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + "912bec42-cb66-4c03-ac63-1761b6898c3e", + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ActionsListByAlertRuleSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ActionsListByAlertRuleSamples.java new file mode 100644 index 000000000000..e19b60830ad0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ActionsListByAlertRuleSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for Actions ListByAlertRule. */ +public final class ActionsListByAlertRuleSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/actions/GetAllActionsByAlertRule.json + */ + /** + * Sample code: Get all actions of alert rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllActionsOfAlertRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.actions().listByAlertRule("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatesGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatesGetSamples.java new file mode 100644 index 000000000000..02649f24bad0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatesGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for AlertRuleTemplates Get. */ +public final class AlertRuleTemplatesGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRuleTemplates/GetAlertRuleTemplateById.json + */ + /** + * Sample code: Get alert rule template by Id. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAlertRuleTemplateById( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .alertRuleTemplates() + .getWithResponse("myRg", "myWorkspace", "65360bb0-8986-4ade-a89d-af3cf44d28aa", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatesListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatesListSamples.java new file mode 100644 index 000000000000..684b9d9bad04 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for AlertRuleTemplates List. */ +public final class AlertRuleTemplatesListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRuleTemplates/GetAlertRuleTemplates.json + */ + /** + * Sample code: Get all alert rule templates. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllAlertRuleTemplates( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.alertRuleTemplates().list("myRg", "myWorkspace", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..b4b2045677ab --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesCreateOrUpdateSamples.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.AlertDetail; +import com.azure.resourcemanager.securityinsights.models.AlertDetailsOverride; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.EntityMapping; +import com.azure.resourcemanager.securityinsights.models.EntityMappingType; +import com.azure.resourcemanager.securityinsights.models.EventGroupingAggregationKind; +import com.azure.resourcemanager.securityinsights.models.EventGroupingSettings; +import com.azure.resourcemanager.securityinsights.models.FieldMapping; +import com.azure.resourcemanager.securityinsights.models.FusionAlertRule; +import com.azure.resourcemanager.securityinsights.models.GroupingConfiguration; +import com.azure.resourcemanager.securityinsights.models.IncidentConfiguration; +import com.azure.resourcemanager.securityinsights.models.MatchingMethod; +import com.azure.resourcemanager.securityinsights.models.MicrosoftSecurityIncidentCreationAlertRule; +import com.azure.resourcemanager.securityinsights.models.MicrosoftSecurityProductName; +import com.azure.resourcemanager.securityinsights.models.NrtAlertRule; +import com.azure.resourcemanager.securityinsights.models.ScheduledAlertRule; +import com.azure.resourcemanager.securityinsights.models.TriggerOperator; +import java.time.Duration; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AlertRules CreateOrUpdate. */ +public final class AlertRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRules/CreateFusionAlertRule.json + */ + /** + * Sample code: Creates or updates a Fusion alert rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAFusionAlertRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .alertRules() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "myFirstFusionRule", + new FusionAlertRule() + .withEtag("3d00c3ca-0000-0100-0000-5d42d5010000") + .withAlertRuleTemplateName("f71aba3d-28fb-450b-b192-4e76a83015c8") + .withEnabled(true), + Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRules/CreateMicrosoftSecurityIncidentCreationAlertRule.json + */ + /** + * Sample code: Creates or updates a MicrosoftSecurityIncidentCreation rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAMicrosoftSecurityIncidentCreationRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .alertRules() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "microsoftSecurityIncidentCreationRuleExample", + new MicrosoftSecurityIncidentCreationAlertRule() + .withEtag("\"260097e0-0000-0d00-0000-5d6fa88f0000\"") + .withDisplayName("testing displayname") + .withEnabled(true) + .withProductFilter(MicrosoftSecurityProductName.MICROSOFT_CLOUD_APP_SECURITY), + Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRules/CreateScheduledAlertRule.json + */ + /** + * Sample code: Creates or updates a Scheduled alert rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAScheduledAlertRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .alertRules() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new ScheduledAlertRule() + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDescription("An example for a scheduled rule") + .withQuery("Heartbeat") + .withDisplayName("My scheduled rule") + .withEnabled(true) + .withSuppressionDuration(Duration.parse("PT1H")) + .withSuppressionEnabled(false) + .withSeverity(AlertSeverity.HIGH) + .withTactics(Arrays.asList(AttackTactic.PERSISTENCE, AttackTactic.LATERAL_MOVEMENT)) + .withIncidentConfiguration( + new IncidentConfiguration() + .withCreateIncident(true) + .withGroupingConfiguration( + new GroupingConfiguration() + .withEnabled(true) + .withReopenClosedIncident(false) + .withLookbackDuration(Duration.parse("PT5H")) + .withMatchingMethod(MatchingMethod.SELECTED) + .withGroupByEntities(Arrays.asList(EntityMappingType.HOST)) + .withGroupByAlertDetails(Arrays.asList(AlertDetail.DISPLAY_NAME)) + .withGroupByCustomDetails( + Arrays.asList("OperatingSystemType", "OperatingSystemName")))) + .withCustomDetails(mapOf("OperatingSystemName", "OSName", "OperatingSystemType", "OSType")) + .withEntityMappings( + Arrays + .asList( + new EntityMapping() + .withEntityType(EntityMappingType.HOST) + .withFieldMappings( + Arrays + .asList( + new FieldMapping() + .withIdentifier("FullName") + .withColumnName("Computer"))), + new EntityMapping() + .withEntityType(EntityMappingType.IP) + .withFieldMappings( + Arrays + .asList( + new FieldMapping() + .withIdentifier("Address") + .withColumnName("ComputerIP"))))) + .withAlertDetailsOverride( + new AlertDetailsOverride() + .withAlertDisplayNameFormat("Alert from {{Computer}}") + .withAlertDescriptionFormat("Suspicious activity was made by {{ComputerIP}}")) + .withQueryFrequency(Duration.parse("PT1H")) + .withQueryPeriod(Duration.parse("P2DT1H30M")) + .withTriggerOperator(TriggerOperator.GREATER_THAN) + .withTriggerThreshold(0) + .withEventGroupingSettings( + new EventGroupingSettings().withAggregationKind(EventGroupingAggregationKind.ALERT_PER_RESULT)), + Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRules/CreateNrtAlertRule.json + */ + /** + * Sample code: Creates or updates a Nrt alert rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesANrtAlertRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .alertRules() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new NrtAlertRule().withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\""), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesDeleteSamples.java new file mode 100644 index 000000000000..8dc6795efc23 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for AlertRules Delete. */ +public final class AlertRulesDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRules/DeleteAlertRule.json + */ + /** + * Sample code: Delete an alert rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAnAlertRule(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .alertRules() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesGetSamples.java new file mode 100644 index 000000000000..98757b0e0166 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesGetSamples.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for AlertRules Get. */ +public final class AlertRulesGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRules/GetScheduledAlertRule.json + */ + /** + * Sample code: Get a Scheduled alert rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAScheduledAlertRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .alertRules() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRules/GetNrtAlertRule.json + */ + /** + * Sample code: Get an Nrt alert rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnNrtAlertRule(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .alertRules() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRules/GetFusionAlertRule.json + */ + /** + * Sample code: Get a Fusion alert rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAFusionAlertRule(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.alertRules().getWithResponse("myRg", "myWorkspace", "myFirstFusionRule", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRules/GetMicrosoftSecurityIncidentCreationAlertRule.json + */ + /** + * Sample code: Get a MicrosoftSecurityIncidentCreation rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAMicrosoftSecurityIncidentCreationRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .alertRules() + .getWithResponse("myRg", "myWorkspace", "microsoftSecurityIncidentCreationRuleExample", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesListSamples.java new file mode 100644 index 000000000000..3fa0cf6f4aca --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for AlertRules List. */ +public final class AlertRulesListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/alertRules/GetAllAlertRules.json + */ + /** + * Sample code: Get all alert rules. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllAlertRules(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.alertRules().list("myRg", "myWorkspace", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..ac7611d84067 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesCreateOrUpdateSamples.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.AutomationRuleModifyPropertiesAction; +import com.azure.resourcemanager.securityinsights.models.AutomationRuleModifyPropertiesActionConfiguration; +import com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyConditionSupportedOperator; +import com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyConditionSupportedProperty; +import com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyValuesCondition; +import com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyValuesConditionProperties; +import com.azure.resourcemanager.securityinsights.models.AutomationRuleRunPlaybookAction; +import com.azure.resourcemanager.securityinsights.models.AutomationRuleRunPlaybookActionConfiguration; +import com.azure.resourcemanager.securityinsights.models.AutomationRuleTriggeringLogic; +import com.azure.resourcemanager.securityinsights.models.IncidentSeverity; +import com.azure.resourcemanager.securityinsights.models.TriggersOn; +import com.azure.resourcemanager.securityinsights.models.TriggersWhen; +import java.util.Arrays; + +/** Samples for AutomationRules CreateOrUpdate. */ +public final class AutomationRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/automationRules/CreateAutomationRule.json + */ + /** + * Sample code: Creates or updates an automation rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAnAutomationRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .automationRules() + .define("73e01a99-5cd7-4139-a149-9f2736ff2ab5") + .withExistingWorkspace("myRg", "myWorkspace") + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDisplayName("High severity incidents escalation") + .withOrder(1) + .withTriggeringLogic( + new AutomationRuleTriggeringLogic() + .withIsEnabled(true) + .withTriggersOn(TriggersOn.INCIDENTS) + .withTriggersWhen(TriggersWhen.CREATED) + .withConditions( + Arrays + .asList( + new AutomationRulePropertyValuesCondition() + .withConditionProperties( + new AutomationRulePropertyValuesConditionProperties() + .withPropertyName( + AutomationRulePropertyConditionSupportedProperty + .INCIDENT_RELATED_ANALYTIC_RULE_IDS) + .withOperator(AutomationRulePropertyConditionSupportedOperator.CONTAINS) + .withPropertyValues( + Arrays + .asList( + "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/fab3d2d4-747f-46a7-8ef0-9c0be8112bf7", + "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/8deb8303-e94d-46ff-96e0-5fd94b33df1a")))))) + .withActions( + Arrays + .asList( + new AutomationRuleModifyPropertiesAction() + .withOrder(1) + .withActionConfiguration( + new AutomationRuleModifyPropertiesActionConfiguration() + .withSeverity(IncidentSeverity.HIGH)), + new AutomationRuleRunPlaybookAction() + .withOrder(2) + .withActionConfiguration( + new AutomationRuleRunPlaybookActionConfiguration() + .withLogicAppResourceId( + "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.Logic/workflows/IncidentPlaybook") + .withTenantId("ee48efaf-50c6-411b-9345-b2bdc3eb4abc")))) + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesDeleteSamples.java new file mode 100644 index 000000000000..3756449b5c83 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for AutomationRules Delete. */ +public final class AutomationRulesDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/automationRules/DeleteAutomationRule.json + */ + /** + * Sample code: Delete an automation rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAnAutomationRule( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .automationRules() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesGetSamples.java new file mode 100644 index 000000000000..b8b8dc007837 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for AutomationRules Get. */ +public final class AutomationRulesGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/automationRules/GetAutomationRule.json + */ + /** + * Sample code: Get an automation rule. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnAutomationRule(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .automationRules() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesListSamples.java new file mode 100644 index 000000000000..4ff1ab5a10d9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for AutomationRules List. */ +public final class AutomationRulesListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/automationRules/GetAllAutomationRules.json + */ + /** + * Sample code: Get all automation rules. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllAutomationRules( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.automationRules().list("myRg", "myWorkspace", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkOperationExpandSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkOperationExpandSamples.java new file mode 100644 index 000000000000..cdb689203566 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkOperationExpandSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.BookmarkExpandParameters; +import java.time.OffsetDateTime; +import java.util.UUID; + +/** Samples for BookmarkOperation Expand. */ +public final class BookmarkOperationExpandSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/bookmarks/expand/PostExpandBookmark.json + */ + /** + * Sample code: Expand an bookmark. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void expandAnBookmark(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .bookmarkOperations() + .expandWithResponse( + "myRg", + "myWorkspace", + "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new BookmarkExpandParameters() + .withEndTime(OffsetDateTime.parse("2020-01-24T17:21:00.000Z")) + .withExpansionId(UUID.fromString("27f76e63-c41b-480f-bb18-12ad2e011d49")) + .withStartTime(OffsetDateTime.parse("2019-12-25T17:21:00.000Z")), + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..fd46e00f39e9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsCreateOrUpdateSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** Samples for BookmarkRelations CreateOrUpdate. */ +public final class BookmarkRelationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/bookmarks/relations/CreateBookmarkRelation.json + */ + /** + * Sample code: Creates or updates a bookmark relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesABookmarkRelation( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .bookmarkRelations() + .define("4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014") + .withExistingBookmark("myRg", "myWorkspace", "2216d0e1-91e3-4902-89fd-d2df8c535096") + .withRelatedResourceId( + "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/incidents/afbd324f-6c48-459c-8710-8d1e1cd03812") + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsDeleteSamples.java new file mode 100644 index 000000000000..b4f421d01b01 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsDeleteSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for BookmarkRelations Delete. */ +public final class BookmarkRelationsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/bookmarks/relations/DeleteBookmarkRelation.json + */ + /** + * Sample code: Delete the bookmark relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteTheBookmarkRelation( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .bookmarkRelations() + .deleteWithResponse( + "myRg", + "myWorkspace", + "2216d0e1-91e3-4902-89fd-d2df8c535096", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsGetSamples.java new file mode 100644 index 000000000000..31e4a038d112 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsGetSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for BookmarkRelations Get. */ +public final class BookmarkRelationsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/bookmarks/relations/GetBookmarkRelationByName.json + */ + /** + * Sample code: Get a bookmark relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getABookmarkRelation( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .bookmarkRelations() + .getWithResponse( + "myRg", + "myWorkspace", + "2216d0e1-91e3-4902-89fd-d2df8c535096", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsListSamples.java new file mode 100644 index 000000000000..edeb03bd2e19 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for BookmarkRelations List. */ +public final class BookmarkRelationsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/bookmarks/relations/GetAllBookmarkRelations.json + */ + /** + * Sample code: Get all bookmark relations. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllBookmarkRelations( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .bookmarkRelations() + .list("myRg", "myWorkspace", "2216d0e1-91e3-4902-89fd-d2df8c535096", null, null, null, null, Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarksCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarksCreateOrUpdateSamples.java new file mode 100644 index 000000000000..ef4cffc2bf28 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarksCreateOrUpdateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.UserInfo; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.UUID; + +/** Samples for Bookmarks CreateOrUpdate. */ +public final class BookmarksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/bookmarks/CreateBookmark.json + */ + /** + * Sample code: Creates or updates a bookmark. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesABookmark( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .bookmarks() + .define("73e01a99-5cd7-4139-a149-9f2736ff2ab5") + .withExistingWorkspace("myRg", "myWorkspace") + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withCreated(OffsetDateTime.parse("2021-09-01T13:15:30Z")) + .withCreatedBy(new UserInfo().withObjectId(UUID.fromString("2046feea-040d-4a46-9e2b-91c2941bfa70"))) + .withDisplayName("My bookmark") + .withLabels(Arrays.asList("Tag1", "Tag2")) + .withNotes("Found a suspicious activity") + .withQuery("SecurityEvent | where TimeGenerated > ago(1d) and TimeGenerated < ago(2d)") + .withQueryResult("Security Event query result") + .withUpdated(OffsetDateTime.parse("2021-09-01T13:15:30Z")) + .withUpdatedBy(new UserInfo().withObjectId(UUID.fromString("2046feea-040d-4a46-9e2b-91c2941bfa70"))) + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarksDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarksDeleteSamples.java new file mode 100644 index 000000000000..50580df23e73 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarksDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for Bookmarks Delete. */ +public final class BookmarksDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/bookmarks/DeleteBookmark.json + */ + /** + * Sample code: Delete a bookmark. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteABookmark(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .bookmarks() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarksGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarksGetSamples.java new file mode 100644 index 000000000000..e22bc00ecc3d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarksGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for Bookmarks Get. */ +public final class BookmarksGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/bookmarks/GetBookmarkById.json + */ + /** + * Sample code: Get a bookmark. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getABookmark(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .bookmarks() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarksListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarksListSamples.java new file mode 100644 index 000000000000..277c62f35196 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarksListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for Bookmarks List. */ +public final class BookmarksListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/bookmarks/GetBookmarks.json + */ + /** + * Sample code: Get all bookmarks. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllBookmarks(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.bookmarks().list("myRg", "myWorkspace", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsCheckRequirementsOperationPostSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsCheckRequirementsOperationPostSamples.java new file mode 100644 index 000000000000..16118bccbc4c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsCheckRequirementsOperationPostSamples.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.AadCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.AscCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.Dynamics365CheckRequirements; +import com.azure.resourcemanager.securityinsights.models.McasCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.MstiCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.MtpCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.OfficeAtpCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.OfficeIrmCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.TICheckRequirements; +import com.azure.resourcemanager.securityinsights.models.TiTaxiiCheckRequirements; + +/** Samples for DataConnectorsCheckRequirementsOperation Post. */ +public final class DataConnectorsCheckRequirementsOperationPostSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsOfficeATP.json + */ + /** + * Sample code: Check requirements for OfficeATP. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForOfficeATP( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new OfficeAtpCheckRequirements(), Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsAzureActiveDirectory.json + */ + /** + * Sample code: Check requirements for AAD. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForAAD( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new AadCheckRequirements(), Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsMicrosoftCloudAppSecurity.json + */ + /** + * Sample code: Check requirements for Mcas. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForMcas( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new McasCheckRequirements(), Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsMdatp.json + */ + /** + * Sample code: Check requirements for Mdatp. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForMdatp( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new McasCheckRequirements(), Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsAzureActiveDirectoryNoAuthorization.json + */ + /** + * Sample code: Check requirements for AAD - no authorization. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForAADNoAuthorization( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new AadCheckRequirements(), Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsAzureSecurityCenter.json + */ + /** + * Sample code: Check requirements for ASC. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForASC( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse( + "myRg", + "myWorkspace", + new AscCheckRequirements().withSubscriptionId("c0688291-89d7-4bed-87a2-a7b1bff43f4c"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsMicrosoftThreatProtection.json + */ + /** + * Sample code: Check requirements for MicrosoftThreatProtection. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForMicrosoftThreatProtection( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new MtpCheckRequirements(), Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsThreatIntelligenceTaxii.json + */ + /** + * Sample code: Check requirements for TI Taxii. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForTITaxii( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new TiTaxiiCheckRequirements(), Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsOfficeIRM.json + */ + /** + * Sample code: Check requirements for OfficeIRM. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForOfficeIRM( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new OfficeIrmCheckRequirements(), Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsMicrosoftThreatIntelligence.json + */ + /** + * Sample code: Check requirements for MicrosoftThreatIntelligence. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForMicrosoftThreatIntelligence( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new MstiCheckRequirements(), Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsDynamics365.json + */ + /** + * Sample code: Check requirements for Dynamics365. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForDynamics365( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new Dynamics365CheckRequirements(), Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsAzureActiveDirectoryNoLicense.json + */ + /** + * Sample code: Check requirements for AAD - no license. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForAADNoLicense( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new AadCheckRequirements(), Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CheckRequirementsThreatIntelligence.json + */ + /** + * Sample code: Check requirements for TI. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForTI( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new TICheckRequirements(), Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsConnectSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsConnectSamples.java new file mode 100644 index 000000000000..262274338c03 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsConnectSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.securityinsights.models.ConnectAuthKind; +import com.azure.resourcemanager.securityinsights.models.DataConnectorConnectBody; +import java.io.IOException; +import java.util.Arrays; + +/** Samples for DataConnectors Connect. */ +public final class DataConnectorsConnectSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/ConnectAPIPolling.json + */ + /** + * Sample code: Connect an APIPolling data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void connectAnAPIPollingDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) throws IOException { + manager + .dataConnectors() + .connectWithResponse( + "myRg", + "myWorkspace", + "316ec55e-7138-4d63-ab18-90c8a60fd1c8", + new DataConnectorConnectBody() + .withKind(ConnectAuthKind.APIKEY) + .withApiKey("123456789") + .withRequestConfigUserInputValues( + Arrays + .asList( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"displayText\":\"Organization" + + " Name\",\"placeHolderName\":\"{{placeHolder1}}\",\"placeHolderValue\":\"somePlaceHolderValue\",\"requestObjectKey\":\"apiEndpoint\"}", + Object.class, + SerializerEncoding.JSON))), + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..b386a213fa65 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsCreateOrUpdateSamples.java @@ -0,0 +1,633 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.securityinsights.models.Availability; +import com.azure.resourcemanager.securityinsights.models.AvailabilityStatus; +import com.azure.resourcemanager.securityinsights.models.CodelessApiPollingDataConnector; +import com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingAuthProperties; +import com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingConfigProperties; +import com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingPagingProperties; +import com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingRequestProperties; +import com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingResponseProperties; +import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigProperties; +import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem; +import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesDataTypesItem; +import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesGraphQueriesItem; +import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesInstructionStepsItem; +import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesSampleQueriesItem; +import com.azure.resourcemanager.securityinsights.models.CodelessUiDataConnector; +import com.azure.resourcemanager.securityinsights.models.ConnectivityType; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnector; +import com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnectorDataTypesDynamics365CdsActivities; +import com.azure.resourcemanager.securityinsights.models.InstructionStepsInstructionsItem; +import com.azure.resourcemanager.securityinsights.models.OfficeDataConnector; +import com.azure.resourcemanager.securityinsights.models.OfficeDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.OfficeDataConnectorDataTypesExchange; +import com.azure.resourcemanager.securityinsights.models.OfficeDataConnectorDataTypesSharePoint; +import com.azure.resourcemanager.securityinsights.models.OfficeDataConnectorDataTypesTeams; +import com.azure.resourcemanager.securityinsights.models.PermissionProviderScope; +import com.azure.resourcemanager.securityinsights.models.Permissions; +import com.azure.resourcemanager.securityinsights.models.PermissionsCustomsItem; +import com.azure.resourcemanager.securityinsights.models.PermissionsResourceProviderItem; +import com.azure.resourcemanager.securityinsights.models.PollingFrequency; +import com.azure.resourcemanager.securityinsights.models.ProviderName; +import com.azure.resourcemanager.securityinsights.models.RequiredPermissions; +import com.azure.resourcemanager.securityinsights.models.SettingType; +import com.azure.resourcemanager.securityinsights.models.TIDataConnector; +import com.azure.resourcemanager.securityinsights.models.TIDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.TIDataConnectorDataTypesIndicators; +import com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnector; +import com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnectorDataTypesTaxiiClient; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for DataConnectors CreateOrUpdate. */ +public final class DataConnectorsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CreateOfficeDataConnetor.json + */ + /** + * Sample code: Creates or updates an Office365 data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAnOffice365DataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new OfficeDataConnector() + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDataTypes( + new OfficeDataConnectorDataTypes() + .withExchange(new OfficeDataConnectorDataTypesExchange().withState(DataTypeState.ENABLED)) + .withSharePoint( + new OfficeDataConnectorDataTypesSharePoint().withState(DataTypeState.ENABLED)) + .withTeams(new OfficeDataConnectorDataTypesTeams().withState(DataTypeState.ENABLED))) + .withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CreateThreatIntelligenceTaxiiDataConnector.json + */ + /** + * Sample code: Creates or updates a Threat Intelligence Taxii data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAThreatIntelligenceTaxiiDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new TiTaxiiDataConnector() + .withEtag("d12423f6-a60b-4ca5-88c0-feb1a182d0f0") + .withWorkspaceId("dd124572-4962-4495-9bd2-9dade12314b4") + .withFriendlyName("testTaxii") + .withTaxiiServer("https://limo.anomali.com/api/v1/taxii2/feeds") + .withCollectionId("135") + .withUsername("--") + .withPassword("--") + .withTaxiiLookbackPeriod(OffsetDateTime.parse("2020-01-01T13:00:30.123Z")) + .withPollingFrequency(PollingFrequency.ONCE_ADAY) + .withDataTypes( + new TiTaxiiDataConnectorDataTypes() + .withTaxiiClient( + new TiTaxiiDataConnectorDataTypesTaxiiClient().withState(DataTypeState.ENABLED))) + .withTenantId("06b3ccb8-1384-4bcc-aec7-852f6d57161b"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CreateThreatIntelligenceDataConnector.json + */ + /** + * Sample code: Creates or updates an Threat Intelligence Platform data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAnThreatIntelligencePlatformDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new TIDataConnector() + .withTipLookbackPeriod(OffsetDateTime.parse("2020-01-01T13:00:30.123Z")) + .withDataTypes( + new TIDataConnectorDataTypes() + .withIndicators(new TIDataConnectorDataTypesIndicators().withState(DataTypeState.ENABLED))) + .withTenantId("06b3ccb8-1384-4bcc-aec7-852f6d57161b"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CreateDynamics365DataConnetor.json + */ + /** + * Sample code: Creates or updates a Dynamics365 data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesADynamics365DataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "c2541efb-c9a6-47fe-9501-87d1017d1512", + new Dynamics365DataConnector() + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDataTypes( + new Dynamics365DataConnectorDataTypes() + .withDynamics365CdsActivities( + new Dynamics365DataConnectorDataTypesDynamics365CdsActivities() + .withState(DataTypeState.ENABLED))) + .withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CreateGenericUI.json + */ + /** + * Sample code: Creates or updates a GenericUI data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAGenericUIDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) throws IOException { + manager + .dataConnectors() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "316ec55e-7138-4d63-ab18-90c8a60fd1c8", + new CodelessUiDataConnector() + .withConnectorUiConfig( + new CodelessUiConnectorConfigProperties() + .withTitle("Qualys Vulnerability Management (CCP DEMO)") + .withPublisher("Qualys") + .withDescriptionMarkdown( + "The [Qualys Vulnerability Management" + + " (VM)](https://www.qualys.com/apps/vulnerability-management/) data connector" + + " provides the capability to ingest vulnerability host detection data into Azure" + + " Sentinel through the Qualys API. The connector provides visibility into host" + + " detection data from vulerability scans. This connector provides Azure Sentinel" + + " the capability to view dashboards, create custom alerts, and improve" + + " investigation ") + .withGraphQueriesTableName("QualysHostDetection_CL") + .withGraphQueries( + Arrays + .asList( + new CodelessUiConnectorConfigPropertiesGraphQueriesItem() + .withMetricName("Total data received") + .withLegend("{{graphQueriesTableName}}") + .withBaseQuery("{{graphQueriesTableName}}"))) + .withSampleQueries( + Arrays + .asList( + new CodelessUiConnectorConfigPropertiesSampleQueriesItem() + .withDescription("Top 10 Vulerabilities detected") + .withQuery( + "{{graphQueriesTableName}}\n" + + " | mv-expand todynamic(Detections_s)\n" + + " | extend Vulnerability = tostring(Detections_s.Results)\n" + + " | summarize count() by Vulnerability\n" + + " | top 10 by count_"))) + .withDataTypes( + Arrays + .asList( + new CodelessUiConnectorConfigPropertiesDataTypesItem() + .withName("{{graphQueriesTableName}}") + .withLastDataReceivedQuery( + "{{graphQueriesTableName}}\n" + + " | summarize Time = max(TimeGenerated)\n" + + " | where isnotempty(Time)"))) + .withConnectivityCriteria( + Arrays + .asList( + new CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem() + .withType(ConnectivityType.IS_CONNECTED_QUERY) + .withValue( + Arrays + .asList( + "{{graphQueriesTableName}}\n" + + " | summarize LastLogReceived =" + + " max(TimeGenerated)\n" + + " | project IsConnected = LastLogReceived >" + + " ago(30d)")))) + .withAvailability(new Availability().withStatus(AvailabilityStatus.ONE).withIsPreview(true)) + .withPermissions( + new Permissions() + .withResourceProvider( + Arrays + .asList( + new PermissionsResourceProviderItem() + .withProvider( + ProviderName.MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES) + .withPermissionsDisplayText( + "read and write permissions on the workspace are required.") + .withProviderDisplayName("Workspace") + .withScope(PermissionProviderScope.WORKSPACE) + .withRequiredPermissions( + new RequiredPermissions() + .withWrite(true) + .withRead(true) + .withDelete(true)), + new PermissionsResourceProviderItem() + .withProvider( + ProviderName + .MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES_SHARED_KEYS) + .withPermissionsDisplayText( + "read permissions to shared keys for the workspace are" + + " required. [See the documentation to learn more about" + + " workspace" + + " keys](https://docs.microsoft.com/azure/azure-monitor/platform/agent-windows#obtain-workspace-id-and-key).") + .withProviderDisplayName("Keys") + .withScope(PermissionProviderScope.WORKSPACE) + .withRequiredPermissions( + new RequiredPermissions().withAction(true)))) + .withCustoms( + Arrays + .asList( + new PermissionsCustomsItem() + .withName("Microsoft.Web/sites permissions") + .withDescription( + "Read and write permissions to Azure Functions to create a" + + " Function App is required. [See the documentation to" + + " learn more about Azure" + + " Functions](https://docs.microsoft.com/azure/azure-functions/)."), + new PermissionsCustomsItem() + .withName("Qualys API Key") + .withDescription( + "A Qualys VM API username and password is required. [See the" + + " documentation to learn more about Qualys VM" + + " API](https://www.qualys.com/docs/qualys-api-vmpc-user-guide.pdf).")))) + .withInstructionSteps( + Arrays + .asList( + new CodelessUiConnectorConfigPropertiesInstructionStepsItem() + .withTitle("") + .withDescription( + ">**NOTE:** This connector uses Azure Functions to connect to Qualys VM" + + " to pull its logs into Azure Sentinel. This might result in" + + " additional data ingestion costs. Check the [Azure Functions" + + " pricing" + + " page](https://azure.microsoft.com/pricing/details/functions/)" + + " for details."), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem() + .withTitle("") + .withDescription( + ">**(Optional Step)** Securely store workspace and API authorization" + + " key(s) or token(s) in Azure Key Vault. Azure Key Vault provides" + + " a secure mechanism to store and retrieve key values. [Follow" + + " these" + + " instructions](https://docs.microsoft.com/azure/app-service/app-service-key-vault-references)" + + " to use Azure Key Vault with an Azure Function App."), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem() + .withTitle("") + .withDescription( + "**STEP 1 - Configuration steps for the Qualys VM API**\n\n" + + "1. Log into the Qualys Vulnerability Management console with an" + + " administrator account, select the **Users** tab and the" + + " **Users** subtab. \n" + + "2. Click on the **New** drop-down menu and select **Users..**\n" + + "3. Create a username and password for the API account. \n" + + "4. In the **User Roles** tab, ensure the account role is set to" + + " **Manager** and access is allowed to **GUI** and **API**\n" + + "4. Log out of the administrator account and log into the console" + + " with the new API credentials for validation, then log out of" + + " the API account. \n" + + "5. Log back into the console using an administrator account and" + + " modify the API accounts User Roles, removing access to **GUI**." + + " \n" + + "6. Save all changes."), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem() + .withTitle("") + .withDescription( + "**STEP 2 - Choose ONE from the following two deployment options to" + + " deploy the connector and the associated Azure Function**\n\n" + + ">**IMPORTANT:** Before deploying the Qualys VM connector, have" + + " the Workspace ID and Workspace Primary Key (can be copied from" + + " the following), as well as the Qualys VM API Authorization" + + " Key(s), readily available.") + .withInstructions( + Arrays + .asList( + new InstructionStepsInstructionsItem() + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"fillWith\":[\"WorkspaceId\"],\"label\":\"Workspace" + + " ID\"}", + Object.class, + SerializerEncoding.JSON)) + .withType(SettingType.COPYABLE_LABEL), + new InstructionStepsInstructionsItem() + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"fillWith\":[\"PrimaryKey\"],\"label\":\"Primary" + + " Key\"}", + Object.class, + SerializerEncoding.JSON)) + .withType(SettingType.COPYABLE_LABEL))), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem() + .withTitle("Option 1 - Azure Resource Manager (ARM) Template") + .withDescription( + "Use this method for automated deployment of the Qualys VM connector" + + " using an ARM Tempate.\n\n" + + "1. Click the **Deploy to Azure** button below. \n\n" + + "\t[![Deploy To" + + " Azure](https://aka.ms/deploytoazurebutton)](https://aka.ms/sentinelqualysvmazuredeploy)\n" + + "2. Select the preferred **Subscription**, **Resource Group** and" + + " **Location**. \n" + + "3. Enter the **Workspace ID**, **Workspace Key**, **API" + + " Username**, **API Password** , update the **URI**, and any" + + " additional URI **Filter Parameters** (each filter should be" + + " separated by an \"&\" symbol, no spaces.) \n" + + "> - Enter the URI that corresponds to your region. The complete" + + " list of API Server URLs can be [found" + + " here](https://www.qualys.com/docs/qualys-api-vmpc-user-guide.pdf#G4.735348)" + + " -- There is no need to add a time suffix to the URI, the" + + " Function App will dynamically append the Time Value to the URI" + + " in the proper format. \n" + + " - The default **Time Interval** is set to pull the last five" + + " (5) minutes of data. If the time interval needs to be modified," + + " it is recommended to change the Function App Timer Trigger" + + " accordingly (in the function.json file, post deployment) to" + + " prevent overlapping data ingestion. \n" + + "> - Note: If using Azure Key Vault secrets for any of the values" + + " above, use the`@Microsoft.KeyVault(SecretUri={Security" + + " Identifier})`schema in place of the string values. Refer to" + + " [Key Vault references" + + " documentation](https://docs.microsoft.com/azure/app-service/app-service-key-vault-references)" + + " for further details. \n" + + "4. Mark the checkbox labeled **I agree to the terms and" + + " conditions stated above**. \n" + + "5. Click **Purchase** to deploy."), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem() + .withTitle("Option 2 - Manual Deployment of Azure Functions") + .withDescription( + "Use the following step-by-step instructions to deploy the Quayls VM" + + " connector manually with Azure Functions."), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem() + .withTitle("") + .withDescription( + "**1. Create a Function App**\n\n" + + "1. From the Azure Portal, navigate to [Function" + + " App](https://portal.azure.com/#blade/HubsExtension/BrowseResource/resourceType/Microsoft.Web%2Fsites/kind/functionapp)," + + " and select **+ Add**.\n" + + "2. In the **Basics** tab, ensure Runtime stack is set to" + + " **Powershell Core**. \n" + + "3. In the **Hosting** tab, ensure the **Consumption" + + " (Serverless)** plan type is selected.\n" + + "4. Make other preferrable configuration changes, if needed, then" + + " click **Create**."), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem() + .withTitle("") + .withDescription( + "**2. Import Function App Code**\n\n" + + "1. In the newly created Function App, select **Functions** on" + + " the left pane and click **+ New Function**.\n" + + "2. Select **Timer Trigger**.\n" + + "3. Enter a unique Function **Name** and leave the default cron" + + " schedule of every 5 minutes, then click **Create**.\n" + + "5. Click on **Code + Test** on the left pane. \n" + + "6. Copy the [Function App" + + " Code](https://aka.ms/sentinelqualysvmazurefunctioncode) and" + + " paste into the Function App `run.ps1` editor.\n" + + "7. Click **Save**."), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem() + .withTitle("") + .withDescription( + "**3. Configure the Function App**\n\n" + + "1. In the Function App, select the Function App Name and select" + + " **Configuration**.\n" + + "2. In the **Application settings** tab, select **+ New" + + " application setting**.\n" + + "3. Add each of the following seven (7) application settings" + + " individually, with their respective string values" + + " (case-sensitive): \n" + + "\t\tapiUsername\n" + + "\t\tapiPassword\n" + + "\t\tworkspaceID\n" + + "\t\tworkspaceKey\n" + + "\t\turi\n" + + "\t\tfilterParameters\n" + + "\t\ttimeInterval\n" + + "> - Enter the URI that corresponds to your region. The complete" + + " list of API Server URLs can be [found" + + " here](https://www.qualys.com/docs/qualys-api-vmpc-user-guide.pdf#G4.735348)." + + " The `uri` value must follow the following schema: `https:///api/2.0/fo/asset/host/vm/detection/?action=list&vm_processed_after=`" + + " -- There is no need to add a time suffix to the URI, the" + + " Function App will dynamically append the Time Value to the URI" + + " in the proper format.\n" + + "> - Add any additional filter parameters, for the" + + " `filterParameters` variable, that need to be appended to the" + + " URI. Each parameter should be seperated by an \"&\" symbol and" + + " should not include any spaces.\n" + + "> - Set the `timeInterval` (in minutes) to the value of `5` to" + + " correspond to the Timer Trigger of every `5` minutes. If the" + + " time interval needs to be modified, it is recommended to change" + + " the Function App Timer Trigger accordingly to prevent" + + " overlapping data ingestion.\n" + + "> - Note: If using Azure Key Vault, use" + + " the`@Microsoft.KeyVault(SecretUri={Security Identifier})`schema" + + " in place of the string values. Refer to [Key Vault references" + + " documentation](https://docs.microsoft.com/azure/app-service/app-service-key-vault-references)" + + " for further details.\n" + + "4. Once all application settings have been entered, click" + + " **Save**."), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem() + .withTitle("") + .withDescription( + "**4. Configure the host.json**.\n\n" + + "Due to the potentially large amount of Qualys host detection" + + " data being ingested, it can cause the execution time to surpass" + + " the default Function App timeout of five (5) minutes. Increase" + + " the default timeout duration to the maximum of ten (10)" + + " minutes, under the Consumption Plan, to allow more time for the" + + " Function App to execute.\n\n" + + "1. In the Function App, select the Function App Name and select" + + " the **App Service Editor** blade.\n" + + "2. Click **Go** to open the editor, then select the" + + " **host.json** file under the **wwwroot** directory.\n" + + "3. Add the line `\"functionTimeout\": \"00:10:00\",` above the" + + " `managedDependancy` line \n" + + "4. Ensure **SAVED** appears on the top right corner of the" + + " editor, then exit the editor.\n\n" + + "> NOTE: If a longer timeout duration is required, consider" + + " upgrading to an [App Service" + + " Plan](https://docs.microsoft.com/azure/azure-functions/functions-scale#timeout)")))), + Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/CreateAPIPolling.json + */ + /** + * Sample code: Creates or updates a APIPolling data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAAPIPollingDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) throws IOException { + manager + .dataConnectors() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "316ec55e-7138-4d63-ab18-90c8a60fd1c8", + new CodelessApiPollingDataConnector() + .withConnectorUiConfig( + new CodelessUiConnectorConfigProperties() + .withTitle("GitHub Enterprise Audit Log") + .withPublisher("GitHub") + .withDescriptionMarkdown( + "The GitHub audit log connector provides the capability to ingest GitHub logs into" + + " Azure Sentinel. By connecting GitHub audit logs into Azure Sentinel, you can" + + " view this data in workbooks, use it to create custom alerts, and improve your" + + " investigation process.") + .withGraphQueriesTableName("GitHubAuditLogPolling_CL") + .withGraphQueries( + Arrays + .asList( + new CodelessUiConnectorConfigPropertiesGraphQueriesItem() + .withMetricName("Total events received") + .withLegend("GitHub audit log events") + .withBaseQuery("{{graphQueriesTableName}}"))) + .withSampleQueries( + Arrays + .asList( + new CodelessUiConnectorConfigPropertiesSampleQueriesItem() + .withDescription("All logs") + .withQuery("{{graphQueriesTableName}}\n | take 10 "))) + .withDataTypes( + Arrays + .asList( + new CodelessUiConnectorConfigPropertiesDataTypesItem() + .withName("{{graphQueriesTableName}}") + .withLastDataReceivedQuery( + "{{graphQueriesTableName}}\n" + + " | summarize Time = max(TimeGenerated)\n" + + " | where isnotempty(Time)"))) + .withConnectivityCriteria( + Arrays + .asList( + new CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem() + .withType(ConnectivityType.fromString("SentinelKindsV2")) + .withValue(Arrays.asList()))) + .withAvailability(new Availability().withStatus(AvailabilityStatus.ONE).withIsPreview(true)) + .withPermissions( + new Permissions() + .withResourceProvider( + Arrays + .asList( + new PermissionsResourceProviderItem() + .withProvider( + ProviderName.MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES) + .withPermissionsDisplayText( + "read and write permissions are required.") + .withProviderDisplayName("Workspace") + .withScope(PermissionProviderScope.WORKSPACE) + .withRequiredPermissions( + new RequiredPermissions() + .withWrite(true) + .withRead(true) + .withDelete(true)))) + .withCustoms( + Arrays + .asList( + new PermissionsCustomsItem() + .withName("GitHub API personal token Key") + .withDescription( + "You need access to GitHub personal token, the key should have" + + " 'admin:org' scope")))) + .withInstructionSteps( + Arrays + .asList( + new CodelessUiConnectorConfigPropertiesInstructionStepsItem() + .withTitle("Connect GitHub Enterprise Audit Log to Azure Sentinel") + .withDescription( + "Enable GitHub audit Logs. \n" + + " Follow" + + " [this](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token)" + + " to create or find your personal key") + .withInstructions( + Arrays + .asList( + new InstructionStepsInstructionsItem() + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"enable\":\"true\",\"userRequestPlaceHoldersInput\":[{\"displayText\":\"Organization" + + " Name\",\"placeHolderName\":\"{{placeHolder1}}\",\"placeHolderValue\":\"\",\"requestObjectKey\":\"apiEndpoint\"}]}", + Object.class, + SerializerEncoding.JSON)) + .withType(SettingType.fromString("APIKey"))))))) + .withPollingConfig( + new CodelessConnectorPollingConfigProperties() + .withAuth( + new CodelessConnectorPollingAuthProperties() + .withAuthType("APIKey") + .withApiKeyName("Authorization") + .withApiKeyIdentifier("token")) + .withRequest( + new CodelessConnectorPollingRequestProperties() + .withApiEndpoint("https://api.github.com/organizations/{{placeHolder1}}/audit-log") + .withRateLimitQps(50) + .withQueryWindowInMin(15) + .withHttpMethod("Get") + .withQueryTimeFormat("yyyy-MM-ddTHH:mm:ssZ") + .withRetryCount(2) + .withTimeoutInSeconds(60) + .withHeaders( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"Accept\":\"application/json\",\"User-Agent\":\"Scuba\"}", + Object.class, + SerializerEncoding.JSON)) + .withQueryParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"phrase\":\"created:{_QueryWindowStartTime}..{_QueryWindowEndTime}\"}", + Object.class, + SerializerEncoding.JSON))) + .withPaging( + new CodelessConnectorPollingPagingProperties() + .withPagingType("LinkHeader") + .withPageSizeParaName("per_page")) + .withResponse( + new CodelessConnectorPollingResponseProperties() + .withEventsJsonPaths(Arrays.asList("$")))), + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsDeleteSamples.java new file mode 100644 index 000000000000..966b1e1f7eaa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsDeleteSamples.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for DataConnectors Delete. */ +public final class DataConnectorsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/DeleteGenericUI.json + */ + /** + * Sample code: Delete a GenericUI data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAGenericUIDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/DeleteOfficeDataConnetor.json + */ + /** + * Sample code: Delete an Office365 data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAnOffice365DataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/DeleteAPIPolling.json + */ + /** + * Sample code: Delete a APIPolling data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAAPIPollingDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsDisconnectSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsDisconnectSamples.java new file mode 100644 index 000000000000..e7c222afd42e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsDisconnectSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for DataConnectors Disconnect. */ +public final class DataConnectorsDisconnectSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/DisconnectAPIPolling.json + */ + /** + * Sample code: Disconnect an APIPolling data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void disconnectAnAPIPollingDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .disconnectWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsGetSamples.java new file mode 100644 index 000000000000..904feb8181a0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsGetSamples.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for DataConnectors Get. */ +public final class DataConnectorsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetGenericUI.json + */ + /** + * Sample code: Get a GenericUI data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAGenericUIDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetOffice365AdvancedThreatProtectionById.json + */ + /** + * Sample code: Get a Office ATP data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAOfficeATPDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "3d3e955e-33eb-401d-89a7-251c81ddd660", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetMicrosoftCloudAppSecurityById.json + */ + /** + * Sample code: Get a MCAS data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAMCASDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "b96d014d-b5c2-4a01-9aba-a8058f629d42", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetThreatIntelligenceTaxiiById.json + */ + /** + * Sample code: Get a TI Taxii data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getATITaxiiDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "c39bb458-02a7-4b3f-b0c8-71a1d2692652", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetMicrosoftThreatIntelligenceById.json + */ + /** + * Sample code: Get a MicrosoftThreatIntelligence data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAMicrosoftThreatIntelligenceDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetAzureSecurityCenterById.json + */ + /** + * Sample code: Get a ASC data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAASCDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "763f9fa1-c2d3-4fa2-93e9-bccd4899aa12", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetThreatIntelligenceById.json + */ + /** + * Sample code: Get a TI data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getATIDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetAmazonWebServicesCloudTrailById.json + */ + /** + * Sample code: Get an AwsCloudTrail data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnAwsCloudTrailDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetMicrosoftDefenderAdvancedThreatProtectionById.json + */ + /** + * Sample code: Get a MDATP data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAMDATPDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "06b3ccb8-1384-4bcc-aec7-852f6d57161b", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetMicrosoftThreatProtectionById.json + */ + /** + * Sample code: Get a MicrosoftThreatProtection data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAMicrosoftThreatProtectionDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetAzureActiveDirectoryById.json + */ + /** + * Sample code: Get an AAD data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnAADDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "f0cd27d2-5f03-4c06-ba31-d2dc82dcb51d", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetMicrosoftInsiderRiskManagementById.json + */ + /** + * Sample code: Get a Office IRM data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAOfficeIRMDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "3d3e955e-33eb-401d-89a7-251c81ddd660", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetAzureAdvancedThreatProtectionById.json + */ + /** + * Sample code: Get an AATP data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnAATPDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "07e42cb3-e658-4e90-801c-efa0f29d3d44", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetAPIPolling.json + */ + /** + * Sample code: Get a APIPolling data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAAPIPollingDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetDynamics365DataConnectorById.json + */ + /** + * Sample code: Get a Dynamics365 data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getADynamics365DataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "c2541efb-c9a6-47fe-9501-87d1017d1512", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetOfficeDataConnetorById.json + */ + /** + * Sample code: Get an Office365 data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnOffice365DataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetAmazonWebServicesS3ById.json + */ + /** + * Sample code: Get an Aws S3 data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnAwsS3DataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .dataConnectors() + .getWithResponse("myRg", "myWorkspace", "afef3743-0c88-469c-84ff-ca2e87dc1e48", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsListSamples.java new file mode 100644 index 000000000000..8e975b6cd683 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for DataConnectors List. */ +public final class DataConnectorsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/dataConnectors/GetDataConnectors.json + */ + /** + * Sample code: Get all data connectors. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllDataConnectors( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors().list("myRg", "myWorkspace", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DomainWhoisGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DomainWhoisGetSamples.java new file mode 100644 index 000000000000..4d6a44dba946 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DomainWhoisGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for DomainWhois Get. */ +public final class DomainWhoisGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/enrichment/GetWhoisByDomainName.json + */ + /** + * Sample code: Get whois information for a single domain name. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getWhoisInformationForASingleDomainName( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.domainWhois().getWithResponse("myRg", "microsoft.com", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesExpandSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesExpandSamples.java new file mode 100644 index 000000000000..3a424ef176f1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesExpandSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.EntityExpandParameters; +import java.time.OffsetDateTime; +import java.util.UUID; + +/** Samples for Entities Expand. */ +public final class EntitiesExpandSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/expand/PostExpandEntity.json + */ + /** + * Sample code: Expand an entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void expandAnEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .entities() + .expandWithResponse( + "myRg", + "myWorkspace", + "e1d3d618-e11f-478b-98e3-bb381539a8e1", + new EntityExpandParameters() + .withEndTime(OffsetDateTime.parse("2019-05-26T00:00:00.000Z")) + .withExpansionId(UUID.fromString("a77992f3-25e9-4d01-99a4-5ff606cc410a")) + .withStartTime(OffsetDateTime.parse("2019-04-25T00:00:00.000Z")), + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetInsightsSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetInsightsSamples.java new file mode 100644 index 000000000000..5a386b78ca17 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetInsightsSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.EntityGetInsightsParameters; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.UUID; + +/** Samples for Entities GetInsights. */ +public final class EntitiesGetInsightsSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/insights/PostGetInsights.json + */ + /** + * Sample code: Entity Insight. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void entityInsight(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .entities() + .getInsightsWithResponse( + "myRg", + "myWorkspace", + "e1d3d618-e11f-478b-98e3-bb381539a8e1", + new EntityGetInsightsParameters() + .withStartTime(OffsetDateTime.parse("2021-09-01T00:00:00.000Z")) + .withEndTime(OffsetDateTime.parse("2021-10-01T00:00:00.000Z")) + .withAddDefaultExtendedTimeRange(false) + .withInsightQueryIds(Arrays.asList(UUID.fromString("cae8d0aa-aa45-4d53-8d88-17dd64ffd4e4"))), + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetSamples.java new file mode 100644 index 000000000000..9f199b6267dd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetSamples.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for Entities Get. */ +public final class EntitiesGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetSubmissionMailEntityById.json + */ + /** + * Sample code: Get a submissionMail entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getASubmissionMailEntity( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetDnsEntityById.json + */ + /** + * Sample code: Get a dns entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getADnsEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "f4e74920-f2c0-4412-a45f-66d94fdf01f8", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetFileHashEntityById.json + */ + /** + * Sample code: Get a file hash entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAFileHashEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "ea359fa6-c1e5-f878-e105-6344f3e399a1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetIoTDeviceEntityById.json + */ + /** + * Sample code: Get an IoT device entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnIoTDeviceEntity( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetRegistryKeyEntityById.json + */ + /** + * Sample code: Get a registry key entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getARegistryKeyEntity( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetMailboxEntityById.json + */ + /** + * Sample code: Get a mailbox entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAMailboxEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetMalwareEntityById.json + */ + /** + * Sample code: Get a malware entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAMalwareEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "af378b21-b4aa-4fe7-bc70-13f8621a322f", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetSecurityAlertEntityById.json + */ + /** + * Sample code: Get a security alert entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getASecurityAlertEntity( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "4aa486e0-6f85-41af-99ea-7acdce7be6c8", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetIpEntityById.json + */ + /** + * Sample code: Get an ip entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnIpEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetAccountEntityById.json + */ + /** + * Sample code: Get an account entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnAccountEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetCloudApplicationEntityById.json + */ + /** + * Sample code: Get a cloud application entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getACloudApplicationEntity( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetFileEntityById.json + */ + /** + * Sample code: Get a file entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAFileEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "af378b21-b4aa-4fe7-bc70-13f8621a322f", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetRegistryValueEntityById.json + */ + /** + * Sample code: Get a registry value entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getARegistryValueEntity( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "dc44bd11-b348-4d76-ad29-37bf7aa41356", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetUrlEntityById.json + */ + /** + * Sample code: Get a url entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAUrlEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetMailClusterEntityById.json + */ + /** + * Sample code: Get a mailCluster entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAMailClusterEntity( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetSecurityGroupEntityById.json + */ + /** + * Sample code: Get a security group entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getASecurityGroupEntity( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetMailMessageEntityById.json + */ + /** + * Sample code: Get a mailMessage entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAMailMessageEntity( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetAzureResourceEntityById.json + */ + /** + * Sample code: Get an azure resource entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnAzureResourceEntity( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetHostEntityById.json + */ + /** + * Sample code: Get a host entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAHostEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetProcessEntityById.json + */ + /** + * Sample code: Get a process entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAProcessEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().getWithResponse("myRg", "myWorkspace", "7264685c-038c-42c6-948c-38e14ef1fb98", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetTimelineListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetTimelineListSamples.java new file mode 100644 index 000000000000..1c23634f7b01 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetTimelineListSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.EntityTimelineParameters; +import java.time.OffsetDateTime; + +/** Samples for EntitiesGetTimeline List. */ +public final class EntitiesGetTimelineListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/timeline/PostTimelineEntity.json + */ + /** + * Sample code: Entity timeline. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void entityTimeline(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .entitiesGetTimelines() + .listWithResponse( + "myRg", + "myWorkspace", + "e1d3d618-e11f-478b-98e3-bb381539a8e1", + new EntityTimelineParameters() + .withStartTime(OffsetDateTime.parse("2021-09-01T00:00:00.000Z")) + .withEndTime(OffsetDateTime.parse("2021-10-01T00:00:00.000Z")) + .withNumberOfBucket(4), + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesListSamples.java new file mode 100644 index 000000000000..244186529593 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for Entities List. */ +public final class EntitiesListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetEntities.json + */ + /** + * Sample code: Get all entities. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllEntities(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().list("myRg", "myWorkspace", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesQueriesSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesQueriesSamples.java new file mode 100644 index 000000000000..19392ede6247 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesQueriesSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.EntityItemQueryKind; + +/** Samples for Entities Queries. */ +public final class EntitiesQueriesSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/GetQueries.json + */ + /** + * Sample code: Get Entity Query. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getEntityQuery(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .entities() + .queriesWithResponse( + "myRg", + "myWorkspace", + "e1d3d618-e11f-478b-98e3-bb381539a8e1", + EntityItemQueryKind.INSIGHT, + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesRelationsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesRelationsListSamples.java new file mode 100644 index 000000000000..05c15b6fe4eb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesRelationsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for EntitiesRelations List. */ +public final class EntitiesRelationsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/relations/GetAllEntityRelations.json + */ + /** + * Sample code: Get all relations of an entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllRelationsOfAnEntity( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .entitiesRelations() + .list("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", null, null, null, null, Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..b50cd3e5936c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesCreateOrUpdateSamples.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.ActivityCustomEntityQuery; +import com.azure.resourcemanager.securityinsights.models.ActivityEntityQueriesPropertiesQueryDefinitions; +import com.azure.resourcemanager.securityinsights.models.EntityType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for EntityQueries CreateOrUpdate. */ +public final class EntityQueriesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entityQueries/CreateEntityQueryActivity.json + */ + /** + * Sample code: Creates or updates an Activity entity query. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAnActivityEntityQuery( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .entityQueries() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "07da3cc8-c8ad-4710-a44e-334cdcb7882b", + new ActivityCustomEntityQuery() + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withTitle("An account was deleted on this host") + .withContent("On '{{Computer}}' the account '{{TargetAccount}}' was deleted by '{{AddedBy}}'") + .withDescription("Account deleted on host") + .withQueryDefinitions( + new ActivityEntityQueriesPropertiesQueryDefinitions() + .withQuery( + "let GetAccountActions = (v_Host_Name:string, v_Host_NTDomain:string," + + " v_Host_DnsDomain:string, v_Host_AzureID:string, v_Host_OMSAgentID:string){\n" + + "SecurityEvent\n" + + "| where EventID in (4725, 4726, 4767, 4720, 4722, 4723, 4724)\n" + + "// parsing for Host to handle variety of conventions coming from data\n" + + "| extend Host_HostName = case(\n" + + "Computer has '@', tostring(split(Computer, '@')[0]),\n" + + "Computer has '\\\\', tostring(split(Computer, '\\\\')[1]),\n" + + "Computer has '.', tostring(split(Computer, '.')[0]),\n" + + "Computer\n" + + ")\n" + + "| extend Host_NTDomain = case(\n" + + "Computer has '\\\\', tostring(split(Computer, '\\\\')[0]), \n" + + "Computer has '.', tostring(split(Computer, '.')[-2]), \n" + + "Computer\n" + + ")\n" + + "| extend Host_DnsDomain = case(\n" + + "Computer has '\\\\', tostring(split(Computer, '\\\\')[0]), \n" + + "Computer has '.', strcat_array(array_slice(split(Computer,'.'),-2,-1),'.'), \n" + + "Computer\n" + + ")\n" + + "| where (Host_HostName =~ v_Host_Name and Host_NTDomain =~ v_Host_NTDomain) \n" + + "or (Host_HostName =~ v_Host_Name and Host_DnsDomain =~ v_Host_DnsDomain) \n" + + "or v_Host_AzureID =~ _ResourceId \n" + + "or v_Host_OMSAgentID == SourceComputerId\n" + + "| project TimeGenerated, EventID, Activity, Computer, TargetAccount," + + " TargetUserName, TargetDomainName, TargetSid, SubjectUserName, SubjectUserSid," + + " _ResourceId, SourceComputerId\n" + + "| extend AddedBy = SubjectUserName\n" + + "// Future support for Activities\n" + + "| extend timestamp = TimeGenerated, HostCustomEntity = Computer," + + " AccountCustomEntity = TargetAccount\n" + + "};\n" + + "GetAccountActions('{{Host_HostName}}', '{{Host_NTDomain}}'," + + " '{{Host_DnsDomain}}', '{{Host_AzureID}}', '{{Host_OMSAgentID}}')\n" + + " \n" + + "| where EventID == 4726 ")) + .withInputEntityType(EntityType.HOST) + .withRequiredInputFieldsSets( + Arrays + .asList( + Arrays.asList("Host_HostName", "Host_NTDomain"), + Arrays.asList("Host_HostName", "Host_DnsDomain"), + Arrays.asList("Host_AzureID"), + Arrays.asList("Host_OMSAgentID"))) + .withEntitiesFilter(mapOf("Host_OsFamily", Arrays.asList("Windows"))) + .withEnabled(true), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesDeleteSamples.java new file mode 100644 index 000000000000..b0ebc8807922 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for EntityQueries Delete. */ +public final class EntityQueriesDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entityQueries/DeleteEntityQuery.json + */ + /** + * Sample code: Delete an entity query. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAnEntityQuery(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .entityQueries() + .deleteWithResponse("myRg", "myWorkspace", "07da3cc8-c8ad-4710-a44e-334cdcb7882b", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesGetSamples.java new file mode 100644 index 000000000000..91fe2c9f36d3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesGetSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for EntityQueries Get. */ +public final class EntityQueriesGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entityQueries/GetActivityEntityQueryById.json + */ + /** + * Sample code: Get an Activity entity query. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnActivityEntityQuery( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .entityQueries() + .getWithResponse("myRg", "myWorkspace", "07da3cc8-c8ad-4710-a44e-334cdcb7882b", Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entityQueries/GetExpansionEntityQueryById.json + */ + /** + * Sample code: Get an Expansion entity query. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnExpansionEntityQuery( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .entityQueries() + .getWithResponse("myRg", "myWorkspace", "07da3cc8-c8ad-4710-a44e-334cdcb7882b", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesListSamples.java new file mode 100644 index 000000000000..ef4c72ff84eb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.EntityQueriesKind; + +/** Samples for EntityQueries List. */ +public final class EntityQueriesListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entityQueries/GetEntityQueries.json + */ + /** + * Sample code: Get all entity queries. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllEntityQueries(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entityQueries().list("myRg", "myWorkspace", EntityQueriesKind.EXPANSION, Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplatesGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplatesGetSamples.java new file mode 100644 index 000000000000..5f4b9c3ecc61 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplatesGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for EntityQueryTemplates Get. */ +public final class EntityQueryTemplatesGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entityQueryTemplates/GetActivityEntityQueryTemplateById.json + */ + /** + * Sample code: Get an Activity entity query template. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnActivityEntityQueryTemplate( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .entityQueryTemplates() + .getWithResponse("myRg", "myWorkspace", "07da3cc8-c8ad-4710-a44e-334cdcb7882b", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplatesListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplatesListSamples.java new file mode 100644 index 000000000000..0236af125a46 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplatesListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.Constant69; + +/** Samples for EntityQueryTemplates List. */ +public final class EntityQueryTemplatesListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entityQueryTemplates/GetEntityQueryTemplates.json + */ + /** + * Sample code: Get all entity query templates. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllEntityQueryTemplates( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entityQueryTemplates().list("myRg", "myWorkspace", Constant69.ACTIVITY, Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityRelationsGetRelationSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityRelationsGetRelationSamples.java new file mode 100644 index 000000000000..c60685eeaa1f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityRelationsGetRelationSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for EntityRelations GetRelation. */ +public final class EntityRelationsGetRelationSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/entities/relations/GetEntityRelationByName.json + */ + /** + * Sample code: Get an entity relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnEntityRelation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .entityRelations() + .getRelationWithResponse( + "myRg", + "myWorkspace", + "afbd324f-6c48-459c-8710-8d1e1cd03812", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..18363206a35f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsCreateOrUpdateSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** Samples for IncidentComments CreateOrUpdate. */ +public final class IncidentCommentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/comments/CreateIncidentComment.json + */ + /** + * Sample code: Creates or updates an incident comment. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAnIncidentComment( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidentComments() + .define("4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014") + .withExistingIncident("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5") + .withMessage("Some message") + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsDeleteSamples.java new file mode 100644 index 000000000000..90102df9cb50 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsDeleteSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for IncidentComments Delete. */ +public final class IncidentCommentsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/comments/DeleteIncidentComment.json + */ + /** + * Sample code: Delete the incident comment. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteTheIncidentComment( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidentComments() + .deleteWithResponse( + "myRg", + "myWorkspace", + "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsGetSamples.java new file mode 100644 index 000000000000..6e65461101f5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsGetSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for IncidentComments Get. */ +public final class IncidentCommentsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/comments/GetIncidentCommentById.json + */ + /** + * Sample code: Get an incident comment. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnIncidentComment( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidentComments() + .getWithResponse( + "myRg", + "myWorkspace", + "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsListSamples.java new file mode 100644 index 000000000000..89ca41cc82de --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for IncidentComments List. */ +public final class IncidentCommentsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/comments/GetAllIncidentComments.json + */ + /** + * Sample code: Get all incident comments. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllIncidentComments( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidentComments() + .list("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", null, null, null, null, Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..dda5fd5e067b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsCreateOrUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; + +/** Samples for IncidentRelations CreateOrUpdate. */ +public final class IncidentRelationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/relations/CreateIncidentRelation.json + */ + /** + * Sample code: Creates or updates an incident relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAnIncidentRelation( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidentRelations() + .createOrUpdateWithResponse( + "myRg", + "myWorkspace", + "afbd324f-6c48-459c-8710-8d1e1cd03812", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", + new RelationInner() + .withRelatedResourceId( + "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalIinsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/bookmarks/2216d0e1-91e3-4902-89fd-d2df8c535096"), + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsDeleteSamples.java new file mode 100644 index 000000000000..4e50610251a3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsDeleteSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for IncidentRelations Delete. */ +public final class IncidentRelationsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/relations/DeleteIncidentRelation.json + */ + /** + * Sample code: Delete the incident relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteTheIncidentRelation( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidentRelations() + .deleteWithResponse( + "myRg", + "myWorkspace", + "afbd324f-6c48-459c-8710-8d1e1cd03812", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsGetSamples.java new file mode 100644 index 000000000000..a7237d9e1adc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsGetSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for IncidentRelations Get. */ +public final class IncidentRelationsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/relations/GetIncidentRelationByName.json + */ + /** + * Sample code: Get an incident relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnIncidentRelation( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidentRelations() + .getWithResponse( + "myRg", + "myWorkspace", + "afbd324f-6c48-459c-8710-8d1e1cd03812", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsListSamples.java new file mode 100644 index 000000000000..97abf23d557c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for IncidentRelations List. */ +public final class IncidentRelationsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/relations/GetAllIncidentRelations.json + */ + /** + * Sample code: Get all incident relations. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllIncidentRelations( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidentRelations() + .list("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", null, null, null, null, Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..1e178ad78497 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsCreateOrUpdateSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.IncidentClassification; +import com.azure.resourcemanager.securityinsights.models.IncidentClassificationReason; +import com.azure.resourcemanager.securityinsights.models.IncidentOwnerInfo; +import com.azure.resourcemanager.securityinsights.models.IncidentSeverity; +import com.azure.resourcemanager.securityinsights.models.IncidentStatus; +import java.time.OffsetDateTime; +import java.util.UUID; + +/** Samples for Incidents CreateOrUpdate. */ +public final class IncidentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/CreateIncident.json + */ + /** + * Sample code: Creates or updates an incident. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAnIncident( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidents() + .define("73e01a99-5cd7-4139-a149-9f2736ff2ab5") + .withExistingWorkspace("myRg", "myWorkspace") + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withClassification(IncidentClassification.FALSE_POSITIVE) + .withClassificationComment("Not a malicious activity") + .withClassificationReason(IncidentClassificationReason.INCORRECT_ALERT_LOGIC) + .withDescription("This is a demo incident") + .withFirstActivityTimeUtc(OffsetDateTime.parse("2019-01-01T13:00:30Z")) + .withLastActivityTimeUtc(OffsetDateTime.parse("2019-01-01T13:05:30Z")) + .withOwner(new IncidentOwnerInfo().withObjectId(UUID.fromString("2046feea-040d-4a46-9e2b-91c2941bfa70"))) + .withSeverity(IncidentSeverity.HIGH) + .withStatus(IncidentStatus.CLOSED) + .withTitle("My incident") + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsCreateTeamSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsCreateTeamSamples.java new file mode 100644 index 000000000000..42bae288113f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsCreateTeamSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.TeamProperties; + +/** Samples for Incidents CreateTeam. */ +public final class IncidentsCreateTeamSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/CreateTeam.json + */ + /** + * Sample code: Creates incident teams group. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsIncidentTeamsGroup( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidents() + .createTeamWithResponse( + "ambawolvese5resourcegroup", + "AmbaE5WestCentralUS", + "69a30280-6a4c-4aa7-9af0-5d63f335d600", + new TeamProperties().withTeamName("Team name").withTeamDescription("Team description"), + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsDeleteSamples.java new file mode 100644 index 000000000000..69b48ede0c6f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for Incidents Delete. */ +public final class IncidentsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/DeleteIncident.json + */ + /** + * Sample code: Delete an incident. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAnIncident(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidents() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsGetSamples.java new file mode 100644 index 000000000000..6e4950e0e5da --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for Incidents Get. */ +public final class IncidentsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/GetIncidentById.json + */ + /** + * Sample code: Get an incident. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnIncident(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidents() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListAlertsSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListAlertsSamples.java new file mode 100644 index 000000000000..1d641b6ef9f3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListAlertsSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for Incidents ListAlerts. */ +public final class IncidentsListAlertsSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/GetAllIncidentAlerts.json + */ + /** + * Sample code: Get all incident alerts. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllIncidentAlerts( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidents() + .listAlertsWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListBookmarksSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListBookmarksSamples.java new file mode 100644 index 000000000000..4866c7178b39 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListBookmarksSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for Incidents ListBookmarks. */ +public final class IncidentsListBookmarksSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/GetAllIncidentBookmarks.json + */ + /** + * Sample code: Get all incident bookmarks. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllIncidentBookmarks( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidents() + .listBookmarksWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListEntitiesSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListEntitiesSamples.java new file mode 100644 index 000000000000..5917f8a4af6c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListEntitiesSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for Incidents ListEntities. */ +public final class IncidentsListEntitiesSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/entities/GetAllIncidentEntities.json + */ + /** + * Sample code: Gets all incident related entities. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getsAllIncidentRelatedEntities( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .incidents() + .listEntitiesWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListSamples.java new file mode 100644 index 000000000000..3fd7022bb85f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for Incidents List. */ +public final class IncidentsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/incidents/GetIncidents.json + */ + /** + * Sample code: Get all incidents. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllIncidents(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidents().list("myRg", "myWorkspace", null, "properties/createdTimeUtc desc", 1, null, Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IpGeodataGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IpGeodataGetSamples.java new file mode 100644 index 000000000000..2993b19987e4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IpGeodataGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for IpGeodata Get. */ +public final class IpGeodataGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/enrichment/GetGeodataByIp.json + */ + /** + * Sample code: Get geodata for a single IP address. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getGeodataForASingleIPAddress( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.ipGeodatas().getWithResponse("myRg", "1.2.3.4", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/MetadataCreateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/MetadataCreateSamples.java new file mode 100644 index 000000000000..25f1439922bd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/MetadataCreateSamples.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataAuthor; +import com.azure.resourcemanager.securityinsights.models.MetadataCategories; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencies; +import com.azure.resourcemanager.securityinsights.models.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +import com.azure.resourcemanager.securityinsights.models.Operator; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.time.LocalDate; +import java.util.Arrays; + +/** Samples for Metadata Create. */ +public final class MetadataCreateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/metadata/PutMetadata.json + */ + /** + * Sample code: Create/update full metadata. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createUpdateFullMetadata( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .metadatas() + .define("metadataName") + .withExistingWorkspace("myRg", "myWorkspace") + .withContentId("c00ee137-7475-47c8-9cce-ec6f0f1bedd0") + .withParentId( + "/subscriptions/2e1dc338-d04d-4443-b721-037eff4fdcac/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/ruleName") + .withVersion("1.0.0.0") + .withKind(Kind.ANALYTICS_RULE) + .withSource( + new MetadataSource() + .withKind(SourceKind.SOLUTION) + .withName("Contoso Solution 1.0") + .withSourceId("b688a130-76f4-4a07-bf57-762222a3cadf")) + .withAuthor(new MetadataAuthor().withName("User Name").withEmail("email@microsoft.com")) + .withSupport( + new MetadataSupport() + .withTier(SupportTier.PARTNER) + .withName("Microsoft") + .withEmail("support@microsoft.com") + .withLink("https://support.microsoft.com/")) + .withDependencies( + new MetadataDependencies() + .withOperator(Operator.AND) + .withCriteria( + Arrays + .asList( + new MetadataDependencies() + .withOperator(Operator.OR) + .withCriteria( + Arrays + .asList( + new MetadataDependencies() + .withContentId("045d06d0-ee72-4794-aba4-cf5646e4c756") + .withKind(Kind.DATA_CONNECTOR) + .withName("Microsoft Defender for Endpoint"), + new MetadataDependencies() + .withContentId("dbfcb2cc-d782-40ef-8d94-fe7af58a6f2d") + .withKind(Kind.DATA_CONNECTOR), + new MetadataDependencies() + .withContentId("de4dca9b-eb37-47d6-a56f-b8b06b261593") + .withKind(Kind.DATA_CONNECTOR) + .withVersion("2.0"))), + new MetadataDependencies() + .withContentId("31ee11cc-9989-4de8-b176-5e0ef5c4dbab") + .withKind(Kind.PLAYBOOK) + .withVersion("1.0"), + new MetadataDependencies() + .withContentId("21ba424a-9438-4444-953a-7059539a7a1b") + .withKind(Kind.PARSER)))) + .withCategories( + new MetadataCategories() + .withDomains(Arrays.asList("Application", "Security – Insider Threat")) + .withVerticals(Arrays.asList("Healthcare"))) + .withProviders(Arrays.asList("Amazon", "Microsoft")) + .withFirstPublishDate(LocalDate.parse("2021-05-18")) + .withLastPublishDate(LocalDate.parse("2021-05-18")) + .create(); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/metadata/PutMetadataMinimal.json + */ + /** + * Sample code: Create/update minimal metadata. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createUpdateMinimalMetadata( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .metadatas() + .define("metadataName") + .withExistingWorkspace("myRg", "myWorkspace") + .withContentId("c00ee137-7475-47c8-9cce-ec6f0f1bedd0") + .withParentId( + "/subscriptions/2e1dc338-d04d-4443-b721-037eff4fdcac/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/ruleName") + .withKind(Kind.ANALYTICS_RULE) + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/MetadataDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/MetadataDeleteSamples.java new file mode 100644 index 000000000000..6dd1e0a62f6b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/MetadataDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for Metadata Delete. */ +public final class MetadataDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/metadata/DeleteMetadata.json + */ + /** + * Sample code: Delete metadata. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteMetadata(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.metadatas().deleteWithResponse("myRg", "myWorkspace", "metadataName", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/MetadataGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/MetadataGetSamples.java new file mode 100644 index 000000000000..8a1e5f02348b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/MetadataGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for Metadata Get. */ +public final class MetadataGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/metadata/GetMetadata.json + */ + /** + * Sample code: Get single metadata by name. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getSingleMetadataByName( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.metadatas().getWithResponse("myRg", "myWorkspace", "metadataName", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/MetadataListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/MetadataListSamples.java new file mode 100644 index 000000000000..f61a7bf45c27 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/MetadataListSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for Metadata List. */ +public final class MetadataListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/metadata/GetAllMetadata.json + */ + /** + * Sample code: Get all metadata. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllMetadata(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.metadatas().list("myRg", "myWorkspace", null, null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/metadata/GetAllMetadataOData.json + */ + /** + * Sample code: Get all metadata with OData filter/orderby/skip/top. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllMetadataWithODataFilterOrderbySkipTop( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.metadatas().list("myRg", "myWorkspace", null, null, null, null, Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/MetadataUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/MetadataUpdateSamples.java new file mode 100644 index 000000000000..c6839610fe8e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/MetadataUpdateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.MetadataAuthor; +import com.azure.resourcemanager.securityinsights.models.MetadataModel; + +/** Samples for Metadata Update. */ +public final class MetadataUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/metadata/PatchMetadata.json + */ + /** + * Sample code: Update metadata. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void updateMetadata(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + MetadataModel resource = + manager.metadatas().getWithResponse("myRg", "myWorkspace", "metadataName", Context.NONE).getValue(); + resource + .update() + .withAuthor(new MetadataAuthor().withName("User Name").withEmail("email@microsoft.com")) + .apply(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsDeleteSamples.java new file mode 100644 index 000000000000..c49455b51be6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for OfficeConsents Delete. */ +public final class OfficeConsentsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/officeConsents/DeleteOfficeConsents.json + */ + /** + * Sample code: Delete an office consent. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAnOfficeConsent( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .officeConsents() + .deleteWithResponse("myRg", "myWorkspace", "04e5fd05-ff86-4b97-b8d2-1c20933cb46c", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsGetSamples.java new file mode 100644 index 000000000000..3e6551d94b19 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for OfficeConsents Get. */ +public final class OfficeConsentsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/officeConsents/GetOfficeConsentsById.json + */ + /** + * Sample code: Get an office consent. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnOfficeConsent(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .officeConsents() + .getWithResponse("myRg", "myWorkspace", "04e5fd05-ff86-4b97-b8d2-1c20933cb46c", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsListSamples.java new file mode 100644 index 000000000000..aeaebafce4ea --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for OfficeConsents List. */ +public final class OfficeConsentsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/officeConsents/GetOfficeConsents.json + */ + /** + * Sample code: Get all office consents. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllOfficeConsents( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.officeConsents().list("myRg", "myWorkspace", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsDeleteSamples.java new file mode 100644 index 000000000000..9cb4fdf52408 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for ProductSettings Delete. */ +public final class ProductSettingsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/settings/DeleteEyesOnSetting.json + */ + /** + * Sample code: Delete EyesOn settings. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteEyesOnSettings( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.productSettings().deleteWithResponse("myRg", "myWorkspace", "EyesOn", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsGetSamples.java new file mode 100644 index 000000000000..bd20095f5c6c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for ProductSettings Get. */ +public final class ProductSettingsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/settings/GetEyesOnSetting.json + */ + /** + * Sample code: Get EyesOn settings. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getEyesOnSettings(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.productSettings().getWithResponse("myRg", "myWorkspace", "EyesOn", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsListSamples.java new file mode 100644 index 000000000000..3ef3cd84cdc6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for ProductSettings List. */ +public final class ProductSettingsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/settings/GetAllSettings.json + */ + /** + * Sample code: Get all settings. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllSettings(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.productSettings().listWithResponse("myRg", "myWorkspace", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsUpdateSamples.java new file mode 100644 index 000000000000..1c58f5a79940 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsUpdateSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.EyesOn; + +/** Samples for ProductSettings Update. */ +public final class ProductSettingsUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/settings/UpdateEyesOnSetting.json + */ + /** + * Sample code: Update EyesOn settings. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void updateEyesOnSettings( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .productSettings() + .updateWithResponse( + "myRg", + "myWorkspace", + "EyesOn", + new EyesOn().withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\""), + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesCreateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesCreateSamples.java new file mode 100644 index 000000000000..1b23448977d0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesCreateSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** Samples for SentinelOnboardingStates Create. */ +public final class SentinelOnboardingStatesCreateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/onboardingStates/CreateSentinelOnboardingState.json + */ + /** + * Sample code: Create Sentinel onboarding state. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createSentinelOnboardingState( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .sentinelOnboardingStates() + .define("default") + .withExistingWorkspace("myRg", "myWorkspace") + .withCustomerManagedKey(false) + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesDeleteSamples.java new file mode 100644 index 000000000000..3bdc04f8f8a3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for SentinelOnboardingStates Delete. */ +public final class SentinelOnboardingStatesDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/onboardingStates/DeleteSentinelOnboardingState.json + */ + /** + * Sample code: Delete Sentinel onboarding state. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteSentinelOnboardingState( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sentinelOnboardingStates().deleteWithResponse("myRg", "myWorkspace", "default", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesGetSamples.java new file mode 100644 index 000000000000..7f039b362acc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for SentinelOnboardingStates Get. */ +public final class SentinelOnboardingStatesGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/onboardingStates/GetSentinelOnboardingState.json + */ + /** + * Sample code: Get Sentinel onboarding state. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getSentinelOnboardingState( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sentinelOnboardingStates().getWithResponse("myRg", "myWorkspace", "default", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesListSamples.java new file mode 100644 index 000000000000..cd12b77a568d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for SentinelOnboardingStates List. */ +public final class SentinelOnboardingStatesListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/onboardingStates/GetAllSentinelOnboardingStates.json + */ + /** + * Sample code: Get all Sentinel onboarding states. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllSentinelOnboardingStates( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sentinelOnboardingStates().listWithResponse("myRg", "myWorkspace", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlListRepositoriesSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlListRepositoriesSamples.java new file mode 100644 index 000000000000..94b21485bb0a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlListRepositoriesSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.RepoType; + +/** Samples for SourceControl ListRepositories. */ +public final class SourceControlListRepositoriesSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/repositories/GetRepositories.json + */ + /** + * Sample code: Get repository list. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getRepositoryList(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sourceControls().listRepositories("myRg", "myWorkspace", RepoType.GITHUB, Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationCreateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationCreateSamples.java new file mode 100644 index 000000000000..835128803956 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationCreateSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.ContentPathMap; +import com.azure.resourcemanager.securityinsights.models.ContentType; +import com.azure.resourcemanager.securityinsights.models.RepoType; +import com.azure.resourcemanager.securityinsights.models.Repository; +import java.util.Arrays; + +/** Samples for SourceControlsOperation Create. */ +public final class SourceControlsOperationCreateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/sourcecontrols/CreateSourceControl.json + */ + /** + * Sample code: Creates a source control. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsASourceControl( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .sourceControlsOperations() + .define("789e0c1f-4a3d-43ad-809c-e713b677b04a") + .withExistingWorkspace("myRg", "myWorkspace") + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDisplayName("My Source Control") + .withDescription("This is a source control") + .withRepoType(RepoType.GITHUB) + .withContentTypes(Arrays.asList(ContentType.fromString("AnalyticRules"), ContentType.WORKBOOK)) + .withRepository( + new Repository() + .withUrl("https://github.com/user/repo") + .withBranch("master") + .withDisplayUrl("https://github.com/user/repo") + .withPathMapping( + Arrays + .asList( + new ContentPathMap() + .withContentType(ContentType.fromString("AnalyticRules")) + .withPath("path/to/rules"), + new ContentPathMap() + .withContentType(ContentType.WORKBOOK) + .withPath("path/to/workbooks")))) + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationDeleteSamples.java new file mode 100644 index 000000000000..1396806d72a4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for SourceControlsOperation Delete. */ +public final class SourceControlsOperationDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/sourcecontrols/DeleteSourceControl.json + */ + /** + * Sample code: Delete a source control. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteASourceControl( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .sourceControlsOperations() + .deleteWithResponse("myRg", "myWorkspace", "789e0c1f-4a3d-43ad-809c-e713b677b04a", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationGetSamples.java new file mode 100644 index 000000000000..4361a8dd0f86 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for SourceControlsOperation Get. */ +public final class SourceControlsOperationGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/sourcecontrols/GetSourceControlById.json + */ + /** + * Sample code: Get a source control. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getASourceControl(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .sourceControlsOperations() + .getWithResponse("myRg", "myWorkspace", "789e0c1f-4a3d-43ad-809c-e713b677b04a", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationListSamples.java new file mode 100644 index 000000000000..80381ef45967 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for SourceControlsOperation List. */ +public final class SourceControlsOperationListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/sourcecontrols/GetSourceControls.json + */ + /** + * Sample code: Get all source controls. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllSourceControls( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sourceControlsOperations().list("myRg", "myWorkspace", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorAppendTagsSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorAppendTagsSamples.java new file mode 100644 index 000000000000..9749bc270173 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorAppendTagsSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAppendTags; +import java.util.Arrays; + +/** Samples for ThreatIntelligenceIndicator AppendTags. */ +public final class ThreatIntelligenceIndicatorAppendTagsSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/threatintelligence/AppendTagsThreatIntelligence.json + */ + /** + * Sample code: Append tags to a threat intelligence indicator. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void appendTagsToAThreatIntelligenceIndicator( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .threatIntelligenceIndicators() + .appendTagsWithResponse( + "myRg", + "myWorkspace", + "d9cd6f0b-96b9-3984-17cd-a779d1e15a93", + new ThreatIntelligenceAppendTags().withThreatIntelligenceTags(Arrays.asList("tag1", "tag2")), + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorCreateIndicatorSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorCreateIndicatorSamples.java new file mode 100644 index 000000000000..4bb2ca256524 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorCreateIndicatorSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModelForRequestBody; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceResourceKindEnum; +import java.util.Arrays; + +/** Samples for ThreatIntelligenceIndicator CreateIndicator. */ +public final class ThreatIntelligenceIndicatorCreateIndicatorSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/threatintelligence/CreateThreatIntelligence.json + */ + /** + * Sample code: Create a new Threat Intelligence. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createANewThreatIntelligence( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .threatIntelligenceIndicators() + .createIndicatorWithResponse( + "myRg", + "myWorkspace", + new ThreatIntelligenceIndicatorModelForRequestBody() + .withKind(ThreatIntelligenceResourceKindEnum.INDICATOR) + .withThreatIntelligenceTags(Arrays.asList("new schema")) + .withSource("Azure Sentinel") + .withDisplayName("new schema") + .withDescription("debugging indicators") + .withPattern("[url:value = 'https://www.contoso.com']") + .withPatternType("url") + .withKillChainPhases(Arrays.asList()) + .withCreatedByRef("contoso@contoso.com") + .withExternalReferences(Arrays.asList()) + .withGranularMarkings(Arrays.asList()) + .withLabels(Arrays.asList()) + .withRevoked(false) + .withConfidence(78) + .withThreatTypes(Arrays.asList("compromised")) + .withValidFrom("2021-09-15T17:44:00.114052Z") + .withValidUntil("") + .withModified(""), + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorCreateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorCreateSamples.java new file mode 100644 index 000000000000..29f6e3bb7a5f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorCreateSamples.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModelForRequestBody; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceResourceKindEnum; +import java.util.Arrays; + +/** Samples for ThreatIntelligenceIndicator Create. */ +public final class ThreatIntelligenceIndicatorCreateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/threatintelligence/UpdateThreatIntelligence.json + */ + /** + * Sample code: Update a threat Intelligence indicator. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void updateAThreatIntelligenceIndicator( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .threatIntelligenceIndicators() + .createWithResponse( + "myRg", + "myWorkspace", + "d9cd6f0b-96b9-3984-17cd-a779d1e15a93", + new ThreatIntelligenceIndicatorModelForRequestBody() + .withKind(ThreatIntelligenceResourceKindEnum.INDICATOR) + .withThreatIntelligenceTags(Arrays.asList("new schema")) + .withSource("Azure Sentinel") + .withDisplayName("new schema") + .withDescription("debugging indicators") + .withPattern("[url:value = 'https://www.contoso.com']") + .withPatternType("url") + .withKillChainPhases(Arrays.asList()) + .withCreatedByRef("contoso@contoso.com") + .withExternalReferences(Arrays.asList()) + .withGranularMarkings(Arrays.asList()) + .withLabels(Arrays.asList()) + .withRevoked(false) + .withConfidence(78) + .withThreatTypes(Arrays.asList("compromised")) + .withValidFrom("2020-04-15T17:44:00.114052Z") + .withValidUntil("") + .withModified(""), + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorDeleteSamples.java new file mode 100644 index 000000000000..3390496ddde3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for ThreatIntelligenceIndicator Delete. */ +public final class ThreatIntelligenceIndicatorDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/threatintelligence/DeleteThreatIntelligence.json + */ + /** + * Sample code: Delete a threat intelligence indicator. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAThreatIntelligenceIndicator( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .threatIntelligenceIndicators() + .deleteWithResponse("myRg", "myWorkspace", "d9cd6f0b-96b9-3984-17cd-a779d1e15a93", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorGetSamples.java new file mode 100644 index 000000000000..32de3f040f1c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for ThreatIntelligenceIndicator Get. */ +public final class ThreatIntelligenceIndicatorGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/threatintelligence/GetThreatIntelligenceById.json + */ + /** + * Sample code: View a threat intelligence indicator by name. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void viewAThreatIntelligenceIndicatorByName( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .threatIntelligenceIndicators() + .getWithResponse("myRg", "myWorkspace", "e16ef847-962e-d7b6-9c8b-a33e4bd30e47", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorMetricsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorMetricsListSamples.java new file mode 100644 index 000000000000..bb65f1330542 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorMetricsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for ThreatIntelligenceIndicatorMetrics List. */ +public final class ThreatIntelligenceIndicatorMetricsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/threatintelligence/CollectThreatIntelligenceMetrics.json + */ + /** + * Sample code: Get threat intelligence indicators metrics. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getThreatIntelligenceIndicatorsMetrics( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.threatIntelligenceIndicatorMetrics().listWithResponse("myRg", "myWorkspace", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorQueryIndicatorsSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorQueryIndicatorsSamples.java new file mode 100644 index 000000000000..c596ee8d3efd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorQueryIndicatorsSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceFilteringCriteria; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceSortingCriteria; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceSortingCriteriaEnum; +import java.util.Arrays; + +/** Samples for ThreatIntelligenceIndicator QueryIndicators. */ +public final class ThreatIntelligenceIndicatorQueryIndicatorsSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/threatintelligence/QueryThreatIntelligence.json + */ + /** + * Sample code: Query threat intelligence indicators as per filtering criteria. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void queryThreatIntelligenceIndicatorsAsPerFilteringCriteria( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .threatIntelligenceIndicators() + .queryIndicators( + "myRg", + "myWorkspace", + new ThreatIntelligenceFilteringCriteria() + .withPageSize(100) + .withMinConfidence(25) + .withMaxConfidence(80) + .withMinValidUntil("2021-04-05T17:44:00.114052Z") + .withMaxValidUntil("2021-04-25T17:44:00.114052Z") + .withSortBy( + Arrays + .asList( + new ThreatIntelligenceSortingCriteria() + .withItemKey("lastUpdatedTimeUtc") + .withSortOrder(ThreatIntelligenceSortingCriteriaEnum.DESCENDING))) + .withSources(Arrays.asList("Azure Sentinel")), + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorReplaceTagsSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorReplaceTagsSamples.java new file mode 100644 index 000000000000..1d69de18fcfa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorReplaceTagsSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModelForRequestBody; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceResourceKindEnum; +import java.util.Arrays; + +/** Samples for ThreatIntelligenceIndicator ReplaceTags. */ +public final class ThreatIntelligenceIndicatorReplaceTagsSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/threatintelligence/ReplaceTagsThreatIntelligence.json + */ + /** + * Sample code: Replace tags to a Threat Intelligence. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void replaceTagsToAThreatIntelligence( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .threatIntelligenceIndicators() + .replaceTagsWithResponse( + "myRg", + "myWorkspace", + "d9cd6f0b-96b9-3984-17cd-a779d1e15a93", + new ThreatIntelligenceIndicatorModelForRequestBody() + .withKind(ThreatIntelligenceResourceKindEnum.INDICATOR) + .withEtag("\"0000262c-0000-0800-0000-5e9767060000\"") + .withThreatIntelligenceTags(Arrays.asList("patching tags")), + Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsOperationListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsOperationListSamples.java new file mode 100644 index 000000000000..92a575f59541 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsOperationListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for ThreatIntelligenceIndicatorsOperation List. */ +public final class ThreatIntelligenceIndicatorsOperationListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/threatintelligence/GetThreatIntelligence.json + */ + /** + * Sample code: Get all threat intelligence indicators. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllThreatIntelligenceIndicators( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .threatIntelligenceIndicatorsOperations() + .list("myRg", "myWorkspace", null, null, null, null, Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..3f661f4e2530 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsCreateOrUpdateSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** Samples for WatchlistItems CreateOrUpdate. */ +public final class WatchlistItemsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/watchlists/CreateWatchlistItem.json + */ + /** + * Sample code: Creates or updates a watchlist item. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAWatchlistItem( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) throws IOException { + manager + .watchlistItems() + .define("82ba292c-dc97-4dfc-969d-d4dd9e666842") + .withExistingWatchlist("myRg", "myWorkspace", "highValueAsset") + .withEtag("0300bf09-0000-0000-0000-5c37296e0000") + .withItemsKeyValue( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"Business tier\":\"10.0.2.0/24\",\"Data tier\":\"10.0.2.0/24\",\"Gateway" + + " subnet\":\"10.0.255.224/27\",\"Private DMZ in\":\"10.0.0.0/27\",\"Public DMZ" + + " out\":\"10.0.0.96/27\",\"Web Tier\":\"10.0.1.0/24\"}", + Object.class, + SerializerEncoding.JSON)) + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsDeleteSamples.java new file mode 100644 index 000000000000..3af2a66b8040 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for WatchlistItems Delete. */ +public final class WatchlistItemsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/watchlists/DeleteWatchlistItem.json + */ + /** + * Sample code: Delete a watchlist Item. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAWatchlistItem( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .watchlistItems() + .deleteWithResponse( + "myRg", "myWorkspace", "highValueAsset", "4008512e-1d30-48b2-9ee2-d3612ed9d3ea", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsGetSamples.java new file mode 100644 index 000000000000..febc5d6875e5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for WatchlistItems Get. */ +public final class WatchlistItemsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/watchlists/GetWatchlistItemById.json + */ + /** + * Sample code: Get a watchlist item. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAWatchlistItem(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .watchlistItems() + .getWithResponse( + "myRg", "myWorkspace", "highValueAsset", "3f8901fe-63d9-4875-9ad5-9fb3b8105797", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsListSamples.java new file mode 100644 index 000000000000..311a49ce9121 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for WatchlistItems List. */ +public final class WatchlistItemsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/watchlists/GetWatchlistItems.json + */ + /** + * Sample code: Get all watchlist Items. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllWatchlistItems( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlistItems().list("myRg", "myWorkspace", "highValueAsset", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistsCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..da86ccd85778 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistsCreateOrUpdateSamples.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.Source; + +/** Samples for Watchlists CreateOrUpdate. */ +public final class WatchlistsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/watchlists/CreateWatchlistAndWatchlistItems.json + */ + /** + * Sample code: Creates or updates a watchlist and bulk creates watchlist items. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAWatchlistAndBulkCreatesWatchlistItems( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .watchlists() + .define("highValueAsset") + .withExistingWorkspace("myRg", "myWorkspace") + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDisplayName("High Value Assets Watchlist") + .withProvider("Microsoft") + .withSource(Source.LOCAL_FILE) + .withDescription("Watchlist from CSV content") + .withNumberOfLinesToSkip(1) + .withRawContent("This line will be skipped\nheader1,header2\nvalue1,value2") + .withItemsSearchKey("header1") + .withContentType("text/csv") + .create(); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/watchlists/CreateWatchlist.json + */ + /** + * Sample code: Creates or updates a watchlist. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAWatchlist( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager + .watchlists() + .define("highValueAsset") + .withExistingWorkspace("myRg", "myWorkspace") + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDisplayName("High Value Assets Watchlist") + .withProvider("Microsoft") + .withSource(Source.LOCAL_FILE) + .withDescription("Watchlist from CSV content") + .withItemsSearchKey("header1") + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistsDeleteSamples.java new file mode 100644 index 000000000000..db8514012dd0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for Watchlists Delete. */ +public final class WatchlistsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/watchlists/DeleteWatchlist.json + */ + /** + * Sample code: Delete a watchlist. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAWatchlist(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlists().deleteWithResponse("myRg", "myWorkspace", "highValueAsset", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistsGetSamples.java new file mode 100644 index 000000000000..27f293170fdd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for Watchlists Get. */ +public final class WatchlistsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/watchlists/GetWatchlistByAlias.json + */ + /** + * Sample code: Get a watchlist. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAWatchlist(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlists().getWithResponse("myRg", "myWorkspace", "highValueAsset", Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistsListSamples.java new file mode 100644 index 000000000000..a058a896ab86 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.Context; + +/** Samples for Watchlists List. */ +public final class WatchlistsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/examples/watchlists/GetWatchlists.json + */ + /** + * Sample code: Get all watchlists. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllWatchlists(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlists().list("myRg", "myWorkspace", Context.NONE); + } +} diff --git a/sdk/securityinsights/ci.yml b/sdk/securityinsights/ci.yml new file mode 100644 index 000000000000..d19ca4811a34 --- /dev/null +++ b/sdk/securityinsights/ci.yml @@ -0,0 +1,39 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/securityinsights/ci.yml + - sdk/securityinsights/azure-resourcemanager-securityinsights/ + exclude: + - sdk/securityinsights/pom.xml + - sdk/securityinsights/azure-resourcemanager-securityinsights/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securityinsights/ci.yml + - sdk/securityinsights/azure-resourcemanager-securityinsights/ + exclude: + - sdk/securityinsights/pom.xml + - sdk/securityinsights/azure-resourcemanager-securityinsights/pom.xml + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: securityinsights + Artifacts: + - name: azure-resourcemanager-securityinsights + groupId: com.azure.resourcemanager + safeName: azureresourcemanagersecurityinsights diff --git a/sdk/securityinsights/pom.xml b/sdk/securityinsights/pom.xml new file mode 100644 index 000000000000..167fb320729b --- /dev/null +++ b/sdk/securityinsights/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-securityinsights-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-securityinsights + + + +